A Parametric Box Generator for 3D Printing
A useful enclosure should start with the object it needs to hold, not with another round of repetitive CAD work. I built a browser-based Parametric Box Generator that turns exact inner or outer dimensions into a box with a matching sliding lid.
The model is generated as real solid geometry directly in the browser. An interactive preview makes the fit and lid mechanism visible before separate STEP or STL files are downloaded for CAD work or 3D printing.
Why I Built It
Custom enclosures are a recurring part of many electronics, workshop and organization projects. The geometry is usually simple, but creating the same walls, clearances and lid details again for every new size takes time. It is also easy to begin with the outside dimensions and discover too late that the usable interior space is smaller than expected.
The Parametric Box Generator removes that repetitive setup. It starts with the measurements that matter and rebuilds the complete model whenever a dimension changes.
Inner or Outer Dimensions
The generator supports two complementary ways of working:
- Inner dimensions define the usable space required for an object.
- Outer dimensions define the maximum footprint available for the enclosure.
Length, width and height can be entered as exact millimetre values or adjusted with sliders. The corresponding inner or outer measurements are calculated automatically, so both perspectives stay synchronized.
Inspecting the Model Before Export
Every change creates an updated box and lid in the interactive 3D preview. The model can be rotated, zoomed and panned, while a separate control slides the lid from fully open to closed. This makes it easier to inspect the guide, end stop and screw position before downloading anything.
The validation panel measures the generated geometry itself. It reports the exterior size, usable interior space, wall and base thickness, lid clearance and whether the box and lid are both valid closed solids. Invalid combinations are explained next to the relevant input instead of producing an unusable file.
Designed for 3D Printing
The enclosure uses a guided sliding lid with a retaining edge, end stop and an M3 screw lock. Critical transitions are sloped so the box and lid can be printed without support material in their intended orientations. A nominal clearance of 0.15 mm per side provides a practical starting point for a calibrated FDM printer.
An optional Heisel logo can be engraved 0.20 mm into the inner floor. The separate printing guide covers part orientation, suggested Bambu Studio settings, transparent-lid ideas and final assembly.
STEP and STL, Generated Locally
The box and lid can each be exported as a STEP solid for further CAD work or as an STL mesh for slicing. A complete STEP set is also available for editing and archiving. Generation happens locally in the browser: dimensions and exported geometry are not uploaded to a server.
This keeps the workflow short: measure the available space, choose inner or outer dimensions, inspect the result and download the two parts.
Technologies
- OpenCascade
- Replicad
- Three.js
- Web Workers
- STEP
- STL
Tags
- 3D-Print
- CAD
- Parametric Design

