46 lines
1.5 KiB
Python
46 lines
1.5 KiB
Python
# /// script
|
|
# requires-python = ">=3.14"
|
|
# dependencies = ["ocp_vscode", "build123d"]
|
|
# ///
|
|
|
|
from build123d import *
|
|
from ocp_vscode import *
|
|
|
|
### Dimensions ###
|
|
diameter_at_hole = 5.5 * MM
|
|
ptfe_length = 5 * MM
|
|
filament_length = 5 * MM
|
|
diameter_at_filament = 3 * MM
|
|
washer_thickness = 2 * MM
|
|
###################
|
|
|
|
with BuildPart() as stopper:
|
|
with BuildSketch() as sketch:
|
|
Circle(diameter_at_hole / 2.0 + 2 * MM)
|
|
Circle(diameter_at_hole / 2.0, mode=Mode.SUBTRACT)
|
|
extrude(amount=washer_thickness)
|
|
with BuildSketch(Plane.XY.offset(washer_thickness)) as sketch:
|
|
Circle(diameter_at_hole / 2.0 + 0.5 * MM)
|
|
Circle(diameter_at_hole / 2.0, mode=Mode.SUBTRACT)
|
|
extrude(amount=ptfe_length)
|
|
z_offset = ptfe_length + washer_thickness
|
|
with BuildSketch(Plane.XY.offset(z_offset)) as sketch:
|
|
Circle(diameter_at_hole / 2.0 + 0.5 * MM)
|
|
Circle(diameter_at_hole / 2.0, mode=Mode.SUBTRACT)
|
|
z_offset += filament_length
|
|
with BuildSketch(Plane.XY.offset(z_offset)) as sketch:
|
|
Circle(diameter_at_filament / 2.0 + 0.5 * MM)
|
|
Circle(diameter_at_filament / 2.0, mode=Mode.SUBTRACT)
|
|
loft()
|
|
with BuildSketch(Plane.XZ) as sketch:
|
|
with Locations((0, z_offset)):
|
|
with BuildLine():
|
|
l1 = RadiusArc(
|
|
(diameter_at_filament / 2.0, 0), (diameter_at_hole / 2, 1), radius=1
|
|
)
|
|
offset(amount=0.5 * MM, side=Side.RIGHT)
|
|
make_face()
|
|
revolve(axis=Axis.Z)
|
|
show(stopper)
|
|
|
|
export_stl(stopper.part, "stopper.stl")
|