lineadraw 0.10.0 → 0.11.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.
Files changed (35) hide show
  1. package/README.md +18 -7
  2. package/bin/lineadraw.mjs +60 -10
  3. package/dist/bridge.d.ts +1 -0
  4. package/dist/bridge.js +1 -1
  5. package/dist/{chunk-YYJAXJOY.js → chunk-7UFXC7OI.js} +1680 -141
  6. package/dist/chunk-7UFXC7OI.js.map +1 -0
  7. package/dist/chunk-FDLANLIC.js +1161 -0
  8. package/dist/chunk-FDLANLIC.js.map +1 -0
  9. package/dist/chunk-M3EDRSHW.js +81 -0
  10. package/dist/chunk-M3EDRSHW.js.map +1 -0
  11. package/dist/chunk-MYP7RUYK.js +9 -0
  12. package/dist/chunk-MYP7RUYK.js.map +1 -0
  13. package/dist/{chunk-L2CWZAKW.js → chunk-RNA2RDGL.js} +13 -6
  14. package/dist/chunk-RNA2RDGL.js.map +1 -0
  15. package/dist/dist-56K6CNML.js +188 -0
  16. package/dist/dist-56K6CNML.js.map +1 -0
  17. package/dist/dist-IEN64QSV.js +10 -0
  18. package/dist/dist-IEN64QSV.js.map +1 -0
  19. package/dist/emscripten-module-Q67P5WYC-ITCU5LXL.js +2424 -0
  20. package/dist/emscripten-module-Q67P5WYC-ITCU5LXL.js.map +1 -0
  21. package/dist/{exportDxf-C4CLQCC3.js → exportDxf-6XTXQ4XN.js} +2 -2
  22. package/dist/ffi-SHMEF5YV.js +82 -0
  23. package/dist/ffi-SHMEF5YV.js.map +1 -0
  24. package/dist/module-ES6BEMUI-BJFWC656.js +14 -0
  25. package/dist/module-ES6BEMUI-BJFWC656.js.map +1 -0
  26. package/dist/module-asyncify-2EFITU5U-7F5WZXRA.js +9 -0
  27. package/dist/module-asyncify-2EFITU5U-7F5WZXRA.js.map +1 -0
  28. package/dist/sdk.d.ts +868 -95
  29. package/dist/sdk.js +619 -558
  30. package/dist/sdk.js.map +1 -1
  31. package/lineadraw.d.ts +162 -8
  32. package/package.json +2 -2
  33. package/dist/chunk-L2CWZAKW.js.map +0 -1
  34. package/dist/chunk-YYJAXJOY.js.map +0 -1
  35. /package/dist/{exportDxf-C4CLQCC3.js.map → exportDxf-6XTXQ4XN.js.map} +0 -0
package/dist/sdk.d.ts CHANGED
@@ -272,6 +272,35 @@ declare const ModelObjectSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
272
272
  ratio: z.ZodNumber;
273
273
  startAngle: z.ZodDefault<z.ZodNumber>;
274
274
  endAngle: z.ZodDefault<z.ZodNumber>;
