Performance regression: Concave minkowski slow in Manifold mode
Taking the minkowski sum where an operand is concave causes a significant performance regression in Manifold mode.
We implement minkowski by first decomposing operands into convex operands, then subsequently union the partial convex minkowski sums to yield the final minkowski sum. This final union is significantly faster using Manifold than CGAL. The convex decomposition doesn't have a corresponding operator in Manifold, so we currently use CGAL to perform it, and the regression in question is related to converting a Manifold mesh to a CGAL Nef polyhedron.
CGAL Nef polyhedrons can be natively converted from either Polyhedron_3 or a Surface_mesh. However, the requirement is that the meshes being converted has no self-intersections. A self-intersection often occurs when an epsilon-valid Manifold mesh has duplicated a vertex to allow distinguising between a topology and geometry and allow representing certain corner-case objects as manifolds (the typical examples is two cubes sharing an edge). For more discussion on CGAL and self-intersections, see https://github.com/CGAL/cgal/issues/7271.
Finally, the root cause of the regression is that conversion from a Manifold to a Nef polyhedron (via a Surface_mesh) is terribly slow if the object has self-intersections. This used to be broken, but was implemented in #6233.
The obvious solution is to implement all or part of Minkowski in Manifold, convex decomposition being the core missing feature.
TODO:
- Establish one or more examples demonstrating this performance regression.
Source: openscad/openscad