Open roipoussiere opened 2 years ago
Anyway I used CadQuery builtin export function, so you have time to investigate. :)
I'd recommend to use the CadQuery functions.
Nevertheless, write_stl_file
works as
from jupyter_cadquery.ocp_utils import write_stl_file
from jupyter_cadquery import Part
box = cq.Workplane('XY').box(1, 2, 3).edges().fillet(0.1)
write_stl_file(
box.objects[0].wrapped,
"test.stl",
tolerance=0.1,
angular_tolerance=0.3,
)
Since each object depending on size needs different params (a tradeoff between smoothness and time needed for tessellation, write_stl_file
doesn't have default values for tolerance
and angular_tolerance
.
I understand, but why in this line you set tolerance
to None
instead something like 0.1
?
Fair point. I should change the defaults. I am anyhow currently preparing a new release (with isometric view and orientation buttons working like in FreeCAD or Onshape). Will change it
@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.
@roipoussiere V3.3.0 is out. It fixes this issue by using 0.01 and 0.2 as defaults in exportSTL
(module exports
)
exportSTL
wraps write_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.
I'm trying to handle stl export in cq-server.
So far I tried this:
It fails with this error:
In the write_stl_file function, there is a call to
BRepMesh_IncrementalMesh
:Where
tolerance
is defaulted toFalse
, but it's supposed to be a required float.Maybe you have to set the default tolerance to a float in the function signature?