Recipes

Copy-paste Pipe recipes for common parts - rounded boxes, plates with holes, enclosures, threads, gears, text, vases, snap fits and multi-colour prints.

Practical patterns you can paste into the studio or hand to your agent. Every recipe builds as-is and prints without supports unless noted. Change the numbers at the top to fit your project.

Several recipes have a complete version in the gallery, made by Zolid. Open it and click Remix in the studio to start from there.

Rounded box

Round the vertical corners first, then the top and bottom edges. Order matters: each fillet works on the edges that exist at that point.

Pipe
units("mm")W = 60D = 40H = 25block = box(W, D, H, z0=0)  | fillet(vertical, 8)  | fillet(top_rim, 2)  | fillet(bottom_rim, 0.6)

A small fillet on the bottom rim (0.4–0.8 mm) keeps the squashed first layers ("elephant's foot") from sticking out.

Plate with mounting holes

Cut all the holes in one batch with at=[...], and make the cutter taller than the plate. A cone at the top of each hole countersinks it for flat-head screws.

Pipe
units("mm")W = 80D = 50e = 6plate = box(W, D, 4, z0=0) | fillet(vertical, 5)holes = [(W/2 - e, D/2 - e, 0), (e - W/2, D/2 - e, 0), (W/2 - e, e - D/2, 0), (e - W/2, e - D/2, 0)]plate = plate | cut(cyl(1.7, 20, segs=48), at=holes)plate = plate | cut(cone(1.7, 3.5, 1.9, segs=48), at=[(holes[i][0], holes[i][1], 3.06) for i in range(4)])

For M3 screws, a 3.4 mm hole (r=1.7) gives a free fit; 2.8 mm (r=1.4) lets a self-tapping screw bite.

Grid of holes

A single comprehension makes a rectangular grid: % gives the column, floor(i / cols) the row.

Pipe
units("mm")cols = 8rows = 5pitch = 10panel = box(cols * pitch + 10, rows * pitch + 10, 3, z0=0) | fillet(vertical, 4)panel = panel | cut(cyl(3, 10, segs=32),  at=[((i % cols - (cols - 1) / 2) * pitch, (floor(i / cols) - (rows - 1) / 2) * pitch, 0) for i in range(cols * rows)])

For holes on a circle, use radial:

Pipe
units("mm")flange = cyl(40, 6, z0=0, segs=96) | cut(cyl(12, 20, segs=64))flange = flange | cut(cyl(3.2, 20, segs=32) | radial(6, r=30))

Hollow part with a wall

shell keeps the outside and removes the inside, leaving walls of the thickness you give. The top stays open unless you pass open_top=false.

Pipe
units("mm")tray = box(90, 60, 20, z0=0)  | fillet(vertical, 10)  | fillet(bottom_rim, 3)  | shell(1.6)

Round the outside before you shell so the inside follows the same curves. For curved shapes, solidify(t) is the safer alternative.

Enclosure with screw bosses

A box with a lid: corner bosses for self-tapping screws, and a lid with matching countersunk holes. Change W, D and H to resize everything. The full version, Parametric Electronics Enclosure, adds mounting ears and a cable gland.

Pipe
units("mm")W = 90D = 60H = 35t = 2.4c = [(W/2 - 6, D/2 - 6, 0), (6 - W/2, D/2 - 6, 0), (W/2 - 6, 6 - D/2, 0), (6 - W/2, 6 - D/2, 0)]body = box(W, D, H, z0=0) | fillet(vertical, 6) | shell(t) | color(0.27, 0.31, 0.38)body = body | add(cyl(4.5, H - t, z0=t - 0.1, segs=48), at=c)body = body | cut(cyl(1.4, H, z0=10, segs=32), at=c)# --- step: lidc = [(W/2 - 6, D/2 - 6, 0), (6 - W/2, D/2 - 6, 0), (W/2 - 6, 6 - D/2, 0), (6 - W/2, 6 - D/2, 0)]lid = box(W, D, 3, z0=0) | fillet(vertical, 6) | bevel(top_rim, 1) | color(0.85, 0.87, 0.9)lid = lid | cut(cyl(1.7, 10, segs=32), at=c) | cut(cone(1.7, 3.4, 1.8, segs=32), at=[(c[i][0], c[i][1], 2.2) for i in range(4)])lid = lid | move(0, D + 12, 0)

Bosses start slightly inside the floor (z0=t - 0.1) so they fuse with it. The pilot holes stop at z = 10, leaving the floor closed. The lid step repeats the list c because only numbers and parts carry over from one step to the next.

Threaded jar

