3D Printing Generator
DeutschEnglish

Print a hinged box in one piece

A box that comes off the printer in one piece

A hinged box is the classic print-in-place project: base, lid and hinge are made in a single print, and when you take the box off the bed it opens and closes right away. No glue, no screws, no pin from the hardware store. A small snap latch at the front keeps the lid shut, and an inner lip centers it so it doesn’t rattle.

This generator builds such boxes to your measurements: a pill box with four compartments, an earplug case, a box for SD cards, batteries, screwdriver bits, guitar picks, business cards or trading cards, a jewelry box, or a ring box with a name on the lid. Ready-made designs are in the examples, for instance the standard 60 × 40 mm box, the pill box with four compartments and the ring box with a name in a second color.

How the generator works

Everything runs in your browser. Nothing is uploaded, and your design lives in the link: “Share” sends exactly this box to someone or saves it as a bookmark. Every change shows up in the 3D preview a moment later.

The box prints opened up: base and lid lie open side up next to each other, so the lid is upside down, and the hinge sits right between them at rim height. When you fold the lid over by 180° after printing, it lands exactly on the base. That is why both halves are the same height: “Height” is the outside height of the closed box, and each half gets half of it.

Below the dimensions the generator shows three numbers: the outside size, the inside size and the area the opened box needs on the bed. Since both halves lie side by side, the print is a little more than twice as long as the box is deep. At the largest “Depth” of 85 mm it still fits a 180 × 180 mm bed such as the Prusa MINI’s.

Planning the size

“Depth” runs from the hinge to the front (20–85 mm), “Width” along the hinge (20–170 mm), and “Height” is the closed box from bottom to top (14–100 mm). For the inside, subtract wall, clearance and inner lip on every side, and floor and lid top in height. The default 60 × 40 × 24 mm box with a 1.2 mm wall and the inner lip is 55.6 × 35.6 × 21.6 mm inside.

Some starting points for common contents:

ContentsOutside (depth × width × height)Example
SD cards, a stack of up to ten30 × 38 × 26 mmSD card box
four AA batteries lying flat58 × 68 × 20 mm, three dividersBattery box
business cards, 85 × 55 mm62 × 92 × 28 mmBusiness card box
sleeved trading cards72 × 98 × 30 mmTrading card box
1/4 inch bits, 25 mm long34 × 70 × 20 mmBit box

“Wall thickness” is 1.2 mm by default, three lines with a 0.4 mm nozzle. “Floor thickness” applies to the floor and the lid top; at 0 it matches the wall. “Corner radius” rounds the vertical corners. Keep in mind that the hinge sits on the straight part of the back wall, so a large radius makes it shorter. “Bed edge chamfer” (0.8 mm) bevels the edges of the faces that lie on the bed and keeps the first layer from bulging out.

If the box is very low, the hinge arms need a bit more room. The generator then makes the box slightly taller on its own and tells you by how much.

The hinge

The hinge is a row of alternating knuckles: the outer ones belong to the base, the ones in between to the lid. Each knuckle hangs on a 45° arm from its half’s back wall. “Hinge” offers two variants:

  • Print-in-place: cones join the knuckles. Every knuckle has a small cone at one end that reaches into a conical socket in its neighbor. The cones are 45° steep, so they print without supports, and the “Hinge gap” stays open between cone and socket everywhere, so they don’t fuse. The box moves straight off the printer.
  • Pin: instead of cones, a teardrop-shaped hole runs through all knuckles. After printing, push in a piece of 1.75 mm filament, a wire or a thin nail. It is very sturdy and forgives a rough print.

The “Hinge gap” (0.25–0.8 mm, default 0.4 mm) is the single most important number for a working print-in-place hinge. Below 0.35 mm the knuckles fuse on many printers; above 0.6 mm the hinge gets noticeably loose. Test it before you print a big box: set “Print” to “Hinge test” and the generator builds only the hinge with two wall strips as long as your box. On a Prusa MINI that takes just under 17 minutes and 2 g of filament.

“Hinge segments” sets the number of knuckles: the value is the number of base knuckles minus one (2 → five knuckles in total, three of them on the base); at 0 the generator places a knuckle about every 8 mm. “Cone diameter” (2.5 mm by default) sets the size of the cones, and the knuckle grows with it. “Clearance” (0.2 mm) is the play between inner lip and lid, at the snap bead and in the pin hole.

