bug in stl export
See original GitHub issueI’m trying to handle stl export in cq-server.
So far I tried this:
from jupyter_cadquery.ocp_utils import write_stl_file
# ...
assembly = to_assembly(*self.models, names=self.names)
write_stl_file(assembly.compound(), 'output.stl')
It fails with this error:
File "/home/somed/.cache/pypoetry/virtualenvs/cadquery-server-Io9SCdfb-py3.10/lib/python3.10/site-packages/jupyter_cadquery/ocp_utils.py", line 248, in write_stl_file
mesh = BRepMesh_IncrementalMesh(compound, tolerance, True, angular_tolerance)
TypeError: __init__(): incompatible constructor arguments. The following argument types are supported:
1. OCP.BRepMesh.BRepMesh_IncrementalMesh()
2. OCP.BRepMesh.BRepMesh_IncrementalMesh(theShape: OCP.TopoDS.TopoDS_Shape, theLinDeflection: float, isRelative: bool = False, theAngDeflection: float = 0.5, isInParallel: bool = False)
3. OCP.BRepMesh.BRepMesh_IncrementalMesh(theShape: OCP.TopoDS.TopoDS_Shape, theParameters: IMeshTools_Parameters, theRange: OCP.Message.Message_ProgressRange = <OCP.Message.Message_ProgressRange object at 0x7fbe17cac8b0>)
Invoked with: <OCP.TopoDS.TopoDS_Compound object at 0x7fbe0662a7b0>, None, True, None
In the write_stl_file function, there is a call to BRepMesh_IncrementalMesh
:
mesh = BRepMesh_IncrementalMesh(compound, tolerance, True, angular_tolerance)
Where tolerance
is defaulted to False
, but it’s supposed to be a required float.
Maybe you have to set the default tolerance to a float in the function signature?
Issue Analytics
- State:
- Created a year ago
- Comments:7 (7 by maintainers)
Top Results From Across the Web
Bug in stl export? - FreeCAD Forum
I'm trying to 3d print a model rocket. I designed the nosecone by revolving an arc. It looks good in the part design...
Read more >stl export for 3d printing bug - Maya - Autodesk Forums
Hello, having an odd problem here that i can't diagnose with a couple stl exports i made for 3d printing, the model was...
Read more >My STL doesn't download or it hangs forever. What's wrong?
1. Make sure you are on the Chrome browser (The native Windows Store app has a known export bug). · 2. Try selecting...
Read more >STLExport Bug(ish) - Babylon.js Forum
I'm using the STLExport functionality, but when I import the STL file into my slicer, it says that I have thousands of open...
Read more >[Bug] Stl export only 1Mb - 3D-Coat
I have made a model in Surface mode and when i export it to 3d printer the stl file is only 1Mb, that...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
@roipoussiere V3.3.0 is out. It fixes this issue by using 0.01 and 0.2 as defaults in
exportSTL
(moduleexports
)exportSTL
wrapswrite_stl_file
to create a compound before. This is the routine that should be used,write_stl_file
is an internal function and shouldn’t be used.@roipoussiere just published 1.7.0 of
three-cad-viewer
The reason why I increased the minor version is that it changes the default orientation behavior:Will now start to publish the dependent package and jupyter cadquery I think that addresses the comment in discord about wrong orientation.