This seems to depend on the resolution, if I use 32 or more than 64 on this specific input, it works. I'd like to use 32 or 64 for speed. It does end up in this panic however occasionally with some inputs.
Investigation:
The decomp.compute_exact_convex_hulls(&vertices, &indices) after decompose outputs some empty vertex vectors and passes them to ConvexPolygon::from_convex_polyline. Which then panics when indexing first normal[0] when checking if first vertex should be removed.
Two fix ideas:
Figure out why compute_exact_convex_hulls outputs empty sets of points, fix that or just filter empty parts out.
Don't allow ConvexPolygon::from_convex_polyline to work on empty vectors... (return early if points.len() == 0.
The following input panics:
This seems to depend on the resolution, if I use 32 or more than 64 on this specific input, it works. I'd like to use 32 or 64 for speed. It does end up in this panic however occasionally with some inputs.
Investigation: The
decomp.compute_exact_convex_hulls(&vertices, &indices)
after decompose outputs some empty vertex vectors and passes them toConvexPolygon::from_convex_polyline
. Which then panics when indexing firstnormal[0]
when checking if first vertex should be removed.Two fix ideas:
compute_exact_convex_hulls
outputs empty sets of points, fix that or just filter emptyparts
out.ConvexPolygon::from_convex_polyline
to work on empty vectors... (return early ifpoints.len() == 0
.