Roger Maitland#7070 | A parametric pot lid holder:
from math import sqrt
from build123d import *
from ocp_vscode import *
set_defaults(reset_camera=False)
lid_d = 212 * MM # lid diameter
lid_t = 15 * MM # lid edge thickness
gap = 2 * MM # gap to allow easy insertion
lip = 15 * MM # amount the holder folds back on itself
thickness = 3 * MM # material thickness
with BuildPart() as holder:
# Create the profile from a filleted line
with BuildSketch() as profile:
with BuildLine() as outline:
Polyline(
(0, 0),
(lid_d / 2 + gap, 0),
(lid_d / 2 + gap, lid_t + gap),
(lid_d / 2 - lip, lid_t + gap),
)
fillet(outline.vertices(), radius=gap)
offset(amount=thickness, side=Side.RIGHT)
make_face()
# Revolve 90° as the part is mirrored later
revolve(axis=Axis.Y, revolution_arc=90)
# Create a box to control the part of the revolution to keep
size = holder.part.bounding_box().size
with Locations((0, -thickness, -lid_d / 4)):
Box(
2 * size.X,
size.Y,
size.Y,
mode=Mode.INTERSECT,
align=(Align.CENTER, Align.MIN, Align.CENTER),
) | 19:28:43 |