Laser Cut Box Generator Script

by bvesperman, published

Laser Cut Box Generator Script by bvesperman Jan 29, 2013


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

21005Views 2746Downloads Found in DIY


I have found other simple box generators, http://boxmaker.rahulbotics.com/ but found I wanted something more. My script has logic for screw assembly and for advanced users, gives you the ability to cut holes and modify the box,


Download the OpenSCAD file and change the following variable at the top of the script:

width - box width
length - box length
depth - box depth

tablength - the length of the tabs, can also be thought of as material thickness
tabwidth - the width of the tab

tablengthperiod - the number of tabs along the length dimentions of the box
tabwidthperiod - the number of tabs along the width dimentions of the box
tabdepthperiod - the number of tabs along the depth dimentions of the box

screwLength - the length of the fasening screw
screwDiameter - the diameter of the fasening screw

hexWidth - the width of the fasening hex nut
screwhexThickness - this is more of the length of the hex nut, not sure why i called it thickness

exploded - when set to true, will render the plates ready to be cut out, when false you can see the box assembled
explodedplateseperation - the seperation beween the plates when rendered in the exploded view

The values I have in the script work well for plywood that is 6 mm thick. I got the plywood from home depot. And I used 16mm long 3M screws.

There are sub function in the script (BottomPanel, TopPanel, etc) that represent each plate. In side each function is a basic Panel function, if you want to cut a circle or square out of plate just perform a difference method. The transformations are well setup so you can just use magic numbers in the BottomPanel function and it will translate well between exploded and assembled views.

More from DIY

view more

All Apps

Upgrade this Thing with Thingiverse Apps

No results.

I noticed the hexWidth and hexThickness should be switched. I was wondering why when I got a wider nut the depth of the channel increased haha. I just switched them everywhere in your script for my purposes.

Thanks for the script this is great!

The program runs fine and looks very useful however
I set the parameters for using 12mm long screws but the nut is then positioned
too far away ,
From the surface of the box to the closest face of the nut is 11.799
From the surface of the box to the far side of the nut is 14.199

The screw would only go into the nut 0.2mm

can you tell me how to fix this please

Once I change all the dimensions etc, how do I save as dxf ready to cut on the laser?

change the exploded variable to true and then recompile the file. All the panels will be laying flat. You can then export the drawing as a DXF. That is how I cut it to a file.