Changeset View
Changeset View
Standalone View
Standalone View
source/blender/bmesh/intern/bmesh_polygon.c
| Show First 20 Lines • Show All 228 Lines • ▼ Show 20 Lines | |||||
| { | { | ||||
| /* inline 'area_poly_v2' logic, avoid creating a temp array */ | /* inline 'area_poly_v2' logic, avoid creating a temp array */ | ||||
| const BMLoop *l_iter, *l_first; | const BMLoop *l_iter, *l_first; | ||||
| l_iter = l_first = BM_FACE_FIRST_LOOP(f); | l_iter = l_first = BM_FACE_FIRST_LOOP(f); | ||||
| /* The Trapezium Area Rule */ | /* The Trapezium Area Rule */ | ||||
| float cross = 0.0f; | float cross = 0.0f; | ||||
| do { | do { | ||||
| const MLoopUV *luv = BM_ELEM_CD_GET_VOID_P(l_iter, cd_loop_uv_offset); | const float *luv = BM_ELEM_CD_GET_FLOAT_P(l_iter, cd_loop_uv_offset); | ||||
| const MLoopUV *luv_next = BM_ELEM_CD_GET_VOID_P(l_iter->next, cd_loop_uv_offset); | const float *luv_next = BM_ELEM_CD_GET_FLOAT_P(l_iter->next, cd_loop_uv_offset); | ||||
| cross += (luv_next->uv[0] - luv->uv[0]) * (luv_next->uv[1] + luv->uv[1]); | cross += (luv_next[0] - luv[0]) * (luv_next[1] + luv[1]); | ||||
| } while ((l_iter = l_iter->next) != l_first); | } while ((l_iter = l_iter->next) != l_first); | ||||
| return fabsf(cross * 0.5f); | return fabsf(cross * 0.5f); | ||||
| } | } | ||||
| float BM_face_calc_perimeter(const BMFace *f) | float BM_face_calc_perimeter(const BMFace *f) | ||||
| { | { | ||||
| const BMLoop *l_iter, *l_first; | const BMLoop *l_iter, *l_first; | ||||
| float perimeter = 0.0f; | float perimeter = 0.0f; | ||||
| ▲ Show 20 Lines • Show All 1,084 Lines • Show Last 20 Lines | |||||