Petal Lid Box
A small square box for rings, earbuds and other trinkets, with a lid made of four triangular petals. Each petal is hinged to one edge of the box and swings open like a flower, and closed together they form a pyramid lid; the hinge pins are short pieces of 1.75 mm filament (about 39 mm each). The box is 60 x 60 x 45 mm (64 x 64 x 73 mm with the lid closed), and the print layout of the box plus four flat petals is 167 x 89 x 51 mm. Print the box on its bottom and the petals flat; no supports are needed. The pose parameter switches between the print layout and the closed or open assembly, and you can also change the box size, height, wall thickness, closed and open angles, knuckle radius, pin hole diameter and knuckle gap.
# Petal Lid Box - small square box whose four hinged triangular petals close into a pyramid lid
# A square box has a hinge on each of its four edges, and four triangular petals form a pyramid lid.
# Each petal swings open around its edge's hinge axis (like a flytrap opening its mouth).
# The hinge pins are cut from 1.75mm filament.
# pose: "print" = print layout (box + four flat petals) / "closed" = closed assembly / "open" = open assembly
@param choices:["print", "closed", "open"] desc:"State to show"
pose = "print"
@param 40..120 desc:"Box outer width = depth (mm)"
W = 60
@param 20..100 desc:"Box height, excluding hinge lugs (mm)"
H = 45
@param 1.6..4 step:0.2 desc:"Wall thickness (mm)"
wall = 2.4
@param 30..60 desc:"Petal tilt when closed (deg)"
close_deg = 45
@param 90..200 desc:"Petal tilt when open (deg)"
open_deg = 160
@param 2.5..5 step:0.5 desc:"Hinge knuckle radius (mm)"
r_k = 3.0
@param 1.8..2.4 step:0.05 desc:"Pin hole diameter (for 1.75mm filament) (mm)"
pin_d = 2.0
@param 0.2..0.8 step:0.1 desc:"Axial gap between knuckles (mm)"
k_gap = 0.4
t = wall # petal plate thickness
k = 16 # petal knuckle length
lug = 10 # box lug length (one on each side)
ya = -W / 2 + wall / 2 # hinge axis Y (on the wall's center line)
za = H + r_k # hinge axis Z (r_k above the rim)
L = (-ya) / cos(close_deg) # slant length from the axis to the apex
edge = t + 0.6 # ridge relief so neighboring petals do not collide
y0 = r_k + 0.5 # plate root (distance clear of the lugs)
hw0 = (-ya) * (1 - y0 / L) - edge # plate half-width at the root
# ---- Box ----
body = box W W H | floor | edges =Z | fillet 4 | faces >Z | shell wall
lug_one = (cylinder r_k lug | rotate 0 90 0)
+ (box lug (r_k * 2) (r_k + 1) | floor | translate 0 0 (-r_k - 1))
lug_pos = k / 2 + k_gap + lug / 2
lugs_side = (lug_one | translate lug_pos ya za) + (lug_one | translate (-lug_pos) ya za)
pin_side = cylinder (pin_d / 2) (k + 2 * (k_gap + lug) + 2) | rotate 0 90 0 | translate 0 ya za
hinge_side = lugs_side - pin_side
base = body + (union [hinge_side | rotate 0 0 (90 * i) for i in range(4)])
# ---- Petal (hinge axis = X axis at the origin; lying flat, plate underside at z=-r_k) ----
plate = sketch [(-hw0, y0), (hw0, y0), (0, L - edge * 1.5)]
| extrude t | translate 0 0 (-r_k)
bridge = box k (y0 + 1) t | floor | translate 0 ((y0 + 1) / 2) (-r_k)
knuckle = cylinder r_k k | rotate 0 90 0
pin_hole = cylinder (pin_d / 2) (k + 2) | rotate 0 90 0
petal = plate + bridge + knuckle - pin_hole
def mounted($deg) = union [petal | rotate $deg 0 0 | translate 0 ya za | rotate 0 0 (90 * i) for i in range(4)]
# Print layout: petals lie flat in a 2x2 grid to the right of the box (underside at z=0)
gap = 6
px = W / 2 + gap + hw0
printed = union [petal | translate 0 0 r_k
| translate (px + (i % 2) * (hw0 * 2 + gap)) (if i < 2 then (-L - gap / 2) else (gap / 2 + r_k)) 0
for i in range(4)]
base
if pose == "print" then printed else (if pose == "closed" then mounted(close_deg) else mounted(open_deg))