# Designing from the brick, not bolting onto it

Amir's guide for any new part that hangs on a mount brick.

A Slatfinity part is not "a mount plus a thing stuck on the front". The mount brick is the skeleton. Its spine, its edges, its print orientation and its lever's swing decide where everything else goes. Work through the steps below in order, and don't write shapes until steps 1 to 4 have answers you could say out loud.

This guide sits on top of the rest of the skill: the loop, rules R1–R10 and the change report in [SKILL.md](../SKILL.md). Load that too.

## 1. Brief the object, not the part

Write down, in numbers:

- **The item's size, and the size of what touches the part:** a rail profile, a peg, an edge, keyholes. Measure the item, or a real file of it, when you can. A person's STL of a holder that already works is gold: slice it and read the interface off it.
- **Its weight, and how far out from the wall its centre of mass sits.** That lever arm, not the weight alone, is what pulls a mount out of the slot.
- **How it goes in and comes out.** Does it slide, drop or clip, and in which direction? What holds it: gravity, a latch, friction or a ratchet? Which hand does what?
- **What the person must still reach with the item in place, or after taking it off:** the lock lever, a release tab, a button, a battery latch.

## 2. Read the brick's real geometry

Before you draw, get these from `get_brick`, the brick's readouts and one `inspect_draft`.

**The anchor frame.** A shape attached to the cam-lock mount's `arm_root` has these axes:

- x runs out from the spine's front face (x = 0).
- The slat face is at x = minus the `spine` setting: −4.4 at the default 4.4 mm spine. Keep x at −4.3 or more there.
- y is up, with y = 0 at the hook seat.
- z runs across the mount, from 0 to its `width`.

A shape that isn't attached uses the brick's own frame instead, where x = 0 is the slat face.

**The body's extent.** The cam-lock mount runs from the top of its L at y ≈ +14.3 (`lip_h`) down to its foot, about 5 mm below the key's slot (`foot_below`). The key's slot floor (`slot_floor`) sits exactly one slat pitch below the hook seat: 76.2 mm on standard slatwall, 75.4 mm on VEVOR. So the body bottoms out at about y −81 (−80.4 on VEVOR), and it fills the whole width in z.

**The lever's keep-out zone.** The lever sweeps the bottom corner on the z = 0 side:

- It turns about the key's axis, which runs along x at y = "mount.YK", z = "mount.ZC". `YK` is the middle of the key's slot, and `ZC` is about 6.1 mm at the defaults.
- At the brick's defaults it is 18 mm long (`lever_len`) and 9.8 mm wide (`lever_w`), so it sweeps a radius of 18 mm. A design that changes `lever_len` changes the swing with it.
- Unlocked, it points along +z, to about z = 24.
- Locked, it points straight up, to y = "mount.YK + 18". The joint bricks keep clear above "mount.YK + 19.5".
- It turns in front of the foot, from about x = 4.9 to 8.4 in the `arm_root` frame at the defaults (`foot_depth` 9 mm from the slat face, less the spine, plus `fit.axial`). The foot's front face is at about x = 4.6.

Anything in front of the foot in that corner must clear the swing by at least `fit.print_in_place` (0.3 mm at the Standard fit), or sit behind the foot. No readout gives the swing's radius, so take it from the brick's settings and an R8 fix (see [rules-and-fixes.md](rules-and-fixes.md)).

**The print orientation the brick needs.** The cam-lock mount prints on its side (orient `on-side`, +z up), so every layer is an x-y plane. Anything you extrude along z prints well, and anything that hangs in z needs support.

