Every part of Ted is written as Python code with build123d, not drawn by hand in a CAD program. That means a change like “make the shin 12 mm longer” is one number, and every part that depends on it updates by itself.
Code can still be wrong, though, and our first two prints taught us that the hard way (see the build log). So nothing gets printed until a set of checks has measured it against the real parts.
pip install -r requirements.txt
cd cad
python build_cad.py # every part -> stl/, plus viewer.html and dims.json
python build_leg2.py # lays the leg parts flat for printing -> stl/leg3_*.stl
python build_torso_print.py # lays the torso parts flat -> stl/torso1_*.stl
python export_sim.py # the MuJoCo twin -> ../sim/biped.xml and biped_backlash.xml
When build_cad.py finishes, open viewer.html to look at the result in 3D.
Run these before every print. Each one prints a table and a final pass or fail.
| Script | What it checks |
|---|---|
check_fit.py |
Swings every joint through its full range and looks for parts hitting each other. |
check_servo_fit.py |
Places the real STS3215 3D model at every joint. For every case screw it measures the air gap under the head, how much thread bites into the servo and how far the hole is from the servo’s hole. It also checks the horn plates and the plug clearance as the joints turn. |
check_wiring.py |
Sweeps every servo cable through its joints’ full range to find the longest path, checks it fits the stock 150 mm cable, and checks that no wire passes through a part. It also adds up the mass and works out how level the robot hangs from its tether. |
check_torso_fit.py |
Casts a grid of rays out of every face of every board, the battery and the sensors, and reports the free room to the nearest wall, servo or other board. Every side needs at least 0.2 mm. It also checks the mounting-hole spacing against the makers’ drawings. |
They sample surfaces and cast rays rather than filling solids, so each one runs in about 0.5 GB of memory.
section_views.py cuts each leg part through its servo and draws the real servo in dark grey, the printed part in orange and the screw lines in blue. It’s a quick way to see that every wall touches the case rim at the screws.
