skip zero area polygons in vnf_slice

This commit is contained in:
Adrian Mariano 2024-01-20 14:12:18 -05:00
parent 41369e844b
commit d17f72cffd

View file

@ -806,8 +806,8 @@ function vnf_triangulate(vnf) =
// Function vnf_unify_faces() // Function: vnf_unify_faces()
// Synposis: Remove triangulation from VNF, returning a copy with full faces // Synopsis: Remove triangulation from VNF, returning a copy with full faces
// SynTags: VNF // SynTags: VNF
// Topics: VNF Manipulation // Topics: VNF Manipulation
// See Also: vnf_reverse_faces(), vnf_quantize(), vnf_merge_points(), vnf_triangulate(), vnf_slice() // See Also: vnf_reverse_faces(), vnf_quantize(), vnf_merge_points(), vnf_triangulate(), vnf_slice()
@ -999,7 +999,9 @@ function _slice_3dpolygons(polys, dir, cuts) =
) )
flatten([ flatten([
for (poly = polys) for (poly = polys)
let( plane = plane_from_polygon(poly)) if (polygon_area(poly)>EPSILON) // Discard zero area polygons
let(
plane = plane_from_polygon(poly,1e-4))
assert(plane,"Found non-coplanar face.") assert(plane,"Found non-coplanar face.")
let( let(
normal = point3d(plane), normal = point3d(plane),