Skip to content

Commit

Permalink
support compounds in extrude_until
Browse files Browse the repository at this point in the history
  • Loading branch information
bernhard-42 committed Aug 5, 2023
1 parent 23b5f5b commit 0ea6be9
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion src/build123d/topology.py
Original file line number Diff line number Diff line change
Expand Up @@ -5639,9 +5639,16 @@ def extrude_until(
# Project section onto the shape to generate faces that will clip the extrusion
# and exclude the planar faces normal to the direction of extrusion and these
# will have no volume when extruded
faces = []
for f in section.project_to_shape(target_object, direction):
if isinstance(f, Face):
faces.append(f)
else:
faces += f.faces()

Check warning on line 5647 in src/build123d/topology.py

View check run for this annotation

Codecov / codecov/patch

src/build123d/topology.py#L5647

Added line #L5647 was not covered by tests

clip_faces = [
f
for f in section.project_to_shape(target_object, direction)
for f in faces
if not (f.geom_type() == "PLANE" and f.normal_at().dot(direction) == 0.0)
]
if not clip_faces:
Expand All @@ -5651,6 +5658,7 @@ def extrude_until(
clipping_objects = [
Solid.extrude(f, clipping_direction).fix() for f in clip_faces
]
clipping_objects = [o for o in clipping_objects if o.volume > 1e-9]

if until == Until.NEXT:
extrusion = extrusion.cut(target_object)
Expand Down

0 comments on commit 0ea6be9

Please sign in to comment.