Skip to content

A cabinet that is a rule

A catalogue module used to be a file: one .glb, one size, one price. A customer who wanted 637 mm got 600, because 637 was not in the catalogue.

A recipe is the same cabinet written as rules. Its width is a parameter, its panels are formulas, and the cabinet at 637 mm exists the moment somebody asks for it — with its own cut list, its own edge banding and its own price. Nobody exports a file, and there is no file to be out of date.

{
"id": "base_cabinet",
"version": 1,
"params": [ { "key": "width", "type": "integer", "default": 600,
"range": { "from": 300, "to": 1200, "step": 1 } } ],
"derived": { "inner_w": "width - 2*t" },
"parts": [ { "id": "side", "role": "side", "size": ["t", "height", "depth"],
"at": [0, 0, 0], "repeat": 2, "mirrorX": true,
"material": "body", "grain": "y", "edges": { "front": "abs2" } } ],
"layout": { "enabled": true, "cavity": { … }, "default": { "cell": { "fill": "shelves", "count": 1 } } }
}

Five sections, and they run in this order:

  1. params — what the customer chooses. Width, height, a front, a thickness.
  2. derived — what you work out once from those. inner_w is width - 2*t and everything spanning the inside says inner_w.
  3. rules — what must not happen, and what to do instead. Four kinds; see the language.
  4. parts — the panels. Each is a box of three formulas at a position of three formulas, with a material, a grain direction and its banding.
  5. layout — the inside, which the CUSTOMER divides: shelves, drawers, a door. You write the cavity and the limits; they arrange it.

Everything downstream is derived from the parts and nothing is authored twice:

From the parts Where it goes
the boxes the 3D scene, the AR file
sheet (length × width × thickness) the cut list, the nesting, the DXF
edges the banding order, in metres per type
hardware the fittings order, with supplier codes
areas, metres, counts, pricing.labour the price

Whole millimetres, everywhere. Lengths are integers, angles are whole degrees, money is cents. A formula may divide by three; what comes out is rounded, and the leftover millimetre goes somewhere visible rather than into a fraction nobody can cut.

A published version never changes. Saved kitchens pin themselves to the version they were quoted from, so editing @1 after a customer has one would change their price and their cut list under them. Publish @2 instead: the kitchens on @1 stay exactly as they were.

  • The language — parameters, derived values, rules, and the functions you can use in a formula.
  • Parts — roles, grain, edge banding, and how a panel becomes a blank on a sheet.
  • The inside — cells, fills and limits: what the customer may do to your cabinet, and what you refuse.
  • Worktops and plinths — the parts that belong to a row of cabinets rather than to any one of them, and the one slot that lets a row exist at all.
  • Tests and publishing — recorded cut lists, what the validator catches, and how a version goes live.