-
-
Notifications
You must be signed in to change notification settings - Fork 1.5k
Open
Labels
Milestone
Description
Don't perform a union in the following cases:
- Separate root objects
forloops: Aforloop will create a list of separate object passed on to the parent node (or the root)children(). Achildren()statement will pass on the list of children to the parent node
The code lives in https://github.com/openscad/openscad/tree/issue350
This feature is currently experimental. To enabled it, lazy unions must be enabled in Preferences or the cmd-line (--enable=lazy-union).
Exporting top-level object to STL/OFF/AMF/DXF/SVG will attempt to keep the objects separate as far as the used file format supports it.
TODO:
- Basic implementation
- Tag as experimental feature (to be able to merge)
- Test csg output (top level,
for()andchildren()) - Test
intersection() for() - Test
hull() for() - Test nested for test
- Test simple top-level objects
- Test
minkowski() for() - Test
difference() for() - Test
children() - STL export
- OFF export
- AMF export
- DXF export
- SVG export
- Deprecate
intersection_for: To combine this with the experimental feature, we need to defer builtin initialization until after preferences has been read => no need to combine it with experimental for now, deprecateintersection_forafter we move out of the experimental stage - Document the behavior of each file format for some slicer engines
- Consider the unwrap operator: https://github.com/openscad/openscad/wiki/OEP4%3A-Unwrap-Operator
- Evaluate compatibility with OpenSCAD2: https://github.com/doug-moen/openscad2/blob/master/rfc/Functions.md#fixing-the-module-composability-problem
- Test AMF import of separate objects.
This has been discussed a bit, and is interesting for a number of reasons:
- Speed: In many cases, most (half?) of the time and memory used for compiling an OpenSCAD design is consumed by the final union of the top-level objects (see e.g. Compile and Render doesn't ever get past 99% #261 and OpenSCAD crashes with high memory usage. #342)
- Necessity: Slicer software (Slic3r in particular, others unknown) supports slicing overlapping objects as it performs an implicit union of all submeshes.
- Multi-material 3D printing: We could, at the top-level, specify different colors for different top-level objects. When exporting as separate meshes, these colors could be mapped to materials by the slicer software. Combined with amf or obj export, this could make multi-material prints a lot more convenient.
- Manifoldness: This will partially let users export more complex models where the final manifold test done today fails (see export directly to stl from nef polyhedron w/o manifold check [$10] #337).
Further work past this issue:
- Don't need to perform any unions which are not influenced by subsequent operations, independent on top-level or not. This will allow modules to create on non-unioned objects.
- Do lazy evaluation of CGAL Nef polyhedrons. This will make it possible to defer calculation of transformations until the last minute, which perhaps makes it possible to avoid caching more than one instance of geometries which only differ in transformation.
Want to back this issue? Post a bounty on it! We accept bounties via Bountysource.
Reactions are currently unavailable