mirror of
https://github.com/gumyr/build123d.git
synced 2026-01-07 01:33:44 -08:00
Moved extrude until previous/first to extrude_until method
This commit is contained in:
parent
76dd8cd801
commit
70e0c14da8
2 changed files with 4 additions and 5 deletions
|
|
@ -110,15 +110,11 @@ def extrude(
|
|||
for face in to_extrude_faces
|
||||
]
|
||||
|
||||
flip_direction = 1
|
||||
if until is not None:
|
||||
if target is None and context is None:
|
||||
raise ValueError("A target object must be provided")
|
||||
if target is None:
|
||||
target = context.part
|
||||
if until in [Until.PREVIOUS, Until.FIRST]:
|
||||
flip_direction = -1
|
||||
until = Until.NEXT if until == Until.PREVIOUS else Until.LAST
|
||||
|
||||
logger.info(
|
||||
"%d face(s) to extrude on %d face plane(s)",
|
||||
|
|
@ -141,7 +137,7 @@ def extrude(
|
|||
Solid.extrude_until(
|
||||
section=face,
|
||||
target_object=target,
|
||||
direction=plane.z_dir * direction * flip_direction,
|
||||
direction=plane.z_dir * direction,
|
||||
until=until,
|
||||
)
|
||||
)
|
||||
|
|
|
|||
|
|
@ -5326,6 +5326,9 @@ class Solid(Shape, Mixin3D):
|
|||
Union[Compound, Solid]: extruded Face
|
||||
"""
|
||||
direction = Vector(direction)
|
||||
if until in [Until.PREVIOUS, Until.FIRST]:
|
||||
direction *= -1
|
||||
until = Until.NEXT if until == Until.PREVIOUS else Until.LAST
|
||||
|
||||
max_dimension = (
|
||||
Compound.make_compound([section, target_object]).bounding_box().diagonal
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue