What hitlcad is, and why it checks the whole assembly

hitlcad is open-source, human-in-the-loop CAD. A coding agent writes each part as Python, and every build is checked as an assembly before you look at it.

Modeling5 min readPart 1 of 5 in Text-to-CAD with hitlcad
On this page

Ask an AI for a gearbox and you’ll probably get something that looks like a gearbox. Whether it works is another question. In an early test model of ours, the sun gear’s bore came out at 5.2 mm on a 5.0 mm shaft. A clearance meant as radial had been read as diametral, an easy slip that’s invisible on screen. The model looked fine. Nothing in it knew that the bore and the shaft were supposed to meet, so nothing checked them.

That bug is why hitlcad exists. It’s an open-source tool we built for designing real parts with a coding agent, and it rests on one idea. Before anyone writes geometry, the design says which features are meant to meet and how. Then every build checks the geometry against that declaration.

The rest of the series covers installing it, building a first design, reviewing by pointing at the model, and the example designs that ship with it.

Three pieces, and only one of them is ours

hitlcad doesn’t have its own AI. You bring the agent you already use, Claude Code or Codex in VS Code, and it does the modelling. The geometry comes from established open-source kernels, build123d for precise mechanical parts and Blender for sculpted shapes like figurines. hitlcad sits between them and you.

Every time a file is saved, hitlcad rebuilds the parts that changed, puts the assembly together and measures it. Then it does two things with the result. It writes a report the agent reads, and it shows you the model in 3D right next to the code.

One loop, on every save You a brief, picks and pins Your agent writes design.json and the Python hitlcad builds, measures, checks it all 3D panel the model and its report save report
The agent sees the report on every save, so most mistakes are fixed before you look.

The inner loop matters most. The agent gets the report after every build, so when a check fails it usually fixes the problem and rebuilds before you’ve even glanced at the screen. You end up reviewing designs that already build clean.

Structure before geometry

In most AI CAD tools the model is the geometry and nothing else. In hitlcad, a design starts as a file called design.json that lists what the product is made of. Each printed part gets a material and a process. Bought parts like screws, heat-set inserts and bearings come from a catalogue by their standard designation. And every joint names the two features it connects, the kind of motion it allows and, where it matters, the fit.

Here’s a fragment from the hand-held blower that ships as an example.

{
"parts": {
"impeller": {
"role": "axial fan rotor on the motor shaft",
"file": "parts/impeller.py",
"material": "PETG",
"connectors": {
"bore": { "kind": "hole" }
}
},
"handle_screw": {
"role": "holds the handle to the duct pad",
"file": "parts/hardware.py",
"catalog": {
"designation": "ISO 4762 M3 × 10",
"fidelity": "exact"
}
}
},
"mates": [
{
"type": "cylindrical",
"a": "motor.shaft",
"b": "impeller.bore",
"fit": { "clearance": [0.0, 0.15] }
}
]
}

The mate at the end says the impeller’s bore turns on the motor’s shaft with between 0 and 0.15 mm of clearance. Once that’s written down, hitlcad can find both features in the built geometry, measure them and tell you whether the fit is what was asked for. The sun gear bug would have failed right there.

Values that two parts share, such as a bore and the shaft that fits it, are computed once in a file called interfaces.py, and both parts read them from there. Parts never measure each other’s geometry. That’s the same discipline experienced CAD users follow with layout sketches, except here it’s enforced.

What gets checked

For the blower that’s 134 checks on every build. They fall into a handful of groups.

  • Parts. Every part is a valid solid with a closed mesh.
  • Connectors. Every feature the design declares is found in the geometry and measured.
  • Mates and fits. Joined features line up, and fits come out as specified once the printer’s allowance is taken into account.
  • Fasteners. Every screw sits on its hole, clears every hole it passes through, has the right thread and engages enough of it without bottoming out.
  • Interference and motion. No two parts overlap unless a joint says they should, and moving parts are swept through their whole range looking for collisions.
  • Manufacturing. Each part is checked against the rules of the process that makes it, in the orientation it’s made. FDM, resin printing, CNC milling, sheet metal and injection moulding each have their own.
  • Requirements. The brief’s requirements become checks with numbers attached.

When something fails, the report says so in one line per cause, with numbers. If the impeller’s diameter gets typed in by hand as 70 mm instead of coming from the parameters, the build comes back with this.

✗ interference duct+impeller: duct and impeller overlap by 91.11 mm³ in 7 pieces within x 4.00 … 22.00, y -34.20 … 35.00, z -35.00 … 35.00, about 0.25 mm deep (also: motion motor.shaft+impeller.bore, requirement 'Impeller blade tips clear the duct')

One mistake, one line, even though it broke three checks. That’s deliberate. An agent that gets twenty lines of symptoms tends to fix them one by one, and badly. An agent that gets the cause, where it is and how big it is can fix the cause.

Where the person comes in

Some things a program can’t settle. “The intake guard is finger-safe” is a requirement in the blower’s brief, and hitlcad doesn’t pretend to check it. It reports it as unverified and leaves it for a person to judge. That honesty runs through the whole tool. A check either passes, fails with a reason, or says it couldn’t be checked and why. It never guesses.

The other place you come in is review, and here hitlcad’s main idea is that you shouldn’t have to describe geometry in words. You click the face you mean, or pin a note on it, and the agent gets the exact part and face along with your next message. Part 4 is all about that.

What it isn’t

It isn’t a box you type a prompt into and get a mesh back in seconds. It runs locally in VS Code, it needs Claude Code or Codex, and the agent may take a few minutes and several builds to get a design right. It also doesn’t solve constraints, simulate loads or manage part numbers. Those are jobs for FEA tools and your own systems.

What you get in return is a design you can trust and keep. The output is a STEP assembly that opens in other CAD tools as real parts and sub-assemblies, STL and 3MF files for the printer (how the three compare), a bill of materials, and the design itself, a plain folder of Python and JSON you can commit to git and change later.

Part 2 gets it installed. If you’d prefer us to model a part with hitlcad, get in touch.

Questions or corrections about this post? Leave a comment.

Planning a project?

Tell us where your systems are today and where you want them to be, and we’ll work out where to start.

Contact us