A thread is a helix you add to a neck. The lid's thread is cut slightly larger, which gives the clearance it needs to turn. See Threaded Jar and Lid for a knurled version.

Pipe
units("mm")jar = cyl(31, 50, z0=0, segs=96) | fillet(bottom_rim, 4) | shell(2.2)jar = jar | add(pipe(31, 24.5, 4, z0=46, segs=96))jar = jar | add(thread(26.5, 28, 3, 4) | move(0, 0, 49) | cut(cyl(24.5, 40, z0=44, segs=96)))# --- step: lidlid = cyl(33, 16, z0=0, segs=96) | fillet(bottom_rim, 2) | move(80, 0, 0)lid = lid | cut(cyl(27, 20, z0=2, segs=96, at=(80, 0, 0)))lid = lid | cut(thread(26.9, 28.4, 3, 5) | move(80, 0, 2))

thread(r0, r1, pitch, turns) rises pitch × turns from z = 0. Here it is 3 mm × 4 turns = 12 mm. 0.4 mm of clearance (26.5 → 26.9) suits most FDM printers; add more if the lid binds. Print the lid upside down.

Meshing gears

Gears of the same module mesh when their centres are m × (z1 + z2) / 2 apart. Rotate the second gear half a tooth (180 / z2 degrees) when it has an even number of teeth. The Spur Gear Train puts three on pins in a base plate.

Pipe
units("mm")m = 2z1 = 24z2 = 12plate = box(110, 60, 4, z0=0, at=(18, 0, 0)) | fillet(vertical, 6)plate = plate | add(cyl(2.2, 12, z0=3.9, segs=32), at=[(0, 0, 0), (m * (z1 + z2) / 2, 0, 0)])wheel = gear(z1, m=m, h=6, bore=2.5) | cut(cyl(5, 20) | radial(5, r=14)) | move(0, 0, 8)pinion = gear(z2, m=m, h=6, bore=2.5) | rot(0, 0, 180 / z2) | move(m * (z1 + z2) / 2, 0, 8)

The bore (radius 2.5) is 0.3 mm larger than the pins (radius 2.2) so the gears spin freely.

Text label

text3d makes solid letters from z = 0 up to depth. Raise them onto a plate for embossed text, or cut them into it for engraved text.

Pipe
units("mm")tag = box(70, 24, 3, z0=0) | fillet(vertical, 6) | fillet(top_rim, 0.6) | color(0.16, 0.16, 0.2)tag = tag | cut(cyl(3, 10, segs=32, at=(-28, 0, 0)), fillet=0.6)letters = text3d("ZOLID", height=10, depth=1.2) | move(6, 0, 3) | color(0.98, 0.98, 1)# --- step: engraved backtag = tag | cut(text3d("2026", height=6, depth=1) | rot(0, 180, 0) | move(6, 0, 0.6))

Keep letters at least 6 mm tall and strokes 0.8 mm wide so they print cleanly. The Text Keychain and Desk Name Plate are ready-made versions.

Vase

Start from a lobed outline, hollow it, then twist and flare it with deform. In the slicer, print with 2 walls or in spiral (vase) mode. Full model: Spiral Vase.

Pipe
units("mm")n = 120lobes = 8vase = extrude2d([((34 + 3 * cos(lobes * i * 2 * pi / n)) * cos(i * 2 * pi / n),                   (34 + 3 * cos(lobes * i * 2 * pi / n)) * sin(i * 2 * pi / n)) for i in range(n)], 0, 140)vase = vase | shell(1.6) | deform("twist", axis=z, angle=90) | deform("taper", axis=z, factor=0.3)

For a smooth turned shape, revolve a profile instead:

Pipe
units("mm")pot = revolve([(0, 0), (38, 0), (40, 1), (50, 90), (54, 92), (54, 96), (0, 96)], segs=96) | shell(2.4)pot = pot | cut(cyl(4, 10, segs=32)) | cut(cyl(3, 10, segs=32) | radial(4, r=20))

Snap-fit lid

A lid with a lip that drops inside the box, and a small ridge on the lip that clicks into a groove in the wall. Tolerances: 0.3 mm between lip and wall, 0.3 mm of snap overlap. Full model: Snap-Fit Box.

