Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
39 changes: 39 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,44 @@
# Changelog

## 0.13.2 (2026-12-03)

New:

- `$view = "assembled"` or `$view = "apart"` at the top level of a
program says how a flat picture of the design shows it: put together,
as a layered ornament looks best, or as its parts laid apart, as a box
does. `render()` gives it as `view`; without it the field is not
there and the viewer chooses. Like `$print` it is never a setting.
The files to cut and the 3D files are the same either way.

Changes:

- In the print layout (`--print`, `layout: "print"`) an object of several
parts that would need supports whichever way it lies, a print group or
a part with what is glued on it, prints as a few objects that do not.
A cabinet closed by its front used to be one object with a panel over
air: now its carcass and shelves are one object, lying on the back,
and the front another. The object is laid the way that keeps the most
of it whole, the parts that hang over air then are taken off with what
they hold, and those print together where they touch. The objects are
named after the group and their biggest part, as "cabinet - Back". An
object with less than 100 mm² over air, as the lintel of a small
window, stays whole, and so does every object that already printed
without supports and parts with `print = "each"`. `meshBodies()` and
`toModel()` take `split`: `false` keeps every object whole, a number
sets how much may hang over air, in mm².
- In the print layout an object no longer stands off the bed on its
engraving. A mark on a face turned down and nearer the bed than the
mark is high, as under a panel a hundredth of a millimetre above the
lowest edge, used to be made under the bed, which lifted the whole
object by the mark's height (0.6 mm with `--print`) and left all of it
over air. Such marks are left out, as marks on the bed face are.
- In the print layout a part that bends on a living hinge, in a print
group, is tried standing on its edge too, where it used to be tried
only on the faces of the group's parts.
- The print layout finds how an object lies faster, most of all for
models with much engraving, and `overhangs()` is faster.

## 0.13.1 (2026-12-02)

Changes:
Expand Down
5 changes: 4 additions & 1 deletion LANGUAGE.md
Original file line number Diff line number Diff line change
Expand Up @@ -212,6 +212,7 @@ module hang_hole(d = 5) {
| `$join_lines` | `false` | join lines that meet end to end and order them nearest first, for less travel |
| `$min_width` | `1.5` | warn where a part's material is narrower than this; `0` turns it off |
| `$knob` | `12` | the size of the jigsaw knobs joining the pieces of a split part |
| `$view` | | at the top level: a flat picture shows the design `"assembled"` or `"apart"`; never a setting |
| `$stands` | `false` | `true` for a model meant to stand: it warns if its weight's centre is not over what it stands on |
| `$density` | `0.6` | the parts' density in g/cm³ for that check, plywood's by default |
| `$knob_clearance` | `0.15` | the room between a knob and its socket |
Expand Down Expand Up @@ -345,7 +346,9 @@ material(thickness = 4, kerf = 0.12, name = "birch") {
the face away from the rest of it, so the cup stands on its bottom
however the box is placed; if that would hang over air, it lies on a
face of one of its biggest parts that needs clearly less support. A
part glued on another prints with it unless it has a print name of
group that needs support whichever way it lies prints as a few
objects that do not, each named after the group and its biggest
part. A part glued on another prints with it unless it has a print name of
its own. `print = "each"` prints every copy of the part as an object
of its own, joined only with the same copy of other parts with
`print = "each"` that touch it: copy 3 of a chess piece's base with
Expand Down
4 changes: 2 additions & 2 deletions alias/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "kerfscript",
"version": "0.13.1",
"version": "0.13.2",
"description": "KerfScript: a programming language for laser cutting. Same package as @mylasertools/kerfscript.",
"type": "module",
"license": "AGPL-3.0-only",
Expand Down Expand Up @@ -52,6 +52,6 @@
"node": ">=20"
},
"dependencies": {
"@mylasertools/kerfscript": "0.13.1"
"@mylasertools/kerfscript": "0.13.2"
}
}
2 changes: 1 addition & 1 deletion desktop/src-tauri/Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion desktop/src-tauri/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "kerfscript-desktop"
version = "0.13.1"
version = "0.13.2"
description = "KerfScript: a programming language for laser cutting"
authors = ["MyLaserTools"]
license = "AGPL-3.0-only"
Expand Down
22 changes: 22 additions & 0 deletions docs/3d-files.md
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,25 @@ base. `print_on = "back"` or `"front"` names the face. A stack of
parallel layers lies on its bigger end: a lid glued over a smaller
insert prints on the lid.

An object of several parts that would need supports whichever way it
lies, a print group or a part with what is glued on it, prints as a few
objects that do not. A cabinet closed by its front has a panel over air
on every side, so its carcass and shelves print as one object, lying on
the back, and the front as another. The object is laid the way that
keeps the most of it whole, and the parts that hang over air then are
taken off it with what they hold; they print as an object of their own
where they touch, shared out again if they need it. Each object is named
after the group and its biggest part, as "cabinet - Back" and "cabinet -
Front", or after its biggest part alone where the parts were only glued.

