You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I build an object and split it, and that works. However if I fillet some of the edges before splitting it, there's an error. Here's a minimal example:
import build123d as b3d
from build123d import Align, Axis, Box, Compound, Keep, Location, Plane, Polygon, extrude, faces, fillet, offset, split
from ocp_vscode import show
a = 100
b = 200
c = 50
h = 10
d = 2
o = 25
def example():
t = Polygon([(0, 0, 0), (a, 0, 0), (a,
b, 0), (0, c, 0)], align=Align.MIN)
obj = extrude(t, h)
top_edges = obj.edges().group_by(Axis.Z)[-1]
# if the line below is commented out, the example runs, if not, throws error
# obj = fillet(top_edges, d)
right = split(obj, bisect_by=Plane.YZ.offset(o), keep=Keep.TOP)
left = split(obj, bisect_by=Plane.YZ.offset(o), keep=Keep.BOTTOM)
return [left, right]
show(example())
Observation by Bernhard on Discord:
I think this is a bug in Shape.split: BRepAlgoAPI_Splitter returns a list of one Compound instead of two Solids. If I change
if keep == Keep.BOTH:
result = Compound(downcast(splitter.Shape()))
else:
parts = list(Compound(downcast(splitter.Shape())))
tops = []
to
parts = list(Compound(downcast(splitter.Shape())))
if len(parts) == 1 and isinstance(parts[0], Compound):
parts = list(parts[0])
if keep == Keep.BOTH:
result = Compound(parts)
else:
tops = []
then it works.
The text was updated successfully, but these errors were encountered:
Thanks for pointing this out. The problem with Compounds of Compounds has happened before so I've created an unwrap method for Compounds that remove these redundant layers. With this change the fix looks like:
I build an object and split it, and that works. However if I fillet some of the edges before splitting it, there's an error. Here's a minimal example:
Observation by Bernhard on Discord:
I think this is a bug in Shape.split: BRepAlgoAPI_Splitter returns a list of one Compound instead of two Solids. If I change
to
then it works.
The text was updated successfully, but these errors were encountered: