From e89fbd6c5aa676889a9e40232f5eccb83dbf3ce6 Mon Sep 17 00:00:00 2001 From: jdegenstein Date: Sun, 16 Oct 2022 13:53:03 -0500 Subject: [PATCH] testing changes for build123d by Gumyr --- cq_editor/cq_utils.py | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/cq_editor/cq_utils.py b/cq_editor/cq_utils.py index f52a5a4..e74cd82 100644 --- a/cq_editor/cq_utils.py +++ b/cq_editor/cq_utils.py @@ -23,8 +23,8 @@ def to_compound(obj : Union[cq.Workplane, List[cq.Workplane], cq.Shape, List[cq. if isinstance(obj,cq.Workplane): vals.extend(obj.vals()) - elif hasattr(obj,"wrapped") and isinstance(obj.wrapped,TopoDS_Shape): - vals.append(obj.wrapped) + elif isinstance(obj,cq.Shape): + vals.append(obj) elif isinstance(obj,list) and isinstance(obj[0],cq.Workplane): for o in obj: vals.extend(o.vals()) elif isinstance(obj,list) and isinstance(obj[0],cq.Shape): @@ -33,6 +33,10 @@ def to_compound(obj : Union[cq.Workplane, List[cq.Workplane], cq.Shape, List[cq. vals.append(cq.Shape.cast(obj)) elif isinstance(obj,list) and isinstance(obj[0],TopoDS_Shape): vals.extend(cq.Shape.cast(o) for o in obj) + 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)) elif isinstance(obj, cq.Sketch): if obj._faces: vals.append(obj._faces)