An object stays whole with less than 100 mm² over air, as the lintel of
a small window or the end of a finger, which print as short bridges. It
stays whole too where a little hangs under each of many parts, as round
a globe of layers, and where sharing it out would leave half as much
over air or more. Parts with `print = "each"` are not shared out. A
model of very many parts that cannot print joined, as a bowl of twisted
slats, prints as its parts laid flat.

Everything glued on a part of the group comes with it, unless it has a
print name of its own. `print = "each"` prints every copy of a part as
an object of its own, as coasters stacked in the assembly to show them.
Expand Down Expand Up @@ -179,6 +198,9 @@ triangles in millimetres) for a viewer of your own, and `toGlb()`, `to3mf()`
and `toStl()` write them. The options are `layout` (`"assembled"`,
`"flat"` or `"print"`), `markHeight`, `lineWidth`, `slitWidth`, `hinges`
(`false` leaves the cuts of living hinges out, as the print layout does),
`split` (`false` keeps an object that needs supports whole; a
number is how much of it may hang over air before it is shared out, in
mm², 100 unless given),
`hardware` and `gap`. A part or mark body has `matrix`, the 4 x 4 matrix
(row by row, as `result.assembly` has it) that takes its part's own
coordinates, the outline in x and y and z from 0 at the back to the
Expand Down
3 changes: 2 additions & 1 deletion docs/customizer.md
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,8 @@ part("figure") figure(figure, 80);
```

`/* [Size] */` starts a group named Size. `/* [Hidden] */` hides the
settings that follow it, until another group begins.
settings that follow it, until another group begins. `$print` and `$view`
are never settings, wherever they are.

A `//` comment immediately above a variable supplies its caption. Keep the
file's introductory comment separate with a blank line so it does not
Expand Down
1 change: 1 addition & 0 deletions docs/javascript.md
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,7 @@ The URL should point to a font file provided by your application.
| `assembly` | One entry per copy of a part with `name`, `copy`, `thickness`, `material`, `outline`, a 4 × 4 `matrix` and `placed`, for showing the design put together. Parts without `at` or `rotate` have `placed: false`. A bent part has `bends`; a part in a step has `step`; a part that moves when the model is opened has `moves`; `marks` holds what is engraved and scored on it, front and back; a mark that is the cuts of a living hinge has `hinge: true` |
| `steps` | The text of each assembly step, in order; a part's `step` counts from 1 |
| `stages` | The stages of opening the model, from `hinge()` and `slide()`, in order: a numbered stage as its number, a named one as its name |
| `view` | `"assembled"` or `"apart"` when the program sets `$view`: how a flat picture of the design shows it. Not there when the program leaves it to the viewer |
| `hardware` | Each `hardware()`: `kind`, `from`, `to`, `size`, `up`, `sides`, `step`, `label` and `moves` |
| `lights` | Each light, from a tealight, LED, bulb or `light()`: `from` and `to` (the same point unless it is a strip), `color`, `lumens`, `flicker`, `source`, `step`, `label` and `moves` |
| `paths` | Layer paths with `name`, `mode`, `color`, `d`, `regions` and `lines` |
Expand Down
4 changes: 2 additions & 2 deletions docs/versions.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Versions

KerfScript 0.13.1 implements language version 0.3. The package version tracks
KerfScript 0.13.2 implements language version 0.3. The package version tracks
the software release; the language version tracks the syntax and behavior
of `.kerf` programs.

Expand Down Expand Up @@ -30,4 +30,4 @@ files used with a design. Applications that store designs should retain
that information and compare the output before upgrading the interpreter.

Pin the npm package to an exact version when your application needs a fixed
renderer, for example `@mylasertools/kerfscript@0.13.1`.
renderer, for example `@mylasertools/kerfscript@0.13.2`.
4 changes: 2 additions & 2 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@mylasertools/kerfscript",
"version": "0.13.1",
"version": "0.13.2",
"description": "KerfScript: a programming language and library for laser-cutting generators. Write parametric 2D parts with cut, score and engrave layers, kerf compensation and joinery, then turn settings into SVG or DXF cut files from Node.js, the browser, the command line or WebAssembly.",
"type": "module",
"license": "AGPL-3.0-only",
Expand Down
1 change: 1 addition & 0 deletions packaging/flatpak/com.mylasertools.KerfScript.metainfo.xml
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@
</supports>
<content_rating type="oars-1.1"/>
<releases>
<release version="0.13.2" date="2026-12-03"/>
<release version="0.13.1" date="2026-12-02"/>
<release version="0.13.0" date="2026-12-01"/>
<release version="0.12.3" date="2026-11-30"/>
Expand Down
5 changes: 3 additions & 2 deletions src/customizer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -98,8 +98,9 @@ export function parameters(source: string): { parameters: Parameter[] } {
// Settings whose `when` follows a [...], so it is surely a condition
const afterControl = new Set<Parameter>();
for (const s of program.body) {
// $print names the program's print group, never a setting
if (s.kind !== 'assign' || /^\$(f[nas]|print)$/.test(s.name)) continue;
// $print names the program's print group and $view how it shows,
// never settings
if (s.kind !== 'assign' || /^\$(f[nas]|print|view)$/.test(s.name)) continue;
const lit = literal(s.value);
if (!lit.ok) continue;
const group =
Expand Down
Loading
Loading