Toddler Tunes - A Digital Music Box · Part 2 of 5

Designing the puck in code

With no CAD experience, the owner had Claude design the enclosure as a build123d script and checked it through rendered previews. Two reviews from JLC3DP's engineers then led to a wall-thickness checker and a ribbed, thicker-walled puck.

  • Published
  • Worked Oct 20 – 21, 2026
  • Claude Opus 5.5
  • build123d3d-printingmjfenclosuredesign-for-manufacture

A description, some options, and a script

The board was laid out, and the enclosure was designed next to it in Claude Code, in a session whose record didn’t survive. This post rests on the commits, the code and its README, and the owner’s account.

Me

I don’t know CAD, and I don’t have time to learn it. Designing the enclosure in build123d, a Python CAD library, let me explore Claude’s CAD capabilities. That was key to validating the “thought to thing” side of this project.

Me

I gave Claude a rough description, and it presented some options. One of the earliest put the board above the speaker, with the speaker firing downward. I rejected it, because changing the batteries would have meant taking the whole toy apart. We went back and forth for a few rounds: Claude presented renders, and I asked for changes. The renders were the only check I used. I was surprised by just how well Claude was able to turn my ideas into tangible 3D designs.

Claude

The first version, as the commit and its README record it, was a round puck, 105.6 mm across and 67 mm tall, that clamps the board between a base and a lid, for JLC3DP’s MJF nylon. It had six printed parts: the base, the lid with its grille, the battery door, a button cap, the knob and a USB-C shutter. The board’s heights come from KiCad’s STEP export. A fit check tests every part against every other part and against each part on the board, including the shutter slid up, and must end with “fit check: no overlaps”. A second script renders previews.

Claude

The toddler rules are in the geometry. The grille’s holes are 3 mm, too small for fingers. The button cap’s flange is wider than its hole, so it’s captive once the lid is on. The knob is glued onto the pot’s D-shaft, so it can’t come off as a small part. The battery door takes two screws, because toy-safety rules for under-3s expect a compartment that needs a tool. The shutter rests over the USB-C port by gravity and is captive in its track.

Every part of the puck exploded along its axis: the blue lid with its grille, the red button cap and green knob above it, the speaker, the board, the yellow base and the orange battery door at the bottom. It shows the design as printed, after the second review's ribs.

What does an enclosure look like as a build123d script?

The script builds each part from solids such as boxes, cylinders and cones, cuts and joins them, and exports STEP and STL files for the printer. Every dimension is a named constant near the top of the file, so a change is an edit and a rerun.

The parts sit in the board STEP’s own coordinates: the origin at the board’s centre, z = 0 at the underside of the PCB, and +Y toward the USB-C port. Heights such as the top of the button switch and the centre of the USB-C socket are measured from that STEP.

The clearances follow JLC3DP’s MJF rules. FIT is 0.3 mm per side for parts that assemble, and FIT_SLIDE is 0.5 mm for the button and the shutter. Clearance holes are 3.6 mm, because MJF holes print up to 0.3 mm small.

The first review: walls too thin to print

JLC3DP checks uploaded models before printing. The board and the enclosure were ordered on October 20, and the fix for the first review was committed at 07:35 the next morning.

Me

JLC3DP emailed to say the print would likely fail as it was, with suggestions for fixing it. I gave the email to Claude Code as a PDF, let it make the adjustments, and had it draft my reply.

Claude

The review flagged two thin walls in the base I had modelled: a 0.5 mm sliver between the battery door’s seat and the board-screw counterbores, and 0.33 mm lips where the shutter track crossed the base’s tongue. I fixed those and wrote wallcheck.py, a check like the one JLC3DP runs. It found the same two, plus thin spots in the door (a knife edge on its bevel, short screw ears), the button’s flange edge, a 0.5 mm roof on the knob, and two places in the lid: the rim beside the USB bay and the pot-lug pocket.

Claude

The fixes: the door opening clears the holder by 0.5 mm a side, its seat has a 1.2 mm vertical edge and a 1 mm bevel, the counterbores grew to 6 mm and the floor to 4 mm, and the door’s ears got longer and wider. The tongue now stops at the USB bay, where the lid’s bay block comes down to meet the base. The button flange gained a vertical edge and the knob a 2 mm roof. Every part then passed at 1.0 mm, and the fit check stayed clean. I also drafted your reply to JLC3DP.

How does a script measure wall thickness?

At points spread over each part’s surface, wallcheck.py casts a ray inward along the surface normal and measures the distance to the far side. A ray that starts near an edge can graze a face and read thin where the wall isn’t, so each point also casts two rays tilted 15° from the normal, and the longest reading counts. Specks of one or two thin points are ignored, because a real thin wall shows up as a region.

It takes about two minutes, and before any order it must end with “every part is at least 1.0 mm thick”.

The second review: warping, and ribs

Me

JLC3DP sent a second email after reviewing the changes: warping was likely. I gave that email to Claude Code as well, and suggested ribs myself, as I knew they were a common approach to stiffening plastic enclosures like this one.

The engineers’ reasoning, as the commit records it: a large nylon enclosure without internal ribs shrinks toward its centre and twists as it cools, and flat areas and frame shapes are worst. The base’s floor around the battery opening was exactly such a frame.

Claude

I added the ribs you suggested and thickened the walls from 3.3 to 4.3 mm, which grew the puck to 107.6 mm. The joint’s tongue and the lid’s rim became 2 mm each, and the lid’s top plate 4 mm. In the base, a rib box round the battery holder turns the floor’s frame into a box section, eight radial ribs run from it to the wall, and a 45° gusset ring stiffens the wall’s foot.

The base from above: the rib box round the square battery opening, radial ribs out to the wall, four board standoffs, two keys on the tongue and the USB bay at the back

Claude

In the lid, a rib frame round the speaker flange also locates the speaker, more ribs run out to the wall, a bridge ties the button guide to the wall, and a gusset ring sits under the top plate. The battery door got three ribs on its inside face. The fit check stayed clean, and every part passed the wall check at 1.0 mm. The base, lid, door and knob also passed at 1.45 mm.

The lid from below: the rib frame round the grille's holes, ribs out to the wall, the four posts, the button collar and the volume-pot hole

Me

I had asked Claude which materials would make a child-friendly enclosure, and it suggested nylon. I ordered every part in PA11-HP, black. I ordered no test prints: I bet on Claude’s design being right on the first try.

The reviews left two lasting rules in the project’s notes: give any new flat area a rib, and run the wall check before every JLC3DP order. The printed parts arrived on November 2. Before that, the board came back from JLCPCB, which is the next post.