Files
kidsbox/enclosure/Makefile
Claude 75dd63b56f Add parametric 3D-printable enclosure (OpenSCAD)
A printable reimagining of the wooden Kidsbox: rectangular cabinet with two
front speakers, removable top lid (NFC tag rests there, reader mounts beneath),
and swappable speaker mounts.

- kidsbox.scad: master model + part dispatcher (body/lid/speaker_adapter/grill)
- params.scad: all tunable dimensions in one place
- lib.scad: helper modules (rounded shell, bosses, bolt circles)
- Fixed front-panel speaker interface + swappable adapter so any driver fits
  by printing a new adapter (edit spk_* params, re-export)
- Internal mounts: 2x18650 cradle, ESP32-LyraT standoffs, RC522 under lid,
  3 buttons on lid, USB/charge + power-switch side ports, back-wall vents
- Snap-in speaker grills
- Makefile to export STLs and render previews (headless via xvfb)
- Exported STLs and preview renders included
- Link enclosure from main README

Dimensions are sensible defaults from the reference photos and common parts;
README flags the fit-critical values to verify before mass-printing.

https://claude.ai/code/session_01MhAnh68DPNnTjcKqjNYDmk
2026-06-13 10:39:55 +00:00

47 lines
1.7 KiB
Makefile

# Regenerate Kidsbox enclosure STLs and preview images from the OpenSCAD source.
#
# make stl export all printable STLs into stl/
# make img render preview PNGs into img/ (needs a display or xvfb)
# make all both
# make clean remove generated STLs and images
#
# Override the renderer if openscad isn't on PATH: make OPENSCAD=/path/to/openscad
OPENSCAD ?= openscad
SRC = kidsbox.scad params.scad lib.scad
PARTS = body lid speaker_adapter grill
STL_FILES = $(addprefix stl/,$(addsuffix .stl,$(PARTS)))
# Software GL so it works headless under xvfb on a server.
RENDER_ENV = LIBGL_ALWAYS_SOFTWARE=1 GALLIUM_DRIVER=llvmpipe
XVFB = xvfb-run -a -s "-screen 0 1280x960x24"
IMGOPTS = --viewall --autocenter --imgsize=1280,960 --colorscheme=Tomorrow
.PHONY: all stl img clean
all: stl img
stl: $(STL_FILES)
stl/%.stl: $(SRC)
@mkdir -p stl
$(OPENSCAD) -D 'part="$*"' -o $@ kidsbox.scad
img: $(SRC)
@mkdir -p img
$(RENDER_ENV) $(XVFB) $(OPENSCAD) -D 'part="assembly"' -D 'explode=0' \
--camera=0,0,0,64,0,28,0 $(IMGOPTS) -o img/hero.png kidsbox.scad
$(RENDER_ENV) $(XVFB) $(OPENSCAD) -D 'part="assembly"' \
--camera=0,0,0,62,0,28,0 $(IMGOPTS) -o img/assembly.png kidsbox.scad
$(RENDER_ENV) $(XVFB) $(OPENSCAD) -D 'part="body"' \
--camera=0,0,0,60,0,25,0 $(IMGOPTS) -o img/body.png kidsbox.scad
$(RENDER_ENV) $(XVFB) $(OPENSCAD) -D 'part="lid"' \
--camera=0,0,0,60,0,200,0 $(IMGOPTS) -o img/lid_top.png kidsbox.scad
$(RENDER_ENV) $(XVFB) $(OPENSCAD) -D 'part="speaker_adapter"' \
--camera=0,0,0,60,0,20,0 $(IMGOPTS) -o img/speaker_adapter.png kidsbox.scad
$(RENDER_ENV) $(XVFB) $(OPENSCAD) -D 'part="grill"' \
--camera=0,0,0,55,0,20,0 $(IMGOPTS) -o img/grill.png kidsbox.scad
clean:
rm -f stl/*.stl img/*.png