From e35adc23b2ecc6818da826acb9c6fa28125ae062 Mon Sep 17 00:00:00 2001 From: Jamie Greunbaum Date: Sat, 26 Sep 2026 14:04:32 -0400 Subject: [PATCH] Removed fix_polygon_winding's ability to delete edges, since it caused problems with polygons that have only three vertices and also that isn't really its job to do anyway. --- src/liborng/nodes/mesh_editing_library.cpp | 13 +------------ 1 file changed, 1 insertion(+), 12 deletions(-) diff --git a/src/liborng/nodes/mesh_editing_library.cpp b/src/liborng/nodes/mesh_editing_library.cpp index 3084868..ecc5474 100644 --- a/src/liborng/nodes/mesh_editing_library.cpp +++ b/src/liborng/nodes/mesh_editing_library.cpp @@ -806,20 +806,9 @@ void MeshEditingLibrary::fix_polygon_winding(MeshEditPolygon2D &polygon) const int32_t b_index = i; const int32_t c_index = (i + 1) % polygon.vertices.size(); - const float ab_dist_squared = (polygon.vertices[b_index].position - polygon.vertices[a_index].position).length_squared(); const Vector2 ab_edge = (polygon.vertices[b_index].position - polygon.vertices[a_index].position).normalized(); - - const float bc_dist_squared = (polygon.vertices[c_index].position - polygon.vertices[b_index].position).length_squared(); const Vector2 bc_edge = (polygon.vertices[c_index].position - polygon.vertices[b_index].position).normalized(); - - if (ab_dist_squared < TINY_NUMBER || bc_dist_squared < TINY_NUMBER || (ab_edge - bc_edge).length_squared() < TEENY_TINY_NUMBER) - { - polygon.vertices.erase(polygon.vertices.begin() + i); - } - else - { - total_angle += UtilityFunctions::asin(ab_edge.x * bc_edge.y - ab_edge.y * bc_edge.x); - } + total_angle += UtilityFunctions::asin(ab_edge.x * bc_edge.y - ab_edge.y * bc_edge.x); } if (total_angle < 0.0f)