`ConvexHull::try_new`: avoid adding degenerate faces
When simplifying coplanar or concave triangles into a single polygonal
face, sometimes the edge-marching algorithm will create a face with two
vertices, throwing off the Euler characteristic for the resulting solid.
Adding a guard against these degenerate faces keeps the Euler
characteristic correct.
@@ -234,7 +234,9 @@ impl<N: RealField> ConvexHull<N> {
}
}
+ if new_face.num_vertices_or_edges > 2 {
faces.push(new_face);
+ }
break;
}
}
