Repository navigation
BREPcode v0.4.0
Models that flow instead of snapping together, imported colour that survives the trip, and an AI that reads a third less to do more.
Organic modelling
union() puts a crease exactly where two shapes cross — right for a bracket, wrong for a wrist. Two new ops join through a soft-minimum distance blend, where the fillet shapes itself: widest at shallow meetings, tighter head-on.
blob([[0,0,14,13], [0,0,34,9], [11,0,12,4], [-11,0,12,4]], { k: 7 })
smoothUnion(5, cylinder({ r: 6, h: 22 }), translate([0,0,24], sphere({ r: 14 })))blob() is metaballs — the cheapest route to a creature. smoothUnion() blends anything, imported meshes included. k is the blend in mm: 2–4 a generous fillet, 6–10 flesh, 15+ melts the parts into one mass. Resolution comes from a triangle budget, so a character builds in about a second; pass { maxTris: 20000 } for the one build before a final export.
This matters most for the AI: describing a mascot used to mean constructing organic geometry, which models are bad at. Now it means placing blobs and picking k, which they are good at.
Imported OBJs keep their colour
A coloured OBJ used to come back grey and welded into one solid — every import was flattened to STL, a format with no colour at all. Now a coloured OBJ arrives as separate, named, editable parts:
return group(
colorize("#408c4d", importedMesh("coin-rim.stl", { repair: "BASIC" })),
colorize("#f56b9e", importedMesh("coin-side_A_face.stl", { repair: "BASIC" })),
);Vertex colours are read (what BREPcode's own exports and Blender carry), part names come from the file's own groups, and heavy files get an instant coloured preview with a build button rather than a frozen tab.
A lighter AI harness
Six sections of the always-on prompt teach situations — an attached image, a drawing sheet, gear fits, splitting for the plate, pasted OpenSCAD, the built-model reference. Most messages are none of those, yet every message paid for all of them. They now arrive only when the request calls for them.
A typical request: 33,219 → 20,817 characters, 37% lighter. Nothing was removed — a request that needs a section always gets it. The biggest winners are local models with no prompt cache (Lemonade, llama.cpp, the in-browser model), which re-read every byte every message.
Fixes
- Window controls stay in one cluster on every panel — no more ⇲ ⤢ ✕ spread across the header
- The editor header stays on one line whatever the model is called
- Free-form corner balls sit on the part, and never overwrite a
difference()or turn a cylinder into a box - Stretching keeps the cut true — a hole stays round while the plate stretches, and the snap on release is gone
- Published gallery thumbnails frame the whole model instead of cropping whatever the camera happened to show
- The publish panel says where the stash actually lives, and its checkboxes are readable
- The (i) panel's sections collapse independently
4,163 checks across 75 files.
Downloads
- BREPcode.exe — portable Windows app, no installer.
- BREPcode-site.zip — the static site, if you want to host it yourself.