Parametric Box Generator

by clifford, published

Parametric Box Generator by clifford Jan 7, 2010



Public Domain
Parametric Box Generator by clifford is licensed under the Public Domain license.

Liked By

View All

Give a Shout Out

If you print this Thing and display it in public proudly give attribution by printing and displaying this tag.

Print Thing Tag


Thing Statistics

10921Views 1956Downloads


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.

All Apps

Upgrade this Thing with Thingiverse Apps

No results.

Possible with a 3d printer?

In the Scad file the door parameter is not working... it is possible?

Hallo / hello boxmakers!

Not all people like to install software...

So you can try this online boxcreator to create different boxes:


!You need a modern Webbrowser (Firefox, Chrome, Opera...) !

Why does the box generator give measurements in "fingers"? How big is a finger?


i made my first box using the "Parametric Box Generator by clifford"

after SPL setup and file.box creation the output dxf file was ready to be imported and lasercutted!!

many many thanks @ clifford

Is there a Windows supported version of this I can buy somewhere? I have had mountains of trouble with Cygwin and MinGW!

I guess your problems is with building SPL on win32? SPL should build fine with MinGW + MSYS. Unfortunately installing MSYS is a nightmare atm because they don't seam to have a single install package anymore but expect users to install many separate packages..

I haven't looked into that for a while and don't even have a windows installation running that I could use to test it. So maybe the easiest solution would be to boot into a ubuntu linux live cd and install spl into the RAM disk (SPL is available as pre-build package in the ubuntu package repositor
y - so no need to build anything by hand).

Thank you so much for your response. I will try the route that you have explained and see if I have any luck with it. Thanks for your time! :)

did you forget to upload the scad file?

Yup. I've added it now. But only see the uploaded files as an example of what can be done. The script has been heavily improved since I made this box..