circuit-json-to-lbrn 0.0.39 → 0.0.40

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/index.js CHANGED
@@ -266,7 +266,7 @@ var addOvalPlatedHole = (platedHole, ctx) => {
266
266
  };
267
267
 
268
268
  // lib/element-handlers/addPlatedHole/addCircularHoleWithRectPad.ts
269
- import { ShapePath as ShapePath3 } from "lbrnts";
269
+ import { ShapePath as ShapePath4 } from "lbrnts";
270
270
 
271
271
  // lib/helpers/roundedRectShape.ts
272
272
  var createRoundedRectPath = ({
@@ -357,12 +357,55 @@ var createRoundedRectPath = ({
357
357
  return { verts, prims };
358
358
  };
359
359
 
360
- // lib/element-handlers/addPlatedHole/addCircularHoleWithRectPad.ts
361
- var addCircularHoleWithRectPad = (platedHole, ctx) => {
360
+ // lib/helpers/addCopperGeometryToNetOrProject.ts
361
+ import { ShapePath as ShapePath3 } from "lbrnts";
362
+
363
+ // lib/helpers/pathToPolygon.ts
364
+ import { Polygon, point as point2 } from "@flatten-js/core";
365
+ var pathToPolygon = (verts) => {
366
+ const points = verts.map((v) => point2(v.x, v.y));
367
+ return new Polygon(points);
368
+ };
369
+
370
+ // lib/helpers/addCopperGeometryToNetOrProject.ts
371
+ var addCopperGeometryToNetOrProject = ({
372
+ geometryId,
373
+ path,
374
+ layer,
375
+ ctx
376
+ }) => {
362
377
  const {
363
378
  project,
379
+ connMap,
380
+ topCutNetGeoms,
381
+ bottomCutNetGeoms,
364
382
  topCopperCutSetting,
365
383
  bottomCopperCutSetting,
384
+ includeLayers
385
+ } = ctx;
386
+ if (!includeLayers.includes(layer)) return;
387
+ const netId = connMap.getNetConnectedToId(geometryId);
388
+ const cutSetting = layer === "top" ? topCopperCutSetting : bottomCopperCutSetting;
389
+ const netGeoms = layer === "top" ? topCutNetGeoms : bottomCutNetGeoms;
390
+ if (netId) {
391
+ const polygon = pathToPolygon(path.verts);
392
+ netGeoms.get(netId)?.push(polygon);
393
+ } else {
394
+ project.children.push(
395
+ new ShapePath3({
396
+ cutIndex: cutSetting.index,
397
+ verts: path.verts,
398
+ prims: path.prims,
399
+ isClosed: true
400
+ })
401
+ );
402
+ }
403
+ };
404
+
405
+ // lib/element-handlers/addPlatedHole/addCircularHoleWithRectPad.ts
406
+ var addCircularHoleWithRectPad = (platedHole, ctx) => {
407
+ const {
408
+ project,
366
409
  soldermaskCutSetting,
367
410
  throughBoardCutSetting,
368
411
  origin,
@@ -385,26 +428,18 @@ var addCircularHoleWithRectPad = (platedHole, ctx) => {
385
428
  borderRadius
386
429
  });
387
430
  if (includeCopper) {
388
- if (includeLayers.includes("top")) {
389
- project.children.push(
390
- new ShapePath3({
391
- cutIndex: topCopperCutSetting.index,
392
- verts: padPath.verts,
393
- prims: padPath.prims,
394
- isClosed: true
395
- })
396
- );
397
- }
398
- if (includeLayers.includes("bottom")) {
399
- project.children.push(
400
- new ShapePath3({
401
- cutIndex: bottomCopperCutSetting.index,
402
- verts: padPath.verts,
403
- prims: padPath.prims,
404
- isClosed: true
405
- })
406
- );
407
- }
431
+ addCopperGeometryToNetOrProject({
432
+ geometryId: platedHole.pcb_plated_hole_id,
433
+ path: padPath,
434
+ layer: "top",
435
+ ctx
436
+ });
437
+ addCopperGeometryToNetOrProject({
438
+ geometryId: platedHole.pcb_plated_hole_id,
439
+ path: padPath,
440
+ layer: "bottom",
441
+ ctx
442
+ });
408
443
  }
409
444
  if (includeSoldermask) {
410
445
  const smPadWidth = padWidth + 2 * globalCopperSoldermaskMarginAdjustment + (platedHole.soldermask_margin ?? 0);
@@ -417,7 +452,7 @@ var addCircularHoleWithRectPad = (platedHole, ctx) => {
417
452
  borderRadius
418
453
  });
419
454
  project.children.push(
420
- new ShapePath3({
455
+ new ShapePath4({
421
456
  cutIndex: soldermaskCutSetting.index,
422
457
  verts: smPadPath.verts,
423
458
  prims: smPadPath.prims,
@@ -435,7 +470,7 @@ var addCircularHoleWithRectPad = (platedHole, ctx) => {
435
470
  segments: 32
436
471
  });
437
472
  project.children.push(
438
- new ShapePath3({
473
+ new ShapePath4({
439
474
  cutIndex: throughBoardCutSetting.index,
440
475
  verts: holePath.verts,
441
476
  prims: holePath.prims,
@@ -446,7 +481,7 @@ var addCircularHoleWithRectPad = (platedHole, ctx) => {
446
481
  };
447
482
 
448
483
  // lib/element-handlers/addPlatedHole/addPillHoleWithRectPad.ts
449
- import { ShapePath as ShapePath4 } from "lbrnts";
484
+ import { ShapePath as ShapePath5 } from "lbrnts";
450
485
 
451
486
  // lib/helpers/pathPointUtils.ts
452
487
  var createPointAdder = ({
@@ -546,8 +581,6 @@ var createPillPath = ({
546
581
  var addPillHoleWithRectPad = (platedHole, ctx) => {
547
582
  const {
548
583
  project,
549
- topCopperCutSetting,
550
- bottomCopperCutSetting,
551
584
  soldermaskCutSetting,
552
585
  throughBoardCutSetting,
553
586
  origin,
@@ -570,26 +603,18 @@ var addPillHoleWithRectPad = (platedHole, ctx) => {
570
603
  borderRadius
571
604
  });
572
605
  if (includeCopper) {
573
- if (includeLayers.includes("top")) {
574
- project.children.push(
575
- new ShapePath4({
576
- cutIndex: topCopperCutSetting.index,
577
- verts: padPath.verts,
578
- prims: padPath.prims,
579
- isClosed: true
580
- })
581
- );
582
- }
583
- if (includeLayers.includes("bottom")) {
584
- project.children.push(
585
- new ShapePath4({
586
- cutIndex: bottomCopperCutSetting.index,
587
- verts: padPath.verts,
588
- prims: padPath.prims,
589
- isClosed: true
590
- })
591
- );
592
- }
606
+ addCopperGeometryToNetOrProject({
607
+ geometryId: platedHole.pcb_plated_hole_id,
608
+ path: padPath,
609
+ layer: "top",
610
+ ctx
611
+ });
612
+ addCopperGeometryToNetOrProject({
613
+ geometryId: platedHole.pcb_plated_hole_id,
614
+ path: padPath,
615
+ layer: "bottom",
616
+ ctx
617
+ });
593
618
  }
594
619
  if (includeSoldermask) {
595
620
  const smPadWidth = padWidth + 2 * globalCopperSoldermaskMarginAdjustment + (platedHole.soldermask_margin ?? 0);
@@ -602,7 +627,7 @@ var addPillHoleWithRectPad = (platedHole, ctx) => {
602
627
  borderRadius
603
628
  });
604
629
  project.children.push(
605
- new ShapePath4({
630
+ new ShapePath5({
606
631
  cutIndex: soldermaskCutSetting.index,
607
632
  verts: smPadPath.verts,
608
633
  prims: smPadPath.prims,
@@ -623,7 +648,7 @@ var addPillHoleWithRectPad = (platedHole, ctx) => {
623
648
  height: holeHeight
624
649
  });
625
650
  project.children.push(
626
- new ShapePath4({
651
+ new ShapePath5({
627
652
  cutIndex: throughBoardCutSetting.index,
628
653
  verts: holePath.verts,
629
654
  prims: holePath.prims,
@@ -634,12 +659,10 @@ var addPillHoleWithRectPad = (platedHole, ctx) => {
634
659
  };
635
660
 
636
661
  // lib/element-handlers/addPlatedHole/addRotatedPillHoleWithRectPad.ts
637
- import { ShapePath as ShapePath5 } from "lbrnts";
662
+ import { ShapePath as ShapePath6 } from "lbrnts";
638
663
  var addRotatedPillHoleWithRectPad = (platedHole, ctx) => {
639
664
  const {
640
665
  project,
641
- topCopperCutSetting,
642
- bottomCopperCutSetting,
643
666
  soldermaskCutSetting,
644
667
  throughBoardCutSetting,
645
668
  origin,
@@ -665,26 +688,18 @@ var addRotatedPillHoleWithRectPad = (platedHole, ctx) => {
665
688
  rotation: padRotation
666
689
  });
667
690
  if (includeCopper) {
668
- if (includeLayers.includes("top")) {
669
- project.children.push(
670
- new ShapePath5({
671
- cutIndex: topCopperCutSetting.index,
672
- verts: padPath.verts,
673
- prims: padPath.prims,
674
- isClosed: true
675
- })
676
- );
677
- }
678
- if (includeLayers.includes("bottom")) {
679
- project.children.push(
680
- new ShapePath5({
681
- cutIndex: bottomCopperCutSetting.index,
682
- verts: padPath.verts,
683
- prims: padPath.prims,
684
- isClosed: true
685
- })
686
- );
687
- }
691
+ addCopperGeometryToNetOrProject({
692
+ geometryId: platedHole.pcb_plated_hole_id,
693
+ path: padPath,
694
+ layer: "top",
695
+ ctx
696
+ });
697
+ addCopperGeometryToNetOrProject({
698
+ geometryId: platedHole.pcb_plated_hole_id,
699
+ path: padPath,
700
+ layer: "bottom",
701
+ ctx
702
+ });
688
703
  }
689
704
  if (includeSoldermask) {
690
705
  const smPadWidth = padWidth + 2 * globalCopperSoldermaskMarginAdjustment + (platedHole.soldermask_margin ?? 0);
@@ -699,7 +714,7 @@ var addRotatedPillHoleWithRectPad = (platedHole, ctx) => {
699
714
  rotation: padRotation
700
715
  });
701
716
  project.children.push(
702
- new ShapePath5({
717
+ new ShapePath6({
703
718
  cutIndex: soldermaskCutSetting.index,
704
719
  verts: smPadPath.verts,
705
720
  prims: smPadPath.prims,
@@ -722,7 +737,7 @@ var addRotatedPillHoleWithRectPad = (platedHole, ctx) => {
722
737
  rotation: holeRotation
723
738
  });
724
739
  project.children.push(
725
- new ShapePath5({
740
+ new ShapePath6({
726
741
  cutIndex: throughBoardCutSetting.index,
727
742
  verts: holePath.verts,
728
743
  prims: holePath.prims,
@@ -733,7 +748,7 @@ var addRotatedPillHoleWithRectPad = (platedHole, ctx) => {
733
748
  };
734
749
 
735
750
  // lib/element-handlers/addPlatedHole/addHoleWithPolygonPad.ts
736
- import { ShapePath as ShapePath6 } from "lbrnts";
751
+ import { ShapePath as ShapePath7 } from "lbrnts";
737
752
 
738
753
  // lib/helpers/polygonShape.ts
739
754
  var createPolygonPathFromOutline = ({
@@ -742,9 +757,9 @@ var createPolygonPathFromOutline = ({
742
757
  offsetY
743
758
  }) => {
744
759
  const verts = [];
745
- for (const point6 of outline) {
746
- const x = (point6.x ?? 0) + offsetX;
747
- const y = (point6.y ?? 0) + offsetY;
760
+ for (const point5 of outline) {
761
+ const x = (point5.x ?? 0) + offsetX;
762
+ const y = (point5.y ?? 0) + offsetY;
748
763
  verts.push({ x, y });
749
764
  }
750
765
  if (verts.length === 0) {
@@ -760,8 +775,6 @@ var createPolygonPathFromOutline = ({
760
775
  var addHoleWithPolygonPad = (platedHole, ctx) => {
761
776
  const {
762
777
  project,
763
- topCopperCutSetting,
764
- bottomCopperCutSetting,
765
778
  soldermaskCutSetting,
766
779
  throughBoardCutSetting,
767
780
  origin,
@@ -777,30 +790,22 @@ var addHoleWithPolygonPad = (platedHole, ctx) => {
777
790
  offsetY: platedHole.y + origin.y
778
791
  });
779
792
  if (includeCopper) {
780
- if (includeLayers.includes("top")) {
781
- project.children.push(
782
- new ShapePath6({
783
- cutIndex: topCopperCutSetting.index,
784
- verts: pad.verts,
785
- prims: pad.prims,
786
- isClosed: true
787
- })
788
- );
789
- }
790
- if (includeLayers.includes("bottom")) {
791
- project.children.push(
792
- new ShapePath6({
793
- cutIndex: bottomCopperCutSetting.index,
794
- verts: pad.verts,
795
- prims: pad.prims,
796
- isClosed: true
797
- })
798
- );
799
- }
793
+ addCopperGeometryToNetOrProject({
794
+ geometryId: platedHole.pcb_plated_hole_id,
795
+ path: pad,
796
+ layer: "top",
797
+ ctx
798
+ });
799
+ addCopperGeometryToNetOrProject({
800
+ geometryId: platedHole.pcb_plated_hole_id,
801
+ path: pad,
802
+ layer: "bottom",
803
+ ctx
804
+ });
800
805
  }
801
806
  if (includeSoldermask) {
802
807
  project.children.push(
803
- new ShapePath6({
808
+ new ShapePath7({
804
809
  cutIndex: soldermaskCutSetting.index,
805
810
  verts: pad.verts,
806
811
  prims: pad.prims,
@@ -820,7 +825,7 @@ var addHoleWithPolygonPad = (platedHole, ctx) => {
820
825
  segments: 64
821
826
  });
822
827
  project.children.push(
823
- new ShapePath6({
828
+ new ShapePath7({
824
829
  cutIndex: throughBoardCutSetting.index,
825
830
  verts: hole.verts,
826
831
  prims: hole.prims,
@@ -839,7 +844,7 @@ var addHoleWithPolygonPad = (platedHole, ctx) => {
839
844
  segments: 64
840
845
  });
841
846
  project.children.push(
842
- new ShapePath6({
847
+ new ShapePath7({
843
848
  cutIndex: throughBoardCutSetting.index,
844
849
  verts: hole.verts,
845
850
  prims: hole.prims,
@@ -850,7 +855,7 @@ var addHoleWithPolygonPad = (platedHole, ctx) => {
850
855
  };
851
856
 
852
857
  // lib/element-handlers/addPlatedHole/addPillPlatedHole.ts
853
- import { ShapePath as ShapePath7 } from "lbrnts";
858
+ import { ShapePath as ShapePath8 } from "lbrnts";
854
859
  var addPcbPlatedHolePill = (platedHole, ctx) => {
855
860
  const {
856
861
  project,
@@ -877,7 +882,7 @@ var addPcbPlatedHolePill = (platedHole, ctx) => {
877
882
  });
878
883
  if (includeLayers.includes("top")) {
879
884
  project.children.push(
880
- new ShapePath7({
885
+ new ShapePath8({
881
886
  cutIndex: topCopperCutSetting.index,
882
887
  verts: outer.verts,
883
888
  prims: outer.prims,
@@ -887,7 +892,7 @@ var addPcbPlatedHolePill = (platedHole, ctx) => {
887
892
  }
888
893
  if (includeLayers.includes("bottom")) {
889
894
  project.children.push(
890
- new ShapePath7({
895
+ new ShapePath8({
891
896
  cutIndex: bottomCopperCutSetting.index,
892
897
  verts: outer.verts,
893
898
  prims: outer.prims,
@@ -907,7 +912,7 @@ var addPcbPlatedHolePill = (platedHole, ctx) => {
907
912
  rotation
908
913
  });
909
914
  project.children.push(
910
- new ShapePath7({
915
+ new ShapePath8({
911
916
  cutIndex: soldermaskCutSetting.index,
912
917
  verts: outer.verts,
913
918
  prims: outer.prims,
@@ -924,7 +929,7 @@ var addPcbPlatedHolePill = (platedHole, ctx) => {
924
929
  rotation
925
930
  });
926
931
  project.children.push(
927
- new ShapePath7({
932
+ new ShapePath8({
928
933
  cutIndex: throughBoardCutSetting.index,
929
934
  verts: inner.verts,
930
935
  prims: inner.prims,
@@ -958,17 +963,12 @@ var addPlatedHole = (platedHole, ctx) => {
958
963
  };
959
964
 
960
965
  // lib/element-handlers/addSmtPad/addRectSmtPad.ts
961
- import { Box } from "@flatten-js/core";
962
- import { ShapePath as ShapePath8 } from "lbrnts";
966
+ import "@flatten-js/core";
967
+ import { ShapePath as ShapePath9 } from "lbrnts";
963
968
  var addRectSmtPad = (smtPad, ctx) => {
964
969
  const {
965
970
  project,
966
- topCopperCutSetting,
967
- bottomCopperCutSetting,
968
971
  soldermaskCutSetting,
969
- connMap,
970
- topCutNetGeoms,
971
- bottomCutNetGeoms,
972
972
  origin,
973
973
  includeCopper,
974
974
  includeSoldermask,
@@ -986,44 +986,24 @@ var addRectSmtPad = (smtPad, ctx) => {
986
986
  const centerY = smtPad.y + origin.y;
987
987
  const halfWidth = smtPad.width / 2;
988
988
  const halfHeight = smtPad.height / 2;
989
- const netId = connMap.getNetConnectedToId(smtPad.pcb_smtpad_id);
990
- const copperCutSetting = padLayer === "top" ? topCopperCutSetting : bottomCopperCutSetting;
991
- const netGeoms = padLayer === "top" ? topCutNetGeoms : bottomCutNetGeoms;
992
989
  if (includeCopper) {
993
- if (netId) {
994
- netGeoms.get(netId)?.push(
995
- new Box(
996
- centerX - halfWidth,
997
- centerY - halfHeight,
998
- centerX + halfWidth,
999
- centerY + halfHeight
1000
- )
1001
- );
1002
- } else {
1003
- const verts = [
990
+ const path = {
991
+ verts: [
1004
992
  { x: centerX - halfWidth, y: centerY - halfHeight },
1005
993
  { x: centerX + halfWidth, y: centerY - halfHeight },
1006
994
  { x: centerX + halfWidth, y: centerY + halfHeight },
1007
995
  { x: centerX - halfWidth, y: centerY + halfHeight },
1008
996
  { x: centerX - halfWidth, y: centerY - halfHeight }
1009
997
  // Close the path
1010
- ];
1011
- const prims = [
1012
- { type: 0 },
1013
- { type: 0 },
1014
- { type: 0 },
1015
- { type: 0 },
1016
- { type: 0 }
1017
- ];
1018
- project.children.push(
1019
- new ShapePath8({
1020
- cutIndex: copperCutSetting.index,
1021
- verts,
1022
- prims,
1023
- isClosed: true
1024
- })
1025
- );
1026
- }
998
+ ],
999
+ prims: [{ type: 0 }, { type: 0 }, { type: 0 }, { type: 0 }, { type: 0 }]
1000
+ };
1001
+ addCopperGeometryToNetOrProject({
1002
+ geometryId: smtPad.pcb_smtpad_id,
1003
+ path,
1004
+ layer: padLayer,
1005
+ ctx
1006
+ });
1027
1007
  }
1028
1008
  if (includeSoldermask) {
1029
1009
  const smHalfWidth = halfWidth + globalCopperSoldermaskMarginAdjustment + (smtPad.soldermask_margin ?? 0);
@@ -1044,7 +1024,7 @@ var addRectSmtPad = (smtPad, ctx) => {
1044
1024
  { type: 0 }
1045
1025
  ];
1046
1026
  project.children.push(
1047
- new ShapePath8({
1027
+ new ShapePath9({
1048
1028
  cutIndex: soldermaskCutSetting.index,
1049
1029
  verts,
1050
1030
  prims,
@@ -1055,20 +1035,14 @@ var addRectSmtPad = (smtPad, ctx) => {
1055
1035
  };
1056
1036
 
1057
1037
  // lib/element-handlers/addSmtPad/addCircleSmtPad.ts
1058
- import { ShapePath as ShapePath9 } from "lbrnts";
1059
- import { Circle as Circle2, point as point2 } from "@flatten-js/core";
1038
+ import { ShapePath as ShapePath10 } from "lbrnts";
1060
1039
  var addCircleSmtPad = (smtPad, ctx) => {
1061
1040
  const {
1062
1041
  project,
1063
- topCopperCutSetting,
1064
- bottomCopperCutSetting,
1065
1042
  soldermaskCutSetting,
1066
- topCutNetGeoms,
1067
- bottomCutNetGeoms,
1068
1043
  origin,
1069
1044
  includeCopper,
1070
1045
  includeSoldermask,
1071
- connMap,
1072
1046
  globalCopperSoldermaskMarginAdjustment,
1073
1047
  includeLayers
1074
1048
  } = ctx;
@@ -1079,33 +1053,22 @@ var addCircleSmtPad = (smtPad, ctx) => {
1079
1053
  if (!includeLayers.includes(padLayer)) {
1080
1054
  return;
1081
1055
  }
1082
- const copperCutSetting = padLayer === "top" ? topCopperCutSetting : bottomCopperCutSetting;
1083
- const netGeoms = padLayer === "top" ? topCutNetGeoms : bottomCutNetGeoms;
1084
1056
  const centerX = smtPad.x + origin.x;
1085
1057
  const centerY = smtPad.y + origin.y;
1086
1058
  if (smtPad.radius > 0) {
1087
1059
  const outerRadius = smtPad.radius;
1088
1060
  if (includeCopper) {
1089
- const netId = connMap.getNetConnectedToId(smtPad.pcb_smtpad_id);
1090
- const circle = new Circle2(point2(centerX, centerY), outerRadius);
1091
- const polygon = circleToPolygon(circle);
1092
- if (netId) {
1093
- netGeoms.get(netId)?.push(polygon);
1094
- } else {
1095
- const outer = createCirclePath({
1096
- centerX,
1097
- centerY,
1098
- radius: outerRadius
1099
- });
1100
- project.children.push(
1101
- new ShapePath9({
1102
- cutIndex: copperCutSetting.index,
1103
- verts: outer.verts,
1104
- prims: outer.prims,
1105
- isClosed: true
1106
- })
1107
- );
1108
- }
1061
+ const path = createCirclePath({
1062
+ centerX,
1063
+ centerY,
1064
+ radius: outerRadius
1065
+ });
1066
+ addCopperGeometryToNetOrProject({
1067
+ geometryId: smtPad.pcb_smtpad_id,
1068
+ path,
1069
+ layer: padLayer,
1070
+ ctx
1071
+ });
1109
1072
  }
1110
1073
  if (includeSoldermask) {
1111
1074
  const smRadius = outerRadius + globalCopperSoldermaskMarginAdjustment + (smtPad.soldermask_margin ?? 0);
@@ -1115,7 +1078,7 @@ var addCircleSmtPad = (smtPad, ctx) => {
1115
1078
  radius: smRadius
1116
1079
  });
1117
1080
  project.children.push(
1118
- new ShapePath9({
1081
+ new ShapePath10({
1119
1082
  cutIndex: soldermaskCutSetting.index,
1120
1083
  verts: outer.verts,
1121
1084
  prims: outer.prims,
@@ -1127,28 +1090,14 @@ var addCircleSmtPad = (smtPad, ctx) => {
1127
1090
  };
1128
1091
 
1129
1092
  // lib/element-handlers/addSmtPad/addPillSmtPad.ts
1130
- import { ShapePath as ShapePath10 } from "lbrnts";
1131
-
1132
- // lib/helpers/pathToPolygon.ts
1133
- import { Polygon as Polygon2, point as point3 } from "@flatten-js/core";
1134
- var pathToPolygon = (verts) => {
1135
- const points = verts.map((v) => point3(v.x, v.y));
1136
- return new Polygon2(points);
1137
- };
1138
-
1139
- // lib/element-handlers/addSmtPad/addPillSmtPad.ts
1093
+ import { ShapePath as ShapePath11 } from "lbrnts";
1140
1094
  var addPillSmtPad = (smtPad, ctx) => {
1141
1095
  const {
1142
1096
  project,
1143
- topCopperCutSetting,
1144
- bottomCopperCutSetting,
1145
1097
  soldermaskCutSetting,
1146
- topCutNetGeoms,
1147
- bottomCutNetGeoms,
1148
1098
  origin,
1149
1099
  includeCopper,
1150
1100
  includeSoldermask,
1151
- connMap,
1152
1101
  globalCopperSoldermaskMarginAdjustment,
1153
1102
  includeLayers
1154
1103
  } = ctx;
@@ -1159,8 +1108,6 @@ var addPillSmtPad = (smtPad, ctx) => {
1159
1108
  if (!includeLayers.includes(padLayer)) {
1160
1109
  return;
1161
1110
  }
1162
- const copperCutSetting = padLayer === "top" ? topCopperCutSetting : bottomCopperCutSetting;
1163
- const netGeoms = padLayer === "top" ? topCutNetGeoms : bottomCutNetGeoms;
1164
1111
  const centerX = smtPad.x + origin.x;
1165
1112
  const centerY = smtPad.y + origin.y;
1166
1113
  if (smtPad.width > 0 && smtPad.height > 0) {
@@ -1171,20 +1118,12 @@ var addPillSmtPad = (smtPad, ctx) => {
1171
1118
  height: smtPad.height
1172
1119
  });
1173
1120
  if (includeCopper) {
1174
- const netId = connMap.getNetConnectedToId(smtPad.pcb_smtpad_id);
1175
- const polygon = pathToPolygon(outer.verts);
1176
- if (netId) {
1177
- netGeoms.get(netId)?.push(polygon);
1178
- } else {
1179
- project.children.push(
1180
- new ShapePath10({
1181
- cutIndex: copperCutSetting.index,
1182
- verts: outer.verts,
1183
- prims: outer.prims,
1184
- isClosed: true
1185
- })
1186
- );
1187
- }
1121
+ addCopperGeometryToNetOrProject({
1122
+ geometryId: smtPad.pcb_smtpad_id,
1123
+ path: outer,
1124
+ layer: padLayer,
1125
+ ctx
1126
+ });
1188
1127
  }
1189
1128
  if (includeSoldermask) {
1190
1129
  const smWidth = smtPad.width + 2 * globalCopperSoldermaskMarginAdjustment + (smtPad.soldermask_margin ?? 0);
@@ -1196,7 +1135,7 @@ var addPillSmtPad = (smtPad, ctx) => {
1196
1135
  height: smHeight
1197
1136
  });
1198
1137
  project.children.push(
1199
- new ShapePath10({
1138
+ new ShapePath11({
1200
1139
  cutIndex: soldermaskCutSetting.index,
1201
1140
  verts: smOuter.verts,
1202
1141
  prims: smOuter.prims,
@@ -1208,19 +1147,14 @@ var addPillSmtPad = (smtPad, ctx) => {
1208
1147
  };
1209
1148
 
1210
1149
  // lib/element-handlers/addSmtPad/addRotatedPillSmtPad.ts
1211
- import { ShapePath as ShapePath11 } from "lbrnts";
1150
+ import { ShapePath as ShapePath12 } from "lbrnts";
1212
1151
  var addRotatedPillSmtPad = (smtPad, ctx) => {
1213
1152
  const {
1214
1153
  project,
1215
- topCopperCutSetting,
1216
- bottomCopperCutSetting,
1217
1154
  soldermaskCutSetting,
1218
- topCutNetGeoms,
1219
- bottomCutNetGeoms,
1220
1155
  origin,
1221
1156
  includeCopper,
1222
1157
  includeSoldermask,
1223
- connMap,
1224
1158
  globalCopperSoldermaskMarginAdjustment,
1225
1159
  includeLayers
1226
1160
  } = ctx;
@@ -1231,8 +1165,6 @@ var addRotatedPillSmtPad = (smtPad, ctx) => {
1231
1165
  if (!includeLayers.includes(padLayer)) {
1232
1166
  return;
1233
1167
  }
1234
- const copperCutSetting = padLayer === "top" ? topCopperCutSetting : bottomCopperCutSetting;
1235
- const netGeoms = padLayer === "top" ? topCutNetGeoms : bottomCutNetGeoms;
1236
1168
  const centerX = smtPad.x + origin.x;
1237
1169
  const centerY = smtPad.y + origin.y;
1238
1170
  if (smtPad.width > 0 && smtPad.height > 0) {
@@ -1244,20 +1176,12 @@ var addRotatedPillSmtPad = (smtPad, ctx) => {
1244
1176
  rotation: (smtPad.ccw_rotation ?? 0) * (Math.PI / 180)
1245
1177
  });
1246
1178
  if (includeCopper) {
1247
- const netId = connMap.getNetConnectedToId(smtPad.pcb_smtpad_id);
1248
- const polygon = pathToPolygon(outer.verts);
1249
- if (netId) {
1250
- netGeoms.get(netId)?.push(polygon);
1251
- } else {
1252
- project.children.push(
1253
- new ShapePath11({
1254
- cutIndex: copperCutSetting.index,
1255
- verts: outer.verts,
1256
- prims: outer.prims,
1257
- isClosed: true
1258
- })
1259
- );
1260
- }
1179
+ addCopperGeometryToNetOrProject({
1180
+ geometryId: smtPad.pcb_smtpad_id,
1181
+ path: outer,
1182
+ layer: padLayer,
1183
+ ctx
1184
+ });
1261
1185
  }
1262
1186
  if (includeSoldermask) {
1263
1187
  const smWidth = smtPad.width + 2 * globalCopperSoldermaskMarginAdjustment + (smtPad.soldermask_margin ?? 0);
@@ -1270,7 +1194,7 @@ var addRotatedPillSmtPad = (smtPad, ctx) => {
1270
1194
  rotation: (smtPad.ccw_rotation ?? 0) * (Math.PI / 180)
1271
1195
  });
1272
1196
  project.children.push(
1273
- new ShapePath11({
1197
+ new ShapePath12({
1274
1198
  cutIndex: soldermaskCutSetting.index,
1275
1199
  verts: smOuter.verts,
1276
1200
  prims: smOuter.prims,
@@ -1282,7 +1206,7 @@ var addRotatedPillSmtPad = (smtPad, ctx) => {
1282
1206
  };
1283
1207
 
1284
1208
  // lib/element-handlers/addSmtPad/addPolygonSmtPad.ts
1285
- import { ShapePath as ShapePath12 } from "lbrnts";
1209
+ import { ShapePath as ShapePath13 } from "lbrnts";
1286
1210
 
1287
1211
  // lib/polygon-to-shape-path.ts
1288
1212
  function polygonToShapePathData(polygon) {
@@ -1315,15 +1239,10 @@ function polygonToShapePathData(polygon) {
1315
1239
  var addPolygonSmtPad = (smtPad, ctx) => {
1316
1240
  const {
1317
1241
  project,
1318
- topCopperCutSetting,
1319
- bottomCopperCutSetting,
1320
1242
  soldermaskCutSetting,
1321
- topCutNetGeoms,
1322
- bottomCutNetGeoms,
1323
1243
  origin,
1324
1244
  includeCopper,
1325
1245
  includeSoldermask,
1326
- connMap,
1327
1246
  globalCopperSoldermaskMarginAdjustment,
1328
1247
  includeLayers
1329
1248
  } = ctx;
@@ -1334,8 +1253,6 @@ var addPolygonSmtPad = (smtPad, ctx) => {
1334
1253
  if (!includeLayers.includes(padLayer)) {
1335
1254
  return;
1336
1255
  }
1337
- const copperCutSetting = padLayer === "top" ? topCopperCutSetting : bottomCopperCutSetting;
1338
- const netGeoms = padLayer === "top" ? topCutNetGeoms : bottomCutNetGeoms;
1339
1256
  if (smtPad.points.length >= 3) {
1340
1257
  const pad = createPolygonPathFromOutline({
1341
1258
  outline: smtPad.points,
@@ -1343,24 +1260,16 @@ var addPolygonSmtPad = (smtPad, ctx) => {
1343
1260
  offsetY: origin.y
1344
1261
  });
1345
1262
  if (includeCopper) {
1346
- const netId = connMap.getNetConnectedToId(smtPad.pcb_smtpad_id);
1347
- const polygon = pathToPolygon(pad.verts);
1348
- if (netId) {
1349
- netGeoms.get(netId)?.push(polygon);
1350
- } else {
1351
- project.children.push(
1352
- new ShapePath12({
1353
- cutIndex: copperCutSetting.index,
1354
- verts: pad.verts,
1355
- prims: pad.prims,
1356
- isClosed: true
1357
- })
1358
- );
1359
- }
1263
+ addCopperGeometryToNetOrProject({
1264
+ geometryId: smtPad.pcb_smtpad_id,
1265
+ path: pad,
1266
+ layer: padLayer,
1267
+ ctx
1268
+ });
1360
1269
  }
1361
1270
  if (includeSoldermask) {
1362
1271
  project.children.push(
1363
- new ShapePath12({
1272
+ new ShapePath13({
1364
1273
  cutIndex: soldermaskCutSetting.index,
1365
1274
  verts: pad.verts,
1366
1275
  prims: pad.prims,
@@ -1372,19 +1281,14 @@ var addPolygonSmtPad = (smtPad, ctx) => {
1372
1281
  };
1373
1282
 
1374
1283
  // lib/element-handlers/addSmtPad/addRotatedRectSmtPad.ts
1375
- import { ShapePath as ShapePath13 } from "lbrnts";
1284
+ import { ShapePath as ShapePath14 } from "lbrnts";
1376
1285
  var addRotatedRectSmtPad = (smtPad, ctx) => {
1377
1286
  const {
1378
1287
  project,
1379
- topCopperCutSetting,
1380
- bottomCopperCutSetting,
1381
1288
  soldermaskCutSetting,
1382
- topCutNetGeoms,
1383
- bottomCutNetGeoms,
1384
1289
  origin,
1385
1290
  includeCopper,
1386
1291
  includeSoldermask,
1387
- connMap,
1388
1292
  globalCopperSoldermaskMarginAdjustment,
1389
1293
  includeLayers
1390
1294
  } = ctx;
@@ -1395,8 +1299,6 @@ var addRotatedRectSmtPad = (smtPad, ctx) => {
1395
1299
  if (!includeLayers.includes(padLayer)) {
1396
1300
  return;
1397
1301
  }
1398
- const copperCutSetting = padLayer === "top" ? topCopperCutSetting : bottomCopperCutSetting;
1399
- const netGeoms = padLayer === "top" ? topCutNetGeoms : bottomCutNetGeoms;
1400
1302
  const centerX = smtPad.x + origin.x;
1401
1303
  const centerY = smtPad.y + origin.y;
1402
1304
  const rotation = (smtPad.ccw_rotation ?? 0) * (Math.PI / 180);
@@ -1412,20 +1314,12 @@ var addRotatedRectSmtPad = (smtPad, ctx) => {
1412
1314
  rotation
1413
1315
  });
1414
1316
  if (includeCopper) {
1415
- const netId = connMap.getNetConnectedToId(smtPad.pcb_smtpad_id);
1416
- const polygon = pathToPolygon(outer.verts);
1417
- if (netId) {
1418
- netGeoms.get(netId)?.push(polygon);
1419
- } else {
1420
- project.children.push(
1421
- new ShapePath13({
1422
- cutIndex: copperCutSetting.index,
1423
- verts: outer.verts,
1424
- prims: outer.prims,
1425
- isClosed: true
1426
- })
1427
- );
1428
- }
1317
+ addCopperGeometryToNetOrProject({
1318
+ geometryId: smtPad.pcb_smtpad_id,
1319
+ path: outer,
1320
+ layer: padLayer,
1321
+ ctx
1322
+ });
1429
1323
  }
1430
1324
  if (includeSoldermask) {
1431
1325
  const smWidth = smtPad.width + 2 * globalCopperSoldermaskMarginAdjustment + (smtPad.soldermask_margin ?? 0);
@@ -1440,7 +1334,7 @@ var addRotatedRectSmtPad = (smtPad, ctx) => {
1440
1334
  rotation
1441
1335
  });
1442
1336
  project.children.push(
1443
- new ShapePath13({
1337
+ new ShapePath14({
1444
1338
  cutIndex: soldermaskCutSetting.index,
1445
1339
  verts: smOuter.verts,
1446
1340
  prims: smOuter.prims,
@@ -1479,8 +1373,8 @@ var splitRouteSegmentsByLayer = (trace) => {
1479
1373
  }
1480
1374
  let currentSegment = [];
1481
1375
  let currentLayer = null;
1482
- for (const point6 of trace.route) {
1483
- if ("route_type" in point6 && point6.route_type === "via") {
1376
+ for (const point5 of trace.route) {
1377
+ if ("route_type" in point5 && point5.route_type === "via") {
1484
1378
  if (currentLayer && currentSegment.length > 0) {
1485
1379
  if (!layerSegments.has(currentLayer)) {
1486
1380
  layerSegments.set(currentLayer, []);
@@ -1491,9 +1385,9 @@ var splitRouteSegmentsByLayer = (trace) => {
1491
1385
  currentLayer = null;
1492
1386
  continue;
1493
1387
  }
1494
- const isWirePoint = !("route_type" in point6) || point6.route_type === "wire";
1495
- if (isWirePoint && "layer" in point6 && point6.layer) {
1496
- const pointLayer = point6.layer;
1388
+ const isWirePoint = !("route_type" in point5) || point5.route_type === "wire";
1389
+ if (isWirePoint && "layer" in point5 && point5.layer) {
1390
+ const pointLayer = point5.layer;
1497
1391
  if (pointLayer !== "top" && pointLayer !== "bottom") {
1498
1392
  continue;
1499
1393
  }
@@ -1507,7 +1401,7 @@ var splitRouteSegmentsByLayer = (trace) => {
1507
1401
  currentSegment = [];
1508
1402
  }
1509
1403
  currentLayer = pointLayer;
1510
- currentSegment.push({ x: point6.x, y: point6.y });
1404
+ currentSegment.push({ x: point5.x, y: point5.y });
1511
1405
  }
1512
1406
  }
1513
1407
  if (currentLayer && currentSegment.length > 0) {
@@ -1743,9 +1637,9 @@ var addPcbTrace = (trace, ctx) => {
1743
1637
  if (!trace.route || trace.route.length < 2) {
1744
1638
  return;
1745
1639
  }
1746
- const wirePoint = trace.route.find((point6) => {
1747
- if (!("route_type" in point6)) return true;
1748
- return point6.route_type === "wire";
1640
+ const wirePoint = trace.route.find((point5) => {
1641
+ if (!("route_type" in point5)) return true;
1642
+ return point5.route_type === "wire";
1749
1643
  });
1750
1644
  const traceWidth = wirePoint?.width ?? 0.15;
1751
1645
  const layerSegments = splitRouteSegmentsByLayer(trace);
@@ -1816,8 +1710,8 @@ var addPcbTrace = (trace, ctx) => {
1816
1710
  };
1817
1711
 
1818
1712
  // lib/element-handlers/addPcbBoard/index.ts
1819
- import { Polygon as Polygon3, point as point4 } from "@flatten-js/core";
1820
- import { ShapePath as ShapePath14 } from "lbrnts";
1713
+ import { Polygon as Polygon2, point as point3 } from "@flatten-js/core";
1714
+ import { ShapePath as ShapePath15 } from "lbrnts";
1821
1715
  var addPcbBoard = (board, ctx) => {
1822
1716
  const {
1823
1717
  origin,
@@ -1829,9 +1723,9 @@ var addPcbBoard = (board, ctx) => {
1829
1723
  } = ctx;
1830
1724
  let polygon = null;
1831
1725
  if (board.outline?.length) {
1832
- polygon = new Polygon3(
1726
+ polygon = new Polygon2(
1833
1727
  board.outline.map(
1834
- (outlinePoint) => point4(outlinePoint.x + origin.x, outlinePoint.y + origin.y)
1728
+ (outlinePoint) => point3(outlinePoint.x + origin.x, outlinePoint.y + origin.y)
1835
1729
  )
1836
1730
  );
1837
1731
  } else if (typeof board.width === "number" && typeof board.height === "number" && board.center) {
@@ -1841,18 +1735,18 @@ var addPcbBoard = (board, ctx) => {
1841
1735
  const minY = board.center.y - halfHeight + origin.y;
1842
1736
  const maxX = board.center.x + halfWidth + origin.x;
1843
1737
  const maxY = board.center.y + halfHeight + origin.y;
1844
- polygon = new Polygon3([
1845
- point4(minX, minY),
1846
- point4(maxX, minY),
1847
- point4(maxX, maxY),
1848
- point4(minX, maxY)
1738
+ polygon = new Polygon2([
1739
+ point3(minX, minY),
1740
+ point3(maxX, minY),
1741
+ point3(maxX, maxY),
1742
+ point3(minX, maxY)
1849
1743
  ]);
1850
1744
  }
1851
1745
  if (!polygon) return;
1852
1746
  const { verts, prims } = polygonToShapePathData(polygon);
1853
1747
  if (includeCopper) {
1854
1748
  project.children.push(
1855
- new ShapePath14({
1749
+ new ShapePath15({
1856
1750
  cutIndex: throughBoardCutSetting.index,
1857
1751
  verts,
1858
1752
  prims,
@@ -1890,14 +1784,14 @@ var calculateCircuitBounds = (circuitJson) => {
1890
1784
  }
1891
1785
  }
1892
1786
  for (const trace of db.pcb_trace.list()) {
1893
- const isWidthPoint = (point6) => "width" in point6 && typeof point6.width === "number";
1787
+ const isWidthPoint = (point5) => "width" in point5 && typeof point5.width === "number";
1894
1788
  const halfWidth = trace.route_thickness_mode === "interpolated" ? 0 : (trace.route.find(isWidthPoint)?.width ?? 0) / 2;
1895
- for (const point6 of trace.route) {
1896
- const pointWidth = trace.route_thickness_mode === "interpolated" ? isWidthPoint(point6) ? point6.width / 2 : 0 : halfWidth;
1897
- minX = Math.min(minX, point6.x - pointWidth);
1898
- minY = Math.min(minY, point6.y - pointWidth);
1899
- maxX = Math.max(maxX, point6.x + pointWidth);
1900
- maxY = Math.max(maxY, point6.y + pointWidth);
1789
+ for (const point5 of trace.route) {
1790
+ const pointWidth = trace.route_thickness_mode === "interpolated" ? isWidthPoint(point5) ? point5.width / 2 : 0 : halfWidth;
1791
+ minX = Math.min(minX, point5.x - pointWidth);
1792
+ minY = Math.min(minY, point5.y - pointWidth);
1793
+ maxX = Math.max(maxX, point5.x + pointWidth);
1794
+ maxY = Math.max(maxY, point5.y + pointWidth);
1901
1795
  }
1902
1796
  }
1903
1797
  for (const hole of db.pcb_plated_hole.list()) {
@@ -1922,8 +1816,8 @@ var calculateOriginFromBounds = (bounds, margin) => {
1922
1816
  };
1923
1817
 
1924
1818
  // lib/element-handlers/addPcbVia/index.ts
1925
- import { ShapePath as ShapePath15 } from "lbrnts";
1926
- import { Circle as Circle3, point as point5 } from "@flatten-js/core";
1819
+ import { ShapePath as ShapePath16 } from "lbrnts";
1820
+ import { Circle as Circle2, point as point4 } from "@flatten-js/core";
1927
1821
  var addPcbVia = (via, ctx) => {
1928
1822
  const {
1929
1823
  db,
@@ -1955,7 +1849,7 @@ var addPcbVia = (via, ctx) => {
1955
1849
  }
1956
1850
  }
1957
1851
  const outerRadius = via.outer_diameter / 2;
1958
- const circle = new Circle3(point5(centerX, centerY), outerRadius);
1852
+ const circle = new Circle2(point4(centerX, centerY), outerRadius);
1959
1853
  const polygon = circleToPolygon(circle);
1960
1854
  if (netId) {
1961
1855
  if (includeLayers.includes("top")) {
@@ -1972,7 +1866,7 @@ var addPcbVia = (via, ctx) => {
1972
1866
  });
1973
1867
  if (includeLayers.includes("top")) {
1974
1868
  project.children.push(
1975
- new ShapePath15({
1869
+ new ShapePath16({
1976
1870
  cutIndex: topCopperCutSetting.index,
1977
1871
  verts: outer.verts,
1978
1872
  prims: outer.prims,
@@ -1982,7 +1876,7 @@ var addPcbVia = (via, ctx) => {
1982
1876
  }
1983
1877
  if (includeLayers.includes("bottom")) {
1984
1878
  project.children.push(
1985
- new ShapePath15({
1879
+ new ShapePath16({
1986
1880
  cutIndex: bottomCopperCutSetting.index,
1987
1881
  verts: outer.verts,
1988
1882
  prims: outer.prims,
@@ -2000,7 +1894,7 @@ var addPcbVia = (via, ctx) => {
2000
1894
  radius: smRadius
2001
1895
  });
2002
1896
  project.children.push(
2003
- new ShapePath15({
1897
+ new ShapePath16({
2004
1898
  cutIndex: soldermaskCutSetting.index,
2005
1899
  verts: outer.verts,
2006
1900
  prims: outer.prims,
@@ -2016,7 +1910,7 @@ var addPcbVia = (via, ctx) => {
2016
1910
  radius: innerRadius
2017
1911
  });
2018
1912
  project.children.push(
2019
- new ShapePath15({
1913
+ new ShapePath16({
2020
1914
  cutIndex: throughBoardCutSetting.index,
2021
1915
  verts: inner.verts,
2022
1916
  prims: inner.prims,
@@ -2027,7 +1921,7 @@ var addPcbVia = (via, ctx) => {
2027
1921
  };
2028
1922
 
2029
1923
  // lib/element-handlers/addPcbHole/addCirclePcbHole.ts
2030
- import { ShapePath as ShapePath16 } from "lbrnts";
1924
+ import { ShapePath as ShapePath17 } from "lbrnts";
2031
1925
  var addCirclePcbHole = (hole, ctx) => {
2032
1926
  const { project, throughBoardCutSetting, origin, includeCopper } = ctx;
2033
1927
  const centerX = hole.x + origin.x;
@@ -2040,7 +1934,7 @@ var addCirclePcbHole = (hole, ctx) => {
2040
1934
  radius
2041
1935
  });
2042
1936
  project.children.push(
2043
- new ShapePath16({
1937
+ new ShapePath17({
2044
1938
  cutIndex: throughBoardCutSetting.index,
2045
1939
  verts: circlePath.verts,
2046
1940
  prims: circlePath.prims,
@@ -2051,7 +1945,7 @@ var addCirclePcbHole = (hole, ctx) => {
2051
1945
  };
2052
1946
 
2053
1947
  // lib/element-handlers/addPcbHole/addRectPcbHole.ts
2054
- import { ShapePath as ShapePath17 } from "lbrnts";
1948
+ import { ShapePath as ShapePath18 } from "lbrnts";
2055
1949
  var addRectPcbHole = (hole, ctx) => {
2056
1950
  const { project, throughBoardCutSetting, origin, includeCopper } = ctx;
2057
1951
  const centerX = hole.x + origin.x;
@@ -2066,7 +1960,7 @@ var addRectPcbHole = (hole, ctx) => {
2066
1960
  // no border radius for rect holes
2067
1961
  });
2068
1962
  project.children.push(
2069
- new ShapePath17({
1963
+ new ShapePath18({
2070
1964
  cutIndex: throughBoardCutSetting.index,
2071
1965
  verts: rectPath.verts,
2072
1966
  prims: rectPath.prims,
@@ -2077,7 +1971,7 @@ var addRectPcbHole = (hole, ctx) => {
2077
1971
  };
2078
1972
 
2079
1973
  // lib/element-handlers/addPcbHole/addOvalPcbHole.ts
2080
- import { ShapePath as ShapePath18 } from "lbrnts";
1974
+ import { ShapePath as ShapePath19 } from "lbrnts";
2081
1975
  var addOvalPcbHole = (hole, ctx) => {
2082
1976
  const { project, throughBoardCutSetting, origin, includeCopper } = ctx;
2083
1977
  const centerX = hole.x + origin.x;
@@ -2090,7 +1984,7 @@ var addOvalPcbHole = (hole, ctx) => {
2090
1984
  height: hole.hole_height
2091
1985
  });
2092
1986
  project.children.push(
2093
- new ShapePath18({
1987
+ new ShapePath19({
2094
1988
  cutIndex: throughBoardCutSetting.index,
2095
1989
  verts: ovalPath.verts,
2096
1990
  prims: ovalPath.prims,
@@ -2101,7 +1995,7 @@ var addOvalPcbHole = (hole, ctx) => {
2101
1995
  };
2102
1996
 
2103
1997
  // lib/element-handlers/addPcbHole/addPillPcbHole.ts
2104
- import { ShapePath as ShapePath19 } from "lbrnts";
1998
+ import { ShapePath as ShapePath20 } from "lbrnts";
2105
1999
  var addPillPcbHole = (hole, ctx) => {
2106
2000
  const { project, throughBoardCutSetting, origin, includeCopper } = ctx;
2107
2001
  const centerX = hole.x + origin.x;
@@ -2114,7 +2008,7 @@ var addPillPcbHole = (hole, ctx) => {
2114
2008
  height: hole.hole_height
2115
2009
  });
2116
2010
  project.children.push(
2117
- new ShapePath19({
2011
+ new ShapePath20({
2118
2012
  cutIndex: throughBoardCutSetting.index,
2119
2013
  verts: pillPath.verts,
2120
2014
  prims: pillPath.prims,
@@ -2125,7 +2019,7 @@ var addPillPcbHole = (hole, ctx) => {
2125
2019
  };
2126
2020
 
2127
2021
  // lib/element-handlers/addPcbHole/addRotatedPillPcbHole.ts
2128
- import { ShapePath as ShapePath20 } from "lbrnts";
2022
+ import { ShapePath as ShapePath21 } from "lbrnts";
2129
2023
  var addRotatedPillPcbHole = (hole, ctx) => {
2130
2024
  const { project, throughBoardCutSetting, origin, includeCopper } = ctx;
2131
2025
  const centerX = hole.x + origin.x;
@@ -2140,7 +2034,7 @@ var addRotatedPillPcbHole = (hole, ctx) => {
2140
2034
  rotation
2141
2035
  });
2142
2036
  project.children.push(
2143
- new ShapePath20({
2037
+ new ShapePath21({
2144
2038
  cutIndex: throughBoardCutSetting.index,
2145
2039
  verts: pillPath.verts,
2146
2040
  prims: pillPath.prims,
@@ -2171,7 +2065,7 @@ var addPcbHole = (hole, ctx) => {
2171
2065
  };
2172
2066
 
2173
2067
  // lib/element-handlers/addPcbCutout/addCirclePcbCutout.ts
2174
- import { ShapePath as ShapePath21 } from "lbrnts";
2068
+ import { ShapePath as ShapePath22 } from "lbrnts";
2175
2069
  var addCirclePcbCutout = (cutout, ctx) => {
2176
2070
  const { project, throughBoardCutSetting, origin, includeCopper } = ctx;
2177
2071
  const centerX = cutout.center.x + origin.x;
@@ -2183,7 +2077,7 @@ var addCirclePcbCutout = (cutout, ctx) => {
2183
2077
  radius: cutout.radius
2184
2078
  });
2185
2079
  project.children.push(
2186
- new ShapePath21({
2080
+ new ShapePath22({
2187
2081
  cutIndex: throughBoardCutSetting.index,
2188
2082
  verts: circlePath.verts,
2189
2083
  prims: circlePath.prims,
@@ -2194,7 +2088,7 @@ var addCirclePcbCutout = (cutout, ctx) => {
2194
2088
  };
2195
2089
 
2196
2090
  // lib/element-handlers/addPcbCutout/addRectPcbCutout.ts
2197
- import { ShapePath as ShapePath22 } from "lbrnts";
2091
+ import { ShapePath as ShapePath23 } from "lbrnts";
2198
2092
  var addRectPcbCutout = (cutout, ctx) => {
2199
2093
  const { project, throughBoardCutSetting, origin, includeCopper } = ctx;
2200
2094
  const centerX = cutout.center.x + origin.x;
@@ -2213,7 +2107,7 @@ var addRectPcbCutout = (cutout, ctx) => {
2213
2107
  rotation
2214
2108
  });
2215
2109
  project.children.push(
2216
- new ShapePath22({
2110
+ new ShapePath23({
2217
2111
  cutIndex: throughBoardCutSetting.index,
2218
2112
  verts: rectPath.verts,
2219
2113
  prims: rectPath.prims,
@@ -2224,7 +2118,7 @@ var addRectPcbCutout = (cutout, ctx) => {
2224
2118
  };
2225
2119
 
2226
2120
  // lib/element-handlers/addPcbCutout/addPolygonPcbCutout.ts
2227
- import { ShapePath as ShapePath23 } from "lbrnts";
2121
+ import { ShapePath as ShapePath24 } from "lbrnts";
2228
2122
  var addPolygonPcbCutout = (cutout, ctx) => {
2229
2123
  const { project, throughBoardCutSetting, origin, includeCopper } = ctx;
2230
2124
  if (cutout.points.length >= 3 && includeCopper) {
@@ -2234,7 +2128,7 @@ var addPolygonPcbCutout = (cutout, ctx) => {
2234
2128
  offsetY: origin.y
2235
2129
  });
2236
2130
  project.children.push(
2237
- new ShapePath23({
2131
+ new ShapePath24({
2238
2132
  cutIndex: throughBoardCutSetting.index,
2239
2133
  verts: polygonPath.verts,
2240
2134
  prims: polygonPath.prims,
@@ -2245,21 +2139,21 @@ var addPolygonPcbCutout = (cutout, ctx) => {
2245
2139
  };
2246
2140
 
2247
2141
  // lib/element-handlers/addPcbCutout/addPathPcbCutout.ts
2248
- import { ShapePath as ShapePath24 } from "lbrnts";
2142
+ import { ShapePath as ShapePath25 } from "lbrnts";
2249
2143
  var addPathPcbCutout = (cutout, ctx) => {
2250
2144
  const { project, throughBoardCutSetting, origin, includeCopper } = ctx;
2251
2145
  if (cutout.route.length >= 2 && includeCopper) {
2252
2146
  const verts = [];
2253
2147
  const prims = [];
2254
- for (const point6 of cutout.route) {
2148
+ for (const point5 of cutout.route) {
2255
2149
  verts.push({
2256
- x: point6.x + origin.x,
2257
- y: point6.y + origin.y
2150
+ x: point5.x + origin.x,
2151
+ y: point5.y + origin.y
2258
2152
  });
2259
2153
  prims.push({ type: 0 });
2260
2154
  }
2261
2155
  project.children.push(
2262
- new ShapePath24({
2156
+ new ShapePath25({
2263
2157
  cutIndex: throughBoardCutSetting.index,
2264
2158
  verts,
2265
2159
  prims,
@@ -2288,8 +2182,8 @@ var addPcbCutout = (cutout, ctx) => {
2288
2182
  };
2289
2183
 
2290
2184
  // lib/createCopperShapesForLayer.ts
2291
- import { Polygon as Polygon4, Box as Box2, BooleanOperations } from "@flatten-js/core";
2292
- import { ShapePath as ShapePath25 } from "lbrnts";
2185
+ import { Polygon as Polygon3, Box as Box2, BooleanOperations } from "@flatten-js/core";
2186
+ import { ShapePath as ShapePath26 } from "lbrnts";
2293
2187
  var outputPolygon = (poly, cutIndex, project) => {
2294
2188
  if (poly.faces.size > 1) {
2295
2189
  for (const face of poly.faces) {
@@ -2298,11 +2192,11 @@ var outputPolygon = (poly, cutIndex, project) => {
2298
2192
  facePoints.push(edge.start);
2299
2193
  }
2300
2194
  if (facePoints.length >= 3) {
2301
- const facePoly = new Polygon4(facePoints);
2195
+ const facePoly = new Polygon3(facePoints);
2302
2196
  const { verts: verts2, prims: prims2 } = polygonToShapePathData(facePoly);
2303
2197
  if (verts2.length > 0) {
2304
2198
  project.children.push(
2305
- new ShapePath25({
2199
+ new ShapePath26({
2306
2200
  cutIndex,
2307
2201
  verts: verts2,
2308
2202
  prims: prims2,
@@ -2316,7 +2210,7 @@ var outputPolygon = (poly, cutIndex, project) => {
2316
2210
  }
2317
2211
  const { verts, prims } = polygonToShapePathData(poly);
2318
2212
  project.children.push(
2319
- new ShapePath25({
2213
+ new ShapePath26({
2320
2214
  cutIndex,
2321
2215
  verts,
2322
2216
  prims,
@@ -2326,7 +2220,7 @@ var outputPolygon = (poly, cutIndex, project) => {
2326
2220
  };
2327
2221
  var outputIndividualGeometries = (netGeoms, cutIndex, project) => {
2328
2222
  for (const geom of netGeoms) {
2329
- const poly = geom instanceof Box2 ? new Polygon4(geom) : geom;
2223
+ const poly = geom instanceof Box2 ? new Polygon3(geom) : geom;
2330
2224
  outputPolygon(poly, cutIndex, project);
2331
2225
  }
2332
2226
  };
@@ -2355,18 +2249,18 @@ var createCopperShapesForLayer = ({
2355
2249
  }
2356
2250
  if (netGeoms.length === 1) {
2357
2251
  const geom = netGeoms[0];
2358
- const poly = geom instanceof Box2 ? new Polygon4(geom) : geom;
2252
+ const poly = geom instanceof Box2 ? new Polygon3(geom) : geom;
2359
2253
  outputPolygon(poly, cutIndex, project);
2360
2254
  continue;
2361
2255
  }
2362
2256
  try {
2363
2257
  let union = netGeoms[0];
2364
2258
  if (union instanceof Box2) {
2365
- union = new Polygon4(union);
2259
+ union = new Polygon3(union);
2366
2260
  }
2367
2261
  let unionFailed = false;
2368
2262
  for (const geom of netGeoms.slice(1)) {
2369
- const poly = geom instanceof Polygon4 ? geom : new Polygon4(geom);
2263
+ const poly = geom instanceof Polygon3 ? geom : new Polygon3(geom);
2370
2264
  union = BooleanOperations.unify(union, poly);
2371
2265
  if (union.faces.size === 0) {
2372
2266
  unionFailed = true;
@@ -2396,8 +2290,8 @@ var createCopperShapesForLayer = ({
2396
2290
  };
2397
2291
 
2398
2292
  // lib/createTraceClearanceAreasForLayer.ts
2399
- import { Polygon as Polygon5, Box as Box3, BooleanOperations as BooleanOperations2 } from "@flatten-js/core";
2400
- import { ShapePath as ShapePath26 } from "lbrnts";
2293
+ import { Polygon as Polygon4, Box as Box3, BooleanOperations as BooleanOperations2 } from "@flatten-js/core";
2294
+ import { ShapePath as ShapePath27 } from "lbrnts";
2401
2295
  var createTraceClearanceAreasForLayer = ({
2402
2296
  layer,
2403
2297
  ctx
@@ -2427,31 +2321,31 @@ var createTraceClearanceAreasForLayer = ({
2427
2321
  try {
2428
2322
  let innerUnion = innerGeoms[0];
2429
2323
  if (innerUnion instanceof Box3) {
2430
- innerUnion = new Polygon5(innerUnion);
2324
+ innerUnion = new Polygon4(innerUnion);
2431
2325
  }
2432
2326
  for (const geom of innerGeoms.slice(1)) {
2433
- if (geom instanceof Polygon5) {
2327
+ if (geom instanceof Polygon4) {
2434
2328
  innerUnion = BooleanOperations2.unify(innerUnion, geom);
2435
2329
  } else if (geom instanceof Box3) {
2436
- innerUnion = BooleanOperations2.unify(innerUnion, new Polygon5(geom));
2330
+ innerUnion = BooleanOperations2.unify(innerUnion, new Polygon4(geom));
2437
2331
  }
2438
2332
  }
2439
2333
  let outerUnion = outerGeoms[0];
2440
2334
  if (outerUnion instanceof Box3) {
2441
- outerUnion = new Polygon5(outerUnion);
2335
+ outerUnion = new Polygon4(outerUnion);
2442
2336
  }
2443
2337
  for (const geom of outerGeoms.slice(1)) {
2444
- if (geom instanceof Polygon5) {
2338
+ if (geom instanceof Polygon4) {
2445
2339
  outerUnion = BooleanOperations2.unify(outerUnion, geom);
2446
2340
  } else if (geom instanceof Box3) {
2447
- outerUnion = BooleanOperations2.unify(outerUnion, new Polygon5(geom));
2341
+ outerUnion = BooleanOperations2.unify(outerUnion, new Polygon4(geom));
2448
2342
  }
2449
2343
  }
2450
2344
  const clearanceArea = BooleanOperations2.subtract(outerUnion, innerUnion);
2451
2345
  for (const island of clearanceArea.splitToIslands()) {
2452
2346
  const { verts, prims } = polygonToShapePathData(island);
2453
2347
  project.children.push(
2454
- new ShapePath26({
2348
+ new ShapePath27({
2455
2349
  cutIndex: cutSetting.index,
2456
2350
  verts,
2457
2351
  prims,