/print3d-kit:print3dfrom print3d-kit
Designs printable 3D models (STL/3MF/STEP) for FDM printers using build123d and p3d CLI. Generates enclosures, brackets, hooks, stands, and replacement parts with print-check validation.
Ships in print3d-kit. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
None: SKILL.md is the whole skill.
You design parts as Python (build123d), build them with p3d build, then look at
the preview PNG and read the print checks before calling anything done.
p3d printers; default is the user's own from $P3D_PRINTER or
~/.config/print3d-kit/printer, else generic 220x220x250, 0.4 mm nozzle),p3d parts lists ready parts and hole cutters
(box_with_lid, l_bracket, wall_hook, standoff, clearance_hole,
counterbore_hole, countersunk_hole, nut_trap, heat_insert_hole, ...).models/<name>.py in the user's project (create the dir).
Put every dimension in a named UPPER_CASE constant at the top so the user can tweak it.
The script must define result (one shape) or parts (dict name -> shape).
Set PRINTER = "..." only when the user names a printer other than their default;
a hardcoded PRINTER overrides the user's default.p3d build models/<name>.py (add -p <printer> if needed).
Output goes to models/out/<name>/: STL per part, one 3MF with all parts, STEP,
preview.png, report.json. Exit code 1 = errors in checks, 2 = script crashed,
137 = killed at the memory cap (half the RAM by default). On 137 do not just raise
the cap: simplify the model first (fuse repeated cutters into one and subtract once,
fewer/coarser decorative grooves), and only then retry with P3D_MEMORY_MAX=8G.
Never run p3d through .venv/bin/p3d directly: that skips the cap.preview.png with the Read tool. Every time. Compare it to the brief:
right features, right side, holes where intended, nothing floating, part lying on
its intended print face. Use --views iso,back-iso,bottom,left to see hidden sides.Units are mm. Z is up, the bed is z=0. Model the part in its print orientation,
or model it naturally and finish with result = on_bed(Rot(...) * part).
from print3d_kit import on_bed, arrange — on_bed drops a shape to z=0 and
centers it; arrange(parts) lays several parts out in a row.
Hole cutters open at the origin and go depth mm into the part along axis
(default "-Z", down from a top face). Put the origin on the face the hole
starts from and aim it inward:
part -= Pos(x, y, top_z) * clearance_hole("M3", depth=5) # from the top
part -= Pos(x, y, 0) * nut_trap("M3", axis="+Z") # from the bottom
part -= Pos(x_max, y, z) * clearance_hole("M3", depth=8, axis="-X") # into the +X face
part -= Pos(x, y_min, z) * clearance_hole("M4", depth=8, axis="+Y", teardrop=True)
Wrong sign = the cutter points out of the part and cuts nothing; check the preview.
Horizontal holes (±X/±Y): pass teardrop=True for anything ≥ 5 mm, it adds a 45° roof
so the hole prints without support.
Openings in enclosure walls: cutout(box, "+X", width, height, z, offset=..., wall=WALL).
Use to_rim=True (no height) when the opening can run up through the top edge — the lid
closes it and no weak sliver is left above it.
teardrop=True.from build123d import *
from print3d_kit import on_bed
from print3d_kit.parts import clearance_hole, countersunk_hole, standoff
W, D, H = 40, 20, 8
MIN = (Align.CENTER, Align.CENTER, Align.MIN) # sits on z=0, centered in XY
body = Box(W, D, H, align=MIN) # Box(length_x, width_y, height_z)
body += Pos(0, 0, H) * Cylinder(5, 10, align=MIN) # stack on top
body -= Pos(-12, 0, H) * countersunk_hole("M3", depth=H)
body = fillet(body.edges().filter_by(Axis.Z), 2) # round vertical edges
body = chamfer(body.edges().group_by(Axis.Z)[0], 0.6) # chamfer bottom edges
plate = extrude(RectangleRounded(60, 30, 4), 3) # 2D sketch on XY -> solid
rib = extrude(Plane.YZ * Polygon((0, 0), (10, 0), (0, 10), align=None), 3)
ring = Cylinder(10, 5, align=MIN) - Cylinder(8, 5, align=MIN)
result = on_bed(body)
Gotchas:
align= to anchor them.Pos(x, y, z) * shape moves, Rot(rx, ry, rz) * shape rotates around the origin
(degrees). Pos(...) * Rot(...) * s = rotate first, then move.Polygon(...) keeps points where you put them; Rectangle, Circle,
RectangleRounded, RegularPolygon are centered. Pass align=None to Polygon
anyway, older build123d versions centered it..edges().filter_by(Axis.Z) (parallel to Z), .group_by(Axis.Z)[-1]
(topmost group), .faces().sort_by(Axis.Z)[-1] (top face).StdFail_NotDone — reduce radius
or select fewer edges.shape.bounding_box(), shape.volume, shape.is_valid.| check | level | what to do |
|---|---|---|
| watertight / winding / volume | error | geometry broken; usually a bad boolean — overlap the solids slightly |
| bed | error | too big for the printer; rotate 90°, split into parts, or scale |
| bodies | warning | disconnected pieces in one part; unintended → make them overlap |
| thin_walls / thin_spot | warning / info | thicken to ≥ 2 × nozzle; the message gives the XYZ of the thinnest spot — a thin_spot right under the top face or beside a cutout usually means a sliver you did not intend (e.g. cutout ends 1 mm below the rim: extend it to the rim or raise the wall) |
| overhangs | warning/info | each region comes with a bbox, flat/sloped and the bridge span. Warning = some span > 10 mm (incl. cantilevers: span is 2× the overhang length) or > 50 mm² sloped. Fix the biggest region: rotate, chamfer the ceiling, teardrop the hole, run a cutout to_rim, or accept supports |
| bed_contact / tipping | warning | flip to a flat face, or recommend brim |
report.json carries the same findings with machine-readable where (at, bbox,
regions[].span) — read it instead of parsing the text when you need coordinates.
Other commands: p3d check file.stl -p prusa-mk4 (check any mesh, also downloaded ones),
p3d render file.stl --views iso,top (preview any mesh), p3d printers, p3d parts.
If p3d is not on PATH, run <repo>/bin/p3d — it bootstraps its own venv on first use.
What SKILL.md sets; muted values are Claude Code's defaults
Generated from the plugin's indexed repository (skurzynowski/print3d-kit) — no native marketplace selected
npx claudepluginhub p/skurzynowski-print3d-kitOther plugins' skills for the same job