Skip to content
Closed
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
37 changes: 37 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,42 @@
# Changelog

## 0.13.1 (2026-12-02)

Changes:

- In the print layout (`--print`, `layout: "print"`) a part that bends on
a living hinge prints solid, in its bent shape. The cuts of
`living_hinge()` and `flex_rect()` are left out of it, since plastic is
made bent and needs no hinge; every other hole and cut stays. A bent
part on its own, or in a stack, used to lie flat with its hinge cut:
it now stands bent on its lower edge, with what is glued on it, as one
object. The files for the laser and the other layouts are unchanged.
- `symbol(solid = true)` engraves only the drawing's detail: its holes,
the gaps it closes and its bridges. It used to engrave thin slivers in
every inside corner of the outline too, where closing rounds the
corner, so a plain silhouette such as a tree came out with specks
along its edge, and they printed as loose flakes beside the piece.
- `close(r, sharp = true)` closes gaps and leaves inside corners as
drawn, where `close()` rounds them to `r`.
- Every body of a 3D file is a closed solid in three cases where a slicer
used to report open edges: a part bent on a living hinge and the marks
on it are one surface, not bands with walls between them inside; a
strip bent round to meet itself, as the side of `flex_box()`, has no
wall where its ends meet; and areas that touch at a corner, as the
engraved squares of a chessboard, stand a hundredth of a millimetre
apart there. Strips of an area thinner than 0.004 mm, and gaps
narrower than the files can hold, are left out of the solids, since
they came out as faces with no thickness.
- Each part and mark body of `meshBodies()` has `matrix`: where its part
lies in the layout, as a 4 x 4 matrix from the part's own coordinates
to the body's, row by row as the assembly's. With it a program can
place a part's outline itself in the print or flat layout, without the
triangles. A part bent on a living hinge has none.
- `meshBodies()` and `toModel()` take `hinges`: `false` leaves the cuts
of living hinges out of any layout, `true` keeps them in the print
layout. A mark of `result.assembly` that is a living hinge's cuts has
`hinge: true`.

## 0.13.0 (2026-12-01)

New:
Expand Down
2 changes: 1 addition & 1 deletion LANGUAGE.md
Original file line number Diff line number Diff line change
Expand Up @@ -502,7 +502,7 @@ playground, the command line and `kerfscript.wasm` have `Atkinson`
| `fill_holes(min_area)` | fills holes smaller than `min_area` mm², or all of them |
| `join_islands(width = 1)` | joins every separate piece of the material to the nearest other piece with a strip `width` wide, until it is one piece |
| `largest(n = 1)` | keeps the `n` biggest connected pieces of the material, dropping crumbs; marks stay as drawn |
| `close(r = 0.5)` | closes gaps and notches narrower than `2 r`, keeping the outline |
| `close(r = 0.5, sharp = false)` | closes gaps and notches narrower than `2 r`, keeping the outline; it rounds inside corners to `r` unless `sharp = true` |
| `pattern(spacing, stagger = 0)` | repeats its first child over the area of the others, clipped at the edge |
| `hatch(angle = 45, pitch = 5, width)` | parallel lines across the children's area, or stripes `width` wide |
| `flow(field, spacing = 2, step, min_length, seed = 1)` | evenly spaced lines following `field(p)` (degrees, a vector, or `undef` to stop) across the children's area; see [Plotting](#plotting) |
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.0",
"version": "0.13.1",
"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.0"
"@mylasertools/kerfscript": "0.13.1"
}
}
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.0"
version = "0.13.1"
description = "KerfScript: a programming language for laser cutting"
authors = ["MyLaserTools"]
license = "AGPL-3.0-only"
Expand Down
24 changes: 18 additions & 6 deletions docs/3d-files.md
Original file line number Diff line number Diff line change
Expand Up @@ -132,8 +132,14 @@ of objects and the ones that need supports, so you can see what prints as
one piece before you download.

Each layer takes its colour from its material: a colour in the name
(`material = "green"`, `"#cc3333 card"`) or a wood or sheet it names. A
stack with a part bent on a living hinge is laid out part by part, flat.
(`material = "green"`, `"#cc3333 card"`) or a wood or sheet it names.

A part that bends on a living hinge prints in its bent shape, and solid:
plastic is made bent, so the cuts of `living_hinge()` and `flex_rect()`
are left out of it, and every other hole and cut stays. On its own, or
with what is glued on it, it stands on its lower edge, so its bends rise
straight from the bed; `print_on` lays it another way. The files for the
laser, and the assembled and flat layouts, have the hinge cut as before.

## Formats

Expand All @@ -154,8 +160,9 @@ or a flame, are emissive. Blender and most glTF viewers light the scene
with them.

Every part and mark is a closed solid: each edge is shared by exactly two
triangles, facing out. A bent part is the exception: it is built from bands
across its hinge, which meet inside it.
triangles, facing out. A bent part is too: its bands across the hinge
join edge to edge, with no walls inside. Areas that touch at a corner
stand a hundredth of a millimetre apart there, so each is closed.

## From JavaScript

Expand All @@ -170,7 +177,12 @@ const print = toModel(result, '3mf', { layout: 'print', markHeight: 0.6 });
`meshBodies(result, options)` gives the bodies themselves (positions and
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`, `hardware`
and `gap`. `overhangs(bodies)` lists the objects of the print layout that
`"flat"` or `"print"`), `markHeight`, `lineWidth`, `slitWidth`, `hinges`
(`false` leaves the cuts of living hinges out, as the print layout does),
`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
thickness, to where the body lies in the layout; a part bent on a living
hinge has none. `overhangs(bodies)` lists the objects of the print layout that
hang over air.
See the [JavaScript API](javascript.md).
Loading
Loading