Latch, inner lip and compartments

The “Inner lip” is a narrow collar on the base that reaches 1.5 mm into the lid. At the front it turns into a tongue with the snap bead. “Snap bead depth” (0.65 mm) decides how firmly the box closes, “Snap bead height” (2 mm) where the bead sits above the rim. The lid has the matching groove; if the wall gets too thin there, the generator reinforces it with a flat bump on the outside.

The “Lift tab” is a small tab at the front of the lid for pushing the box open with your thumb, handy on small cases like the earplug case. “Grip ribs” are two fine ribs on the front of both halves.

“Dividers across” and “Dividers lengthwise” split the box into compartments, up to ten in each direction. In the base the dividers reach up into the inner lip. With “Dividers in the lid” the lid gets matching walls that stop just short of its rim to leave room for the lip, so pills, beads or screws stay in their compartment even when the box is closed. The small parts box with six compartments does exactly that.

Patterns and lid label

Lid and floor lie on the bed while printing, so patterns and the label are shallow recesses in those faces: the first layers leave them out and the next layer bridges them. You can pick “Honeycomb”, “Lines”, “Grid” and “Dots”, separately for lid and floor, with adjustable “Pattern cell size”, “Pattern depth” and “Line width”.

The “Lid label” runs along the hinge and reads from the front when the closed box stands in front of you. With “Text size” 0 the generator fits the text to the lid. Without a color of its own the label is engraved; with its own color it is inlaid flush.

Colors and multi-material printing

The box has three colors: “Box”, “Lid” and “Lid label”. Because the two halves touch nowhere at the hinge, the lid can have its own color. In the “Multi-color 3MF (PrusaSlicer)” download every part sits on its own extruder, ideal for an MMU3, an XL or a Core One with a multi-material setup. “3MF (Bambu Studio / OrcaSlicer)” maps the parts to the filament slots of an AMS, and “STL per color (ZIP)” gives you one file per color. See the two-color hinged box for an example.

With a single extruder, print the box in one color; the label is then engraved.

Printing tips

  • Orientation: leave the box exactly as the generator shows it, both halves open side up with the hinge between them. You don’t need supports: in a test slice with PrusaSlicer not a single support line was generated, even with automatic supports.
  • First layer: a clean first layer matters, because patterns and label lie on the bed. Clean the bed and check your Z offset.
  • Material: PLA is fine for most boxes. PETG is tougher and takes more open-and-close cycles, but it strings more, so give it an extra 0.05 mm of hinge gap if needed.
  • Print time: on a Prusa MINI with the 0.20 mm SPEED profile, Prusament PLA and 15 % infill the default box takes 33 min 48 s and 13.93 g of filament. The pill box needs 55 min 15 s and 19.36 g, the 120 × 80 mm small parts box 2 h 44 min and 70.52 g.
  • Freeing the hinge: let the box cool down, hold the base and slowly push the lid open. Then open and close it fully a few times.

Origin and license

The way the box is built (both halves opened up side by side, the hinge at rim height, inner lip, snap bead with groove, compartments and patterns) comes from HingeBox() in the UB.scad library by Ulrich Bär. It is released under CC0 1.0, so it is in the public domain. We adopted the formulas for the knuckle diameter, hinge position, inner lip, latch length and inner size; the generator builds the halves themselves from scratch.

The hinge is a port of knuckle_hinge() from BOSL2 by Revar Desmera under the BSD-2-Clause license: the knuckle layout, the arm profile and the cones for printing in place. The bed edge chamfer, lift tab, hinge test, lid label and colors are new. All sources are listed under licenses.

Need an open box for stacking instead? Have a look at the storage caddy. Or open the generator and plan your first hinged box.

All parameters

The numeric settings of the generator with their default values and allowed ranges. Text, fonts, patterns and colors are set directly in the generator.

