---
title: "Your first hitlcad design, from the brief to a clean build"
description: "Follow one design through hitlcad, from a one-line request to the brief, design.json, the part files and the build report, using the hand-held blower example."
date: 2026-10-25
locale: en
url: https://tokenflake.com/blog/first-hitlcad-design/
---

The best way to understand hitlcad is to follow one design from the first sentence to the files you'd send to a printer. This part does that with the hand-held blower from hitlcad's examples. You can open the finished design yourself, and everything quoted here comes from it.

It assumes you've [installed hitlcad](/blog/install-hitlcad/) and have a project open with Claude Code or Codex beside it.

## It starts with one sentence

The request was this, typed into the agent's chat.

> A hand-held blower for dusting my PC. A 750 W brushless motor in a printed duct, PETG, with a pistol grip.

That's not much to go on, and a good agent knows it. Before it draws anything, it writes a **brief** into the design. The blower's brief has a title and a summary, the key dimensions it settled on, the features of each part, the assumptions it made and the questions it couldn't answer.

The key dimensions are where you'll spot a misunderstanding early. The agent assumed a 36 × 50 mm inrunner motor with a 5 mm shaft, a 68 mm impeller with seven flat blades, a duct bore of 69.5 mm (a 0.75 mm gap all round the blade tips) and a 20 mm nozzle. Its open questions were the exact motor, and whether it runs from a battery or the mains.

Read the brief before anything else. It's one screen of text, and fixing a wrong assumption there costs a sentence. Fixing it after six part files have been written costs a lot more.

## Then the structure, still with no geometry

Next the agent fills in `design.json`, the list of what the product is made of and how it goes together. For the blower that's 13 parts. Seven are printed in PETG (the duct, motor mount, impeller, intake guard, nozzle, handle and grip cap). The rest are bought, the motor plus the M3 screws and heat-set inserts that hold everything together. Counting every screw and insert separately, there are 24 pieces in the assembly.

Every joint is declared between two named features. Here's the motor mount sliding into the duct's bore.

```json
{
  "type": "cylindrical",
  "a": "duct.mount_bore",
  "b": "motor_mount.ring",
  "flip": true,
  "fit": { "clearance": [0.05, 0.5] }
}
```

Screws are declared as fastener sets, saying what they pass through and what they end in.

```json
{
  "fastener": "motor_screw.seat",
  "through": ["motor_mount.motor_screws"],
  "into": "motor.screw_holes",
  "engagement": 1.5
}
```

And requirements from the brief become checks with numbers. The blower has to fit in a 220 × 100 × 220 mm box, and the impeller's blade tips must clear the duct by at least 0.4 mm.

hitlcad checks this structure before a single part is built. Unknown names, a joint between features that don't exist, a screw that isn't a catalogue part, a material the chosen process can't print, all of these fail here, while they're still cheap.

## Five kinds of file, each with one job

Once the structure holds up, the agent writes code. A design folder always has the same shape, and each file has one job.

![A design folder read top to bottom. design.json declares the parts, joints, fasteners and requirements. interfaces.py computes values two parts share. Each file in parts builds one part in its own frame. assembly.py places every instance. The build checks all of it and writes STEP, STL, 3MF and a bill of materials to build.](./figures/first-hitlcad-design/f1.svg "The notes on the right are the blower's.")

`interfaces.py` holds every value that two parts share, computed once from the parameters. The duct's bore around the impeller, for example, is the fan's diameter plus the tip gap on both sides.

```python
def duct_id(p, i):
    """The bore around the impeller."""
    return p["fan_d"] + 2 * p["tip_gap"]
```

The impeller reads `fan_d` and the duct reads `duct_id`, and neither ever measures the other. Change the fan size and both follow.

Each file in `parts/` builds its part in its own frame, the way it's made. The impeller is modelled hub face down because that's how it prints, so its blades lean at an angle a printer can manage without supports. The file returns the shape and the frames of its declared features, here the bore the motor shaft enters.

`assembly.py` only places things. It puts each of the 24 pieces where it belongs and decides nothing else. Every dimension it needs comes from `interfaces.py`.

## Save, and read the report

Every save rebuilds the design. Only part files whose inputs changed are rebuilt, because hitlcad records which parameters and shared values each file read. Then the whole assembly is checked again, 134 checks for the blower, and the agent reads the report.

Here's one line from a passing build, for the motor mount in the duct.

```
fit 0.200 mm (hole Ø73.850, shaft Ø73.500, after process allowances (0.15 hole, 0 shaft)), needs 0.05 … 0.5
```

It shows how a printed fit differs from a drawn one. Printed holes come out a little smaller than modelled, and this design sets that allowance to 0.15 mm. So the model's hole is drawn 0.15 mm larger on purpose, and hitlcad takes the allowance back off before comparing.

![The duct's bore is modelled at 73.850 mm. Taking off the printer's 0.150 mm hole allowance leaves 73.700. The motor mount's ring is 73.500, so the clearance is 0.200 mm. On a scale from 0 to 0.6 mm, the allowed band runs from 0.05 to 0.5 and the measured 0.200 sits inside it.](./figures/first-hitlcad-design/f2.svg "Our working of the fit line above.")

**73.850 − 0.150 − 73.500 = 0.200 mm**

That's inside the 0.05 to 0.5 mm the joint asked for, so it passes. If someone shrank the bore by 0.2 mm, the clearance would drop to 0.000 and the mount would no longer slide in. The report would say exactly that, with the numbers.

## When a build fails

Mistakes are normal at this stage, and the report is written so the agent can act on them. Suppose it picks M3 × 12 screws for a motor whose threaded holes are only 6 mm deep. All four screws come back as one line.

```
✗ fastener motor_screw.seat:motor_mount.motor_screws>motor.screw_holes ×4 at [0, 1, 2, 3]
  bottoms out: it reaches 8.50 mm past the opening of motor.screw_holes[0], where motor stops it at 6.00
```

The agent switches to a shorter screw and saves again. Some designs go further and compute the screw length in `interfaces.py`. The blower does, choosing the longest standard M3 screw that engages enough thread without bottoming out, and raising an error that reaches you if no standard length works.

You'll see failures like this scroll past while the agent works. By the time it says it's done, the report should be clean apart from anything left for you to judge.

## What you get at the end

The latest good build is copied into the design's `build/` folder, which git ignores.

- `model.step`, the assembly with its structure intact, so other CAD tools open it as parts and sub-assemblies
- a STEP and an STL for each part, in the frame it's made in, ready for a slicer or a machine shop
- a 3MF and a bill of materials, because the blower's `design.json` asks for them
- `preview.png`, a quick render of the assembly

The STEP keeps exact surfaces, while the STL and 3MF are meshes made at a set :term[chord tolerance]{#chord-tolerance}. We compared all three on the blower in [STL vs STEP vs 3MF](/blog/stl-vs-step-vs-3mf/).

A failed build never replaces the last good files. And every revision, failed or not, is kept in hitlcad's history, so you can compare any two later.

The design itself is the folder of JSON and Python, and that's what you commit. [Part 4](/blog/hitlcad-picks-and-pins/) is about the review that comes next, where you point at the model instead of describing it.
