commit fd26411c69c9b68111b6d68893d0b048c14c8419
parent 58a79cf39c4e084b1589b8625ae97a842a1dfe13
Author: Christophe Coustet <christophe.coustet@meso-star.com>
Date: Wed, 10 Jun 2020 18:24:27 +0200
Add an assert on degenerated triangles detection
Diffstat:
1 file changed, 10 insertions(+), 0 deletions(-)
diff --git a/src/sg2d_geometry.c b/src/sg2d_geometry.c
@@ -424,6 +424,16 @@ sg2d_geometry_add
}
else continue;
}
+#ifndef NDEBUG
+ {
+ double edge[3];
+ struct vertex* vertices = darray_vertex_cdata_get(&geom->unique_vertices);
+ d3_sub(edge, vertices[tmp.vertex_ids[0]], vertices[tmp.vertex_ids[1]]);
+ /* As vertices are deduplicated, an edge cannot be nul if vertices have
+ * distinct indices */
+ ASSERT(d3_len(edge) != 0);
+ }
+#endif
/* Get properties */
if(get_prop) get_prop(ns, tmp.properties, ctx);
/* Find duplicate segments */