**Readouts to build on.** Use readouts such as `YK`, `ZC` and `slot_floor` on the cam-lock mount, or `hubTop` on the joint bricks, read as "instance.readout" ("mount.YK" when the design names the brick's use "mount"). Write every position as a formula from a readout, never as a number copied off one wall.

## 3. Choose the mount: brick, reach and width

**How many slats.** The `cam-lock-mount` (print-tested) spans one slat: its top L sits in one slot and its key locks in the next slot down, one pitch lower. Use it when:

- the working feature fits within about one pitch of height, and
- its load figure comfortably exceeds the item.

Use the `multi-slot-lock` with `slots` at 2 or 3 when:

- the feature is taller than a pitch;
- the lever arm is long (a heavy item far from the wall); or
- the cam-lock mount's load figure is close to the item's weight.

The `multi-slot-lock` has never been printed, so say so. Decide from the numbers in step 1 and the load figure, not by habit.

**Width.** Size the mount to the feature: make the feature's length across the wall the mount's `width` (`width: "=settings.<len>"` in the brick's settings under `uses`), so the feature ends flush with the mount's sides. The cam-lock mount's `width` defaults to 25.4 mm and runs from 14.4 to 101.6 mm, and its `minWidth` readout says how narrow it can go. Don't keep a stock 25.4 or 50.8 mm mount and hang a wider feature off it. Don't widen a mount just to reach a far post, either: move the post instead.

**Lever access.** If the item covers the lever, the person must be able to take the item off first. Never cover the lever with a fixed part.

## 4. Let print orientation pick the feature's direction

Find the one cross-section that does the work (a rail channel, a hook, a dovetail, a ratchet track) and lay it in the print layer's plane.

- **With an on-side mount, draw the working profile in x-y and extrude it along z.** Lips, hooks and grooves then print with no overhangs, and loads run along the layers.
- **If the natural direction would print badly, turn the feature first.** A C-channel that slides up and down, printed on its side, leaves floating lips. A battery that slides in sideways along z, held by a latch, beats a vertical slide that needs a separate head.
- **Split into two pieces only when no orientation works for both.** Then join them with a joint brick, `drop-dovetail` or `dovetail-slide`, neither of which has been printed yet. Print the joint on its own as a test first, and print each piece in the orientation that suits its own critical profile.
- **No floating islands, and no bridge on a face that must be accurate unless you choose to accept it.** A latch's catch face may be a short bridge; say so.

## 5. Place it off-centre on purpose

Centred is a default, not a design. Place the feature so that:

- it clears the lever's swing, usually above it, or to the side away from z = 0;
- its edges land on the mount's edges, top or sides, so the outline reads as one piece;
- the load sits over the mount body, and the item overhangs on its open, entry side;
- the closed or stop end prints first on the bed, and the entry end is free.

Positions come from readouts: a feature whose bottom sits at "mount.YK + 23.6", for example, clears the locked lever (its top is at "mount.YK + 18") with room to spare.

## 6. Grow it out of the brick

- **Start the feature's profile at the spine face**: x = 0, or −4.3 where it rises above the top of the mount. Its back is the mount, not a plate in front of it.
- **Prefer one profile with all its walls over many boxes.** A C-channel is one 8-point profile. A bracket is one outline with a fillet into the spine.
- **Every member must carry load along a path into the mount, or locate the item.** If you can't say what a bar does, delete it. If a bar exists only to reach a post placed off the mount, move the post onto the mount's edge.
- **Brick parts that move (keys and levers) set the clearances.** Check them in every state, not just in the default picture.

## 7. First pass, then a cleanup pass

Get a first pass through the quick check (`update_draft` runs it). Then look at the front, side, wall and print pictures from `inspect_draft`, and go through this list:

- **Merge.** Can two or more shapes become one profile, or one union with no seams, steps or slivers? Remove 0.01 mm shims that do nothing at the current settings.
- **Edges.** Do the ends line up flush with the mount's sides and top? Are wall thicknesses consistent, for example 4 mm walls and a 5 mm back?
- **Round.** Round the outer corners with a profile's `round` (1.5 to 3 mm), and fillet where the feature meets the spine. Give `round` per corner (a radius by point index) so a fit face or a catch face stays sharp: never round those.
- **Lead-ins.** Chamfer or hull the entry ends of rails, sockets and channels (about 1.5 mm), so the item finds its way in.
- **Strength.** Read the load figure and where it says the part is weakest. Fix that section (thicker, shorter, a fillet), or explain why the estimate's worst point isn't real. Don't ship a part whose figure is under the item's weight without saying so.
- **Print view.** Does it stand on the right face? Is there no floating geometry, and does every overhang have a reason?
- **Explain.** Write one line for each remaining member on what it does. If the person asks "why is that there?", you already have the answer.

Then run the full check before you show it: `validate_draft` with scope "full". It builds:

- every wall the design claims;
- every brick state;
- both ends of every simple setting, including a simple choice's other options;
- every preset.

## 8. Choices and families

One design with a choice setting beats near-duplicate files ("pick your battery").

- Put each option's measured sizes in `advanced` settings whose defaults are ternaries on the choice, like `"=settings.battery == "m18" ? 52 : 48"`. The shapes then read one setting such as "settings.rail_g" and stay short, and a person can still type their own sizes.
- Don't use `expert` for your own settings: that level is for the cam-lock bricks' print-tested lock tuning.
- Measure every option from a real reference. Label a reference you can't identify honestly, rather than guessing a brand.

## Worked examples

These are Amir's real cases: what went wrong, and the fix.

- **Battery holder, bolted on.**
  - The first version was a separate battery head on a drop-in dovetail, printed upright and hung in front of a 50.8 mm mount. It had two pieces, an untested joint, and a weak point of 0.3 to 1 kg.
  - Grown from the brick, the rail channel became one profile, extruded along z from the spine face and sitting just above the lever. The mount is as wide as the channel, the battery slides in sideways, and the end stop prints on the bed.
  - It became one piece with no supports, and the load figure rose to about 6 to 8 kg.
- **Charger dock frame.**
  - The charger was wider than the 90 mm mount, so its corner posts sat outside the mount and needed five cross bars.
  - The fix: the mount went to full width, so one post grows from its edge. The other post is tied in by one plate above the lever, and one bar runs under the cups.
- **Hold-down clamp ratchet.**
  - The ratchet sat beside the lock to stay out of the whole area the lever could reach, which doubled the width.
  - The lever only sweeps the bottom corner, so the ratchet now runs straight above the lock in the same column, with a stop under the track. The width went from 60 mm to 26 mm.
