@mylasertools/kerfscript 0.6.0 → 0.8.0
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/CHANGELOG.md +201 -1
- package/LANGUAGE.md +169 -30
- package/README.md +8 -2
- package/THIRD-PARTY-NOTICES.md +113 -0
- package/dist/analysis.d.cts +20 -0
- package/dist/analysis.d.ts +20 -0
- package/dist/assembly.d.cts +28 -1
- package/dist/assembly.d.ts +28 -1
- package/dist/ast.d.cts +9 -0
- package/dist/ast.d.ts +9 -0
- package/dist/cli.js +10333 -4650
- package/dist/diff.d.cts +18 -0
- package/dist/diff.d.ts +18 -0
- package/dist/evaluator.d.cts +34 -0
- package/dist/evaluator.d.ts +34 -0
- package/dist/functions.d.cts +1 -0
- package/dist/functions.d.ts +1 -0
- package/dist/geometry.d.cts +22 -0
- package/dist/geometry.d.ts +22 -0
- package/dist/hardware.d.cts +13 -0
- package/dist/hardware.d.ts +13 -0
- package/dist/highlight.cjs +2 -2
- package/dist/highlight.js +2 -2
- package/dist/index.cjs +2278 -52
- package/dist/index.d.cts +11 -2
- package/dist/index.d.ts +11 -2
- package/dist/index.js +2278 -52
- package/dist/instructions.d.cts +3 -0
- package/dist/instructions.d.ts +3 -0
- package/dist/language.cjs +2235 -50
- package/dist/language.js +2235 -50
- package/dist/libraries.cjs +2211 -26
- package/dist/libraries.d.cts +3 -0
- package/dist/libraries.d.ts +3 -0
- package/dist/libraries.js +2211 -26
- package/dist/png.d.cts +9 -0
- package/dist/png.d.ts +9 -0
- package/dist/render.d.cts +22 -1
- package/dist/render.d.ts +22 -1
- package/dist/signatures.cjs +269 -11
- package/dist/signatures.js +269 -11
- package/dist/slots.d.cts +8 -0
- package/dist/slots.d.ts +8 -0
- package/dist/values.d.cts +6 -1
- package/dist/values.d.ts +6 -1
- package/dist/verify/command.d.cts +1 -0
- package/dist/verify/command.d.ts +1 -0
- package/dist/verify/geometry.d.cts +25 -0
- package/dist/verify/geometry.d.ts +25 -0
- package/dist/verify/index.d.cts +10 -0
- package/dist/verify/index.d.ts +10 -0
- package/dist/verify/joints.d.cts +7 -0
- package/dist/verify/joints.d.ts +7 -0
- package/dist/verify/mechanics.d.cts +11 -0
- package/dist/verify/mechanics.d.ts +11 -0
- package/dist/verify/motion.d.cts +8 -0
- package/dist/verify/motion.d.ts +8 -0
- package/dist/verify/pose.d.cts +5 -0
- package/dist/verify/pose.d.ts +5 -0
- package/dist/verify/relations.d.cts +8 -0
- package/dist/verify/relations.d.ts +8 -0
- package/dist/verify/snapshot.d.cts +11 -0
- package/dist/verify/snapshot.d.ts +11 -0
- package/dist/verify/solids.d.cts +40 -0
- package/dist/verify/solids.d.ts +40 -0
- package/dist/verify/spec.d.cts +9 -0
- package/dist/verify/spec.d.ts +9 -0
- package/dist/verify/summary.d.cts +17 -0
- package/dist/verify/summary.d.ts +17 -0
- package/dist/verify/types.d.cts +301 -0
- package/dist/verify/types.d.ts +301 -0
- package/docs/cli.md +87 -15
- package/docs/javascript.md +57 -25
- package/docs/layers.md +42 -2
- package/docs/library.md +501 -3
- package/docs/parts-and-sheets.md +199 -1
- package/docs/shared-libraries.md +8 -1
- package/docs/specification.md +78 -23
- package/docs/verification.md +363 -0
- package/docs/versions.md +2 -2
- package/package.json +2 -1
- package/dist/import/dbg.d.cts +0 -1
- package/dist/import/dbg.d.ts +0 -1
package/dist/signatures.js
CHANGED
|
@@ -36,7 +36,8 @@ var text = (name, doc) => ({
|
|
|
36
36
|
p("font", "Font name", "$font"),
|
|
37
37
|
named("halign", "left, center or right", '"left"'),
|
|
38
38
|
named("valign", "baseline, top, center or bottom", '"baseline"'),
|
|
39
|
-
named("spacing", "Letter spacing factor", "1")
|
|
39
|
+
named("spacing", "Letter spacing factor", "1"),
|
|
40
|
+
named("fit", "Measure at the size that fits this width")
|
|
40
41
|
],
|
|
41
42
|
section: "Text measurements",
|
|
42
43
|
doc
|
|
@@ -112,7 +113,8 @@ var SIGNATURES = [
|
|
|
112
113
|
kind: "module",
|
|
113
114
|
params: [
|
|
114
115
|
p("d", 'SVG path data, as "M0 0 L10 0 L5 8 Z"'),
|
|
115
|
-
named("fill", '"evenodd" or "nonzero"', '"evenodd"')
|
|
116
|
+
named("fill", '"evenodd" or "nonzero"', '"evenodd"'),
|
|
117
|
+
named("close", "Close every open subpath into an area", "false")
|
|
116
118
|
],
|
|
117
119
|
section: "Shapes",
|
|
118
120
|
doc: "Shapes from SVG path data: closed subpaths become areas, open ones lines"
|
|
@@ -126,7 +128,8 @@ var SIGNATURES = [
|
|
|
126
128
|
p("font", "Font name", "$font"),
|
|
127
129
|
named("halign", "left, center or right", '"left"'),
|
|
128
130
|
named("valign", "baseline, top, center or bottom", '"baseline"'),
|
|
129
|
-
named("spacing", "Letter spacing factor", "1")
|
|
131
|
+
named("spacing", "Letter spacing factor", "1"),
|
|
132
|
+
named("fit", "Shrink the size so the text is no wider than this")
|
|
130
133
|
],
|
|
131
134
|
section: "Shapes",
|
|
132
135
|
doc: "Text as shapes; the font must be available to the renderer"
|
|
@@ -134,9 +137,13 @@ var SIGNATURES = [
|
|
|
134
137
|
{
|
|
135
138
|
name: "line",
|
|
136
139
|
kind: "module",
|
|
137
|
-
params: [
|
|
140
|
+
params: [
|
|
141
|
+
p("from", "Start point", "[0, 0]"),
|
|
142
|
+
p("to", "End point", "[10, 0]"),
|
|
143
|
+
p("width", "Make a strip this wide, an area, instead of a line")
|
|
144
|
+
],
|
|
138
145
|
section: "Shapes",
|
|
139
|
-
doc: "A straight line,
|
|
146
|
+
doc: "A straight line, or with a width a strip between the points"
|
|
140
147
|
},
|
|
141
148
|
{
|
|
142
149
|
name: "polyline",
|
|
@@ -256,6 +263,73 @@ var SIGNATURES = [
|
|
|
256
263
|
section: "Combining",
|
|
257
264
|
doc: "Grow or shrink the areas of the children"
|
|
258
265
|
},
|
|
266
|
+
{
|
|
267
|
+
name: "pattern",
|
|
268
|
+
kind: "module",
|
|
269
|
+
params: [
|
|
270
|
+
p("spacing", "Distance between copies, a number or [x, y]", "10"),
|
|
271
|
+
p("stagger", "Shift of every other row, as a share of the x spacing", "0")
|
|
272
|
+
],
|
|
273
|
+
children: true,
|
|
274
|
+
section: "Combining",
|
|
275
|
+
doc: "Repeat the first child over the area of the others, clipping copies at its edge"
|
|
276
|
+
},
|
|
277
|
+
{
|
|
278
|
+
name: "spline",
|
|
279
|
+
kind: "module",
|
|
280
|
+
params: [
|
|
281
|
+
p("points", "The [x, y] points the curve goes through"),
|
|
282
|
+
p("width", "Make an area this wide along the curve, instead of a line"),
|
|
283
|
+
named("steps", "Points between each two given ones", "8"),
|
|
284
|
+
named("closed", "Join the curve back to its start", "false")
|
|
285
|
+
],
|
|
286
|
+
section: "Shapes",
|
|
287
|
+
doc: "A smooth curve through points: a line, or with a width an area"
|
|
288
|
+
},
|
|
289
|
+
{
|
|
290
|
+
name: "hatch",
|
|
291
|
+
kind: "module",
|
|
292
|
+
params: [
|
|
293
|
+
p("angle", "Direction of the lines, in degrees from +x", "45"),
|
|
294
|
+
p("pitch", "Distance between the lines", "5"),
|
|
295
|
+
p("width", "Make stripes this wide, areas, instead of lines")
|
|
296
|
+
],
|
|
297
|
+
children: true,
|
|
298
|
+
section: "Combining",
|
|
299
|
+
doc: "Parallel lines or stripes across the area of the children"
|
|
300
|
+
},
|
|
301
|
+
{
|
|
302
|
+
name: "paint",
|
|
303
|
+
kind: "module",
|
|
304
|
+
params: [p("layers", 'A layer for each child; "" leaves that child out')],
|
|
305
|
+
children: true,
|
|
306
|
+
section: "Combining",
|
|
307
|
+
doc: "Painter's order: each child loses the area of the children after it"
|
|
308
|
+
},
|
|
309
|
+
{
|
|
310
|
+
name: "measure",
|
|
311
|
+
kind: "module",
|
|
312
|
+
params: [p("draw", "Draw the first child too", "false")],
|
|
313
|
+
children: true,
|
|
314
|
+
section: "Combining",
|
|
315
|
+
doc: "Set $bounds = [x0, y0, x1, y1], $area and $centroid = [x, y] of the first child for the children after it"
|
|
316
|
+
},
|
|
317
|
+
{
|
|
318
|
+
name: "fill_holes",
|
|
319
|
+
kind: "module",
|
|
320
|
+
params: [p("min_area", "Fill only holes smaller than this many square millimetres")],
|
|
321
|
+
children: true,
|
|
322
|
+
section: "Combining",
|
|
323
|
+
doc: "Fill the holes in the areas of the children"
|
|
324
|
+
},
|
|
325
|
+
{
|
|
326
|
+
name: "close",
|
|
327
|
+
kind: "module",
|
|
328
|
+
params: [p("r", "Close gaps and notches narrower than twice this", "0.5")],
|
|
329
|
+
children: true,
|
|
330
|
+
section: "Combining",
|
|
331
|
+
doc: "Close narrow gaps between and in the areas of the children"
|
|
332
|
+
},
|
|
259
333
|
{
|
|
260
334
|
name: "stroke",
|
|
261
335
|
kind: "module",
|
|
@@ -284,7 +358,13 @@ var SIGNATURES = [
|
|
|
284
358
|
{
|
|
285
359
|
name: "score",
|
|
286
360
|
kind: "module",
|
|
287
|
-
params: [
|
|
361
|
+
params: [
|
|
362
|
+
p(
|
|
363
|
+
"side",
|
|
364
|
+
'"front", or "back" for the face underneath, made after turning the part over',
|
|
365
|
+
'"front"'
|
|
366
|
+
)
|
|
367
|
+
],
|
|
288
368
|
children: true,
|
|
289
369
|
section: "Layers",
|
|
290
370
|
doc: "Put the children on the score layer: lines marked without cutting through"
|
|
@@ -292,7 +372,13 @@ var SIGNATURES = [
|
|
|
292
372
|
{
|
|
293
373
|
name: "engrave",
|
|
294
374
|
kind: "module",
|
|
295
|
-
params: [
|
|
375
|
+
params: [
|
|
376
|
+
p(
|
|
377
|
+
"side",
|
|
378
|
+
'"front", or "back" for the face underneath, made after turning the part over',
|
|
379
|
+
'"front"'
|
|
380
|
+
)
|
|
381
|
+
],
|
|
296
382
|
children: true,
|
|
297
383
|
section: "Layers",
|
|
298
384
|
doc: "Put the children on the engrave layer: areas filled in"
|
|
@@ -311,7 +397,14 @@ var SIGNATURES = [
|
|
|
311
397
|
params: [
|
|
312
398
|
p("name", "Layer name"),
|
|
313
399
|
p("mode", '"cut", "line", "fill" or "guide"'),
|
|
314
|
-
p("color", 'Colour in the output, as "#00aa00"')
|
|
400
|
+
p("color", 'Colour in the output, as "#00aa00"'),
|
|
401
|
+
named("order", "Where it goes among the custom layers in the files, lowest first", "0"),
|
|
402
|
+
named("bleed", "How far past the part's edge it may print", "0"),
|
|
403
|
+
named(
|
|
404
|
+
"side",
|
|
405
|
+
'"front", or "back" for the face underneath, made after turning the part over',
|
|
406
|
+
'"front"'
|
|
407
|
+
)
|
|
315
408
|
],
|
|
316
409
|
children: true,
|
|
317
410
|
section: "Layers",
|
|
@@ -324,12 +417,72 @@ var SIGNATURES = [
|
|
|
324
417
|
p("name", "Part name", '"part"'),
|
|
325
418
|
p("qty", "Number of copies to cut", "1"),
|
|
326
419
|
named("at", "Where the part goes in the assembled view, [x, y, z]"),
|
|
327
|
-
named("rotate", "How the part is turned in the assembled view, [x, y, z] in degrees")
|
|
420
|
+
named("rotate", "How the part is turned in the assembled view, [x, y, z] in degrees"),
|
|
421
|
+
named("stack", "Layers glued in a stack at each placement, one thickness apart", "1"),
|
|
422
|
+
named("mirror", "Cut the part mirrored left to right, its text still reading", "false"),
|
|
423
|
+
named("material", "The material it is cut from, as material(name = ...) sets it"),
|
|
424
|
+
named("bend", "Living hinge bends in the assembled view: [x0, x1, angle] or a list"),
|
|
425
|
+
named("on", "The name of a bent part this one is glued to, to move with it"),
|
|
426
|
+
named("slots", "Names of parts whose tabs pass through this one: their slots are cut"),
|
|
427
|
+
named("clearance", "Added to the slots, in total across each", "0.1"),
|
|
428
|
+
named(
|
|
429
|
+
"glue",
|
|
430
|
+
"The name of a part this one is glued flat onto; at and rotate are then on its face"
|
|
431
|
+
),
|
|
432
|
+
named("face", 'The face of the glue part it goes on: "top" or "bottom"', '"top"')
|
|
328
433
|
],
|
|
329
434
|
children: true,
|
|
330
435
|
section: "Parts and sheets",
|
|
331
436
|
doc: "A named part, with its thickness, kerf and material"
|
|
332
437
|
},
|
|
438
|
+
{
|
|
439
|
+
name: "place",
|
|
440
|
+
kind: "module",
|
|
441
|
+
params: [
|
|
442
|
+
p("at", "Where the parts inside go, [x, y, z]", "[0, 0, 0]"),
|
|
443
|
+
p("rotate", "How they are turned, [x, y, z] in degrees", "[0, 0, 0]")
|
|
444
|
+
],
|
|
445
|
+
children: true,
|
|
446
|
+
section: "Parts and sheets",
|
|
447
|
+
doc: "Place the parts inside in the assembled view, with their own placements inside this one"
|
|
448
|
+
},
|
|
449
|
+
{
|
|
450
|
+
name: "call",
|
|
451
|
+
kind: "module",
|
|
452
|
+
params: [p("name", 'The name of a module, as "roses"')],
|
|
453
|
+
rest: true,
|
|
454
|
+
children: true,
|
|
455
|
+
section: "Other",
|
|
456
|
+
doc: "Calls the module of that name with the other arguments and the children, so a table can carry which module draws each entry"
|
|
457
|
+
},
|
|
458
|
+
{
|
|
459
|
+
name: "step",
|
|
460
|
+
kind: "module",
|
|
461
|
+
params: [
|
|
462
|
+
p("text", "What to do in this step", '""'),
|
|
463
|
+
p("substeps", "Steps inside it become its sub-steps; false adds them to this one", "true")
|
|
464
|
+
],
|
|
465
|
+
children: true,
|
|
466
|
+
section: "Parts and sheets",
|
|
467
|
+
doc: 'An assembly step: the parts and hardware inside are added in it, in order. A step inside a step is a sub-step, named "outer: inner"'
|
|
468
|
+
},
|
|
469
|
+
{
|
|
470
|
+
name: "hardware",
|
|
471
|
+
kind: "module",
|
|
472
|
+
params: [
|
|
473
|
+
p("kind", 'What it is, as "dowel", "screw", "magnet", "elastic" or "paper"', '"dowel"'),
|
|
474
|
+
p("from", "One end, [x, y, z]; a ball sits midway between from and to"),
|
|
475
|
+
p("to", "The other end, [x, y, z]; a ball may leave it out"),
|
|
476
|
+
p("size", "Diameter, or [width, height] for a flat section", "6"),
|
|
477
|
+
named("up", "The direction a [width, height] section's height points"),
|
|
478
|
+
named("sides", "Sides of a round section in the 3D view; 0 makes a ball", "24"),
|
|
479
|
+
named("shape", '"rod", or "ball" for a bulb, a marble or a bead', '"rod"'),
|
|
480
|
+
named("label", "The name in the hardware list")
|
|
481
|
+
],
|
|
482
|
+
children: true,
|
|
483
|
+
section: "Parts and sheets",
|
|
484
|
+
doc: "Hardware the assembly needs, in the parts list and the 3D view"
|
|
485
|
+
},
|
|
333
486
|
{
|
|
334
487
|
name: "material",
|
|
335
488
|
kind: "module",
|
|
@@ -480,6 +633,18 @@ var SIGNATURES = [
|
|
|
480
633
|
section: "Numbers and vectors",
|
|
481
634
|
doc: "Interpolate between numbers or vectors"
|
|
482
635
|
},
|
|
636
|
+
{
|
|
637
|
+
name: "train_for",
|
|
638
|
+
kind: "function",
|
|
639
|
+
params: [
|
|
640
|
+
p("ratio", "Turns in for one turn out; under 1 speeds up"),
|
|
641
|
+
p("stages", "Pairs of gears, 1 to 3", "2"),
|
|
642
|
+
p("pinion", "Fewest and most teeth of the small gears", "[10, 20]"),
|
|
643
|
+
p("wheel", "Fewest and most teeth of the big gears", "[20, 80]")
|
|
644
|
+
],
|
|
645
|
+
section: "Numbers and vectors",
|
|
646
|
+
doc: "Tooth counts for a gear train nearest a ratio: {stages = [[driver, driven], ...], ratio, error}"
|
|
647
|
+
},
|
|
483
648
|
{
|
|
484
649
|
name: "norm",
|
|
485
650
|
kind: "function",
|
|
@@ -494,13 +659,105 @@ var SIGNATURES = [
|
|
|
494
659
|
section: "Numbers and vectors",
|
|
495
660
|
doc: "Cross product: a number for 2D vectors, a vector for 3D ones"
|
|
496
661
|
},
|
|
662
|
+
// Paths and 3D rotations
|
|
663
|
+
{
|
|
664
|
+
name: "path_length",
|
|
665
|
+
kind: "function",
|
|
666
|
+
params: [p("points", "A list of [x, y] points")],
|
|
667
|
+
section: "Paths and rotations",
|
|
668
|
+
doc: "The length of the lines through a list of points"
|
|
669
|
+
},
|
|
670
|
+
{
|
|
671
|
+
name: "offset_path",
|
|
672
|
+
kind: "function",
|
|
673
|
+
params: [
|
|
674
|
+
p("points", "A list of [x, y] points"),
|
|
675
|
+
p("d", "How far to move it: to the left going along it, or the right when less than 0"),
|
|
676
|
+
p("closed", "The path goes round, its last point joined to its first", "false")
|
|
677
|
+
],
|
|
678
|
+
section: "Paths and rotations",
|
|
679
|
+
doc: "The path moved sideways, each corner mitred: the two edges of a strip along a curve"
|
|
680
|
+
},
|
|
681
|
+
{
|
|
682
|
+
name: "point_at",
|
|
683
|
+
kind: "function",
|
|
684
|
+
params: [p("points", "A list of [x, y] points"), p("s", "Distance along the path")],
|
|
685
|
+
section: "Paths and rotations",
|
|
686
|
+
doc: "The point a distance along a path; past either end it carries on straight"
|
|
687
|
+
},
|
|
688
|
+
{
|
|
689
|
+
name: "heading_at",
|
|
690
|
+
kind: "function",
|
|
691
|
+
params: [p("points", "A list of [x, y] points"), p("s", "Distance along the path")],
|
|
692
|
+
section: "Paths and rotations",
|
|
693
|
+
doc: "The direction of a path a distance along it, in degrees from +x"
|
|
694
|
+
},
|
|
695
|
+
{
|
|
696
|
+
name: "path_points",
|
|
697
|
+
kind: "function",
|
|
698
|
+
params: [
|
|
699
|
+
p("d", 'SVG path data, as "M0 0 L10 0 A5 5 0 0 1 20 0"'),
|
|
700
|
+
p("tolerance", "How far curves may stray from their points", "0.05")
|
|
701
|
+
],
|
|
702
|
+
section: "Paths and rotations",
|
|
703
|
+
doc: "The points of SVG path data: one list of points for each subpath"
|
|
704
|
+
},
|
|
705
|
+
{
|
|
706
|
+
name: "spline_points",
|
|
707
|
+
kind: "function",
|
|
708
|
+
params: [
|
|
709
|
+
p("points", "The [x, y] points the curve goes through"),
|
|
710
|
+
p("steps", "Points between each two given ones", "8"),
|
|
711
|
+
p("closed", "Join the curve back to its start", "false")
|
|
712
|
+
],
|
|
713
|
+
section: "Paths and rotations",
|
|
714
|
+
doc: "The points of a smooth curve through points, as spline() draws it"
|
|
715
|
+
},
|
|
716
|
+
{
|
|
717
|
+
name: "rotation",
|
|
718
|
+
kind: "function",
|
|
719
|
+
params: [p("angles", "[x, y, z] in degrees, as part() turns")],
|
|
720
|
+
section: "Paths and rotations",
|
|
721
|
+
doc: "The 3x3 matrix of a rotation; matrices multiply with *"
|
|
722
|
+
},
|
|
723
|
+
{
|
|
724
|
+
name: "euler",
|
|
725
|
+
kind: "function",
|
|
726
|
+
params: [p("matrix", "A 3x3 rotation matrix")],
|
|
727
|
+
section: "Paths and rotations",
|
|
728
|
+
doc: "The [x, y, z] angles of a rotation matrix, for part()'s rotate"
|
|
729
|
+
},
|
|
730
|
+
{
|
|
731
|
+
name: "orient",
|
|
732
|
+
kind: "function",
|
|
733
|
+
params: [
|
|
734
|
+
p("x", "Where the part's own x axis points"),
|
|
735
|
+
p("z", "Where its z axis, out of its top face, points", "[0, 0, 1]")
|
|
736
|
+
],
|
|
737
|
+
section: "Paths and rotations",
|
|
738
|
+
doc: "The rotate angles that turn a part's x and z axes onto two directions"
|
|
739
|
+
},
|
|
497
740
|
// Lists and strings
|
|
498
741
|
{
|
|
499
742
|
name: "len",
|
|
500
743
|
kind: "function",
|
|
501
744
|
params: value,
|
|
502
745
|
section: "Lists and strings",
|
|
503
|
-
doc: "Number of items in a list or
|
|
746
|
+
doc: "Number of items in a list, characters in a string or fields in a record"
|
|
747
|
+
},
|
|
748
|
+
{
|
|
749
|
+
name: "keys",
|
|
750
|
+
kind: "function",
|
|
751
|
+
params: [p("record", "A record, as {name = value}")],
|
|
752
|
+
section: "Lists and strings",
|
|
753
|
+
doc: "A record's field names, in the order they were written"
|
|
754
|
+
},
|
|
755
|
+
{
|
|
756
|
+
name: "merge",
|
|
757
|
+
kind: "function",
|
|
758
|
+
params: [p("a", "A record"), p("b", "A record whose fields add to or replace those of a")],
|
|
759
|
+
section: "Lists and strings",
|
|
760
|
+
doc: "A record with the fields of a and b, b winning where both have one"
|
|
504
761
|
},
|
|
505
762
|
{
|
|
506
763
|
name: "concat",
|
|
@@ -614,12 +871,13 @@ var SIGNATURES = [
|
|
|
614
871
|
is("is_list", "a list"),
|
|
615
872
|
is("is_undef", "undef"),
|
|
616
873
|
is("is_function", "a function"),
|
|
874
|
+
is("is_record", "a record, as {name = value}"),
|
|
617
875
|
{
|
|
618
876
|
name: "type_of",
|
|
619
877
|
kind: "function",
|
|
620
878
|
params: value,
|
|
621
879
|
section: "Types",
|
|
622
|
-
doc: "The type name: number, string, boolean, undef, list, range or
|
|
880
|
+
doc: "The type name: number, string, boolean, undef, list, range, function or record"
|
|
623
881
|
},
|
|
624
882
|
{
|
|
625
883
|
name: "rands",
|
package/dist/slots.d.cts
ADDED
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { type Poly } from './geometry.cjs';
|
|
2
|
+
export interface Solid {
|
|
3
|
+
matrix: number[];
|
|
4
|
+
thickness: number;
|
|
5
|
+
outline: Poly[];
|
|
6
|
+
}
|
|
7
|
+
export declare function crossSection(target: Solid, other: Solid): Poly[];
|
|
8
|
+
export declare function slotsFor(target: Solid, others: Solid[], clearance: number): Poly[];
|
package/dist/slots.d.ts
ADDED
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { type Poly } from './geometry.js';
|
|
2
|
+
export interface Solid {
|
|
3
|
+
matrix: number[];
|
|
4
|
+
thickness: number;
|
|
5
|
+
outline: Poly[];
|
|
6
|
+
}
|
|
7
|
+
export declare function crossSection(target: Solid, other: Solid): Poly[];
|
|
8
|
+
export declare function slotsFor(target: Solid, others: Solid[], clearance: number): Poly[];
|
package/dist/values.d.cts
CHANGED
|
@@ -12,10 +12,15 @@ export interface Closure {
|
|
|
12
12
|
scope: unknown;
|
|
13
13
|
name?: string;
|
|
14
14
|
}
|
|
15
|
-
export
|
|
15
|
+
export interface Rec {
|
|
16
|
+
type: 'record';
|
|
17
|
+
fields: Map<string, Value>;
|
|
18
|
+
}
|
|
19
|
+
export type Value = number | string | boolean | undefined | Value[] | Range | Closure | Rec;
|
|
16
20
|
export declare const isRange: (v: Value) => v is Range;
|
|
17
21
|
export declare const isFn: (v: Value) => v is Closure;
|
|
18
22
|
export declare const isNum: (v: Value) => v is number;
|
|
23
|
+
export declare const isRec: (v: Value) => v is Rec;
|
|
19
24
|
export declare const own: <T>(o: Record<string, T> | undefined, key: string) => T | undefined;
|
|
20
25
|
export declare function checkSetting(name: string, v: unknown, depth?: number): void;
|
|
21
26
|
export declare function rangeValues(r: Range, limit: number): number[];
|
package/dist/values.d.ts
CHANGED
|
@@ -12,10 +12,15 @@ export interface Closure {
|
|
|
12
12
|
scope: unknown;
|
|
13
13
|
name?: string;
|
|
14
14
|
}
|
|
15
|
-
export
|
|
15
|
+
export interface Rec {
|
|
16
|
+
type: 'record';
|
|
17
|
+
fields: Map<string, Value>;
|
|
18
|
+
}
|
|
19
|
+
export type Value = number | string | boolean | undefined | Value[] | Range | Closure | Rec;
|
|
16
20
|
export declare const isRange: (v: Value) => v is Range;
|
|
17
21
|
export declare const isFn: (v: Value) => v is Closure;
|
|
18
22
|
export declare const isNum: (v: Value) => v is number;
|
|
23
|
+
export declare const isRec: (v: Value) => v is Rec;
|
|
19
24
|
export declare const own: <T>(o: Record<string, T> | undefined, key: string) => T | undefined;
|
|
20
25
|
export declare function checkSetting(name: string, v: unknown, depth?: number): void;
|
|
21
26
|
export declare function rangeValues(r: Range, limit: number): number[];
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function verificationCommand(args: string[]): void;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function verificationCommand(args: string[]): void;
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import { type Vec3 } from '../assembly.cjs';
|
|
2
|
+
import { type Poly } from '../geometry.cjs';
|
|
3
|
+
import type { SnapshotPart } from './types.cjs';
|
|
4
|
+
export declare const EPS = 0.001;
|
|
5
|
+
export declare const dot: (a: Vec3, b: Vec3) => number;
|
|
6
|
+
export declare const sub: (a: Vec3, b: Vec3) => Vec3;
|
|
7
|
+
export declare const length: (a: Vec3) => number;
|
|
8
|
+
export declare const normal: (m: number[]) => Vec3;
|
|
9
|
+
export declare const apply: (m: number[], p: Vec3) => Vec3;
|
|
10
|
+
export declare const relative: (a: SnapshotPart, b: SnapshotPart) => number[];
|
|
11
|
+
export declare function signedArea(p: Poly): number;
|
|
12
|
+
export declare const netArea: (p: Poly[]) => number;
|
|
13
|
+
export declare const boundaryLength: (p: Poly[]) => number;
|
|
14
|
+
export declare function bounds(p: Poly[]): [number, number, number, number];
|
|
15
|
+
export declare const rectangle: ([x0, y0, x1, y1]: number[]) => Poly;
|
|
16
|
+
export declare function rectangular(p: Poly[]): boolean;
|
|
17
|
+
export declare const clipRectangle: (p: Poly[], b: number[]) => Poly[];
|
|
18
|
+
export declare function project(p: Poly[], m: number[], z?: number): Poly[];
|
|
19
|
+
export declare function inside(r: Poly, p: [number, number]): boolean;
|
|
20
|
+
export declare function pointSegment(p: [number, number], a: [number, number], b: [number, number]): number;
|
|
21
|
+
export declare function edgeDistance(a: Poly, b: Poly): number;
|
|
22
|
+
export declare const holesAt: (p: Poly[], at: [number, number]) => Poly[];
|
|
23
|
+
export declare function materialGuard(p: SnapshotPart): string | null;
|
|
24
|
+
export declare function orthogonal(m: number[]): boolean;
|
|
25
|
+
export declare function geometryEqual(a: SnapshotPart, b: SnapshotPart): boolean;
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import { type Vec3 } from '../assembly.js';
|
|
2
|
+
import { type Poly } from '../geometry.js';
|
|
3
|
+
import type { SnapshotPart } from './types.js';
|
|
4
|
+
export declare const EPS = 0.001;
|
|
5
|
+
export declare const dot: (a: Vec3, b: Vec3) => number;
|
|
6
|
+
export declare const sub: (a: Vec3, b: Vec3) => Vec3;
|
|
7
|
+
export declare const length: (a: Vec3) => number;
|
|
8
|
+
export declare const normal: (m: number[]) => Vec3;
|
|
9
|
+
export declare const apply: (m: number[], p: Vec3) => Vec3;
|
|
10
|
+
export declare const relative: (a: SnapshotPart, b: SnapshotPart) => number[];
|
|
11
|
+
export declare function signedArea(p: Poly): number;
|
|
12
|
+
export declare const netArea: (p: Poly[]) => number;
|
|
13
|
+
export declare const boundaryLength: (p: Poly[]) => number;
|
|
14
|
+
export declare function bounds(p: Poly[]): [number, number, number, number];
|
|
15
|
+
export declare const rectangle: ([x0, y0, x1, y1]: number[]) => Poly;
|
|
16
|
+
export declare function rectangular(p: Poly[]): boolean;
|
|
17
|
+
export declare const clipRectangle: (p: Poly[], b: number[]) => Poly[];
|
|
18
|
+
export declare function project(p: Poly[], m: number[], z?: number): Poly[];
|
|
19
|
+
export declare function inside(r: Poly, p: [number, number]): boolean;
|
|
20
|
+
export declare function pointSegment(p: [number, number], a: [number, number], b: [number, number]): number;
|
|
21
|
+
export declare function edgeDistance(a: Poly, b: Poly): number;
|
|
22
|
+
export declare const holesAt: (p: Poly[], at: [number, number]) => Poly[];
|
|
23
|
+
export declare function materialGuard(p: SnapshotPart): string | null;
|
|
24
|
+
export declare function orthogonal(m: number[]): boolean;
|
|
25
|
+
export declare function geometryEqual(a: SnapshotPart, b: SnapshotPart): boolean;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import type { VerificationReport, VerificationResult, VerificationSnapshot, VerificationSpec, VerifyLimits } from './types.cjs';
|
|
2
|
+
export { snapshotFromRender, type SnapshotContext } from './snapshot.cjs';
|
|
3
|
+
export { poseAssembly } from './pose.cjs';
|
|
4
|
+
export type * from './types.cjs';
|
|
5
|
+
/** Compare an archived report with freshly captured input fingerprints and the
|
|
6
|
+
* complete current requirements. Callers must hash the actual loaded bytes. */
|
|
7
|
+
export declare function verificationIsCurrent(report: VerificationReport, specification: VerificationSpec, snapshots: VerificationSnapshot[]): boolean;
|
|
8
|
+
/** Verify declarative requirements against captured geometry. This function does
|
|
9
|
+
* no rendering, filesystem access or execution of expressions in a specification. */
|
|
10
|
+
export declare function verify(input: unknown, inputs: unknown, limits?: VerifyLimits): VerificationResult;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import type { VerificationReport, VerificationResult, VerificationSnapshot, VerificationSpec, VerifyLimits } from './types.js';
|
|
2
|
+
export { snapshotFromRender, type SnapshotContext } from './snapshot.js';
|
|
3
|
+
export { poseAssembly } from './pose.js';
|
|
4
|
+
export type * from './types.js';
|
|
5
|
+
/** Compare an archived report with freshly captured input fingerprints and the
|
|
6
|
+
* complete current requirements. Callers must hash the actual loaded bytes. */
|
|
7
|
+
export declare function verificationIsCurrent(report: VerificationReport, specification: VerificationSpec, snapshots: VerificationSnapshot[]): boolean;
|
|
8
|
+
/** Verify declarative requirements against captured geometry. This function does
|
|
9
|
+
* no rendering, filesystem access or execution of expressions in a specification. */
|
|
10
|
+
export declare function verify(input: unknown, inputs: unknown, limits?: VerifyLimits): VerificationResult;
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import type { CapturedShaftClaim, ClaimResult, GlueContactClaim, TabSlotClaim, VerificationSnapshot, VerificationSpec } from './types.cjs';
|
|
2
|
+
type Check = Pick<ClaimResult, 'status' | 'code' | 'message'> & Partial<Pick<ClaimResult, 'measurements' | 'assumptions' | 'coverage'>>;
|
|
3
|
+
export declare const unknown: (message: string) => Check;
|
|
4
|
+
export declare function glueContact(c: GlueContactClaim, s: VerificationSnapshot): Check;
|
|
5
|
+
export declare function tabSlot(c: TabSlotClaim, s: VerificationSnapshot, spec: VerificationSpec): Check;
|
|
6
|
+
export declare function capturedShaft(c: CapturedShaftClaim, s: VerificationSnapshot, spec: VerificationSpec): Check;
|
|
7
|
+
export {};
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import type { CapturedShaftClaim, ClaimResult, GlueContactClaim, TabSlotClaim, VerificationSnapshot, VerificationSpec } from './types.js';
|
|
2
|
+
type Check = Pick<ClaimResult, 'status' | 'code' | 'message'> & Partial<Pick<ClaimResult, 'measurements' | 'assumptions' | 'coverage'>>;
|
|
3
|
+
export declare const unknown: (message: string) => Check;
|
|
4
|
+
export declare function glueContact(c: GlueContactClaim, s: VerificationSnapshot): Check;
|
|
5
|
+
export declare function tabSlot(c: TabSlotClaim, s: VerificationSnapshot, spec: VerificationSpec): Check;
|
|
6
|
+
export declare function capturedShaft(c: CapturedShaftClaim, s: VerificationSnapshot, spec: VerificationSpec): Check;
|
|
7
|
+
export {};
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { WorkBudget } from './solids.cjs';
|
|
2
|
+
import type { AssemblySupportClaim, ClaimResult, JointClaim, MotionClaim, RetentionClaim, StabilityClaim, VerificationSnapshot, VerificationSpec } from './types.cjs';
|
|
3
|
+
type Check = Partial<ClaimResult>;
|
|
4
|
+
export declare function retention(c: RetentionClaim, s: VerificationSnapshot, spec: VerificationSpec, results: ClaimResult[]): Check;
|
|
5
|
+
export declare function stability(c: StabilityClaim, s: VerificationSnapshot, budget: WorkBudget, results?: ClaimResult[], spec?: VerificationSpec): Check;
|
|
6
|
+
export declare function assemblySupport(c: AssemblySupportClaim, s: VerificationSnapshot, spec: VerificationSpec, results: ClaimResult[]): Check;
|
|
7
|
+
export declare function jointConstraints(c: JointClaim, s: VerificationSnapshot, reference: VerificationSnapshot, budget: WorkBudget, spec?: VerificationSpec, results?: ClaimResult[]): Check;
|
|
8
|
+
/** Algebraic trajectory checks for ideal joint trees. Closed linkage solving and
|
|
9
|
+
* contact forces cannot be inferred from an authored animation. */
|
|
10
|
+
export declare function continuousJoints(m: MotionClaim, c: JointClaim, s: VerificationSnapshot, reference: VerificationSnapshot): Check;
|
|
11
|
+
export {};
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { WorkBudget } from './solids.js';
|
|
2
|
+
import type { AssemblySupportClaim, ClaimResult, JointClaim, MotionClaim, RetentionClaim, StabilityClaim, VerificationSnapshot, VerificationSpec } from './types.js';
|
|
3
|
+
type Check = Partial<ClaimResult>;
|
|
4
|
+
export declare function retention(c: RetentionClaim, s: VerificationSnapshot, spec: VerificationSpec, results: ClaimResult[]): Check;
|
|
5
|
+
export declare function stability(c: StabilityClaim, s: VerificationSnapshot, budget: WorkBudget, results?: ClaimResult[], spec?: VerificationSpec): Check;
|
|
6
|
+
export declare function assemblySupport(c: AssemblySupportClaim, s: VerificationSnapshot, spec: VerificationSpec, results: ClaimResult[]): Check;
|
|
7
|
+
export declare function jointConstraints(c: JointClaim, s: VerificationSnapshot, reference: VerificationSnapshot, budget: WorkBudget, spec?: VerificationSpec, results?: ClaimResult[]): Check;
|
|
8
|
+
/** Algebraic trajectory checks for ideal joint trees. Closed linkage solving and
|
|
9
|
+
* contact forces cannot be inferred from an authored animation. */
|
|
10
|
+
export declare function continuousJoints(m: MotionClaim, c: JointClaim, s: VerificationSnapshot, reference: VerificationSnapshot): Check;
|
|
11
|
+
export {};
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { WorkBudget } from './solids.cjs';
|
|
2
|
+
import { type FixedPair } from './relations.cjs';
|
|
3
|
+
import type { AssemblyClaim, ClaimResult, ClearanceClaim, MotionClaim, VerificationSnapshot } from './types.cjs';
|
|
4
|
+
type Check = Partial<ClaimResult>;
|
|
5
|
+
export declare function rigidClearance(c: ClearanceClaim, s: VerificationSnapshot, budget: WorkBudget): Check;
|
|
6
|
+
export declare function motionClearance(c: MotionClaim, from: VerificationSnapshot, to: VerificationSnapshot, budget: WorkBudget, installed?: FixedPair[]): Check;
|
|
7
|
+
export declare function assemblyAccess(c: AssemblyClaim, s: VerificationSnapshot, budget: WorkBudget): Check;
|
|
8
|
+
export {};
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { WorkBudget } from './solids.js';
|
|
2
|
+
import { type FixedPair } from './relations.js';
|
|
3
|
+
import type { AssemblyClaim, ClaimResult, ClearanceClaim, MotionClaim, VerificationSnapshot } from './types.js';
|
|
4
|
+
type Check = Partial<ClaimResult>;
|
|
5
|
+
export declare function rigidClearance(c: ClearanceClaim, s: VerificationSnapshot, budget: WorkBudget): Check;
|
|
6
|
+
export declare function motionClearance(c: MotionClaim, from: VerificationSnapshot, to: VerificationSnapshot, budget: WorkBudget, installed?: FixedPair[]): Check;
|
|
7
|
+
export declare function assemblyAccess(c: AssemblyClaim, s: VerificationSnapshot, budget: WorkBudget): Check;
|
|
8
|
+
export {};
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import type { RenderResult } from '../render.cjs';
|
|
2
|
+
import type { MotionClaim } from './types.cjs';
|
|
3
|
+
/** Display the very same analytic path that is verified, while preserving all
|
|
4
|
+
* manufacturing geometry and cut files. No parameter expression is evaluated. */
|
|
5
|
+
export declare function poseAssembly(result: RenderResult, moving: MotionClaim['moving'], phase: number): RenderResult;
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import type { RenderResult } from '../render.js';
|
|
2
|
+
import type { MotionClaim } from './types.js';
|
|
3
|
+
/** Display the very same analytic path that is verified, while preserving all
|
|
4
|
+
* manufacturing geometry and cut files. No parameter expression is evaluated. */
|
|
5
|
+
export declare function poseAssembly(result: RenderResult, moving: MotionClaim['moving'], phase: number): RenderResult;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import type { BodyRef, VerificationSnapshot } from './types.cjs';
|
|
2
|
+
export interface FixedPair {
|
|
3
|
+
a: BodyRef;
|
|
4
|
+
b: BodyRef;
|
|
5
|
+
faceA?: 'top' | 'bottom';
|
|
6
|
+
faceB?: 'top' | 'bottom';
|
|
7
|
+
}
|
|
8
|
+
export declare function nativeFixedPairs(s: VerificationSnapshot): FixedPair[];
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import type { RenderResult } from '../render.cjs';
|
|
2
|
+
import type { Value } from '../values.cjs';
|
|
3
|
+
import type { VerificationSnapshot, VerificationProvenance } from './types.cjs';
|
|
4
|
+
export interface SnapshotContext {
|
|
5
|
+
configuration: string;
|
|
6
|
+
params?: Record<string, Value>;
|
|
7
|
+
renderSettings?: Record<string, Value>;
|
|
8
|
+
provenance?: VerificationProvenance;
|
|
9
|
+
}
|
|
10
|
+
/** Copy and freeze the inputs. Caller mutations cannot change archived evidence. */
|
|
11
|
+
export declare function snapshotFromRender(result: RenderResult, context: SnapshotContext): VerificationSnapshot;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import type { RenderResult } from '../render.js';
|
|
2
|
+
import type { Value } from '../values.js';
|
|
3
|
+
import type { VerificationSnapshot, VerificationProvenance } from './types.js';
|
|
4
|
+
export interface SnapshotContext {
|
|
5
|
+
configuration: string;
|
|
6
|
+
params?: Record<string, Value>;
|
|
7
|
+
renderSettings?: Record<string, Value>;
|
|
8
|
+
provenance?: VerificationProvenance;
|
|
9
|
+
}
|
|
10
|
+
/** Copy and freeze the inputs. Caller mutations cannot change archived evidence. */
|
|
11
|
+
export declare function snapshotFromRender(result: RenderResult, context: SnapshotContext): VerificationSnapshot;
|