Added 3d2scad.py to convert 3MF and STL files to SCAD #1738
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This Python utility takes a STL or 3MF file as input, and does these things (in this order):
In some cases, the operations above can result in non-manifold shapes, such as when two objects share an edge, the resulting edge may be shared by more than two faces.
The output .scad file has the form:
This is compatible with BOSL2's
vnf_polyhedron()
. That is, to render:If more than one shell is in the original STL or 3MF file, then the output file has separate parts, labeled
model0
,model1
,model2
, and so on. Themodel
string is the root name of your output file.This Python script requires several libraries not typically installed with Python. The script prompts you to install them if any are missing.