275
+ }, z.core.$strip>, z.ZodObject<{
276
+ id: z.ZodString;
277
+ layerId: z.ZodString;
278
+ color: z.ZodOptional<z.ZodString>;
279
+ lineType: z.ZodOptional<z.ZodString>;
280
+ lineTypeScale: z.ZodOptional<z.ZodNumber>;
281
+ lineWidth: z.ZodOptional<z.ZodNumber>;
282
+ opacity: z.ZodOptional<z.ZodNumber>;
283
+ degree: z.ZodNumber;
284
+ controlPoints: z.ZodArray<z.ZodPreprocess<z.ZodObject<{
285
+ x: z.ZodNumber;
286
+ y: z.ZodNumber;
287
+ }, z.core.$strip>, unknown>>;
288
+ knots: z.ZodArray<z.ZodNumber>;
289
+ weights: z.ZodOptional<z.ZodArray<z.ZodNumber>>;
290
+ type: z.ZodLiteral<"spline">;
291
+ fitPoints: z.ZodOptional<z.ZodArray<z.ZodPreprocess<z.ZodObject<{
292
+ x: z.ZodNumber;
293
+ y: z.ZodNumber;
294
+ }, z.core.$strip>, unknown>>>;
295
+ startTangent: z.ZodOptional<z.ZodPreprocess<z.ZodObject<{
296
+ x: z.ZodNumber;
297
+ y: z.ZodNumber;
298
+ }, z.core.$strip>, unknown>>;
299
+ endTangent: z.ZodOptional<z.ZodPreprocess<z.ZodObject<{
300
+ x: z.ZodNumber;
301
+ y: z.ZodNumber;
302
+ }, z.core.$strip>, unknown>>;
303
+ closed: z.ZodDefault<z.ZodBoolean>;
275
304
  }, z.core.$strip>, z.ZodObject<{
276
305
  id: z.ZodString;
277
306
  layerId: z.ZodString;
@@ -282,11 +311,52 @@ declare const ModelObjectSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
282
311
  opacity: z.ZodOptional<z.ZodNumber>;
283
312
  type: z.ZodLiteral<"hatch">;
284
313
  loops: z.ZodArray<z.ZodObject<{
285
- points: z.ZodArray<z.ZodPreprocess<z.ZodObject<{
286
- x: z.ZodNumber;
287
- y: z.ZodNumber;
288
- bulge: z.ZodDefault<z.ZodNumber>;
289
- }, z.core.$strip>, unknown>>;
314
+ edges: z.ZodArray<z.ZodDiscriminatedUnion<[z.ZodObject<{
315
+ kind: z.ZodLiteral<"line">;
316
+ a: z.ZodPreprocess<z.ZodObject<{
317
+ x: z.ZodNumber;
318
+ y: z.ZodNumber;
319
+ }, z.core.$strip>, unknown>;
320
+ b: z.ZodPreprocess<z.ZodObject<{
321
+ x: z.ZodNumber;
322
+ y: z.ZodNumber;
323
+ }, z.core.$strip>, unknown>;
324
+ }, z.core.$strip>, z.ZodObject<{
325
+ kind: z.ZodLiteral<"arc">;
326
+ center: z.ZodPreprocess<z.ZodObject<{
327
+ x: z.ZodNumber;
328
+ y: z.ZodNumber;
329
+ }, z.core.$strip>, unknown>;
330
+ radius: z.ZodNumber;
331
+ startAngle: z.ZodNumber;
332
+ endAngle: z.ZodNumber;
333
+ }, z.core.$strip>, z.ZodObject<{
334
+ kind: z.ZodLiteral<"ellipse">;
335
+ center: z.ZodPreprocess<z.ZodObject<{
336
+ x: z.ZodNumber;
337
+ y: z.ZodNumber;
338
+ }, z.core.$strip>, unknown>;
339
+ majorAxis: z.ZodPreprocess<z.ZodObject<{
340
+ x: z.ZodNumber;
341
+ y: z.ZodNumber;
342
+ }, z.core.$strip>, unknown>;
343
+ ratio: z.ZodNumber;
344
+ startAngle: z.ZodDefault<z.ZodNumber>;
345
+ endAngle: z.ZodDefault<z.ZodNumber>;
346
+ }, z.core.$strip>, z.ZodObject<{
347
+ degree: z.ZodNumber;
348
+ controlPoints: z.ZodArray<z.ZodPreprocess<z.ZodObject<{
349
+ x: z.ZodNumber;
350
+ y: z.ZodNumber;
351
+ }, z.core.$strip>, unknown>>;
352
+ knots: z.ZodArray<z.ZodNumber>;
353
+ weights: z.ZodOptional<z.ZodArray<z.ZodNumber>>;
354
+ kind: z.ZodLiteral<"spline">;
355
+ fitPoints: z.ZodOptional<z.ZodArray<z.ZodPreprocess<z.ZodObject<{
356
+ x: z.ZodNumber;
357
+ y: z.ZodNumber;
358
+ }, z.core.$strip>, unknown>>>;
359
+ }, z.core.$strip>], "kind">>;
290
360
  }, z.core.$strip>>;
291
361
  fill: z.ZodDefault<z.ZodDiscriminatedUnion<[z.ZodObject<{
292
362
  kind: z.ZodLiteral<"solid">;
@@ -697,12 +767,13 @@ type Layer = z.infer<typeof LayerSchema>;
697
767
  declare const LineaDocumentSchema: z.ZodPreprocess<z.ZodObject<{
698
768
  id: z.ZodDefault<z.ZodString>;
699
769
  type: z.ZodDefault<z.ZodLiteral<"lineadraw">>;
700
- version: z.ZodLiteral<24>;
770
+ version: z.ZodLiteral<25>;
701
771
  settings: z.ZodDefault<z.ZodObject<{
702
772
  units: z.ZodDefault<z.ZodEnum<{
703
773
  in: "in";
704
774
  mm: "mm";
705
775
  }>>;
776
+ modelScale: z.ZodDefault<z.ZodNumber>;
706
777
  }, z.core.$strip>>;
707
778
  layers: z.ZodArray<z.ZodObject<{
708
779
  id: z.ZodDefault<z.ZodString>;
@@ -811,6 +882,35 @@ declare const LineaDocumentSchema: z.ZodPreprocess<z.ZodObject<{
811
882
  ratio: z.ZodNumber;
812
883
  startAngle: z.ZodDefault<z.ZodNumber>;
813
884
  endAngle: z.ZodDefault<z.ZodNumber>;
885
+ }, z.core.$strip>, z.ZodObject<{
886
+ id: z.ZodString;
887
+ layerId: z.ZodString;
888
+ color: z.ZodOptional<z.ZodString>;
889
+ lineType: z.ZodOptional<z.ZodString>;
890
+ lineTypeScale: z.ZodOptional<z.ZodNumber>;
891
+ lineWidth: z.ZodOptional<z.ZodNumber>;
892
+ opacity: z.ZodOptional<z.ZodNumber>;
893
+ degree: z.ZodNumber;
894
+ controlPoints: z.ZodArray<z.ZodPreprocess<z.ZodObject<{
895
+ x: z.ZodNumber;
896
+ y: z.ZodNumber;
897
+ }, z.core.$strip>, unknown>>;
898
+ knots: z.ZodArray<z.ZodNumber>;
899
+ weights: z.ZodOptional<z.ZodArray<z.ZodNumber>>;
900
+ type: z.ZodLiteral<"spline">;
901
+ fitPoints: z.ZodOptional<z.ZodArray<z.ZodPreprocess<z.ZodObject<{
902
+ x: z.ZodNumber;
903
+ y: z.ZodNumber;
904
+ }, z.core.$strip>, unknown>>>;
905
+ startTangent: z.ZodOptional<z.ZodPreprocess<z.ZodObject<{
906
+ x: z.ZodNumber;
907
+ y: z.ZodNumber;
908
+ }, z.core.$strip>, unknown>>;
909
+ endTangent: z.ZodOptional<z.ZodPreprocess<z.ZodObject<{
910
+ x: z.ZodNumber;
911
+ y: z.ZodNumber;
912
+ }, z.core.$strip>, unknown>>;
913
+ closed: z.ZodDefault<z.ZodBoolean>;
814
914
  }, z.core.$strip>, z.ZodObject<{
815
915
  id: z.ZodString;
816
916
  layerId: z.ZodString;
@@ -821,11 +921,52 @@ declare const LineaDocumentSchema: z.ZodPreprocess<z.ZodObject<{
821
921
  opacity: z.ZodOptional<z.ZodNumber>;
822
922
  type: z.ZodLiteral<"hatch">;
823
923
  loops: z.ZodArray<z.ZodObject<{
824
- points: z.ZodArray<z.ZodPreprocess<z.ZodObject<{
825
- x: z.ZodNumber;
826
- y: z.ZodNumber;
827
- bulge: z.ZodDefault<z.ZodNumber>;
828
- }, z.core.$strip>, unknown>>;
924
+ edges: z.ZodArray<z.ZodDiscriminatedUnion<[z.ZodObject<{
925
+ kind: z.ZodLiteral<"line">;
926
+ a: z.ZodPreprocess<z.ZodObject<{
927
+ x: z.ZodNumber;
928
+ y: z.ZodNumber;
929
+ }, z.core.$strip>, unknown>;
930
+ b: z.ZodPreprocess<z.ZodObject<{
931
+ x: z.ZodNumber;
932
+ y: z.ZodNumber;
933
+ }, z.core.$strip>, unknown>;
934
+ }, z.core.$strip>, z.ZodObject<{
935
+ kind: z.ZodLiteral<"arc">;
936
+ center: z.ZodPreprocess<z.ZodObject<{
937
+ x: z.ZodNumber;
938
+ y: z.ZodNumber;
939
+ }, z.core.$strip>, unknown>;
940
+ radius: z.ZodNumber;
941
+ startAngle: z.ZodNumber;
942
+ endAngle: z.ZodNumber;
943
+ }, z.core.$strip>, z.ZodObject<{
944
+ kind: z.ZodLiteral<"ellipse">;
945
+ center: z.ZodPreprocess<z.ZodObject<{
946
+ x: z.ZodNumber;
947
+ y: z.ZodNumber;
948
+ }, z.core.$strip>, unknown>;
949
+ majorAxis: z.ZodPreprocess<z.ZodObject<{
950
+ x: z.ZodNumber;
951
+ y: z.ZodNumber;
952
+ }, z.core.$strip>, unknown>;
953
+ ratio: z.ZodNumber;
954
+ startAngle: z.ZodDefault<z.ZodNumber>;
955
+ endAngle: z.ZodDefault<z.ZodNumber>;
956
+ }, z.core.$strip>, z.ZodObject<{
957
+ degree: z.ZodNumber;
958
+ controlPoints: z.ZodArray<z.ZodPreprocess<z.ZodObject<{
959
+ x: z.ZodNumber;
960
+ y: z.ZodNumber;
961
+ }, z.core.$strip>, unknown>>;
962
+ knots: z.ZodArray<z.ZodNumber>;
963
+ weights: z.ZodOptional<z.ZodArray<z.ZodNumber>>;
964
+ kind: z.ZodLiteral<"spline">;
965
+ fitPoints: z.ZodOptional<z.ZodArray<z.ZodPreprocess<z.ZodObject<{
966
+ x: z.ZodNumber;
967
+ y: z.ZodNumber;
968
+ }, z.core.$strip>, unknown>>>;
969
+ }, z.core.$strip>], "kind">>;
829
970
  }, z.core.$strip>>;
830
971
  fill: z.ZodDefault<z.ZodDiscriminatedUnion<[z.ZodObject<{
831
972
  kind: z.ZodLiteral<"solid">;
@@ -1302,6 +1443,35 @@ declare const LineaDocumentSchema: z.ZodPreprocess<z.ZodObject<{
1302
1443
  ratio: z.ZodNumber;
1303
1444
  startAngle: z.ZodDefault<z.ZodNumber>;
1304
1445
  endAngle: z.ZodDefault<z.ZodNumber>;
1446
+ }, z.core.$strip>, z.ZodObject<{
1447
+ id: z.ZodString;
1448
+ layerId: z.ZodString;
1449
+ color: z.ZodOptional<z.ZodString>;
1450
+ lineType: z.ZodOptional<z.ZodString>;
1451
+ lineTypeScale: z.ZodOptional<z.ZodNumber>;
1452
+ lineWidth: z.ZodOptional<z.ZodNumber>;
1453
+ opacity: z.ZodOptional<z.ZodNumber>;
1454
+ degree: z.ZodNumber;
1455
+ controlPoints: z.ZodArray<z.ZodPreprocess<z.ZodObject<{
1456
+ x: z.ZodNumber;
1457
+ y: z.ZodNumber;
1458
+ }, z.core.$strip>, unknown>>;
1459
+ knots: z.ZodArray<z.ZodNumber>;
1460
+ weights: z.ZodOptional<z.ZodArray<z.ZodNumber>>;
1461
+ type: z.ZodLiteral<"spline">;
1462
+ fitPoints: z.ZodOptional<z.ZodArray<z.ZodPreprocess<z.ZodObject<{
1463
+ x: z.ZodNumber;
1464
+ y: z.ZodNumber;
1465
+ }, z.core.$strip>, unknown>>>;
1466
+ startTangent: z.ZodOptional<z.ZodPreprocess<z.ZodObject<{
1467
+ x: z.ZodNumber;
1468
+ y: z.ZodNumber;
1469
+ }, z.core.$strip>, unknown>>;
1470
+ endTangent: z.ZodOptional<z.ZodPreprocess<z.ZodObject<{
1471
+ x: z.ZodNumber;
1472
+ y: z.ZodNumber;
1473
+ }, z.core.$strip>, unknown>>;
1474
+ closed: z.ZodDefault<z.ZodBoolean>;
1305
1475
  }, z.core.$strip>, z.ZodObject<{
1306
1476
  id: z.ZodString;
1307
1477
  layerId: z.ZodString;
@@ -1312,11 +1482,52 @@ declare const LineaDocumentSchema: z.ZodPreprocess<z.ZodObject<{
1312
1482
  opacity: z.ZodOptional<z.ZodNumber>;
1313
1483
  type: z.ZodLiteral<"hatch">;
1314
1484
  loops: z.ZodArray<z.ZodObject<{
1315
- points: z.ZodArray<z.ZodPreprocess<z.ZodObject<{
1316
- x: z.ZodNumber;
1317
- y: z.ZodNumber;
1318
- bulge: z.ZodDefault<z.ZodNumber>;
1319
- }, z.core.$strip>, unknown>>;
1485
+ edges: z.ZodArray<z.ZodDiscriminatedUnion<[z.ZodObject<{
1486
+ kind: z.ZodLiteral<"line">;
1487
+ a: z.ZodPreprocess<z.ZodObject<{
1488
+ x: z.ZodNumber;
1489
+ y: z.ZodNumber;
1490
+ }, z.core.$strip>, unknown>;
1491
+ b: z.ZodPreprocess<z.ZodObject<{
1492
+ x: z.ZodNumber;
1493
+ y: z.ZodNumber;
1494
+ }, z.core.$strip>, unknown>;
1495
+ }, z.core.$strip>, z.ZodObject<{
1496
+ kind: z.ZodLiteral<"arc">;
1497
+ center: z.ZodPreprocess<z.ZodObject<{
1498
+ x: z.ZodNumber;
1499
+ y: z.ZodNumber;
1500
+ }, z.core.$strip>, unknown>;
1501
+ radius: z.ZodNumber;
1502
+ startAngle: z.ZodNumber;
1503
+ endAngle: z.ZodNumber;
1504
+ }, z.core.$strip>, z.ZodObject<{
1505
+ kind: z.ZodLiteral<"ellipse">;
1506
+ center: z.ZodPreprocess<z.ZodObject<{
1507
+ x: z.ZodNumber;
1508
+ y: z.ZodNumber;
1509
+ }, z.core.$strip>, unknown>;
1510
+ majorAxis: z.ZodPreprocess<z.ZodObject<{
1511
+ x: z.ZodNumber;
1512
+ y: z.ZodNumber;
1513
+ }, z.core.$strip>, unknown>;
1514
+ ratio: z.ZodNumber;
1515
+ startAngle: z.ZodDefault<z.ZodNumber>;
1516
+ endAngle: z.ZodDefault<z.ZodNumber>;
1517
+ }, z.core.$strip>, z.ZodObject<{
1518
+ degree: z.ZodNumber;
1519
+ controlPoints: z.ZodArray<z.ZodPreprocess<z.ZodObject<{
1520
+ x: z.ZodNumber;
1521
+ y: z.ZodNumber;
1522
+ }, z.core.$strip>, unknown>>;
1523
+ knots: z.ZodArray<z.ZodNumber>;
1524
+ weights: z.ZodOptional<z.ZodArray<z.ZodNumber>>;
1525
+ kind: z.ZodLiteral<"spline">;
1526
+ fitPoints: z.ZodOptional<z.ZodArray<z.ZodPreprocess<z.ZodObject<{
1527
+ x: z.ZodNumber;
1528
+ y: z.ZodNumber;
1529
+ }, z.core.$strip>, unknown>>>;
1530
+ }, z.core.$strip>], "kind">>;
1320
1531
  }, z.core.$strip>>;
1321
1532
  fill: z.ZodDefault<z.ZodDiscriminatedUnion<[z.ZodObject<{
1322
1533
  kind: z.ZodLiteral<"solid">;
@@ -1990,6 +2201,7 @@ declare const InputDefSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
1990
2201
  point: "point";
1991
2202
  polyline: "polyline";
1992
2203
  reference: "reference";
2204
+ spline: "spline";
1993
2205
  table: "table";
1994
2206
  text: "text";
1995
2207
  viewport: "viewport";
@@ -2012,6 +2224,7 @@ declare const InputDefSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
2012
2224
  point: "point";
2013
2225
  polyline: "polyline";
2014
2226
  reference: "reference";
2227
+ spline: "spline";
2015
2228
  table: "table";
2016
2229
  text: "text";
2017
2230
  viewport: "viewport";
@@ -2027,13 +2240,16 @@ declare const InputDefSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
2027
2240
  }, z.core.$strip>], "type">;
2028
2241
  type InputDef = z.infer<typeof InputDefSchema>;
2029
2242
 
2030
- /** ISO A-series portrait sizes in mm [width, height]. */
2243
+ /** Sheet sizes in mm [width, height], portrait: ISO A-series plus US
2244
+ * Letter. */
2031
2245
  declare const SHEET_PRESETS: {
2246
+ readonly A5: readonly [148, 210];
2032
2247
  readonly A4: readonly [210, 297];
2033
2248
  readonly A3: readonly [297, 420];
2034
2249
  readonly A2: readonly [420, 594];
2035
2250
  readonly A1: readonly [594, 841];
2036
2251
  readonly A0: readonly [841, 1189];
2252
+ readonly Letter: readonly [215.9, 279.4];
2037
2253
  };
2038
2254
  type SheetName = keyof typeof SHEET_PRESETS;
2039
2255
  type SheetOrientation = "portrait" | "landscape";
@@ -2171,6 +2387,35 @@ declare const PaperLayoutSchema: z.ZodObject<{
2171
2387
  ratio: z.ZodNumber;
2172
2388
  startAngle: z.ZodDefault<z.ZodNumber>;
2173
2389
  endAngle: z.ZodDefault<z.ZodNumber>;
2390
+ }, z.core.$strip>, z.ZodObject<{
2391
+ id: z.ZodString;
2392
+ layerId: z.ZodString;
2393
+ color: z.ZodOptional<z.ZodString>;
2394
+ lineType: z.ZodOptional<z.ZodString>;
2395
+ lineTypeScale: z.ZodOptional<z.ZodNumber>;
2396
+ lineWidth: z.ZodOptional<z.ZodNumber>;
2397
+ opacity: z.ZodOptional<z.ZodNumber>;
2398
+ degree: z.ZodNumber;
2399
+ controlPoints: z.ZodArray<z.ZodPreprocess<z.ZodObject<{
2400
+ x: z.ZodNumber;
2401
+ y: z.ZodNumber;
2402
+ }, z.core.$strip>, unknown>>;
2403
+ knots: z.ZodArray<z.ZodNumber>;
2404
+ weights: z.ZodOptional<z.ZodArray<z.ZodNumber>>;
2405
+ type: z.ZodLiteral<"spline">;
2406
+ fitPoints: z.ZodOptional<z.ZodArray<z.ZodPreprocess<z.ZodObject<{
2407
+ x: z.ZodNumber;
2408
+ y: z.ZodNumber;
2409
+ }, z.core.$strip>, unknown>>>;
2410
+ startTangent: z.ZodOptional<z.ZodPreprocess<z.ZodObject<{
2411
+ x: z.ZodNumber;
2412
+ y: z.ZodNumber;
2413
+ }, z.core.$strip>, unknown>>;
2414
+ endTangent: z.ZodOptional<z.ZodPreprocess<z.ZodObject<{
2415
+ x: z.ZodNumber;
2416
+ y: z.ZodNumber;
2417
+ }, z.core.$strip>, unknown>>;
2418
+ closed: z.ZodDefault<z.ZodBoolean>;
2174
2419
  }, z.core.$strip>, z.ZodObject<{
2175
2420
  id: z.ZodString;
2176
2421
  layerId: z.ZodString;
@@ -2181,11 +2426,52 @@ declare const PaperLayoutSchema: z.ZodObject<{
2181
2426
  opacity: z.ZodOptional<z.ZodNumber>;
2182
2427
  type: z.ZodLiteral<"hatch">;
2183
2428
  loops: z.ZodArray<z.ZodObject<{
2184
- points: z.ZodArray<z.ZodPreprocess<z.ZodObject<{
2185
- x: z.ZodNumber;
2186
- y: z.ZodNumber;
2187
- bulge: z.ZodDefault<z.ZodNumber>;
2188
- }, z.core.$strip>, unknown>>;
2429
+ edges: z.ZodArray<z.ZodDiscriminatedUnion<[z.ZodObject<{
2430
+ kind: z.ZodLiteral<"line">;
2431
+ a: z.ZodPreprocess<z.ZodObject<{
2432
+ x: z.ZodNumber;
2433
+ y: z.ZodNumber;
2434
+ }, z.core.$strip>, unknown>;
2435
+ b: z.ZodPreprocess<z.ZodObject<{
2436
+ x: z.ZodNumber;
2437
+ y: z.ZodNumber;
2438
+ }, z.core.$strip>, unknown>;
2439
+ }, z.core.$strip>, z.ZodObject<{
2440
+ kind: z.ZodLiteral<"arc">;
2441
+ center: z.ZodPreprocess<z.ZodObject<{
2442
+ x: z.ZodNumber;
2443
+ y: z.ZodNumber;
2444
+ }, z.core.$strip>, unknown>;
2445
+ radius: z.ZodNumber;
2446
+ startAngle: z.ZodNumber;
2447
+ endAngle: z.ZodNumber;
2448
+ }, z.core.$strip>, z.ZodObject<{
2449
+ kind: z.ZodLiteral<"ellipse">;
2450
+ center: z.ZodPreprocess<z.ZodObject<{
2451
+ x: z.ZodNumber;
2452
+ y: z.ZodNumber;
2453
+ }, z.core.$strip>, unknown>;
2454
+ majorAxis: z.ZodPreprocess<z.ZodObject<{
2455
+ x: z.ZodNumber;
2456
+ y: z.ZodNumber;
2457
+ }, z.core.$strip>, unknown>;
2458
+ ratio: z.ZodNumber;
2459
+ startAngle: z.ZodDefault<z.ZodNumber>;
2460
+ endAngle: z.ZodDefault<z.ZodNumber>;
2461
+ }, z.core.$strip>, z.ZodObject<{
2462
+ degree: z.ZodNumber;
2463
+ controlPoints: z.ZodArray<z.ZodPreprocess<z.ZodObject<{
2464
+ x: z.ZodNumber;
2465
+ y: z.ZodNumber;
2466
+ }, z.core.$strip>, unknown>>;
2467
+ knots: z.ZodArray<z.ZodNumber>;
2468
+ weights: z.ZodOptional<z.ZodArray<z.ZodNumber>>;
2469
+ kind: z.ZodLiteral<"spline">;
2470
+ fitPoints: z.ZodOptional<z.ZodArray<z.ZodPreprocess<z.ZodObject<{
2471
+ x: z.ZodNumber;
2472
+ y: z.ZodNumber;
2473
+ }, z.core.$strip>, unknown>>>;
2474
+ }, z.core.$strip>], "kind">>;
2189
2475
  }, z.core.$strip>>;
2190
2476
  fill: z.ZodDefault<z.ZodDiscriminatedUnion<[z.ZodObject<{
2191
2477
  kind: z.ZodLiteral<"solid">;
@@ -2565,7 +2851,73 @@ type PaperLayout = z.infer<typeof PaperLayoutSchema>;
2565
2851
  */
2566
2852
  declare const parseScale: (scale: number | string) => number;
2567
2853
 
2568
- type ModuleExecutor = (script: string) => Record<string, unknown>;
2854
+ /** A point as scripts write it: [x, y] or { x, y }. */
2855
+ type CurvePointLike = readonly [number, number] | {
2856
+ readonly x: number;
2857
+ readonly y: number;
2858
+ };
2859
+ /** A `spline` object input, ready for `document.add` or a block's `draw`. */
2860
+ type SplineThrough = {
2861
+ type: "spline";
2862
+ degree: number;
2863
+ controlPoints: {
2864
+ x: number;
2865
+ y: number;
2866
+ }[];
2867
+ knots: number[];
2868
+ fitPoints: {
2869
+ x: number;
2870
+ y: number;
2871
+ }[];
2872
+ };
2873
+ /**
2874
+ * The smooth spline passing THROUGH `points` (in order) — what the Spline
2875
+ * tool draws. `degree` 3 (default) or 2; fewer points lower it. Throws on
2876
+ * fewer than two distinct points.
2877
+ */
2878
+ declare const splineThrough: (points: readonly CurvePointLike[], degree?: number) => SplineThrough;
2879
+ /** A loop point: [x, y, bulge?] or { x, y, bulge? } — the bulge (tan of a
2880
+ * quarter of the sweep, as on a polyline) bends the edge to the NEXT point
2881
+ * into an arc. */
2882
+ type LoopPointLike = readonly [number, number, number?] | {
2883
+ readonly x: number;
2884
+ readonly y: number;
2885
+ readonly bulge?: number;
2886
+ };
2887
+ /** A hatch loop of lines and arcs, ready for a hatch's `loops`. */
2888
+ type HatchLoopEdges = {
2889
+ edges: ({
2890
+ kind: "line";
2891
+ a: {
2892
+ x: number;
2893
+ y: number;
2894
+ };
2895
+ b: {
2896
+ x: number;
2897
+ y: number;
2898
+ };
2899
+ } | {
2900
+ kind: "arc";
2901
+ center: {
2902
+ x: number;
2903
+ y: number;
2904
+ };
2905
+ radius: number;
2906
+ startAngle: number;
2907
+ endAngle: number;
2908
+ })[];
2909
+ };
2910
+ /**
2911
+ * The closed hatch loop through `points`: straight edges between them, an
2912
+ * arc where a point carries a bulge — the way to hatch a polygon or a
2913
+ * polyline outline (`loops: rings.map(hatchLoop)` for polygon booleans).
2914
+ */
2915
+ declare const hatchLoop: (points: readonly LoopPointLike[]) => HatchLoopEdges;
2916
+
2917
+ /** Which cache compiles the module: blocks run on the paint path (short
2918
+ * budget, switched off after a timeout), commands run once per call. */
2919
+ type ScriptKind = "block" | "command";
2920
+ type ModuleExecutor = (script: string, kind?: ScriptKind) => Record<string, unknown>;
2569
2921
  /** Load the script transpiler (idempotent). Awaited by save/insert flows.
2570
2922
  * Shared by block AND command modules. */
2571
2923
  declare const ensureScriptTranspiler: () => Promise<ModuleExecutor>;
@@ -2863,6 +3215,12 @@ interface SnapSegment extends Segment {
2863
3215
  * exact curve in the nearest tier.
2864
3216
  */
2865
3217
  chord?: boolean;
3218
+ /**
3219
+ * True for facets of a curve that HAS no exact form in the entry (a
3220
+ * spline's samples): they take part in everything — intersections,
3221
+ * nearest, perpendicular — except extension snapping.
3222
+ */
3223
+ facet?: boolean;
2866
3224
  }
2867
3225
  /** Cached per-object snap geometry (also serves hit-testing). */
2868
3226
  interface SnapCacheEntry {
@@ -3112,6 +3470,35 @@ declare const OperationSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
3112
3470
  ratio: z.ZodNumber;
3113
3471
  startAngle: z.ZodDefault<z.ZodNumber>;
3114
3472
  endAngle: z.ZodDefault<z.ZodNumber>;
3473
+ }, z.core.$strip>, z.ZodObject<{
3474
+ id: z.ZodString;
3475
+ layerId: z.ZodString;
3476
+ color: z.ZodOptional<z.ZodString>;
3477
+ lineType: z.ZodOptional<z.ZodString>;
3478
+ lineTypeScale: z.ZodOptional<z.ZodNumber>;
3479
+ lineWidth: z.ZodOptional<z.ZodNumber>;
3480
+ opacity: z.ZodOptional<z.ZodNumber>;
3481
+ degree: z.ZodNumber;
3482
+ controlPoints: z.ZodArray<z.ZodPreprocess<z.ZodObject<{
3483
+ x: z.ZodNumber;
3484
+ y: z.ZodNumber;
3485
+ }, z.core.$strip>, unknown>>;
3486
+ knots: z.ZodArray<z.ZodNumber>;
3487
+ weights: z.ZodOptional<z.ZodArray<z.ZodNumber>>;
3488
+ type: z.ZodLiteral<"spline">;
3489
+ fitPoints: z.ZodOptional<z.ZodArray<z.ZodPreprocess<z.ZodObject<{
3490
+ x: z.ZodNumber;
3491
+ y: z.ZodNumber;
3492
+ }, z.core.$strip>, unknown>>>;
3493
+ startTangent: z.ZodOptional<z.ZodPreprocess<z.ZodObject<{
3494
+ x: z.ZodNumber;
3495
+ y: z.ZodNumber;
3496
+ }, z.core.$strip>, unknown>>;
3497
+ endTangent: z.ZodOptional<z.ZodPreprocess<z.ZodObject<{
3498
+ x: z.ZodNumber;
3499
+ y: z.ZodNumber;
3500
+ }, z.core.$strip>, unknown>>;
3501
+ closed: z.ZodDefault<z.ZodBoolean>;
3115
3502
  }, z.core.$strip>, z.ZodObject<{
3116
3503
  id: z.ZodString;
3117
3504
  layerId: z.ZodString;
@@ -3122,11 +3509,52 @@ declare const OperationSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
3122
3509
  opacity: z.ZodOptional<z.ZodNumber>;
3123
3510
  type: z.ZodLiteral<"hatch">;
3124
3511
  loops: z.ZodArray<z.ZodObject<{
3125
- points: z.ZodArray<z.ZodPreprocess<z.ZodObject<{
3126
- x: z.ZodNumber;
3127
- y: z.ZodNumber;
3128
- bulge: z.ZodDefault<z.ZodNumber>;
3129
- }, z.core.$strip>, unknown>>;
3512
+ edges: z.ZodArray<z.ZodDiscriminatedUnion<[z.ZodObject<{
3513
+ kind: z.ZodLiteral<"line">;
3514
+ a: z.ZodPreprocess<z.ZodObject<{
3515
+ x: z.ZodNumber;
3516
+ y: z.ZodNumber;
3517
+ }, z.core.$strip>, unknown>;
3518
+ b: z.ZodPreprocess<z.ZodObject<{
3519
+ x: z.ZodNumber;
3520
+ y: z.ZodNumber;
3521
+ }, z.core.$strip>, unknown>;
3522
+ }, z.core.$strip>, z.ZodObject<{
3523
+ kind: z.ZodLiteral<"arc">;
3524
+ center: z.ZodPreprocess<z.ZodObject<{
3525
+ x: z.ZodNumber;
3526
+ y: z.ZodNumber;
3527
+ }, z.core.$strip>, unknown>;
3528
+ radius: z.ZodNumber;
3529
+ startAngle: z.ZodNumber;
3530
+ endAngle: z.ZodNumber;
3531
+ }, z.core.$strip>, z.ZodObject<{
3532
+ kind: z.ZodLiteral<"ellipse">;
3533
+ center: z.ZodPreprocess<z.ZodObject<{
3534
+ x: z.ZodNumber;
3535
+ y: z.ZodNumber;
3536
+ }, z.core.$strip>, unknown>;
3537
+ majorAxis: z.ZodPreprocess<z.ZodObject<{
3538
+ x: z.ZodNumber;
3539
+ y: z.ZodNumber;
3540
+ }, z.core.$strip>, unknown>;
3541
+ ratio: z.ZodNumber;
3542
+ startAngle: z.ZodDefault<z.ZodNumber>;
3543
+ endAngle: z.ZodDefault<z.ZodNumber>;
3544
+ }, z.core.$strip>, z.ZodObject<{
3545
+ degree: z.ZodNumber;
3546
+ controlPoints: z.ZodArray<z.ZodPreprocess<z.ZodObject<{
3547
+ x: z.ZodNumber;
3548
+ y: z.ZodNumber;
3549
+ }, z.core.$strip>, unknown>>;
3550
+ knots: z.ZodArray<z.ZodNumber>;
3551
+ weights: z.ZodOptional<z.ZodArray<z.ZodNumber>>;
3552
+ kind: z.ZodLiteral<"spline">;
3553
+ fitPoints: z.ZodOptional<z.ZodArray<z.ZodPreprocess<z.ZodObject<{
3554
+ x: z.ZodNumber;
3555
+ y: z.ZodNumber;
3556
+ }, z.core.$strip>, unknown>>>;
3557
+ }, z.core.$strip>], "kind">>;
3130
3558
  }, z.core.$strip>>;
3131
3559
  fill: z.ZodDefault<z.ZodDiscriminatedUnion<[z.ZodObject<{
3132
3560
  kind: z.ZodLiteral<"solid">;
@@ -3597,6 +4025,35 @@ declare const OperationSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
3597
4025
  ratio: z.ZodNumber;
3598
4026
  startAngle: z.ZodDefault<z.ZodNumber>;
3599
4027
  endAngle: z.ZodDefault<z.ZodNumber>;
4028
+ }, z.core.$strip>, z.ZodObject<{
4029
+ id: z.ZodString;
4030
+ layerId: z.ZodString;
4031
+ color: z.ZodOptional<z.ZodString>;
4032
+ lineType: z.ZodOptional<z.ZodString>;
4033
+ lineTypeScale: z.ZodOptional<z.ZodNumber>;
4034
+ lineWidth: z.ZodOptional<z.ZodNumber>;
4035
+ opacity: z.ZodOptional<z.ZodNumber>;
4036
+ degree: z.ZodNumber;
4037
+ controlPoints: z.ZodArray<z.ZodPreprocess<z.ZodObject<{
4038
+ x: z.ZodNumber;
4039
+ y: z.ZodNumber;
4040
+ }, z.core.$strip>, unknown>>;
4041
+ knots: z.ZodArray<z.ZodNumber>;
4042
+ weights: z.ZodOptional<z.ZodArray<z.ZodNumber>>;
4043
+ type: z.ZodLiteral<"spline">;
4044
+ fitPoints: z.ZodOptional<z.ZodArray<z.ZodPreprocess<z.ZodObject<{
4045
+ x: z.ZodNumber;
4046
+ y: z.ZodNumber;
4047
+ }, z.core.$strip>, unknown>>>;
4048
+ startTangent: z.ZodOptional<z.ZodPreprocess<z.ZodObject<{
4049
+ x: z.ZodNumber;
4050
+ y: z.ZodNumber;
4051
+ }, z.core.$strip>, unknown>>;
4052
+ endTangent: z.ZodOptional<z.ZodPreprocess<z.ZodObject<{
4053
+ x: z.ZodNumber;
4054
+ y: z.ZodNumber;
4055
+ }, z.core.$strip>, unknown>>;
4056
+ closed: z.ZodDefault<z.ZodBoolean>;
3600
4057
  }, z.core.$strip>, z.ZodObject<{
3601
4058
  id: z.ZodString;
3602
4059
  layerId: z.ZodString;
@@ -3607,11 +4064,52 @@ declare const OperationSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
3607
4064
  opacity: z.ZodOptional<z.ZodNumber>;
3608
4065
  type: z.ZodLiteral<"hatch">;
3609
4066
  loops: z.ZodArray<z.ZodObject<{
3610
- points: z.ZodArray<z.ZodPreprocess<z.ZodObject<{
3611
- x: z.ZodNumber;
3612
- y: z.ZodNumber;
3613
- bulge: z.ZodDefault<z.ZodNumber>;
3614
- }, z.core.$strip>, unknown>>;
4067
+ edges: z.ZodArray<z.ZodDiscriminatedUnion<[z.ZodObject<{
4068
+ kind: z.ZodLiteral<"line">;
4069
+ a: z.ZodPreprocess<z.ZodObject<{
4070
+ x: z.ZodNumber;
4071
+ y: z.ZodNumber;
4072
+ }, z.core.$strip>, unknown>;
4073
+ b: z.ZodPreprocess<z.ZodObject<{
4074
+ x: z.ZodNumber;
4075
+ y: z.ZodNumber;
4076
+ }, z.core.$strip>, unknown>;
4077
+ }, z.core.$strip>, z.ZodObject<{
4078
+ kind: z.ZodLiteral<"arc">;
4079
+ center: z.ZodPreprocess<z.ZodObject<{
4080
+ x: z.ZodNumber;
4081
+ y: z.ZodNumber;
4082
+ }, z.core.$strip>, unknown>;
4083
+ radius: z.ZodNumber;
4084
+ startAngle: z.ZodNumber;
4085
+ endAngle: z.ZodNumber;
4086
+ }, z.core.$strip>, z.ZodObject<{
4087
+ kind: z.ZodLiteral<"ellipse">;
4088
+ center: z.ZodPreprocess<z.ZodObject<{
4089
+ x: z.ZodNumber;
4090
+ y: z.ZodNumber;
4091
+ }, z.core.$strip>, unknown>;
4092
+ majorAxis: z.ZodPreprocess<z.ZodObject<{
4093
+ x: z.ZodNumber;
4094
+ y: z.ZodNumber;
4095
+ }, z.core.$strip>, unknown>;
4096
+ ratio: z.ZodNumber;
4097
+ startAngle: z.ZodDefault<z.ZodNumber>;
4098
+ endAngle: z.ZodDefault<z.ZodNumber>;
4099
+ }, z.core.$strip>, z.ZodObject<{
4100
+ degree: z.ZodNumber;
4101
+ controlPoints: z.ZodArray<z.ZodPreprocess<z.ZodObject<{
4102
+ x: z.ZodNumber;
4103
+ y: z.ZodNumber;
4104
+ }, z.core.$strip>, unknown>>;
4105
+ knots: z.ZodArray<z.ZodNumber>;
4106
+ weights: z.ZodOptional<z.ZodArray<z.ZodNumber>>;
4107
+ kind: z.ZodLiteral<"spline">;
4108
+ fitPoints: z.ZodOptional<z.ZodArray<z.ZodPreprocess<z.ZodObject<{
4109
+ x: z.ZodNumber;
4110
+ y: z.ZodNumber;
4111
+ }, z.core.$strip>, unknown>>>;
4112
+ }, z.core.$strip>], "kind">>;
3615
4113
  }, z.core.$strip>>;
3616
4114
  fill: z.ZodDefault<z.ZodDiscriminatedUnion<[z.ZodObject<{
3617
4115
  kind: z.ZodLiteral<"solid">;
@@ -4054,6 +4552,7 @@ declare const OperationSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
4054
4552
  in: "in";
4055
4553
  mm: "mm";
4056
4554
  }>>;
4555
+ modelScale: z.ZodDefault<z.ZodNumber>;
4057
4556
  }, z.core.$strip>;
4058
4557
  }, z.core.$strip>, z.ZodObject<{
4059
4558
  type: z.ZodLiteral<"add-layout">;
@@ -4164,6 +4663,35 @@ declare const OperationSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
4164
4663
  ratio: z.ZodNumber;
4165
4664
  startAngle: z.ZodDefault<z.ZodNumber>;
4166
4665
  endAngle: z.ZodDefault<z.ZodNumber>;
4666
+ }, z.core.$strip>, z.ZodObject<{
4667
+ id: z.ZodString;
4668
+ layerId: z.ZodString;
4669
+ color: z.ZodOptional<z.ZodString>;
4670
+ lineType: z.ZodOptional<z.ZodString>;
4671
+ lineTypeScale: z.ZodOptional<z.ZodNumber>;
4672
+ lineWidth: z.ZodOptional<z.ZodNumber>;
4673
+ opacity: z.ZodOptional<z.ZodNumber>;
4674
+ degree: z.ZodNumber;
4675
+ controlPoints: z.ZodArray<z.ZodPreprocess<z.ZodObject<{
4676
+ x: z.ZodNumber;
4677
+ y: z.ZodNumber;
4678
+ }, z.core.$strip>, unknown>>;
4679
+ knots: z.ZodArray<z.ZodNumber>;
4680
+ weights: z.ZodOptional<z.ZodArray<z.ZodNumber>>;
4681
+ type: z.ZodLiteral<"spline">;
4682
+ fitPoints: z.ZodOptional<z.ZodArray<z.ZodPreprocess<z.ZodObject<{
4683
+ x: z.ZodNumber;
4684
+ y: z.ZodNumber;
4685
+ }, z.core.$strip>, unknown>>>;
4686
+ startTangent: z.ZodOptional<z.ZodPreprocess<z.ZodObject<{
4687
+ x: z.ZodNumber;
4688
+ y: z.ZodNumber;
4689
+ }, z.core.$strip>, unknown>>;
4690
+ endTangent: z.ZodOptional<z.ZodPreprocess<z.ZodObject<{
4691
+ x: z.ZodNumber;
4692
+ y: z.ZodNumber;
4693
+ }, z.core.$strip>, unknown>>;
4694
+ closed: z.ZodDefault<z.ZodBoolean>;
4167
4695
  }, z.core.$strip>, z.ZodObject<{
4168
4696
  id: z.ZodString;
4169
4697
  layerId: z.ZodString;
@@ -4174,11 +4702,52 @@ declare const OperationSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
4174
4702
  opacity: z.ZodOptional<z.ZodNumber>;
4175
4703
  type: z.ZodLiteral<"hatch">;
4176
4704
  loops: z.ZodArray<z.ZodObject<{
4177
- points: z.ZodArray<z.ZodPreprocess<z.ZodObject<{
4178
- x: z.ZodNumber;
4179
- y: z.ZodNumber;
4180
- bulge: z.ZodDefault<z.ZodNumber>;
4181
- }, z.core.$strip>, unknown>>;
4705
+ edges: z.ZodArray<z.ZodDiscriminatedUnion<[z.ZodObject<{
4706
+ kind: z.ZodLiteral<"line">;
4707
+ a: z.ZodPreprocess<z.ZodObject<{
4708
+ x: z.ZodNumber;
4709
+ y: z.ZodNumber;
4710
+ }, z.core.$strip>, unknown>;
4711
+ b: z.ZodPreprocess<z.ZodObject<{
4712
+ x: z.ZodNumber;
4713
+ y: z.ZodNumber;
4714
+ }, z.core.$strip>, unknown>;
4715
+ }, z.core.$strip>, z.ZodObject<{
4716
+ kind: z.ZodLiteral<"arc">;
4717
+ center: z.ZodPreprocess<z.ZodObject<{
4718
+ x: z.ZodNumber;
4719
+ y: z.ZodNumber;
4720
+ }, z.core.$strip>, unknown>;
4721
+ radius: z.ZodNumber;
4722
+ startAngle: z.ZodNumber;
4723
+ endAngle: z.ZodNumber;
4724
+ }, z.core.$strip>, z.ZodObject<{
4725
+ kind: z.ZodLiteral<"ellipse">;
4726
+ center: z.ZodPreprocess<z.ZodObject<{
4727
+ x: z.ZodNumber;
4728
+ y: z.ZodNumber;
4729
+ }, z.core.$strip>, unknown>;
4730
+ majorAxis: z.ZodPreprocess<z.ZodObject<{
4731
+ x: z.ZodNumber;
4732
+ y: z.ZodNumber;
4733
+ }, z.core.$strip>, unknown>;
4734
+ ratio: z.ZodNumber;
4735
+ startAngle: z.ZodDefault<z.ZodNumber>;
4736
+ endAngle: z.ZodDefault<z.ZodNumber>;
4737
+ }, z.core.$strip>, z.ZodObject<{
4738
+ degree: z.ZodNumber;
4739
+ controlPoints: z.ZodArray<z.ZodPreprocess<z.ZodObject<{
4740
+ x: z.ZodNumber;
4741
+ y: z.ZodNumber;
4742
+ }, z.core.$strip>, unknown>>;
4743
+ knots: z.ZodArray<z.ZodNumber>;
4744
+ weights: z.ZodOptional<z.ZodArray<z.ZodNumber>>;
4745
+ kind: z.ZodLiteral<"spline">;
4746
+ fitPoints: z.ZodOptional<z.ZodArray<z.ZodPreprocess<z.ZodObject<{
4747
+ x: z.ZodNumber;
4748
+ y: z.ZodNumber;
4749
+ }, z.core.$strip>, unknown>>>;
4750
+ }, z.core.$strip>], "kind">>;
4182
4751
  }, z.core.$strip>>;
4183
4752
  fill: z.ZodDefault<z.ZodDiscriminatedUnion<[z.ZodObject<{
4184
4753
  kind: z.ZodLiteral<"solid">;
@@ -4678,6 +5247,35 @@ declare const OperationSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
4678
5247
  ratio: z.ZodNumber;
4679
5248
  startAngle: z.ZodDefault<z.ZodNumber>;
4680
5249
  endAngle: z.ZodDefault<z.ZodNumber>;
5250
+ }, z.core.$strip>, z.ZodObject<{
5251
+ id: z.ZodString;
5252
+ layerId: z.ZodString;
5253
+ color: z.ZodOptional<z.ZodString>;
5254
+ lineType: z.ZodOptional<z.ZodString>;
5255
+ lineTypeScale: z.ZodOptional<z.ZodNumber>;
5256
+ lineWidth: z.ZodOptional<z.ZodNumber>;
5257
+ opacity: z.ZodOptional<z.ZodNumber>;
5258
+ degree: z.ZodNumber;
5259
+ controlPoints: z.ZodArray<z.ZodPreprocess<z.ZodObject<{
5260
+ x: z.ZodNumber;
5261
+ y: z.ZodNumber;
5262
+ }, z.core.$strip>, unknown>>;
5263
+ knots: z.ZodArray<z.ZodNumber>;
5264
+ weights: z.ZodOptional<z.ZodArray<z.ZodNumber>>;
5265
+ type: z.ZodLiteral<"spline">;
5266
+ fitPoints: z.ZodOptional<z.ZodArray<z.ZodPreprocess<z.ZodObject<{
5267
+ x: z.ZodNumber;
5268
+ y: z.ZodNumber;
5269
+ }, z.core.$strip>, unknown>>>;
5270
+ startTangent: z.ZodOptional<z.ZodPreprocess<z.ZodObject<{
5271
+ x: z.ZodNumber;
5272
+ y: z.ZodNumber;
5273
+ }, z.core.$strip>, unknown>>;
5274
+ endTangent: z.ZodOptional<z.ZodPreprocess<z.ZodObject<{
5275
+ x: z.ZodNumber;
5276
+ y: z.ZodNumber;
5277
+ }, z.core.$strip>, unknown>>;
5278
+ closed: z.ZodDefault<z.ZodBoolean>;
4681
5279
  }, z.core.$strip>, z.ZodObject<{
4682
5280
  id: z.ZodString;
4683
5281
  layerId: z.ZodString;
@@ -4688,11 +5286,52 @@ declare const OperationSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
4688
5286
  opacity: z.ZodOptional<z.ZodNumber>;
4689
5287
  type: z.ZodLiteral<"hatch">;
4690
5288
  loops: z.ZodArray<z.ZodObject<{
4691
- points: z.ZodArray<z.ZodPreprocess<z.ZodObject<{
4692
- x: z.ZodNumber;
4693
- y: z.ZodNumber;
4694
- bulge: z.ZodDefault<z.ZodNumber>;
4695
- }, z.core.$strip>, unknown>>;
5289
+ edges: z.ZodArray<z.ZodDiscriminatedUnion<[z.ZodObject<{
5290
+ kind: z.ZodLiteral<"line">;
5291
+ a: z.ZodPreprocess<z.ZodObject<{
5292
+ x: z.ZodNumber;
5293
+ y: z.ZodNumber;
5294
+ }, z.core.$strip>, unknown>;
5295
+ b: z.ZodPreprocess<z.ZodObject<{
5296
+ x: z.ZodNumber;
5297
+ y: z.ZodNumber;
5298
+ }, z.core.$strip>, unknown>;
5299
+ }, z.core.$strip>, z.ZodObject<{
5300
+ kind: z.ZodLiteral<"arc">;
5301
+ center: z.ZodPreprocess<z.ZodObject<{
5302
+ x: z.ZodNumber;
5303
+ y: z.ZodNumber;
5304
+ }, z.core.$strip>, unknown>;
5305
+ radius: z.ZodNumber;
5306
+ startAngle: z.ZodNumber;
5307
+ endAngle: z.ZodNumber;
5308
+ }, z.core.$strip>, z.ZodObject<{
5309
+ kind: z.ZodLiteral<"ellipse">;
5310
+ center: z.ZodPreprocess<z.ZodObject<{
5311
+ x: z.ZodNumber;
5312
+ y: z.ZodNumber;
5313
+ }, z.core.$strip>, unknown>;
5314
+ majorAxis: z.ZodPreprocess<z.ZodObject<{
5315
+ x: z.ZodNumber;
5316
+ y: z.ZodNumber;
5317
+ }, z.core.$strip>, unknown>;
5318
+ ratio: z.ZodNumber;
5319
+ startAngle: z.ZodDefault<z.ZodNumber>;
5320
+ endAngle: z.ZodDefault<z.ZodNumber>;
5321
+ }, z.core.$strip>, z.ZodObject<{
5322
+ degree: z.ZodNumber;
5323
+ controlPoints: z.ZodArray<z.ZodPreprocess<z.ZodObject<{
5324
+ x: z.ZodNumber;
5325
+ y: z.ZodNumber;
5326
+ }, z.core.$strip>, unknown>>;
5327
+ knots: z.ZodArray<z.ZodNumber>;
5328
+ weights: z.ZodOptional<z.ZodArray<z.ZodNumber>>;
5329
+ kind: z.ZodLiteral<"spline">;
5330
+ fitPoints: z.ZodOptional<z.ZodArray<z.ZodPreprocess<z.ZodObject<{
5331
+ x: z.ZodNumber;
5332
+ y: z.ZodNumber;
5333
+ }, z.core.$strip>, unknown>>>;
5334
+ }, z.core.$strip>], "kind">>;
4696
5335
  }, z.core.$strip>>;
4697
5336
  fill: z.ZodDefault<z.ZodDiscriminatedUnion<[z.ZodObject<{
4698
5337
  kind: z.ZodLiteral<"solid">;
@@ -5476,6 +6115,9 @@ declare class LocalDrawing implements Drawing$1 {
5476
6115
  private resolveLayer;
5477
6116
  /** Patch a layer (rename, color, lineWidth, visible, locked) by name or id. */
5478
6117
  updateLayer(nameOrId: string, patch: Partial<Omit<Layer, "id">>): void;
6118
+ /** A layer parsed from `full`, refusing an empty name, unknown fields
6119
+ * and an unknown line type among what the caller `sent`. */
6120
+ private checkedLayer;
5479
6121
  /** Remove an EMPTY, non-current layer (the kernel refuses otherwise). */
5480
6122
  removeLayer(nameOrId: string): void;
5481
6123
  /** Reorder the layers (names or ids, every layer exactly once). */
@@ -5602,6 +6244,8 @@ declare class LocalDrawing implements Drawing$1 {
5602
6244
  reorderLayouts(order: readonly string[]): void;
5603
6245
  /** Patch a layout's name / sheet (preset or mm) / print palette. */
5604
6246
  updateLayout(nameOrId: string, patch: LayoutPatch): void;
6247
+ /** What names in a new or changed object must resolve against. */
6248
+ private get nameSources();
5605
6249
  private normalize;
5606
6250
  /**
5607
6251
  * Add objects (points may be `[x, y]`; `layer` resolves by name) to model
@@ -5637,6 +6281,9 @@ declare class LocalDrawing implements Drawing$1 {
5637
6281
  * by `delta`. Returns the new ids, one batch per step, in one undo step.
5638
6282
  */
5639
6283
  array(ids: readonly string[], count: number, delta: PointInput): string[];
6284
+ /** One displaced copy of `ids` per step, applied as ONE add op per space
6285
+ * (an op per step re-copied the whole space each time: quadratic). */
6286
+ private copySteps;
5640
6287
  private get measurer();
5641
6288
  private resolveObject;
5642
6289
  private ctx;
@@ -5678,11 +6325,21 @@ declare class LocalDrawing implements Drawing$1 {
5678
6325
  lineTypeScale?: number | undefined;
5679
6326
  lineWidth?: number | undefined;
5680
6327
  opacity?: number | undefined;
5681
- type: "point";
5682
- p: {
6328
+ type: "block";
6329
+ definitionId: string;
6330
+ rotation: number;
6331
+ scale: number;
6332
+ params: Record<string, string[] | number[] | z.JSONType>;
6333
+ inputs: (string | {
5683
6334
  x: number;
5684
6335
  y: number;
5685
- };
6336
+ })[] | Record<string, string | string[] | {
6337
+ x: number;
6338
+ y: number;
6339
+ }[] | {
6340
+ x: number;
6341
+ y: number;
6342
+ }>;
5686
6343
  } | {
5687
6344
  id: string;
5688
6345
  layerId: string;
@@ -5691,15 +6348,27 @@ declare class LocalDrawing implements Drawing$1 {
5691
6348
  lineTypeScale?: number | undefined;
5692
6349
  lineWidth?: number | undefined;
5693
6350
  opacity?: number | undefined;
5694
- type: "line";
5695
- a: {
6351
+ degree: number;
6352
+ controlPoints: {
5696
6353
  x: number;
5697
6354
  y: number;
5698
- };
5699
- b: {
6355
+ }[];
6356
+ knots: number[];
6357
+ weights?: number[] | undefined;
6358
+ type: "spline";
6359
+ fitPoints?: {
5700
6360
  x: number;
5701
6361
  y: number;
5702
- };
6362
+ }[] | undefined;
6363
+ startTangent?: {
6364
+ x: number;
6365
+ y: number;
6366
+ } | undefined;
6367
+ endTangent?: {
6368
+ x: number;
6369
+ y: number;
6370
+ } | undefined;
6371
+ closed: boolean;
5703
6372
  } | {
5704
6373
  id: string;
5705
6374
  layerId: string;
@@ -5708,13 +6377,15 @@ declare class LocalDrawing implements Drawing$1 {
5708
6377
  lineTypeScale?: number | undefined;
5709
6378
  lineWidth?: number | undefined;
5710
6379
  opacity?: number | undefined;
5711
- type: "polyline";
5712
- points: {
6380
+ type: "line";
6381
+ a: {
5713
6382
  x: number;
5714
6383
  y: number;
5715
- bulge: number;
5716
- }[];
5717
- closed: boolean;
6384
+ };
6385
+ b: {
6386
+ x: number;
6387
+ y: number;
6388
+ };
5718
6389
  } | {
5719
6390
  id: string;
5720
6391
  layerId: string;
@@ -5723,12 +6394,14 @@ declare class LocalDrawing implements Drawing$1 {
5723
6394
  lineTypeScale?: number | undefined;
5724
6395
  lineWidth?: number | undefined;
5725
6396
  opacity?: number | undefined;
5726
- type: "circle";
6397
+ type: "arc";
5727
6398
  center: {
5728
6399
  x: number;
5729
6400
  y: number;
5730
6401
  };
5731
6402
  radius: number;
6403
+ startAngle: number;
6404
+ endAngle: number;
5732
6405
  } | {
5733
6406
  id: string;
5734
6407
  layerId: string;
@@ -5737,14 +6410,12 @@ declare class LocalDrawing implements Drawing$1 {
5737
6410
  lineTypeScale?: number | undefined;
5738
6411
  lineWidth?: number | undefined;
5739
6412
  opacity?: number | undefined;
5740
- type: "arc";
6413
+ type: "circle";
5741
6414
  center: {
5742
6415
  x: number;
5743
6416
  y: number;
5744
6417
  };
5745
6418
  radius: number;
5746
- startAngle: number;
5747
- endAngle: number;
5748
6419
  } | {
5749
6420
  id: string;
5750
6421
  layerId: string;
@@ -5765,6 +6436,34 @@ declare class LocalDrawing implements Drawing$1 {
5765
6436
  ratio: number;
5766
6437
  startAngle: number;
5767
6438
  endAngle: number;
6439
+ } | {
6440
+ id: string;
6441
+ layerId: string;
6442
+ color?: string | undefined;
6443
+ lineType?: string | undefined;
6444
+ lineTypeScale?: number | undefined;
6445
+ lineWidth?: number | undefined;
6446
+ opacity?: number | undefined;
6447
+ type: "polyline";
6448
+ points: {
6449
+ x: number;
6450
+ y: number;
6451
+ bulge: number;
6452
+ }[];
6453
+ closed: boolean;
6454
+ } | {
6455
+ id: string;
6456
+ layerId: string;
6457
+ color?: string | undefined;
6458
+ lineType?: string | undefined;
6459
+ lineTypeScale?: number | undefined;
6460
+ lineWidth?: number | undefined;
6461
+ opacity?: number | undefined;
6462
+ type: "point";
6463
+ p: {
6464
+ x: number;
6465
+ y: number;
6466
+ };
5768
6467
  } | {
5769
6468
  id: string;
5770
6469
  layerId: string;
@@ -5775,11 +6474,52 @@ declare class LocalDrawing implements Drawing$1 {
5775
6474
  opacity?: number | undefined;
5776
6475
  type: "hatch";
5777
6476
  loops: {
5778
- points: {
5779
- x: number;
5780
- y: number;
5781
- bulge: number;
5782
- }[];
6477
+ edges: ({
6478
+ degree: number;
6479
+ controlPoints: {
6480
+ x: number;
6481
+ y: number;
6482
+ }[];
6483
+ knots: number[];
6484
+ weights?: number[] | undefined;
6485
+ kind: "spline";
6486
+ fitPoints?: {
6487
+ x: number;
6488
+ y: number;
6489
+ }[] | undefined;
6490
+ } | {
6491
+ kind: "line";
6492
+ a: {
6493
+ x: number;
6494
+ y: number;
6495
+ };
6496
+ b: {
6497
+ x: number;
6498
+ y: number;
6499
+ };
6500
+ } | {
6501
+ kind: "arc";
6502
+ center: {
6503
+ x: number;
6504
+ y: number;
6505
+ };
6506
+ radius: number;
6507
+ startAngle: number;
6508
+ endAngle: number;
6509
+ } | {
6510
+ kind: "ellipse";
6511
+ center: {
6512
+ x: number;
6513
+ y: number;
6514
+ };
6515
+ majorAxis: {
6516
+ x: number;
6517
+ y: number;
6518
+ };
6519
+ ratio: number;
6520
+ startAngle: number;
6521
+ endAngle: number;
6522
+ })[];
5783
6523
  }[];
5784
6524
  fill: {
5785
6525
  kind: "solid";
@@ -5897,29 +6637,6 @@ declare class LocalDrawing implements Drawing$1 {
5897
6637
  precision?: number | undefined;
5898
6638
  } | undefined;
5899
6639
  scale: number;
5900
- } | {
5901
- id: string;
5902
- layerId: string;
5903
- color?: string | undefined;
5904
- lineType?: string | undefined;
5905
- lineTypeScale?: number | undefined;
5906
- lineWidth?: number | undefined;
5907
- opacity?: number | undefined;
5908
- type: "block";
5909
- definitionId: string;
5910
- rotation: number;
5911
- scale: number;
5912
- params: Record<string, string[] | number[] | z.JSONType>;
5913
- inputs: (string | {
5914
- x: number;
5915
- y: number;
5916
- })[] | Record<string, string | string[] | {
5917
- x: number;
5918
- y: number;
5919
- }[] | {
5920
- x: number;
5921
- y: number;
5922
- }>;
5923
6640
  } | {
5924
6641
  id: string;
5925
6642
  layerId: string;
@@ -6176,11 +6893,64 @@ type EllipseInput = ObjectInputShape<{
6176
6893
  startAngle?: number;
6177
6894
  endAngle?: number;
6178
6895
  }>;
6896
+ /**
6897
+ * A NURBS curve (DXF SPLINE). `knots` number controlPoints + degree + 1,
6898
+ * non-decreasing; `weights` (one per control point) make it rational. With
6899
+ * `fitPoints` the curve was drawn through them. Easiest to create through
6900
+ * points: `splineThrough(points)` from "lineadraw/helpers".
6901
+ */
6902
+ type SplineInput = ObjectInputShape<{
6903
+ type: "spline";
6904
+ degree: number;
6905
+ controlPoints: readonly Vec2Like[];
6906
+ knots: readonly number[];
6907
+ weights?: readonly number[];
6908
+ fitPoints?: readonly Vec2Like[];
6909
+ /** Fit splines: the direction the curve leaves its first fit point. */
6910
+ startTangent?: Vec2Like;
6911
+ /** Fit splines: the direction the curve arrives at its last fit point. */
6912
+ endTangent?: Vec2Like;
6913
+ closed?: boolean;
6914
+ }>;
6915
+ /**
6916
+ * A hatch boundary edge — the geometry of a line, an arc, an elliptic arc or
6917
+ * a spline. An arc runs CCW from startAngle to endAngle (equal = a full
6918
+ * circle); an ellipse in DXF form (parameters, 0 → 2π = whole). Edges are
6919
+ * chained by their ends, stored in either direction. A polygon or bulged
6920
+ * outline: `hatchLoop(points)` from "lineadraw/helpers".
6921
+ */
6922
+ type HatchEdgeInput = {
6923
+ kind: "line";
6924
+ a: Vec2Like;
6925
+ b: Vec2Like;
6926
+ } | {
6927
+ kind: "arc";
6928
+ center: Vec2Like;
6929
+ radius: number;
6930
+ startAngle: number;
6931
+ endAngle: number;
6932
+ } | {
6933
+ kind: "ellipse";
6934
+ center: Vec2Like;
6935
+ majorAxis: Vec2Like;
6936
+ ratio: number;
6937
+ startAngle?: number;
6938
+ endAngle?: number;
6939
+ } | {
6940
+ kind: "spline";
6941
+ degree: number;
6942
+ controlPoints: readonly Vec2Like[];
6943
+ knots: readonly number[];
6944
+ weights?: readonly number[];
6945
+ /** Drawn through points: those points, as on a spline. */
6946
+ fitPoints?: readonly Vec2Like[];
6947
+ };
6179
6948
  type HatchInput = ObjectInputShape<{
6180
6949
  type: "hatch";
6181
- /** loops[0] = outer boundary, the rest are holes (even-odd). */
6950
+ /** loops[0] = outer boundary, the rest are holes (even-odd); each a
6951
+ * closed chain of edges (a circle, ellipse or closed spline is one). */
6182
6952
  loops: readonly {
6183
- points: readonly PolylineVertexInput[];
6953
+ edges: readonly HatchEdgeInput[];
6184
6954
  }[];
6185
6955
  fill?: {
6186
6956
  kind: "solid";
@@ -6400,7 +7170,7 @@ type CommentInput = ObjectInputShape<{
6400
7170
  }>;
6401
7171
  /** What a script WRITES — the union of the authoring DTOs above (what
6402
7172
  * `document.add` takes). Reads return `ModelObject`. */
6403
- type ModelObjectInput$1 = LineInput | PointInput$1 | PolylineInput | CircleInput | ArcInput | EllipseInput | HatchInput | TextInput | DimensionInput | BlockInput | TableInput | ViewportInput | CommentInput | ReferenceInput;
7173
+ type ModelObjectInput$1 = LineInput | PointInput$1 | PolylineInput | CircleInput | ArcInput | EllipseInput | SplineInput | HatchInput | TextInput | DimensionInput | BlockInput | TableInput | ViewportInput | CommentInput | ReferenceInput;
6404
7174
  /** Text style keys a text, table or table cell may override. */
6405
7175
  type TextStyleOverride = Partial<Omit<TextStyle, "id" | "name">>;
6406
7176
  /** Dimension style keys a dimension may override. */
@@ -6504,7 +7274,8 @@ interface RenderSvgOptions {
6504
7274
  layout?: string;
6505
7275
  bbox?: AABB;
6506
7276
  measure?: TextMeasurer;
6507
- /** Padding around the content bbox, world mm (default 5). */
7277
+ /** Padding around the content bbox, world mm (default: model renders 2%
7278
+ * of the drawing's larger side, at least 5; layouts 0). */
6508
7279
  padding?: number;
6509
7280
  /** Print-style color remap ("monochrome" = everything black — use with a
6510
7281
  * white background so light editor-theme layers stay visible). Default:
@@ -6695,8 +7466,10 @@ interface Drawing$1 {
6695
7466
  * capability) embedded, every page a raster reference at true scale. */
6696
7467
  importPdfData(data: ArrayBuffer | Uint8Array, opts?: PdfImportOptions): Promise<PdfImportReport>;
6697
7468
  /** Merge block module sources into the document library (verbatim →
6698
- * skip, same id → replace in place, name clash → suffix). Async: awaits
6699
- * the lazy transpiler so evaluation is definitive on return. */
7469
+ * skip, same id → replace in place, name clash → suffix). All or
7470
+ * nothing: one source that does not compile or validate rejects the call
7471
+ * and adds none (same for `addUserCommands`). Async: awaits the lazy
7472
+ * transpiler so evaluation is definitive on return. */
6700
7473
  addBlockDefinitions(sources: readonly string[]): Promise<MergeReport>;
6701
7474
  removeBlockDefinition(id: string): void;
6702
7475
  addUserCommands(sources: readonly string[]): Promise<MergeReport>;
@@ -6885,4 +7658,4 @@ declare function drawingFromJson(text: string): Drawing;
6885
7658
  /** Open a `.linea` file (parse + migrate) into an in-process kernel. */
6886
7659
  declare function openDrawing(path: string, options?: DrawingOptions): Promise<Drawing>;
6887
7660
 
6888
- export { type AABB, type AddOptions, type BlockMeta, type CommandMeta, type DimStyle$1 as DimStyle, type DocumentSummary, Drawing, type Drawing$1 as DrawingApi, type DrawingOptions, type DxfImportOptions, type DxfImportReport, type EditorSurface, type Layer, type LayerInfo, type LayoutOptions, type LayoutPatch, type LineaDocument, type MarketplaceConfig, type MarketplaceHit, type MarketplaceInfo, type MarketplaceQuery, type Measurement, type MergeReport, type ModelObject, type ModelObjectInput, type ModelObjectType, type ObjectQuery, type Operation, type PaperLayout, type PdfImportReport, type RenderPdfOptions as PdfOptions, type RenderPngOptions as PngOptions, type PointInput, type PrintPalette, type SheetName, type RenderSvgOptions as SvgOptions, type TextMeasurer, type TextStyle$1 as TextStyle, type Vec2$1 as Vec2, type ViewportOptions, drawingFromJson, ensureScriptTranspiler, getBlockMetaResult, getCommandMetaResult, newDrawing, openDrawing, parseScale, renderBlockThumbnailSvg, testBlockDefinition };
7661
+ export { type AABB, type AddOptions, type BlockMeta, type CommandMeta, type DimStyle$1 as DimStyle, type DocumentSummary, Drawing, type Drawing$1 as DrawingApi, type DrawingOptions, type DxfImportOptions, type DxfImportReport, type EditorSurface, type Layer, type LayerInfo, type LayoutOptions, type LayoutPatch, type LineaDocument, type MarketplaceConfig, type MarketplaceHit, type MarketplaceInfo, type MarketplaceQuery, type Measurement, type MergeReport, type ModelObject, type ModelObjectInput, type ModelObjectType, type ObjectQuery, type Operation, type PaperLayout, type PdfImportReport, type RenderPdfOptions as PdfOptions, type RenderPngOptions as PngOptions, type PointInput, type PrintPalette, type SheetName, type RenderSvgOptions as SvgOptions, type TextMeasurer, type TextStyle$1 as TextStyle, type Vec2$1 as Vec2, type ViewportOptions, drawingFromJson, ensureScriptTranspiler, getBlockMetaResult, getCommandMetaResult, hatchLoop, newDrawing, openDrawing, parseScale, renderBlockThumbnailSvg, splineThrough, testBlockDefinition };