# Rugged box ## What this builds A two-part rugged box, modelled as code: a base, a lid, an optional gasket groove, and optional latches. Lid fit, latch engagement, groove dimensions, and stack height are measured. Closed and exploded renders are written. No physical print, and no real gasket, are required. This is an original box, not a copy of a branded case. Read `spekkr.inputs.json` first. The inside is `inner_length` by `inner_width` by `inner_height`, walls `wall`, all millimetres. `gasket` and `latches` add features. `tool` is the modeller. ## Out of scope - A waterproofness certification, or a real gasket in the checks. - A branded case's exact latches, or its name in the id. - A physical print. ## Requirements Each requirement has an id. Checks name the id they cover. ### R1. Fit and features - The lid sits on the base with a 0.2 mm peripheral clearance, and the two solids do not overlap in the closed pose. - If `gasket` is on, the groove is the width and depth in `design.md`, on the documented path, and it does not break the wall thinner than 1.2 mm. - If `latches` is on, each latch's engagement (overlap of hook and catch in the closed pose) is the length in the file, and a kinematic close does not collide earlier than that. - Stack height (closed, overall Z) matches the formula in the file. Inputs outside range are refused. Accept when: clearance, non-overlap, groove, latch engagement, and stack height match, and a short-of-range input is refused. ### R2. Files and frames - Export base and lid (and latches if separate). Meshes watertight. Renders: closed, exploded, a latch close-up, and a groove section. - One command builds, measures, and writes the renders. No print, no gasket, no IP test. Accept when: the command passes for both tools, and a deliberately tight lid (zero clearance) fails the overlap check. ### R3. Inputs - Numeric inputs are read from `spekkr.inputs.json` and must stay inside the ranges in the Inputs table in `design.md`. - A value outside a range is refused before modelling, with a message that names the key. - Options add or remove the features in that table. The `tool` swap selects CadQuery or OpenSCAD; both must meet the same numbers. Accept when: default and one out-of-range value are handled as above, and a second legal input set still matches the formulas in `design.md`. ### R4. Checks and report - One command builds the model at the defaults and at the person's inputs, measures it against `design.md`, and writes a short report. - A model broken on purpose, for example a wall thinner than `wall`, must fail the report. - The command exports the files this spec asks for (STL, and STEP when the tool can). No physical print is required. Accept when: the report says pass at the defaults and at the person's inputs, and fail on a deliberately broken model. ## Verification Lid and base fit, latch engagement, gasket-groove dimensions, and stack height are measured on the meshes. Exploded and closed renders are written. No physical print, no real gasket, and no waterproofness test are required. ## Definition of done - Every acceptance check above runs from one command, and all pass at the person's inputs. - A README says how to export the parts, what the lid clearance was designed for, and that a print is optional.