h0bb3's log

5 min read

CoreCAD: say what you need, watch it take shape

I have a 3D printer, and the hard part of printing a thing is never the printer. It is the CAD program: I know the part in words and numbers, “a plate, 60 by 40, four screw holes, a pin in the middle”, and the program wants me to say it with a mouse, one constraint at a time.

An agent is good at exactly the words-and-numbers part. So I built a CAD program where the agent holds the tools and I watch: h0bb3.github.io/corecad. It runs in the browser, it is free, and there is nothing to install and no account to make.

A minute and a half of it at work (on YouTube): a box with a lid on a hinge, a drawing for the workshop, the model live on a phone, and a small engine built in about a hundred steps.

The start screen of CoreCAD: the address of the tab, a button that copies it for an agent, and three steps What you meet when you open it. The address is this tab’s own, made in the browser.

How it works

The tab makes an address for itself. You copy it into your agent’s chat, and the agent connects to the tab over MCP, through a small relay on my server. Claude, ChatGPT, Cursor, Codex: anything that speaks MCP. Then you ask for a part, and every step the agent takes appears in the tab as it happens: a sketch, a dimension, an extrude, a cut. Each one is an undo step. You can grab the model, turn it, measure it, and change a number by hand in the middle of it all.

The part I like most: you can point. Click a face and say “a hole here”, and the agent knows which face you mean and where on it you clicked. Rest the mouse on an edge and say “this one, rounder”. While it works, the view gets an orange frame and a line saying what it is doing, so you never wonder whether it is still at it.

An agent at work: an orange frame round the view, and a hole cut where the person clicked “A hole here”: the hole went where the click was. The line at the bottom says the agent’s last step.

Under it is a real geometry kernel, OpenCascade, running in the page in a worker. The solids are solids, not meshes pretending: they export as STEP for other CAD programs, and as STL and 3MF for the slicer.

What it can do, ten days in

More than I expected to write down:

  • Sketches with constraints and dimensions, on planes and on faces of the model.
  • Solids: extrude, revolve, fillet, chamfer, shell, mirror, sweep and loft, in a history you can step back through and edit. A thread is one feature: a revolve that climbs as it turns, so a thread, a spring or a screw is one step.
  • Parts and mechanisms: parts with their own histories, groups, linked copies, and joints: a door that turns, a button that slides, gears that turn each other, an engine’s crank, rod and piston that move together.
  • Named numbers: wall = 2.4, clearance = 0.2, and every size that depends on them follows when they change.
  • Drawings for the workshop: views of a part on a sheet, with sizes, tolerances, sections, threads drawn the ISO way and a proper title block, as a PDF at true size.
  • Looking inside: Section cuts the model open, X-ray makes it see-through.
  • Folders: projects kept online and shared by link, encrypted in the browser before they leave it. Sign in, and the links are kept on the server too, so your folders are on every device.
  • A headset: the model in the room at its real size on a Quest 3, or a phone that scans a QR code and watches the tab’s model live.

And one thing that is not a feature in the usual sense: every part and every step can carry a description, like a comment in code. What this is, what it is for, why it is made so. Agents are told to read them before changing anything, and to write them. A model handed to the next agent explains itself.

What it grew

As with Image Forge, almost everything came from using it and saying what annoyed me.

“One way to do each thing.” Early on the agent had grown conveniences: add_box next to sketch-and-extrude, hole next to a circle and a cut. Two ways to do the same thing means an agent has to choose, and chooses differently each time. So the rule became primitives, not conveniences, and 43 commands became 37 the same day. There are 75 now, because the program does much more, but none of them overlap.

“I now want the agent connection to be the default interaction you face when opening core cad.” It started as a CAD program you drive by hand, with a Connect button for an agent. Now the agent is the front door, and drawing by hand is the side entrance: still there, a click away.

“Some kind of file explorer interface.” Shared folders worked from the first day for an agent, which only needs commands. For a person they were a plain dialog. Now there is a proper explorer: back, forward, a path, a filter, a right-click menu, F2 to rename, Delete for the bin.

“The agent itself figures out how it should connect.” When I asked for other agents than Claude, the first try was a row of buttons with each agent’s menus and terminal commands spelled out. Those go out of date the day they are written. Now the copy button gives the address with a short note that says what it is, and the agent works out the rest.

What went wrong

The slicer frowns. Bambu Studio opens CoreCAD’s 3MF files with “The 3mf file has invalid config, load geometry data only”. The geometry is right; the cause is still not found.

The check that failed and then didn’t. Right after one build went live, the check through the public relay failed twice at the same place, and then passed three times with nothing changed. Nobody knows why yet. It is written down as such, which is more honest than calling it fixed.

The headset had no eyes. The phone-style QR scanner failed in the Quest’s browser on the first try: “This browser has no camera that a page may use”. After a system update, the headset reads the code by itself. I did nothing; I am taking the credit anyway.

And the honest limits: it is tested on Chrome on a Windows desktop. Threads come out as valid solids with the right volumes, but nobody has printed a bolt and a nut yet to see whether they screw together.

Used for real

One thing has gone the whole way from a conversation to a printed part: a wall-mounted holder for a tablet, with dovetails, in three variations. It works quite well. That is a sample of one, but it is the one that matters to me.

The numbers

Metric Value
From the first commit to now ten days
Commits 73
Lines, tests included about 39,000
Commands an agent can use 75
Unit tests 232, in 32 pages
End-to-end test scripts 10, in a headless browser
Libraries OpenCascade (through replicad), three.js, two for QR codes
Things to install 0
Accounts needed to start 0
Parts printed and in use 1, in three variations

Take it

It is at h0bb3.github.io/corecad. Open it, copy the address into your agent, and ask for something you need. The code is at github.com/h0bb3/corecad under the MIT licence.

If you print things, tell me what it got wrong on your first part. That is how everything above got made.