Skip to content

KerfScript 0.13.0: print groups for 3D printing - #15

Closed
JulyJ wants to merge 8 commits into
mainfrom
print-groups
Closed

JulyJ wants to merge 8 commits into
mainfrom
print-groups

Conversation

@JulyJ

@JulyJ JulyJ commented Dec 1, 2026

Copy link
Copy Markdown
Contributor

Laid out to 3D print (kerf render --print, layout: "print", the playground's 3MF and STL buttons), a model's parts can now print as one piece instead of parts to glue. Laser output is unchanged.

New

  • part(print = "name"): parts with one print name print as one object where they touch and move alike as the model opens. A box's bottom and walls print as one cup on its bottom; its lid prints beside it on the same plate.
  • print = "each" prints every copy apart, joined only with the same copy of other print = "each" parts that touch it (each chess piece of a base and plates is one object). print = "" leaves a part out of any group.
  • print("name") { ... } and $print = "name" set the group of the parts inside; $print at the top level of a program names every part in it and is never a setting. Glued parts go with their host.
  • print_on = true, "back" or "front" picks the part and face an object lies on. Without it, an object that would hang over air lies on whichever face of its parts needs clearly the least support.
  • Support check: kerf render --print warns about objects that hang over air, kerf check --print lists them, and overhangs(bodies) gives them in JavaScript.
  • spin(from, to, ratio, stage): parts that turn on an axle as the model opens, nested spins together; they print apart from what they turn in.
  • Playground: 3MF and STL download the print layout; the 3D view has a Print layout toggle with the object count and what needs supports.
  • Libraries group what prints as one piece: box(), enclosure(), flex_box(), drawers(), ring_stack(), stand(); grid_dividers() leaves its dividers loose. Examples got print groups.
  • Every body in the print layout carries its object's name.

Changes

  • A stack of parallel glued layers lies on its bigger end.

Language stays 0.3; everything is additive.

Checks

  • 936 tests (935 pass, 1 skipped), build, type check and site build pass.
  • SVG, DXF, parts, warnings and hardware of all 100 examples byte-identical to 0.12.3.
  • All 100 examples lay out to print with nothing floating or overlapping.

JulyJ added 8 commits December 1, 2026 01:16
- part(print = "name") makes touching parts with one print name one
  object in the print layout, as the assembly joins them; $print sets it
  for the parts inside, print = "" leaves one out, and a glued part goes
  with its host unless it has a print name of its own
- An object lies on its first part, on the face away from the rest;
  print_on = true, "back" or "front" lays it on another part or face,
  and a stack of parallel layers lies on its bigger end
- overhangs(), kerf render --print and kerf check --print find what
  hangs over air and needs supports
- box(), enclosure(), flex_box(), drawers(), ring_stack() and stand()
  put what prints as one piece in print groups
- The playground downloads 3MF and STL laid out to print and shows the
  print layout in its 3D view, with what needs supports
- Examples that print well as whole pieces have print groups
Without print_on, an object that hangs over air is now tried on each way
down its parts face, small parts too, most-faced ways first. A book nook
whose best face is its lectern now finds it.

Every body of the print layout carries its object's name: its print
group, or its first part and copy for an object in no group and for a
model with nothing placed.
print("name") { ... } sets the print group of the parts inside, as
$print does, so print("") leaves out parts whose names are worked out.

Parts with print = "each" join the same copy of other such parts that
touch it: a chess set of bases and plates with qty prints each piece as
one object, apart from the board and the next piece.
The search for the way an object needs least support counted its marks,
which the check leaves out, so it could pick a way the check finds worse.
It now weighs the parts only, and weighs the closest few again on a finer
grid, switching when that is 5% and 5 mm² less.
JulyJ added a commit that referenced this pull request Dec 1, 2026
Laid out to 3D print, parts with one print name print as one object
where they touch and move alike: a box's bottom and walls as one cup,
its lid beside it. print = "each", print = "", print("name") blocks and
a top-level $print set the groups; print_on picks the face an object
lies on, and without it an object lies the way that needs least
support. kerf render/check --print and overhangs() report what hangs
over air. spin() turns parts on an axle as the model opens. The
playground downloads 3MF and STL laid out to print and shows the print
layout. Libraries and examples group what prints as one piece.
Laser output is unchanged; language stays 0.3.
@JulyJ

JulyJ commented Dec 1, 2026

Copy link
Copy Markdown
Contributor Author

Merged into main as 556d2bc.

@JulyJ JulyJ closed this Dec 1, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant