diff --git a/docs/selector_example.py b/docs/selector_example.py index 870a105..d6539a3 100644 --- a/docs/selector_example.py +++ b/docs/selector_example.py @@ -34,11 +34,11 @@ with BuildPart() as example: with BuildSketch(example.faces().sort_by(Axis.Z)[-1]): RegularPolygon(radius=7, side_count=6) Circle(radius=4, mode=Mode.SUBTRACT) - Extrude(amount=-2, mode=Mode.SUBTRACT) + extrude(amount=-2, mode=Mode.SUBTRACT) example.part.export_svg( "selector_before.svg", (-100, 100, 150), (0, 0, 1), svg_opts=svg_opts ) - Fillet( + fillet( example.edges() .filter_by(GeomType.CIRCLE) .sort_by(SortBy.RADIUS)[-2:] diff --git a/docs/tutorial_joints.py b/docs/tutorial_joints.py index 65f8250..5cb751f 100644 --- a/docs/tutorial_joints.py +++ b/docs/tutorial_joints.py @@ -27,6 +27,7 @@ license: # [import] from build123d import * + # [Hinge Class] class Hinge(Compound): """Hinge @@ -54,7 +55,6 @@ class Hinge(Compound): pin_diameter: float, inner: bool = True, ): - # The profile of the hinge used to create the tabs with BuildPart(Plane.XY, mode=Mode.PRIVATE) as hinge_profile: with BuildSketch(): @@ -69,7 +69,7 @@ class Hinge(Compound): length, align=(Align.MIN, Align.MIN), ) - Extrude(amount=-barrel_diameter) + extrude(amount=-barrel_diameter) # The hinge pin with BuildPart(Plane.XY, mode=Mode.PRIVATE) as pin: @@ -84,7 +84,7 @@ class Hinge(Compound): height=pin_diameter, align=(Align.CENTER, Align.CENTER, Align.MIN), ) - Fillet( + fillet( *pin_head.edges(Select.LAST).filter_by(GeomType.CIRCLE), radius=pin_diameter / 3, ) @@ -110,13 +110,13 @@ class Hinge(Compound): l4 = Line(l3 @ 1, (width - barrel_diameter, thickness)) l5 = Line(l4 @ 1, (0, thickness)) Line(l5 @ 1, l1 @ 0) - MakeFace() + make_face() with Locations( (width - barrel_diameter / 2, barrel_diameter / 2) ) as pin_center: Circle(pin_diameter / 2 + 0.1 * MM, mode=Mode.SUBTRACT) - Extrude(amount=length) - Add(hinge_profile.part, rotation=(90, 0, 0), mode=Mode.INTERSECT) + extrude(amount=length) + add(hinge_profile.part, rotation=(90, 0, 0), mode=Mode.INTERSECT) # Create holes for fasteners with Workplanes(leaf_builder.part.faces().filter_by(Axis.Y)[-1]): @@ -125,7 +125,7 @@ class Hinge(Compound): # Add the hinge pin to the external leaf if not inner: with Locations(pin_center.locations[0]): - Add(pin.part) + add(pin.part) # [Create the Joints] # @@ -189,7 +189,7 @@ hinge_outer = Hinge( # [Create the box with a RigidJoint to mount the hinge] with BuildPart() as box_builder: box = Box(30 * CM, 30 * CM, 10 * CM) - Offset(amount=-1 * CM, openings=box_builder.faces().sort_by(Axis.Z)[-1]) + offset(amount=-1 * CM, openings=box_builder.faces().sort_by(Axis.Z)[-1]) # Create a notch for the hinge with Locations((-15 * CM, 0, 5 * CM)): Box(2 * CM, 12 * CM, 4 * MM, mode=Mode.SUBTRACT)