CadQuery / CadQuery/CQ-editor

Enabling build123d support in cq-editor

Open
#547 1 comment 0 reactions 0 assignees View on GitHub
Dominant language
Python
Stars
1.2k
Forks
210
PR merge metrics
No merged PRs in 30d

Description

I think build123d is getting more stable

Could we please have native support in cq-editor ?

That is in cq_utils.py, to_compound function add the conditions:

elif hasattr(obj, "wrapped") and isinstance(obj.wrapped, TopoDS_Shape):
vals.append(cq.Shape.cast(obj.wrapped))
elif hasattr(obj, "_obj") and hasattr(obj._obj, "wrapped") and isinstance(obj._obj.wrapped, TopoDS_Shape):
vals.append(cq.Shape.cast(obj._obj.wrapped))

For list of build123d objects, support can be added as well with the additionnal lines:

elif isinstance(obj, list) and hasattr(obj[0], "wrapped") and isinstance(obj[0].wrapped, TopoDS_Shape):
vals.extend(cq.Shape.cast(o.wrapped) for o in obj)
elif isinstance(obj, list) and hasattr(obj[0], "_obj") and hasattr(obj[0]._obj, "wrapped") and isinstance(obj[0]._obj.wrapped, TopoDS_Shape):
vals.extend(cq.Shape.cast(o._obj.wrapped) for o in obj)

These work in the latest cq-editor / build123d versions, for reference it comes from:
https://github.com/gumyr/build123d/issues/54

Cheers

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.