USB temperature logger
A small, complete design: a USB temperature-logger — hollow enclosure, PCB, MCU, USB-C connector, four mounting standoffs, a sensor, and an LED. Every piece below is real geometry from the kernel (Truck B-Rep), tessellated and exported to glTF, rendered live in your browser.
How it was built
Section titled “How it was built”The enclosure uses a single boolean (outer brick minus inner cavity, open top). The board and components are clean primitives — there’s no need for fragile booleans when parts simply sit in place.
use cad_kernel::CadKernel;
let mut k = CadKernel::new();
// hollow enclosure: outer minus inner cavity (open top)let outer = k.create_box(46.0, 16.0, 24.0)?;let inner = k.create_box(43.0, 15.0, 21.0)?;k.translate(inner, 0.0, 2.0, 0.0)?;let shell = k.boolean_subtract(outer, inner)?;
// PCB + a mounting standofflet pcb = k.create_box(40.0, 1.6, 18.0)?;k.translate(pcb, 0.0, 4.0, 0.0)?;let post = k.create_cylinder(1.6, 9.0)?;k.translate(post, 18.0, -1.0, 8.0)?;
let mesh = k.tessellate(shell, 0.08)?;The full generator lives in crates/cad-format/examples/hero_part.rs and writes one glTF per component group so each can be coloured independently.
The same thing from an agent
Section titled “The same thing from an agent”You don’t have to write Rust. Ask a connected agent:
Build a 46 × 24 × 16 mm USB-logger enclosure: hollow shell with 1.5 mm walls and an open top, four internal PCB standoffs, and a USB-C cutout on one end.
It calls design_part_from_spec, the kernel executes, and the result lands in the viewer.
- Connect your agent and try it.
- OCL basics — describe geometry as code.
- Export for fabrication — turn a design into manufacturable files.