diff options
Diffstat (limited to 'source/blender/bmesh/intern/bmesh_edgeloop.c')
-rw-r--r-- | source/blender/bmesh/intern/bmesh_edgeloop.c | 24 |
1 files changed, 12 insertions, 12 deletions
diff --git a/source/blender/bmesh/intern/bmesh_edgeloop.c b/source/blender/bmesh/intern/bmesh_edgeloop.c index fe3f6551b70..4724552e4c9 100644 --- a/source/blender/bmesh/intern/bmesh_edgeloop.c +++ b/source/blender/bmesh/intern/bmesh_edgeloop.c @@ -406,11 +406,11 @@ void BM_mesh_edgeloops_calc_order(BMesh *UNUSED(bm), ListBase *eloops, const boo /* find far outest loop */ { BMEdgeLoopStore *el_store_best = NULL; - float len_best = -1.0f; + float len_best_sq = -1.0f; for (el_store = eloops->first; el_store; el_store = el_store->next) { - const float len = len_squared_v3v3(cent, el_store->co); - if (len > len_best) { - len_best = len; + const float len_sq = len_squared_v3v3(cent, el_store->co); + if (len_sq > len_best_sq) { + len_best_sq = len_sq; el_store_best = el_store; } } @@ -424,27 +424,27 @@ void BM_mesh_edgeloops_calc_order(BMesh *UNUSED(bm), ListBase *eloops, const boo BMEdgeLoopStore *el_store_best = NULL; const float *co = ((BMEdgeLoopStore *)eloops_ordered.last)->co; const float *no = ((BMEdgeLoopStore *)eloops_ordered.last)->no; - float len_best = FLT_MAX; + float len_best_sq = FLT_MAX; if (use_normals) BLI_ASSERT_UNIT_V3(no); for (el_store = eloops->first; el_store; el_store = el_store->next) { - float len; + float len_sq; if (use_normals) { /* scale the length by how close the loops are to pointing at eachother */ float dir[3]; sub_v3_v3v3(dir, co, el_store->co); - len = normalize_v3(dir); - len = len * ((1.0f - fabsf(dot_v3v3(dir, no))) + - (1.0f - fabsf(dot_v3v3(dir, el_store->no)))); + len_sq = normalize_v3(dir); + len_sq = len_sq * ((1.0f - fabsf(dot_v3v3(dir, no))) + + (1.0f - fabsf(dot_v3v3(dir, el_store->no)))); } else { - len = len_squared_v3v3(co, el_store->co); + len_sq = len_squared_v3v3(co, el_store->co); } - if (len < len_best) { - len_best = len; + if (len_sq < len_best_sq) { + len_best_sq = len_sq; el_store_best = el_store; } } |