diff --git a/examples/handle_algebra.py b/examples/handle_algebra.py index ad9ec7c..20e8c09 100644 --- a/examples/handle_algebra.py +++ b/examples/handle_algebra.py @@ -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]