Rugged box
A parametric rugged box: lid fit, latch engagement, gasket groove, stack height, and exploded plus closed renders, with no print required.
This is a CAD spec on Spekkr, published by onyx. It is listed with the other specs. Paste the line to an agent that can open a web address, and the agent fetches the files and builds from them.
- Spec
onyx/rugged-box- Version
- 0.2.0
- Published by
- onyx
- Updated
- 14 Nov 2026
Build this spec
Build the spec at https://spekkr.com/onyx/rugged-box/start.md.
Paste this to your AI agent. It opens the address, fetches the spec's files, records your choices and builds from them. Nothing to install, no account.
Published by onyx.
What does the result look like?
What can I customize?
Your choices go into the line you copy. Anything else is yours to edit, but it leaves the tested path.
What do I get?
-
spec.mdRequirements and acceptance checks.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.jsonfirst. The inside isinner_lengthbyinner_widthbyinner_height, wallswall, all millimetres.gasketandlatchesadd features.toolis 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
gasketis on, the groove is the width and depth indesign.md, on the documented path, and it does not break the wall thinner than 1.2 mm. - If
latchesis 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.jsonand must stay inside the ranges in the Inputs table indesign.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
toolswap 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.
# 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.
-
design.mdLid fit, latch engagement, gasket groove, and stack height.Design
This file fixes the geometry. How the model's code is organised is up to you, as long as the numbers here hold.
Formulas
Outside is inside plus two walls, plus a documented rib. Closed height, groove (width 3.2, depth 1.8, unless the file says otherwise), and latch engagement (2.0 mm) are
fixtures/rugged-measures.json.Print
Base open up, lid groove up. Overhangs ≤ 45°, min wall
wallexcept the groove neck.Inputs
Key Label Default Notes inner_lengthInside length, mm 120 From 60 to 300. inner_widthInside width, mm 80 From 40 to 200. inner_heightInside height, mm 50 From 25 to 150. wallWall thickness, mm 3.0 From 2.0 to 6. gasketA gasket groove on A groove in the lid path, sized in design.md. latchesLatches on Two latch features, with a documented engagement. toolModelling tool cadquery CadQuery writes STEP and STL. OpenSCAD writes STL. Acceptance at the defaults
Millimetres. Default inner length 80, inner width 50, inner height 30, wall 2.4, gasket and latches on.
Quantity Value Tolerance Source Closed overall X, Y, Z 84.80, 54.80, 36.80 0.10 inner + 2*wallin X and Y; Z includes lidWall thickness 2.40 0.05 wallGasket groove width, depth 2.00, 1.20 0.05 When gasketis onLatch engagement 3.00 0.10 Two latches, opposite short sides Rib height on the outside 1.60 0.10 Around the body The closed assembly has no intersection except the documented latch contact of at most 0.05 mm. Both parts are printable without support over 45 degrees except the listed latch underside.
Screenshots
These pictures are headless OpenSCAD renders of the reference model in
reference/model.scad, at the default inputs. They are not drawings of a product that has not been modelled. The first picture is the one Spekkr shows on the spec's card. A build may ship its own goldens; those goldens are of that build and do not have to match these frames pixel-for-pixel.File What it shows shots/closed.pngClosed box 84.8 × 54.8 × 36.8 mm shots/open.pngBase and lid, gasket groove visible How to verify
- Build the model at the default inputs and at two other legal input sets.
- Measure every row of the acceptance table in this file; each must fall inside its tolerance. Use the solid itself or a mesh library on the exported STL, as
design.mdsays for the chosen tool. - Refuse at least one out-of-range input by name before modelling.
- Confirm each exported part is a manifold, watertight mesh, and that walls and print orientation hold where this file asks.
- 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.
# Design This file fixes the geometry. How the model's code is organised is up to you, as long as the numbers here hold. ## Formulas Outside is inside plus two walls, plus a documented rib. Closed height, groove (width 3.2, depth 1.8, unless the file says otherwise), and latch engagement (2.0 mm) are `fixtures/rugged-measures.json`. ## Print Base open up, lid groove up. Overhangs ≤ 45°, min wall `wall` except the groove neck. ## Inputs | Key | Label | Default | Notes | | --- | --- | --- | --- | | `inner_length` | Inside length, mm | 120 | From 60 to 300. | | `inner_width` | Inside width, mm | 80 | From 40 to 200. | | `inner_height` | Inside height, mm | 50 | From 25 to 150. | | `wall` | Wall thickness, mm | 3.0 | From 2.0 to 6. | | `gasket` | A gasket groove | on | A groove in the lid path, sized in design.md. | | `latches` | Latches | on | Two latch features, with a documented engagement. | | `tool` | Modelling tool | cadquery | CadQuery writes STEP and STL. OpenSCAD writes STL. | ## Acceptance at the defaults Millimetres. Default inner length 80, inner width 50, inner height 30, wall 2.4, gasket and latches on. | Quantity | Value | Tolerance | Source | | --- | --- | --- | --- | | Closed overall X, Y, Z | 84.80, 54.80, 36.80 | 0.10 | `inner + 2*wall` in X and Y; Z includes lid | | Wall thickness | 2.40 | 0.05 | `wall` | | Gasket groove width, depth | 2.00, 1.20 | 0.05 | When `gasket` is on | | Latch engagement | 3.00 | 0.10 | Two latches, opposite short sides | | Rib height on the outside | 1.60 | 0.10 | Around the body | The closed assembly has no intersection except the documented latch contact of at most 0.05 mm. Both parts are printable without support over 45 degrees except the listed latch underside. ## Screenshots These pictures are headless OpenSCAD renders of the reference model in `reference/model.scad`, at the default inputs. They are not drawings of a product that has not been modelled. The first picture is the one Spekkr shows on the spec's card. A build may ship its own goldens; those goldens are of that build and do not have to match these frames pixel-for-pixel. | File | What it shows | | --- | --- | | `shots/closed.png` | Closed box 84.8 × 54.8 × 36.8 mm | | `shots/open.png` | Base and lid, gasket groove visible | ## How to verify 1. Build the model at the default inputs and at two other legal input sets. 2. Measure every row of the acceptance table in this file; each must fall inside its tolerance. Use the solid itself or a mesh library on the exported STL, as `design.md` says for the chosen tool. 3. Refuse at least one out-of-range input by name before modelling. 4. Confirm each exported part is a manifold, watertight mesh, and that walls and print orientation hold where this file asks. 5. 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.
-
tasks.mdBuild tasks in order, each with a check.Tasks
Work in order. Finish a task's check before starting the next.
- Set up. Install the tool in the
toolinput (CadQuery or OpenSCAD) and a mesh library for the checks. Readspekkr.inputs.jsoninto one place at the top of the model. Check: an empty or trivial model is written and read back, and the inputs are visible in that source. - Fit and features (R1). Build what
R1. Fit and featuresasks for, to the numbers indesign.md. In particular: The lid sits on the base with a 0.2 mm peripheral clearance, and the two solids do not overlap in the closed pose. Check: theR1. Fit and featuresacceptance checks pass. - Files and frames (R2). Build what
R2. Files and framesasks for, to the numbers indesign.md. In particular: Export base and lid (and latches if separate). Meshes watertight. Renders: closed, exploded, a latch close-up, and a groove section. Check: theR2. Files and framesacceptance checks pass. - Inputs (R3). Build what
R3. Inputsasks for, to the numbers indesign.md. In particular: Numeric inputs are read fromspekkr.inputs.jsonand must stay inside the ranges in the Inputs table indesign.md. Check: theR3. Inputsacceptance checks pass. - Checks and report (R4). Build what
R4. Checks and reportasks for, to the numbers indesign.md. In particular: One command builds the model at the defaults and at the person's inputs, measures it againstdesign.md, and writes a short report. Check: theR4. Checks and reportacceptance checks pass. - Goldens and the report. Render the documented views of the default model. Run the one-command report at the defaults, at the person's inputs, and at one more legal set. Check: the report says pass throughout, and the rendered views are written next to the model.
- Finish. Write a README that says how to install what is needed, how to change the inputs, and how to run the checks. Run the one command from a clean folder. Check: every item under Definition of done in
spec.mdis true.
# Tasks Work in order. Finish a task's check before starting the next. 1. **Set up.** Install the tool in the `tool` input (CadQuery or OpenSCAD) and a mesh library for the checks. Read `spekkr.inputs.json` into one place at the top of the model. Check: an empty or trivial model is written and read back, and the inputs are visible in that source. 2. **Fit and features (R1).** Build what `R1. Fit and features` asks for, to the numbers in `design.md`. In particular: The lid sits on the base with a 0.2 mm peripheral clearance, and the two solids do not overlap in the closed pose. Check: the `R1. Fit and features` acceptance checks pass. 3. **Files and frames (R2).** Build what `R2. Files and frames` asks for, to the numbers in `design.md`. In particular: Export base and lid (and latches if separate). Meshes watertight. Renders: closed, exploded, a latch close-up, and a groove section. Check: the `R2. Files and frames` acceptance checks pass. 4. **Inputs (R3).** Build what `R3. Inputs` asks for, to the numbers in `design.md`. In particular: Numeric inputs are read from `spekkr.inputs.json` and must stay inside the ranges in the Inputs table in `design.md`. Check: the `R3. Inputs` acceptance checks pass. 5. **Checks and report (R4).** Build what `R4. Checks and report` asks for, to the numbers in `design.md`. In particular: One command builds the model at the defaults and at the person's inputs, measures it against `design.md`, and writes a short report. Check: the `R4. Checks and report` acceptance checks pass. 6. **Goldens and the report.** Render the documented views of the default model. Run the one-command report at the defaults, at the person's inputs, and at one more legal set. Check: the report says pass throughout, and the rendered views are written next to the model. 7. **Finish.** Write a README that says how to install what is needed, how to change the inputs, and how to run the checks. Run the one command from a clean folder. Check: every item under Definition of done in `spec.md` is true.
- Set up. Install the tool in the
-
reference/model.scadA parametric OpenSCAD reference of the default model, used to make the listing pictures. A build may use CadQuery or OpenSCAD and does not have to start from this file. -
shots/hero.pngStudio hero of the default model. -
shots/detail.pngCloser studio still of a joint, pocket, or surface.
Is it for me?
- Kind
- CAD
- Tools
- CadQuery, OpenSCAD
What does it need?
- Agent permissions
- shell
- Commands it runs
install CadQuery or OpenSCAD, whichever the tool input namesinstall a mesh library, such as trimesh
What changed?
- 0.2.014 Nov 2026Studio product shots from a shared Cycles rig (cyclorama, PLA materials), including a short loop when present.
- 0.1.014 Nov 2026First version.
For agents: start.md says how to build this spec, spec.json holds everything on this page, and bundle.tar.gz holds its files.