Pipe
units("mm")body = box(64, 44, 32, z0=0) | fillet(vertical, 6) | shell(2) | fillet(bottom_rim, 1.5)body = body | cut(box(61.2, 41.2, 1.2, at=(0, 0, 28)) | fillet(vertical, 4.6))# --- step: lid with lip and snap ridgelid = box(64, 44, 2.4, z0=0) | fillet(vertical, 6) | bevel(bottom_rim, 0.6)lid = lid | add(box(59.4, 39.4, 6, z0=2.4) | fillet(vertical, 3.7) | cut(box(55.8, 35.8, 20, z0=0) | fillet(vertical, 2)))lid = lid | add(box(60.4, 40.4, 0.9, at=(0, 0, 6.4)) | fillet(vertical, 4.2) | cut(box(57, 37, 4, at=(0, 0, 6.4))))lid = lid | move(80, 0, 0)

Print the lid lip-up. PETG flexes more than PLA and survives more clicks.

Hinge pin and knuckles

Print-in-place parts need a gap all round. Here the pin is 0.4 mm smaller than its hole and the knuckles are 0.2 mm shorter than their slots. The full model, Print-in-Place Hinge, goes further so it prints without supports: flat-bottomed knuckles with 45° undersides turning on captive 45° cone pins.

Pipe
units("mm")leaf_a = box(50, 28, 3, z0=0, at=(0, -14.5, 0)) | fillet(vertical, 4)leaf_a = leaf_a | cut(cyl(4.6, 9.6, axis=x, at=[(-10, 0, 4), (10, 0, 4)]))leaf_a = leaf_a | add(cyl(4, 10, axis=x, at=[(-20, 0, 4), (0, 0, 4), (20, 0, 4)])) | add(cyl(2, 49.8, axis=x, at=(0, 0, 4)))leaf_b = box(50, 28, 3, z0=0, at=(0, 14.5, 0)) | fillet(vertical, 4)leaf_b = leaf_b | cut(cyl(4.6, 10.6, axis=x, at=[(-20, 0, 4), (0, 0, 4), (20, 0, 4)]))leaf_b = leaf_b | add(cyl(4, 9.2, axis=x, at=[(-10, 0, 4), (10, 0, 4)])) | cut(cyl(2.4, 60, axis=x, at=(0, 0, 4)))

Smooth joins with fillet=

fillet= on add or cut rounds the seam where two solids meet. It makes bosses stronger and holes friendlier to hands.

Pipe
units("mm")base = box(60, 40, 5, z0=0) | fillet(vertical, 6)base = base | add(cyl(8, 20, z0=4.9, segs=64), fillet=3)base = base | cut(cyl(4, 60, segs=64), fillet=1)base = base | cut(cyl(2.5, 20, segs=32), at=[(-22, 0, 0), (22, 0, 0)], fillet=0.8)

Use segs=1 with fillet= for a chamfer instead of a round.

Multi-colour print

Give each colour its own part with color(). The print-ready 3MF (studio: Print tab; agent: export with print: true) maps each part's colour to a filament slot of your printer, so the slicer opens it with the colours assigned. Parts may touch but should not overlap. Honeycomb Coaster Set is a full example.

Pipe
units("mm")base = box(60, 60, 4, z0=0) | fillet(vertical, 8) | color(0.17, 0.18, 0.22)base = base | cut(text3d("Z", height=36, depth=1) | move(0, 0, 3))inlay = text3d("Z", height=36, depth=1) | move(0, 0, 3) | color(0.56, 0.43, 1)

Here the letter is cut 1 mm into the base and a matching inlay part fills it, so the top is flat and the colour change happens on one layer. For raised text in a second colour, put the letters on top instead (see Text label). With the plain 3MF, keep the parts as one object with several parts in the slicer ("assemble" rather than "split to objects") so they stay aligned.

Fit and tolerance test

Before printing parts that fit together, print a small test to see what clearance your printer needs:

Pipe
units("mm")gaps = [0.1, 0.2, 0.3, 0.4, 0.5]bar = box(80, 16, 6, z0=0) | fillet(vertical, 3)bar = bar | cut(cyl(4, 20, segs=64), at=[(-30 + 15 * i, 0, 0) for i in range(5)])pins = cyl(4 - gaps[0], 10, z0=0, segs=64, at=(-30, 30, 0))pins = pins | add(cyl(4 - gaps[1], 10, z0=0, segs=64, at=(-15, 30, 0)))pins = pins | add(cyl(4 - gaps[2], 10, z0=0, segs=64, at=(0, 30, 0)))pins = pins | add(cyl(4 - gaps[3], 10, z0=0, segs=64, at=(15, 30, 0)))pins = pins | add(cyl(4 - gaps[4], 10, z0=0, segs=64, at=(30, 30, 0)))

Push each pin into the holes; the smallest gap that slides freely is your clearance. The gallery has a ready-made Tolerance Test, plus Overhang Test and Bridge Test.