Light Diffuser for the Lamp of My Kid
FleetingTaking this as a good opportunity to test Claude with build123d.
The transcript of the discussion is 2026-02-05-14-22-42.md
When asked to created a disk shapper lamp diffuser, it went quite well.
([](https://ipfs.konubinix.eu/p/bafkreic2mo3uvzbma5fffxx7psfdihs6byarfe4maxod7g4egytbluybri?test.stl))Then, when asked to make a dome shaped one, it did not succeed.
#!/home/sam/.local/pipx/venvs/clk/bin/python
from build123d import *
# --- Parameters ---
cylinder_diameter = 80 # 8cm cylinder diameter
cylinder_radius = cylinder_diameter / 2
edge_thickness = 2 # 2mm edge thickness of the cylinder
clip_depth = 10 # depth the clip slides onto the cylinder
diffuser_thickness = 1.5 # thickness of the diffuser dome shell
dome_height = 25 # height of the dome bulge
# Derived dimensions
# The 8cm diameter is the circle formed by the gap between walls.
# The gap (= edge_thickness) is centered on cylinder_radius.
inner_wall_outer_radius = cylinder_radius - edge_thickness / 2
outer_wall_inner_radius = cylinder_radius + edge_thickness / 2
wall_thickness = 1.2 # thickness of each clip wall
diffuser_radius = (
outer_wall_inner_radius + wall_thickness + 5
) # disk extends beyond clip
with BuildPart() as diffuser:
# --- Dome diffuser (bulgy shell, sitting on build plate) ---
# Outer dome
with BuildSketch(Plane.XZ):
with BuildLine():
Line((0, 0), (diffuser_radius, 0))
EllipticalCenterArc((0, 0), diffuser_radius, dome_height, 0, 90)
Line((0, dome_height), (0, 0))
make_face()
revolve(axis=Axis.Z)
# Hollow out the dome, keeping a closed shell of diffuser_thickness
# Profile in XZ plane: the ellipse center is shifted up by diffuser_thickness
# so the cavity doesn't reach Z=0, leaving a solid base
with BuildSketch(Plane.XZ):
with BuildLine():
dt = diffuser_thickness
Line((0, dt), (diffuser_radius - dt, dt))
EllipticalCenterArc(
(0, dt),
diffuser_radius - dt,
dome_height - dt,
0,
90,
)
Line((0, dome_height), (0, dt))
make_face()
revolve(axis=Axis.Z, mode=Mode.SUBTRACT)
# --- Inner clip wall (grows upward from dome base) ---
Cylinder(
radius=inner_wall_outer_radius,
height=dome_height + clip_depth,
align=(Align.CENTER, Align.CENTER, Align.MIN),
)
Cylinder(
radius=inner_wall_outer_radius - wall_thickness,
height=dome_height + clip_depth,
align=(Align.CENTER, Align.CENTER, Align.MIN),
mode=Mode.SUBTRACT,
)
# --- Outer clip wall (grows upward from dome base) ---
Cylinder(
radius=outer_wall_inner_radius + wall_thickness,
height=dome_height + clip_depth,
align=(Align.CENTER, Align.CENTER, Align.MIN),
)
Cylinder(
radius=outer_wall_inner_radius,
height=dome_height + clip_depth,
align=(Align.CENTER, Align.CENTER, Align.MIN),
mode=Mode.SUBTRACT,
)
export_stl(diffuser.part, "test.stl")
I iterate a bit on the disk shaped one to make it fit with larger bulbs and provide honeycomb shaped holes to let more light go through.
([](https://ipfs.konubinix.eu/p/bafybeiednienq6e6irzfmbsswuwgufhr7gsnr4hafvhhuceykd3soifg3q?test.stl))