ParameterDefaultRangeMeaning
Size
Depth60 mm20 – 85 mmOutside, from the hinge to the front. Both halves lie side by side on the bed, so the print is a little more than twice as long.
Width40 mm20 – 170 mmOutside, along the hinge.
Height24 mm14 – 100 mmOutside height of the closed box. Base and lid are half of it each.
Wall thickness1.2 mm0.8 – 3 mm1.2 mm is three lines with a 0.4 mm nozzle. Thicker walls make the box sturdier.
Floor thickness0 mm0 – 4 mmThickness of the floor and the lid top; 0 = like the walls.
Corner radius6 mm0 – 30 mmRounds the vertical corners. The hinge sits on the straight part of the back wall, so large radii shorten it.
Bed edge chamfer0.8 mm0 – 2 mm45° chamfer around the faces on the bed. It keeps the first layer from bulging out (elephant foot).
Hinge
Hinge gap0.4 mm0.25 – 0.8 mmGap between the knuckles and around the cones. 0.4 mm suits most printers; if the hinge fuses, use 0.5 mm.
Hinge segments00 – 8Number of base knuckles minus one: 2 → 5 knuckles. 0 picks one knuckle about every 8 mm.
Cone diameter2.5 mm1.6 – 5 mmDiameter of the print-in-place cones. The knuckle grows with it.
Pin diameter1.75 mm1 – 4 mm1.75 for filament. The hole gets the clearance on top.
Clearance0.2 mm0.1 – 0.5 mmPlay between lip and lid, at the snap bead and in the pin hole.
Lip & latch
Lip height1.5 mm0.5 – 4 mmHow far the lip reaches into the lid.
Snap bead depth0.65 mm0 – 1.2 mmHow far the bead at the front stands out. 0 = no snap latch; deeper closes more firmly.
Snap bead height2 mm1.5 – 5 mmHeight of the bead above the base rim. The groove in the lid follows.
Compartments
Dividers across00 – 9Walls parallel to the front: compartments from front to back.
Dividers lengthwise00 – 9Walls parallel to the sides: compartments from left to right.
Divider thickness0 mm0 – 3 mm0 = 65 % of the wall, at least 0.8 mm.
Patterns & label
Pattern cell size5 mm3 – 15 mmSpacing of the pattern elements.
Pattern depth0.4 mm0.2 – 1 mm0.4 mm is two layers at 0.2 mm.
Line width0.6 mm0.4 – 2 mmWidth of the grooves.
Text size0 mm0 – 40 mmHeight of the capital letters; 0 fits the text to the lid.
Label depth0.6 mm0.4 – 1.2 mmHow deep the label sits in the lid. At least 0.6 mm of the lid stays below it.

Frequently asked questions

How do I break the hinge free after printing?

Let the box cool down completely and take it off the bed in one piece. Hold the base and slowly push the lid up. The first time you will hear a faint crack as the fine strings between the knuckles tear. Then open and close it fully ten to twenty times and the hinge runs freely. Don’t twist it and don’t yank it open.

What hinge gap do I need?

The default is 0.4 mm for a 0.4 mm nozzle. If the hinge fuses on your printer, use 0.45 or 0.5 mm; if it wobbles too much, 0.35 mm. The fastest way to find out is the hinge test: it builds only the hinge with two wall strips and prints in about 17 minutes.

Do I need supports?

No. Both halves lie open side up on the bed, and the cones in the hinge and every bead and groove have 45° flanks. In a test slice with PrusaSlicer not a single support line was generated, even with automatic supports switched on.

How big is the inside?

The generator shows the inner size below the dimensions: the outside minus wall, clearance and inner lip on every side, and minus floor and lid top in height. The default 60 × 40 × 24 mm box is 55.6 × 35.6 × 21.6 mm inside.

Can I print base and lid in different colors?

Yes. The hinge keeps the two halves apart, they touch nowhere. Give the lid its own color and it gets its own extruder in the 3MF, so a multi-material setup prints the box in two colors in one run.

Does the snap latch last?

The bead only flexes about 0.45 mm each time you close the box, which PLA and PETG handle for a long time. If the box closes too tightly, reduce the “Snap bead depth” in 0.05 mm steps; if it opens too easily, increase it. At 0 only the inner lip holds the lid.

Origin & license

  • UB.scad by Ulrich Bär (UBaer21) · CC0 1.0 · code ported – HingeBox() from products.scad: sizes and formulas for the hinge position, inner lip, snap bead, compartments and patterns
  • BOSL2 by Revar Desmera · BSD-2-Clause · helper code ported – knuckle_hinge() from hinges.scad: knuckle layout, hinge profile and print-in-place cones (core/geometry/bosl/hinges.ts)