ProjBox Utility


The ProjBox Utility is a Windows or Raspberry Pi utility for generating electronic project enclosures. While these can always be drawn from scratch in a CAD program a simple generator may be more convenient. That is especially true if you stick to some standardized aspects.

There are many community designs for project boxes that try to mimic commercial cast boxes. One reason not to just copy is that cast boxes are designed with sloping walls so as to be more easily removed from molds. A 3D printed box can and should be designed with perfectly vertical walls. Cast boxes also usually have screw posts for the cover extending all the way to the base. They could not be made any other way. A 3D printed box can, with care, be designed to have "hanging posts" just at the top of the box. Also, a custom 3D printed box can have hot threaded inserts and machines screws instead of self-tapping screws.

Example

A design for a box is written as an .ini file with various parameters. For a simple case of "I need a box W x D x H with a hole on each end" the design is short.

[usbtypec] type=hole diameter=3.3 xstretch=5.9 [biphase] type=hole diameter=6.5 [corner] type=post merged=yes outer=8 inner=4.5 inset=6.5 relief=2 fill=5 slope=30 [project] type=box width=75 depth=50 height=30 radius=6 walls=2 base=2 inside=corner left=usbtypec right=biphase

One of the advantages of this approach is that the design is all visible and easily modified. You miscalculated something and it has to be wider? That's a simple text edit, a fraction of a second to generate the STL and a quick preview on your favorite software. You need to mount a PCB in the inside? Simple things are simple but there are ways to do complicated things too. In this case you just add/modify.

[pcb] type=post xspan=40 yspan=25 outer=8 inner=4.5 height=5 ... inside=corner pcb

Posts

There are five styles of posts:

  1. Solid cylindrical post → outer
  2. Solid cylindrical post with stud on top → outer, inner, stud
  3. Cylindrical post with through hole → outer, inner
  4. Cylindrical post with through hole merged into adjacent walls → outer, inner, merged=yes
  5. Cylindrical post with through hole merged into adjacent walls and without lower section → outer, inner, merged=yes, clear

The slope parameter specifies the angle of the underside for hanging posts. slope=0 will be flat, but print very sloppily. slope=45 will be safe on almost all printers. slope=30 is a reasonable compromise.

Posts by default are a set of four specified by two different ways. If you specify with inset the posts are spaced from the inside corners. This is useful if you might resize the box or copy the configuration for other size boxes. The other way is by specifying width and height. This will give you a rectangle of posts centered in the box. Of course you can position this with xshift and yshift.

For a continuous post specify height. If you specify relief that will reference the height to the top of the box. This will make it more easily resizable.

NameTypeDescription
typetype“post”
insetlengthdistance from inside to post
xspanlengthX dimension of dual or quad layout
yspanlengthY dimension of dual or quad layout
xshiftoffsetposition offset in X direction
yshiftoffsetposition offset in Y direction
outerlengthouter diameter of post
innerlengthinner diameter of hole in post
heightlengthheight of post or box
relieflengthdistance from top of box to post
filllengthdistance from top to bottom of hanging post
clearlengthdistance from bottom of hanging post to base
slopeangleangle of bottom of hanging post in degrees
studlengthlength of stud on top of post
mergedboolwhether the post extends to be part of the wall

Holes

There are four styles of holes:

  1. Round → diameter
  2. Flatted → diameter, flat
  3. Stretched → diameter, xstretch, ystretch
  4. Rectangular → width, height

Holes are by default centered in the middle of a flat section of wall. Of course you can position them with xshift and yshift. If you specify more than one hole in a side that side will first be divided into equal sections. The individual holes will be centered in each section. A common adjustment is to specify xshift=5 for the left hole and xshift=-5 for the right hole. This will nudge the two closer. When configuring for multiple holes it may be more convenient to divide a wall into unequal sections. For instance, with three holes you might want to make the first and third sections bigger. You can do that by increasing their "weight", weight=1.5.

NameTypeDescription
typetype“hole”
insetlengthdistance from inside to hole
xspanlengthX dimension of dual or quad layout
yspanlengthY dimension of dual or quad layout
xshiftoffsetposition offset in X direction
yshiftoffsetposition offset in Y direction
diameterlengthdiameter of round hole
flatlengthamount that a round hole is flattened
xstretchlengthelongation of hole in X direction
ystretchlengthelongation of hole in Y direction
widthlengthwidth of rectangle hole
heightlengthheight of rectangle hole
bevellengthbevel or countersink distance each side
alignalignleft, right, top, bottom alignment
weightweightrelative share when dividing a face

Panes

A pane is a container for holes. Since holes are normally distributed left to right along a wall there needs to be a container for vertical organization. A pane can contain a pane, in which case its contents are organized horizontally.

NameTypeDescription
typetype“pane”
facenameholes in the pane
weightweightrelative share when dividing a face

Blocks

Blocks are reference objects, like PCBs. You can enable them for viewing or disable them for slicing.

NameTypeDescription
typetype“block”
widthlengthwidth of block
depthlengthdepth of block
heightlengthheight of block
xshiftoffsetposition offset in X direction
yshiftoffsetposition offset in Y direction
zshiftoffsetposition offset in Z direction

Boxes

A box is the basic top-level unit. You can have more than one in an .ini file. Each will generate an .stl file.

NameTypeDescription
typetype“box”
widthlengthwidth of box
depthlengthdepth of box
heightlengthheight of box
radiuslengthoutside radius of corner of box
baselengththickness of bottom side
wallslengththickness of walls
insidenameholes and posts on the bottom side
frontnameholes in the front side
rightnameholes in the right side
backnameholes in the back side
leftnameholes in the left side
blocksnameblocks to be added

Covers

A cover is an optional top-level object. Holes specified with inset will work properly in the corners.

NameTypeDescription
typetype“cover”
widthlengthwidth of cover
depthlengthdepth of cover
radiuslengthoutside radius of corner of cover
baselengththickness of cover
facenameholes and posts on the surface

Download projbox.exe for Windows.

Download projbox for Raspberry Pi.