mirror of
https://github.com/gumyr/build123d.git
synced 2025-12-05 18:20:46 -08:00
handle_algebra.py -> update to use location_at (^) too
This commit is contained in:
parent
8064bf7342
commit
214c0d8af0
1 changed files with 6 additions and 13 deletions
|
|
@ -13,30 +13,23 @@ handle_center_line = Spline(
|
|||
tangents=((0, 0, 1), (0, 0, -1)),
|
||||
tangent_scalars=(1.5, 1.5),
|
||||
)
|
||||
# Record the center line for display and workplane creation
|
||||
handle_path = handle_center_line.edges()[0]
|
||||
|
||||
|
||||
# Create the cross sections - added to pending_faces
|
||||
|
||||
sections = Sketch()
|
||||
for i in range(segment_count + 1):
|
||||
plane = Plane(
|
||||
origin=handle_path @ (i / segment_count),
|
||||
z_dir=handle_path % (i / segment_count),
|
||||
)
|
||||
location = handle_center_line ^ (i / segment_count)
|
||||
if i % segment_count == 0:
|
||||
circle = plane * Circle(1)
|
||||
circle = location * Circle(1)
|
||||
else:
|
||||
circle = plane * Rectangle(1.25, 3)
|
||||
circle = location * Rectangle(1.25, 3)
|
||||
circle = fillet(circle.vertices(), radius=0.2)
|
||||
sections += circle
|
||||
|
||||
# Create the handle by sweeping along the path
|
||||
handle = sweep(sections, path=handle_path, multisection=True)
|
||||
handle = sweep(sections, path=handle_center_line, multisection=True)
|
||||
|
||||
show_object(handle_path.wrapped, name="handle_path")
|
||||
show_object(handle_center_line, name="handle_path")
|
||||
for i, circle in enumerate(sections):
|
||||
show_object(circle.wrapped, name="section" + str(i))
|
||||
show_object(circle, name="section" + str(i))
|
||||
show_object(handle, name="handle", options=dict(alpha=0.6))
|
||||
# [End]
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue