New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Move manifold out of experimental #4825
Comments
I think one important missing feature would be minkowski sum. We are not very interested in implementing the convex decomposition algorithm required because we think there are better algorithms for 3D offsetting, but we do accept PRs if anyone is willing to do it. |
Good point about minkowski. A very common use-case for minkowski is indeed 3d offset, but there may be other use-cases for which 3d offset wouldn't suffice. We're kind of committed to supporting minkowski forever, but we could use Manifold for the resulting large union of convex objects (unless we already do that, and the CGAL API gives us easy access to those objects). We also have a special-case already which optimizes the case for which all minkowski operands are convex. |
Updated text to mention minkowski |
I think the current minkowski already uses manifold if possible: https://github.com/openscad/openscad/blob/master/src/geometry/manifold/manifold-applyops-minkowski.cc#L196 |
Yes it does, and hopefully soon it will also use Manifold's Hull (incubating this here BTW) The convex decomposition is a tough one. And currently if it fails we also use CGAL's Nef minkowski as a fallback, even when Manifold backend is enabled. TBH I wouldn't necessarily make it a strict goal to wean ourselves off of CGAL. We could just progressively restrict its use to what it's still the best at (e.g. use it to repair meshes or for minkowski), and ensure it progressively becomes the exception rather than the rule. @kintel To answer your open question from #4646 (comment), I think it might soon be time to promote Manifold to the default (if only, to increase the amount of feedback / bug reports from users), and decide what should be the fallback behaviour: we could have a Also, not sure if we also need some OpenGL work to make Manifold (or fast-csg) a 1st class citizen, I remember cutting some corners / converting to PolySet or CGAL_Polyhedron a bit aggressively there. |
For the record, I agree that completely weaning off CGAL isn't an explicit goal, but being able to isolate it could be a way of improving code health. Both your suggestions are already in my list above. Feel free to edit/reword/split into separate issues once you think anything is well-defined enough to explore as separate efforts. The rendering pieces may benefit from waiting for #4782 |
We have similar geometry cache issues for CGAL. I believe the issue is that we can cache geometry as Nef polyhedrons or PolySets, but since PolySets are lossy, correctness of the final result may depend on avoiding cached PolySets. ..and sometimes, doing preview before render primes the cache with non-Nef3 data, or smth. |
Thinking about it, we will get self-intersecting polygons when we try to get the projection of a mesh that is not a valid mesh but only ε-valid (e.g. the touching cubes example), or attempt to slice the mesh. Not sure if clipper works fine with self-intersecting inputs. |
Clipper can fix self intersections if you offset by a minute amount. I have never tried 0, so I don't know if that works. It depends if it gets ignored completely or is still passed through clipper. |
The problem is that if manifoldness (each point is connected to 2 other points) is maintained and we keep the exact coordinates, the polygon will be self-intersecting. Just consider the case in which two triangles share a vertex, it is considered self-intesecting in the shared vertex if you duplicate it, so offset by 0 cannot possibly fix the issue. Maybe should check clipper(2) to make sure it is supported. Btw I think this will also happen when you use CGAL's Nef Polyhedron, it is a general issue. |
I wrote a straight skeleton algorithm years ago that I've been meaning to put into C++ for Manifold - that would give us |
This is a meta issue collecting everything needed or wanted to be able to move Manifold out of experimental and make it the default/preferred/only geometry backend in OpenSCAD.
We may want to ship with Manifold before all of these issues are addressed, in which case we should split out the unsolved topics into separate issues.
ENABLE_CGAL
), with severe loss of functionality, as a way of identifying all CGAL code paths: Allow building without CGAL #4840minkowski()
:hull()
: 3D hull requires CGALroof()
: Needs straight skeletonprojection(cut=true)
: Use Manifold's Slice() feature: Use Manifold's Slice() and Project() to implement projection() #5076--render=cgal
: Forces usage of Nef3 polyhedrons: Rename --render=cgal to --render=force to force-convert to the current backend-specific geometry #4822CGALRenderer
could be split into separate components for Nef polyhedrons, fast-csg and manifoldCGALRenderer
could highlight negative regions in a similar way as for Nef polyhedrons, as demoed on https://manifoldcad.orgThe text was updated successfully, but these errors were encountered: