@mylasertools/kerfscript 0.11.0 → 0.11.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/language.cjs CHANGED
@@ -2328,9 +2328,12 @@ function link_angle(a, b) = atan2(b[1] - a[1], b[0] - a[0]);
2328
2328
  // Copyright (c) 2026 MyLaserTools. AGPL-3.0-only or MyLaserTools commercial licence.
2329
2329
  //
2330
2330
  // A flat key turns an eccentric cam, which slides a bolt: half a turn
2331
- // throws its nose out past the lock's top edge, into a notch or a slot in
2332
- // whatever it locks, and half a turn back pulls it in. Pulling on what is
2333
- // locked only presses the bolt against its slot. The lock is three layers
2331
+ // throws its nose out past the lock's top edge, into a slot in whatever it
2332
+ // locks, and half a turn back pulls it in. A bolt only holds against a pull
2333
+ // across its travel: set the lock so the bolt moves across the way the
2334
+ // locked part opens (sideways for a lid that lifts), and give the slot
2335
+ // wood on the side the part pulls from (a pocket, not a notch open that
2336
+ // way), so pulling presses the bolt against it. The lock is three layers
2334
2337
  // of the current material: a base with the cam's hub, a frame with the
2335
2338
  // cam and the bolt, and a plate with the keyhole.
2336
2339
  //
@@ -2343,7 +2346,7 @@ function link_angle(a, b) = atan2(b[1] - a[1], b[0] - a[0]);
2343
2346
  function lock_bounds(throw = 7) = let (d = lock_dims(throw))
2344
2347
  [-d[6] / 2, d[8], d[6] / 2, d[7]];
2345
2348
 
2346
- // Where the bolt's nose is: [width, y of its tip when locked]. Cut a notch
2349
+ // Where the bolt's nose is: [width, y of its tip when locked]. Cut a pocket
2347
2350
  // a little wider than this where it goes.
2348
2351
  function lock_nose(throw = 7) = let (d = lock_dims(throw)) [d[4], d[7] + d[5]];
2349
2352
 
package/dist/language.js CHANGED
@@ -2328,9 +2328,12 @@ function link_angle(a, b) = atan2(b[1] - a[1], b[0] - a[0]);
2328
2328
  // Copyright (c) 2026 MyLaserTools. AGPL-3.0-only or MyLaserTools commercial licence.
2329
2329
  //
2330
2330
  // A flat key turns an eccentric cam, which slides a bolt: half a turn
2331
- // throws its nose out past the lock's top edge, into a notch or a slot in
2332
- // whatever it locks, and half a turn back pulls it in. Pulling on what is
2333
- // locked only presses the bolt against its slot. The lock is three layers
2331
+ // throws its nose out past the lock's top edge, into a slot in whatever it
2332
+ // locks, and half a turn back pulls it in. A bolt only holds against a pull
2333
+ // across its travel: set the lock so the bolt moves across the way the
2334
+ // locked part opens (sideways for a lid that lifts), and give the slot
2335
+ // wood on the side the part pulls from (a pocket, not a notch open that
2336
+ // way), so pulling presses the bolt against it. The lock is three layers
2334
2337
  // of the current material: a base with the cam's hub, a frame with the
2335
2338
  // cam and the bolt, and a plate with the keyhole.
2336
2339
  //
@@ -2343,7 +2346,7 @@ function link_angle(a, b) = atan2(b[1] - a[1], b[0] - a[0]);
2343
2346
  function lock_bounds(throw = 7) = let (d = lock_dims(throw))
2344
2347
  [-d[6] / 2, d[8], d[6] / 2, d[7]];
2345
2348
 
2346
- // Where the bolt's nose is: [width, y of its tip when locked]. Cut a notch
2349
+ // Where the bolt's nose is: [width, y of its tip when locked]. Cut a pocket
2347
2350
  // a little wider than this where it goes.
2348
2351
  function lock_nose(throw = 7) = let (d = lock_dims(throw)) [d[4], d[7] + d[5]];
2349
2352
 
@@ -2324,9 +2324,12 @@ function link_angle(a, b) = atan2(b[1] - a[1], b[0] - a[0]);
2324
2324
  // Copyright (c) 2026 MyLaserTools. AGPL-3.0-only or MyLaserTools commercial licence.
2325
2325
  //
2326
2326
  // A flat key turns an eccentric cam, which slides a bolt: half a turn
2327
- // throws its nose out past the lock's top edge, into a notch or a slot in
2328
- // whatever it locks, and half a turn back pulls it in. Pulling on what is
2329
- // locked only presses the bolt against its slot. The lock is three layers
2327
+ // throws its nose out past the lock's top edge, into a slot in whatever it
2328
+ // locks, and half a turn back pulls it in. A bolt only holds against a pull
2329
+ // across its travel: set the lock so the bolt moves across the way the
2330
+ // locked part opens (sideways for a lid that lifts), and give the slot
2331
+ // wood on the side the part pulls from (a pocket, not a notch open that
2332
+ // way), so pulling presses the bolt against it. The lock is three layers
2330
2333
  // of the current material: a base with the cam's hub, a frame with the
2331
2334
  // cam and the bolt, and a plate with the keyhole.
2332
2335
  //
@@ -2339,7 +2342,7 @@ function link_angle(a, b) = atan2(b[1] - a[1], b[0] - a[0]);
2339
2342
  function lock_bounds(throw = 7) = let (d = lock_dims(throw))
2340
2343
  [-d[6] / 2, d[8], d[6] / 2, d[7]];
2341
2344
 
2342
- // Where the bolt's nose is: [width, y of its tip when locked]. Cut a notch
2345
+ // Where the bolt's nose is: [width, y of its tip when locked]. Cut a pocket
2343
2346
  // a little wider than this where it goes.
2344
2347
  function lock_nose(throw = 7) = let (d = lock_dims(throw)) [d[4], d[7] + d[5]];
2345
2348
 
package/dist/libraries.js CHANGED
@@ -2324,9 +2324,12 @@ function link_angle(a, b) = atan2(b[1] - a[1], b[0] - a[0]);
2324
2324
  // Copyright (c) 2026 MyLaserTools. AGPL-3.0-only or MyLaserTools commercial licence.
2325
2325
  //
2326
2326
  // A flat key turns an eccentric cam, which slides a bolt: half a turn
2327
- // throws its nose out past the lock's top edge, into a notch or a slot in
2328
- // whatever it locks, and half a turn back pulls it in. Pulling on what is
2329
- // locked only presses the bolt against its slot. The lock is three layers
2327
+ // throws its nose out past the lock's top edge, into a slot in whatever it
2328
+ // locks, and half a turn back pulls it in. A bolt only holds against a pull
2329
+ // across its travel: set the lock so the bolt moves across the way the
2330
+ // locked part opens (sideways for a lid that lifts), and give the slot
2331
+ // wood on the side the part pulls from (a pocket, not a notch open that
2332
+ // way), so pulling presses the bolt against it. The lock is three layers
2330
2333
  // of the current material: a base with the cam's hub, a frame with the
2331
2334
  // cam and the bolt, and a plate with the keyhole.
2332
2335
  //
@@ -2339,7 +2342,7 @@ function link_angle(a, b) = atan2(b[1] - a[1], b[0] - a[0]);
2339
2342
  function lock_bounds(throw = 7) = let (d = lock_dims(throw))
2340
2343
  [-d[6] / 2, d[8], d[6] / 2, d[7]];
2341
2344
 
2342
- // Where the bolt's nose is: [width, y of its tip when locked]. Cut a notch
2345
+ // Where the bolt's nose is: [width, y of its tip when locked]. Cut a pocket
2343
2346
  // a little wider than this where it goes.
2344
2347
  function lock_nose(throw = 7) = let (d = lock_dims(throw)) [d[4], d[7] + d[5]];
2345
2348
 
package/docs/3d-files.md CHANGED
@@ -55,11 +55,11 @@ stack with a part bent on a living hinge is laid out part by part, flat.
55
55
 
56
56
  ## Formats
57
57
 
58
- | File | Units | Holds |
59
- | ------ | ------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
60
- | `.glb` | metres, y up (glTF) | a node and mesh for each body, with materials named after the sheet material or layer; each node's `extras` give its `kind` (part, mark, hardware), `part` and `copy` |
61
- | `.3mf` | millimetres, z up | each part one object, with its engraving and scoring as coloured parts of it, so a slicer prints each in its own colour |
62
- | `.stl` | millimetres, z up | every body in one mesh, without colours |
58
+ | File | Units | Holds |
59
+ | ------ | ------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
60
+ | `.glb` | metres, y up (glTF) | a node and mesh for each body, with materials named after the sheet material or layer; each node's `extras` give its `kind` (part, mark, hardware), `part` and `copy` |
61
+ | `.3mf` | millimetres, z up | each part one object, with its engraving and scoring as coloured parts of it, so a slicer prints each in its own colour; each colour is its own filament in OrcaSlicer, Bambu Studio and the slicers based on them |
62
+ | `.stl` | millimetres, z up | every body in one mesh, without colours |
63
63
 
64
64
  A GLB of the assembled model carries its lights (tealights, LEDs, bulbs
65
65
  and `light()`) as point lights (`KHR_lights_punctual`), each with its
package/docs/library.md CHANGED
@@ -819,10 +819,16 @@ The sector's `[outer radius, inner radius, angle, slant length]`.
819
819
 
820
820
  A lock with a key, for boxes, diaries and money boxes. A flat key turns an
821
821
  eccentric cam that slides a bolt; half a turn throws its nose out past the
822
- lock's top edge into a notch in whatever it locks. It is three layers of
822
+ lock's top edge into a slot in whatever it locks. It is three layers of
823
823
  the current material: a base, a frame with the cam and the bolt, and a
824
824
  plate with the keyhole.
825
825
 
826
+ A bolt only holds against a pull across its travel. Set the lock so the
827
+ bolt moves across the way the locked part opens, sideways for a lid that
828
+ lifts, and cut the slot as a pocket with wood on the side the part pulls
829
+ from, not a notch open that way. `examples/lock-box.kerf` shows both: the
830
+ bolt slides sideways into a pocket in a keeper under the lid.
831
+
826
832
  ### `cam_lock(throw = 7, locked = true, name = "Lock", key = true, ring = true)`
827
833
 
828
834
  The lock's parts, lying flat with the key's axis on the z axis and the
@@ -833,7 +839,7 @@ cover. `throw` is how far the bolt moves; `locked` shows it thrown;
833
839
  ### `lock_bounds(throw = 7)`, `lock_nose(throw = 7)`
834
840
 
835
841
  The lock's outline as `[x0, y0, x1, y1]` round the key's axis, and the
836
- bolt's nose as `[width, y of its tip when locked]`: cut a notch a little
842
+ bolt's nose as `[width, y of its tip when locked]`: cut a pocket a little
837
843
  wider than the nose where it goes.
838
844
 
839
845
  ### `lock_key(t = $thickness, ws = 5)`, `lock_dims(throw)`
package/docs/versions.md CHANGED
@@ -1,6 +1,6 @@
1
1
  # Versions
2
2
 
3
- KerfScript 0.11.0 implements language version 0.3. The package version tracks
3
+ KerfScript 0.11.1 implements language version 0.3. The package version tracks
4
4
  the software release; the language version tracks the syntax and behavior
5
5
  of `.kerf` programs.
6
6
 
@@ -30,4 +30,4 @@ files used with a design. Applications that store designs should retain
30
30
  that information and compare the output before upgrading the interpreter.
31
31
 
32
32
  Pin the npm package to an exact version when your application needs a fixed
33
- renderer, for example `@mylasertools/kerfscript@0.11.0`.
33
+ renderer, for example `@mylasertools/kerfscript@0.11.1`.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@mylasertools/kerfscript",
3
- "version": "0.11.0",
3
+ "version": "0.11.1",
4
4
  "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.",
5
5
  "type": "module",
6
6
  "license": "AGPL-3.0-only",