mirror of
https://github.com/gumyr/build123d.git
synced 2025-12-06 02:30:55 -08:00
Fixed split with nested Compounds Issue #698
This commit is contained in:
parent
2864f0556a
commit
f1a9c58900
2 changed files with 9 additions and 5 deletions
|
|
@ -2760,13 +2760,11 @@ class Shape(NodeMixin):
|
|||
# Perform the splitting operation
|
||||
splitter.Build()
|
||||
|
||||
if keep == Keep.BOTH:
|
||||
result = Compound(downcast(splitter.Shape()))
|
||||
else:
|
||||
parts = list(Compound(downcast(splitter.Shape())))
|
||||
result = Compound(downcast(splitter.Shape())).unwrap(fully=False)
|
||||
if keep != Keep.BOTH:
|
||||
tops = []
|
||||
bottoms = []
|
||||
for part in parts:
|
||||
for part in result:
|
||||
if plane.to_local_coords(part).center().Z >= 0:
|
||||
tops.append(part)
|
||||
else:
|
||||
|
|
|
|||
|
|
@ -462,6 +462,12 @@ class TestSplit(unittest.TestCase):
|
|||
split(bisect_by=Plane.YZ, keep=Keep.TOP)
|
||||
self.assertAlmostEqual(test.part.volume, (2 / 3) * 1000 * pi, 5)
|
||||
|
||||
def test_wrapped_object(self):
|
||||
obj = Box(1, 1, 1)
|
||||
obj = fillet(obj.edges().group_by(Axis.Z)[-1], 0.1)
|
||||
right = split(obj, bisect_by=Plane.YZ, keep=Keep.TOP)
|
||||
self.assertLess(right.volume, obj.volume)
|
||||
|
||||
|
||||
class TestThicken(unittest.TestCase):
|
||||
def test_thicken(self):
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue