Closed anderson-pa closed 10 months ago
Was able to fix by modifying shape_copy()
in extensions.py
to match the signature I found in cadquery's occ_impl/shapes.py
. Namely, added mesh: bool = False
as an argument, and then passed in the additional arguments True, mesh
to the BRepBuilderAPI_Copy
call.
def shape_copy(self: "Shape", mesh: bool = False) -> "Shape":
"""
Creates a new object that is a copy of this object.
"""
# The wrapped object is a OCCT TopoDS_Shape which can't be pickled or copied
# with the standard python copy/deepcopy, so create a deepcopy 'memo' with this
# value already copied which causes deepcopy to skip it.
memo = {id(self.wrapped): downcast(BRepBuilderAPI_Copy(self.wrapped, True, mesh).Shape())}
copy_of_shape = copy.deepcopy(self, memo)
return copy_of_shape
Can fork and submit a PR if desired.
I would appreciate the PR - thanks in advance.
Just submitted, let me know if anything else I can do.
Thanks for this awesome package, really helpful to have this set of additions to cadquery. Also excited to discover build123d.
Thanks for identifying an fixing this problem. I spend all my time on build123d these days so cq_warehouse doesn't get much attention.
This code (based on an official CadQuery example) works as expected with cq v2.3.1 and viewing in the lastest cq-editor (v0.3.0dev):
If the
cq_warehouse.extensions
import is uncommented, the example breaks with the following traceback:Commenting out the
color
arguments for both calls toAssembly.add()
seems to work still. Not seeing the same issue with thename
argument. Also, since the export is persistent, cq-editor must be restarted to get back to a clean state. This is using cq_warehouse v0.8.0. Have not been able to verify if the latest dev version has the same issue as it is not installing for me correctly (still investigating if this is a me issue or not). Running Ubuntu 22.04.3 LTS and Python 3.10.