Parametric Box Generator
by clifford, published
I wrote a script to generate lasercut boxes. The script reads a config file with the box dimensions and generates a DXF file and an OpenSCAD model. We use the script for all types of cases here at metalab. The example file attached is the case of our electronic door lock system.
The script can be found here:
You might need to install SPL (the scripting language I've used for the script) before you can use the script:
Create A *.box file with the box dimensionps:
w = 180
l = 180
h = 100
t = 5
door = 1
E.g. this file is called "mycase.box". Call "boxgen.spl" with "mycase" as argument:
splrun boxgen.spl mycase
This script then generates a "mycase.dxf" and "mycase.scad" file. Use a dxf editor (such as "qcad") to modify the box to fit your needs. Usually you want to add holes for cables, user interface elements and such.
Open "mycase.scad" in OpenSCAD to preview the box. You might want to use the "Thrown together" rendering mode (F12) to speed up things and avoid rendering glitches with the OpenCSG at the highly concave edges of the boxes.