@tscircuit/3d-viewer 0.0.415 → 0.0.416
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 +121 -99
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -26651,7 +26651,7 @@ import * as THREE13 from "three";
|
|
|
26651
26651
|
// package.json
|
|
26652
26652
|
var package_default = {
|
|
26653
26653
|
name: "@tscircuit/3d-viewer",
|
|
26654
|
-
version: "0.0.
|
|
26654
|
+
version: "0.0.415",
|
|
26655
26655
|
main: "./dist/index.js",
|
|
26656
26656
|
module: "./dist/index.js",
|
|
26657
26657
|
type: "module",
|
|
@@ -27552,7 +27552,7 @@ function extractRectBorderRadius(source) {
|
|
|
27552
27552
|
}
|
|
27553
27553
|
|
|
27554
27554
|
// src/geoms/plated-hole.ts
|
|
27555
|
-
var platedHoleLipHeight = 0.
|
|
27555
|
+
var platedHoleLipHeight = 0.02;
|
|
27556
27556
|
var RECT_PAD_SEGMENTS = 64;
|
|
27557
27557
|
var maybeClip = (geom, clipGeom) => clipGeom ? (0, import_booleans.intersect)(clipGeom, geom) : geom;
|
|
27558
27558
|
var createRectPadGeom = ({
|
|
@@ -27581,7 +27581,7 @@ var platedHole = (plated_hole, ctx, options = {}) => {
|
|
|
27581
27581
|
const throughDrillHeight = ctx.pcbThickness + 2 * platedHoleLipHeight + 4 * M;
|
|
27582
27582
|
if (plated_hole.shape === "circle") {
|
|
27583
27583
|
const outerDiameter = plated_hole.outer_diameter ?? Math.max(plated_hole.hole_diameter, 0);
|
|
27584
|
-
const copperHeight = ctx.pcbThickness + 2 *
|
|
27584
|
+
const copperHeight = ctx.pcbThickness + 2 * platedHoleLipHeight;
|
|
27585
27585
|
const copperBody = (0, import_primitives3.cylinder)({
|
|
27586
27586
|
center: [plated_hole.x, plated_hole.y, 0],
|
|
27587
27587
|
radius: outerDiameter / 2,
|
|
@@ -27607,7 +27607,7 @@ var platedHole = (plated_hole, ctx, options = {}) => {
|
|
|
27607
27607
|
createRectPadGeom({
|
|
27608
27608
|
width: padWidth,
|
|
27609
27609
|
height: padHeight,
|
|
27610
|
-
thickness: platedHoleLipHeight
|
|
27610
|
+
thickness: platedHoleLipHeight,
|
|
27611
27611
|
// Slightly thicker to ensure connection
|
|
27612
27612
|
center: [
|
|
27613
27613
|
plated_hole.x,
|
|
@@ -27621,7 +27621,7 @@ var platedHole = (plated_hole, ctx, options = {}) => {
|
|
|
27621
27621
|
createRectPadGeom({
|
|
27622
27622
|
width: padWidth,
|
|
27623
27623
|
height: padHeight,
|
|
27624
|
-
thickness: platedHoleLipHeight
|
|
27624
|
+
thickness: platedHoleLipHeight,
|
|
27625
27625
|
// Slightly thicker to ensure connection
|
|
27626
27626
|
center: [
|
|
27627
27627
|
plated_hole.x,
|
|
@@ -27773,11 +27773,11 @@ var platedHole = (plated_hole, ctx, options = {}) => {
|
|
|
27773
27773
|
size: shouldRotate ? [
|
|
27774
27774
|
holeHeight + 2 * barrelMargin,
|
|
27775
27775
|
rectLength + 2 * barrelMargin,
|
|
27776
|
-
ctx.pcbThickness + 0.
|
|
27776
|
+
ctx.pcbThickness + 0.02
|
|
27777
27777
|
] : [
|
|
27778
27778
|
rectLength + 2 * barrelMargin,
|
|
27779
27779
|
holeHeight + 2 * barrelMargin,
|
|
27780
|
-
ctx.pcbThickness
|
|
27780
|
+
ctx.pcbThickness
|
|
27781
27781
|
]
|
|
27782
27782
|
}),
|
|
27783
27783
|
(0, import_primitives3.cylinder)({
|
|
@@ -27791,8 +27791,7 @@ var platedHole = (plated_hole, ctx, options = {}) => {
|
|
|
27791
27791
|
0
|
|
27792
27792
|
],
|
|
27793
27793
|
radius: holeRadius + barrelMargin,
|
|
27794
|
-
height: ctx.pcbThickness + 0.
|
|
27795
|
-
// extend slightly above/below PCB
|
|
27794
|
+
height: ctx.pcbThickness + 0.02
|
|
27796
27795
|
}),
|
|
27797
27796
|
(0, import_primitives3.cylinder)({
|
|
27798
27797
|
center: shouldRotate ? [
|
|
@@ -27805,7 +27804,7 @@ var platedHole = (plated_hole, ctx, options = {}) => {
|
|
|
27805
27804
|
0
|
|
27806
27805
|
],
|
|
27807
27806
|
radius: holeRadius + barrelMargin,
|
|
27808
|
-
height: ctx.pcbThickness + 0.
|
|
27807
|
+
height: ctx.pcbThickness + 0.02
|
|
27809
27808
|
})
|
|
27810
27809
|
);
|
|
27811
27810
|
const holeCut = (0, import_booleans.union)(
|
|
@@ -27840,30 +27839,41 @@ var platedHole = (plated_hole, ctx, options = {}) => {
|
|
|
27840
27839
|
height: throughDrillHeight * 1.1
|
|
27841
27840
|
})
|
|
27842
27841
|
);
|
|
27843
|
-
const
|
|
27842
|
+
const copperTopPad = createRectPadGeom({
|
|
27844
27843
|
width: padWidth,
|
|
27845
27844
|
height: padHeight,
|
|
27846
|
-
thickness:
|
|
27847
|
-
center: [
|
|
27845
|
+
thickness: platedHoleLipHeight,
|
|
27846
|
+
center: [
|
|
27847
|
+
plated_hole.x,
|
|
27848
|
+
plated_hole.y,
|
|
27849
|
+
ctx.pcbThickness / 2 + platedHoleLipHeight / 2 + M - 0.05
|
|
27850
|
+
],
|
|
27848
27851
|
borderRadius: rectBorderRadius
|
|
27849
27852
|
});
|
|
27850
|
-
const
|
|
27851
|
-
|
|
27852
|
-
|
|
27853
|
-
|
|
27854
|
-
|
|
27855
|
-
|
|
27856
|
-
|
|
27853
|
+
const copperBottomPad = createRectPadGeom({
|
|
27854
|
+
width: padWidth,
|
|
27855
|
+
height: padHeight,
|
|
27856
|
+
thickness: platedHoleLipHeight,
|
|
27857
|
+
center: [
|
|
27858
|
+
plated_hole.x,
|
|
27859
|
+
plated_hole.y,
|
|
27860
|
+
-ctx.pcbThickness / 2 - platedHoleLipHeight / 2 - M + 0.05
|
|
27861
|
+
],
|
|
27862
|
+
borderRadius: rectBorderRadius
|
|
27863
|
+
});
|
|
27864
|
+
const copperFill = (() => {
|
|
27865
|
+
const height10 = ctx.pcbThickness - platedHoleLipHeight * 2 - M * 2 + 0.1;
|
|
27866
|
+
const rect2d = (0, import_primitives3.roundedRectangle)({
|
|
27867
|
+
size: [padWidth, padHeight],
|
|
27868
|
+
roundRadius: rectBorderRadius || 0,
|
|
27869
|
+
segments: RECT_PAD_SEGMENTS
|
|
27857
27870
|
});
|
|
27858
|
-
|
|
27859
|
-
|
|
27860
|
-
|
|
27861
|
-
|
|
27862
|
-
);
|
|
27863
|
-
const
|
|
27864
|
-
-ctx.pcbThickness / 2 + platedHoleLipHeight / 2 - 0.05
|
|
27865
|
-
);
|
|
27866
|
-
const filledArea = (0, import_booleans.subtract)(mainFill, holeCut);
|
|
27871
|
+
const extruded = (0, import_extrusions2.extrudeLinear)({ height: height10 }, rect2d);
|
|
27872
|
+
return (0, import_transforms2.translate)([plated_hole.x, plated_hole.y, -height10 / 2], extruded);
|
|
27873
|
+
})();
|
|
27874
|
+
const copperTopPadCut = (0, import_booleans.subtract)(copperTopPad, holeCut);
|
|
27875
|
+
const copperBottomPadCut = (0, import_booleans.subtract)(copperBottomPad, holeCut);
|
|
27876
|
+
const copperFillCut = (0, import_booleans.subtract)(copperFill, holeCut);
|
|
27867
27877
|
const barrelHoleCut = (0, import_booleans.union)(
|
|
27868
27878
|
(0, import_primitives3.cuboid)({
|
|
27869
27879
|
center: [plated_hole.x + holeOffsetX, plated_hole.y + holeOffsetY, 0],
|
|
@@ -27897,9 +27907,11 @@ var platedHole = (plated_hole, ctx, options = {}) => {
|
|
|
27897
27907
|
})
|
|
27898
27908
|
);
|
|
27899
27909
|
const barrelWithHole = (0, import_booleans.subtract)(barrel, barrelHoleCut);
|
|
27900
|
-
const finalCopper = (
|
|
27901
|
-
|
|
27902
|
-
|
|
27910
|
+
const finalCopper = maybeClip(
|
|
27911
|
+
(0, import_booleans.union)(copperTopPadCut, copperBottomPadCut, copperFillCut, barrelWithHole),
|
|
27912
|
+
clipGeom
|
|
27913
|
+
);
|
|
27914
|
+
return (0, import_colors2.colorize)(colors.copper, finalCopper);
|
|
27903
27915
|
} else {
|
|
27904
27916
|
throw new Error(`Unsupported plated hole shape: ${plated_hole.shape}`);
|
|
27905
27917
|
}
|
|
@@ -28737,111 +28749,80 @@ var BoardGeomBuilder = class {
|
|
|
28737
28749
|
}
|
|
28738
28750
|
processHole(hole) {
|
|
28739
28751
|
if (!this.boardGeom) return;
|
|
28752
|
+
const holeDepth = this.ctx.pcbThickness * 1.5;
|
|
28753
|
+
const copperInset = 0.02;
|
|
28740
28754
|
if (hole.hole_shape === "round" || hole.hole_shape === "circle") {
|
|
28741
28755
|
const cyGeom = (0, import_primitives6.cylinder)({
|
|
28742
28756
|
center: [hole.x, hole.y, 0],
|
|
28743
28757
|
radius: hole.hole_diameter / 2 + M,
|
|
28744
|
-
|
|
28745
|
-
height: this.ctx.pcbThickness * 1.5
|
|
28746
|
-
// Ensure it cuts through
|
|
28758
|
+
height: holeDepth
|
|
28747
28759
|
});
|
|
28748
28760
|
this.boardGeom = (0, import_booleans3.subtract)(this.boardGeom, cyGeom);
|
|
28749
28761
|
this.padGeoms = this.padGeoms.map(
|
|
28750
28762
|
(pg) => (0, import_colors4.colorize)(colors.copper, (0, import_booleans3.subtract)(pg, cyGeom))
|
|
28751
28763
|
);
|
|
28752
|
-
|
|
28764
|
+
const copperCut = (0, import_primitives6.cylinder)({
|
|
28765
|
+
center: [hole.x, hole.y, 0],
|
|
28766
|
+
radius: hole.hole_diameter / 2 + M / 2,
|
|
28767
|
+
height: holeDepth
|
|
28768
|
+
});
|
|
28769
|
+
this.platedHoleGeoms = this.platedHoleGeoms.map(
|
|
28770
|
+
(phg) => (0, import_colors4.colorize)(colors.copper, (0, import_booleans3.subtract)(phg, copperCut))
|
|
28771
|
+
);
|
|
28772
|
+
} else if (hole.hole_shape === "pill" || hole.hole_shape === "rotated_pill") {
|
|
28753
28773
|
const holeWidth = hole.hole_width;
|
|
28754
28774
|
const holeHeight = hole.hole_height;
|
|
28755
28775
|
const holeRadius = Math.min(holeWidth, holeHeight) / 2;
|
|
28756
28776
|
const rectLength = Math.abs(holeWidth - holeHeight);
|
|
28777
|
+
const isRotated = hole.hole_shape === "rotated_pill";
|
|
28757
28778
|
let pillHole;
|
|
28758
28779
|
if (holeWidth > holeHeight) {
|
|
28759
28780
|
pillHole = (0, import_booleans3.union)(
|
|
28760
28781
|
(0, import_primitives6.cuboid)({
|
|
28761
28782
|
center: [hole.x, hole.y, 0],
|
|
28762
|
-
size: [rectLength, holeHeight,
|
|
28783
|
+
size: [rectLength, holeHeight, holeDepth]
|
|
28763
28784
|
}),
|
|
28764
28785
|
(0, import_primitives6.cylinder)({
|
|
28765
28786
|
center: [hole.x - rectLength / 2, hole.y, 0],
|
|
28766
28787
|
radius: holeRadius,
|
|
28767
|
-
height:
|
|
28788
|
+
height: holeDepth
|
|
28768
28789
|
}),
|
|
28769
28790
|
(0, import_primitives6.cylinder)({
|
|
28770
28791
|
center: [hole.x + rectLength / 2, hole.y, 0],
|
|
28771
28792
|
radius: holeRadius,
|
|
28772
|
-
height:
|
|
28793
|
+
height: holeDepth
|
|
28773
28794
|
})
|
|
28774
28795
|
);
|
|
28775
28796
|
} else {
|
|
28776
28797
|
pillHole = (0, import_booleans3.union)(
|
|
28777
28798
|
(0, import_primitives6.cuboid)({
|
|
28778
28799
|
center: [hole.x, hole.y, 0],
|
|
28779
|
-
size: [holeWidth, rectLength,
|
|
28800
|
+
size: [holeWidth, rectLength, holeDepth]
|
|
28780
28801
|
}),
|
|
28781
28802
|
(0, import_primitives6.cylinder)({
|
|
28782
28803
|
center: [hole.x, hole.y - rectLength / 2, 0],
|
|
28783
28804
|
radius: holeRadius,
|
|
28784
|
-
height:
|
|
28805
|
+
height: holeDepth
|
|
28785
28806
|
}),
|
|
28786
28807
|
(0, import_primitives6.cylinder)({
|
|
28787
28808
|
center: [hole.x, hole.y + rectLength / 2, 0],
|
|
28788
28809
|
radius: holeRadius,
|
|
28789
|
-
height:
|
|
28810
|
+
height: holeDepth
|
|
28790
28811
|
})
|
|
28791
28812
|
);
|
|
28792
28813
|
}
|
|
28793
|
-
|
|
28794
|
-
|
|
28795
|
-
|
|
28796
|
-
);
|
|
28797
|
-
} else if (hole.hole_shape === "rotated_pill") {
|
|
28798
|
-
const holeWidth = hole.hole_width;
|
|
28799
|
-
const holeHeight = hole.hole_height;
|
|
28800
|
-
const holeRadius = Math.min(holeWidth, holeHeight) / 2;
|
|
28801
|
-
const rectLength = Math.abs(holeWidth - holeHeight);
|
|
28802
|
-
let pillHole;
|
|
28803
|
-
if (holeWidth > holeHeight) {
|
|
28804
|
-
pillHole = (0, import_booleans3.union)(
|
|
28805
|
-
(0, import_primitives6.cuboid)({
|
|
28806
|
-
center: [0, 0, 0],
|
|
28807
|
-
size: [rectLength, holeHeight, this.ctx.pcbThickness * 1.5]
|
|
28808
|
-
}),
|
|
28809
|
-
(0, import_primitives6.cylinder)({
|
|
28810
|
-
center: [-rectLength / 2, 0, 0],
|
|
28811
|
-
radius: holeRadius,
|
|
28812
|
-
height: this.ctx.pcbThickness * 1.5
|
|
28813
|
-
}),
|
|
28814
|
-
(0, import_primitives6.cylinder)({
|
|
28815
|
-
center: [rectLength / 2, 0, 0],
|
|
28816
|
-
radius: holeRadius,
|
|
28817
|
-
height: this.ctx.pcbThickness * 1.5
|
|
28818
|
-
})
|
|
28819
|
-
);
|
|
28820
|
-
} else {
|
|
28821
|
-
pillHole = (0, import_booleans3.union)(
|
|
28822
|
-
(0, import_primitives6.cuboid)({
|
|
28823
|
-
center: [0, 0, 0],
|
|
28824
|
-
size: [holeWidth, rectLength, this.ctx.pcbThickness * 1.5]
|
|
28825
|
-
}),
|
|
28826
|
-
(0, import_primitives6.cylinder)({
|
|
28827
|
-
center: [0, -rectLength / 2, 0],
|
|
28828
|
-
radius: holeRadius,
|
|
28829
|
-
height: this.ctx.pcbThickness * 1.5
|
|
28830
|
-
}),
|
|
28831
|
-
(0, import_primitives6.cylinder)({
|
|
28832
|
-
center: [0, rectLength / 2, 0],
|
|
28833
|
-
radius: holeRadius,
|
|
28834
|
-
height: this.ctx.pcbThickness * 1.5
|
|
28835
|
-
})
|
|
28836
|
-
);
|
|
28814
|
+
if (isRotated) {
|
|
28815
|
+
const rotationRadians = hole.ccw_rotation * Math.PI / 180;
|
|
28816
|
+
pillHole = (0, import_transforms4.rotateZ)(rotationRadians, pillHole);
|
|
28837
28817
|
}
|
|
28838
|
-
const rotationRadians = hole.ccw_rotation * Math.PI / 180;
|
|
28839
|
-
pillHole = (0, import_transforms4.rotateZ)(rotationRadians, pillHole);
|
|
28840
|
-
pillHole = (0, import_transforms4.translate)([hole.x, hole.y, 0], pillHole);
|
|
28841
28818
|
this.boardGeom = (0, import_booleans3.subtract)(this.boardGeom, pillHole);
|
|
28842
28819
|
this.padGeoms = this.padGeoms.map(
|
|
28843
28820
|
(pg) => (0, import_colors4.colorize)(colors.copper, (0, import_booleans3.subtract)(pg, pillHole))
|
|
28844
28821
|
);
|
|
28822
|
+
const copperPill = (0, import_expansions3.expand)({ delta: -copperInset }, pillHole);
|
|
28823
|
+
this.platedHoleGeoms = this.platedHoleGeoms.map(
|
|
28824
|
+
(phg) => (0, import_colors4.colorize)(colors.copper, (0, import_booleans3.subtract)(phg, copperPill))
|
|
28825
|
+
);
|
|
28845
28826
|
}
|
|
28846
28827
|
}
|
|
28847
28828
|
processPad(pad2) {
|
|
@@ -29876,6 +29857,7 @@ function processPlatedHolesForManifold(Manifold, circuitJson, pcbThickness, mani
|
|
|
29876
29857
|
const platedHoleBoardDrills = [];
|
|
29877
29858
|
const pcbPlatedHoles = su8(circuitJson).pcb_plated_hole.list();
|
|
29878
29859
|
const platedHoleCopperGeoms = [];
|
|
29860
|
+
const platedHoleCopperOpsForSubtract = [];
|
|
29879
29861
|
const createPillOp = (width10, height10, depth) => {
|
|
29880
29862
|
const pillOp = createRoundedRectPrism({
|
|
29881
29863
|
Manifold,
|
|
@@ -29932,6 +29914,7 @@ function processPlatedHolesForManifold(Manifold, circuitJson, pcbThickness, mani
|
|
|
29932
29914
|
manifoldInstancesForCleanup.push(clipped);
|
|
29933
29915
|
finalCopperOp = clipped;
|
|
29934
29916
|
}
|
|
29917
|
+
platedHoleCopperOpsForSubtract.push(finalCopperOp);
|
|
29935
29918
|
const threeGeom = manifoldMeshToThreeGeometry(finalCopperOp.getMesh());
|
|
29936
29919
|
platedHoleCopperGeoms.push({
|
|
29937
29920
|
key: `ph-${ph.pcb_plated_hole_id || index}`,
|
|
@@ -29983,9 +29966,17 @@ function processPlatedHolesForManifold(Manifold, circuitJson, pcbThickness, mani
|
|
|
29983
29966
|
}
|
|
29984
29967
|
const translatedPlatedPart = finalPlatedPartOp.translate([ph.x, ph.y, 0]);
|
|
29985
29968
|
manifoldInstancesForCleanup.push(translatedPlatedPart);
|
|
29986
|
-
|
|
29987
|
-
|
|
29988
|
-
|
|
29969
|
+
let finalCopperOp = translatedPlatedPart;
|
|
29970
|
+
if (boardClipVolume) {
|
|
29971
|
+
const clipped = Manifold.intersection([
|
|
29972
|
+
translatedPlatedPart,
|
|
29973
|
+
boardClipVolume
|
|
29974
|
+
]);
|
|
29975
|
+
manifoldInstancesForCleanup.push(clipped);
|
|
29976
|
+
finalCopperOp = clipped;
|
|
29977
|
+
}
|
|
29978
|
+
platedHoleCopperOpsForSubtract.push(finalCopperOp);
|
|
29979
|
+
const threeGeom = manifoldMeshToThreeGeometry(finalCopperOp.getMesh());
|
|
29989
29980
|
platedHoleCopperGeoms.push({
|
|
29990
29981
|
key: `ph-${ph.pcb_plated_hole_id || index}`,
|
|
29991
29982
|
geometry: threeGeom,
|
|
@@ -30026,14 +30017,14 @@ function processPlatedHolesForManifold(Manifold, circuitJson, pcbThickness, mani
|
|
|
30026
30017
|
Manifold,
|
|
30027
30018
|
width: padWidth,
|
|
30028
30019
|
height: padHeight,
|
|
30029
|
-
thickness: padThickness
|
|
30020
|
+
thickness: padThickness,
|
|
30030
30021
|
borderRadius: rectBorderRadius
|
|
30031
30022
|
}).translate([0, 0, pcbThickness / 2 - padThickness / 2 + 0.05]);
|
|
30032
30023
|
const bottomPad = createRoundedRectPrism({
|
|
30033
30024
|
Manifold,
|
|
30034
30025
|
width: padWidth,
|
|
30035
30026
|
height: padHeight,
|
|
30036
|
-
thickness: padThickness
|
|
30027
|
+
thickness: padThickness,
|
|
30037
30028
|
borderRadius: rectBorderRadius
|
|
30038
30029
|
}).translate([0, 0, -pcbThickness / 2 + padThickness / 2 - 0.05]);
|
|
30039
30030
|
manifoldInstancesForCleanup.push(topPad, bottomPad);
|
|
@@ -30071,6 +30062,7 @@ function processPlatedHolesForManifold(Manifold, circuitJson, pcbThickness, mani
|
|
|
30071
30062
|
manifoldInstancesForCleanup.push(clipped);
|
|
30072
30063
|
finalCopperOp = clipped;
|
|
30073
30064
|
}
|
|
30065
|
+
platedHoleCopperOpsForSubtract.push(finalCopperOp);
|
|
30074
30066
|
const threeGeom = manifoldMeshToThreeGeometry(finalCopperOp.getMesh());
|
|
30075
30067
|
platedHoleCopperGeoms.push({
|
|
30076
30068
|
key: `ph-${ph.pcb_plated_hole_id || index}`,
|
|
@@ -30110,14 +30102,14 @@ function processPlatedHolesForManifold(Manifold, circuitJson, pcbThickness, mani
|
|
|
30110
30102
|
Manifold,
|
|
30111
30103
|
width: padWidth,
|
|
30112
30104
|
height: padHeight,
|
|
30113
|
-
thickness: padThickness
|
|
30105
|
+
thickness: padThickness,
|
|
30114
30106
|
borderRadius: rectBorderRadius
|
|
30115
30107
|
}).translate([0, 0, pcbThickness / 2 - padThickness / 2 + 0.05]);
|
|
30116
30108
|
const bottomPad = createRoundedRectPrism({
|
|
30117
30109
|
Manifold,
|
|
30118
30110
|
width: padWidth,
|
|
30119
30111
|
height: padHeight,
|
|
30120
|
-
thickness: padThickness
|
|
30112
|
+
thickness: padThickness,
|
|
30121
30113
|
borderRadius: rectBorderRadius
|
|
30122
30114
|
}).translate([0, 0, -pcbThickness / 2 + padThickness / 2 - 0.05]);
|
|
30123
30115
|
manifoldInstancesForCleanup.push(topPad, bottomPad);
|
|
@@ -30159,6 +30151,7 @@ function processPlatedHolesForManifold(Manifold, circuitJson, pcbThickness, mani
|
|
|
30159
30151
|
manifoldInstancesForCleanup.push(clipped);
|
|
30160
30152
|
finalCopperOp = clipped;
|
|
30161
30153
|
}
|
|
30154
|
+
platedHoleCopperOpsForSubtract.push(finalCopperOp);
|
|
30162
30155
|
const threeGeom = manifoldMeshToThreeGeometry(finalCopperOp.getMesh());
|
|
30163
30156
|
platedHoleCopperGeoms.push({
|
|
30164
30157
|
key: `ph-${ph.pcb_plated_hole_id || index}`,
|
|
@@ -30167,7 +30160,12 @@ function processPlatedHolesForManifold(Manifold, circuitJson, pcbThickness, mani
|
|
|
30167
30160
|
});
|
|
30168
30161
|
}
|
|
30169
30162
|
});
|
|
30170
|
-
|
|
30163
|
+
let platedHoleSubtractOp = void 0;
|
|
30164
|
+
if (platedHoleCopperOpsForSubtract.length > 0) {
|
|
30165
|
+
platedHoleSubtractOp = Manifold.union(platedHoleCopperOpsForSubtract);
|
|
30166
|
+
manifoldInstancesForCleanup.push(platedHoleSubtractOp);
|
|
30167
|
+
}
|
|
30168
|
+
return { platedHoleBoardDrills, platedHoleCopperGeoms, platedHoleSubtractOp };
|
|
30171
30169
|
}
|
|
30172
30170
|
|
|
30173
30171
|
// src/utils/manifold/process-vias.ts
|
|
@@ -30720,7 +30718,12 @@ var useManifoldBoardBuilder = (manifoldJSModule, circuitJson) => {
|
|
|
30720
30718
|
manifoldInstancesForCleanup.current
|
|
30721
30719
|
);
|
|
30722
30720
|
allBoardDrills.push(...nonPlatedHoleBoardDrills);
|
|
30723
|
-
const {
|
|
30721
|
+
const {
|
|
30722
|
+
platedHoleBoardDrills,
|
|
30723
|
+
platedHoleCopperGeoms,
|
|
30724
|
+
// NEW: bring in platedHoleSubtractOp
|
|
30725
|
+
platedHoleSubtractOp
|
|
30726
|
+
} = processPlatedHolesForManifold(
|
|
30724
30727
|
Manifold,
|
|
30725
30728
|
circuitJson,
|
|
30726
30729
|
currentPcbThickness,
|
|
@@ -30741,9 +30744,28 @@ var useManifoldBoardBuilder = (manifoldJSModule, circuitJson) => {
|
|
|
30741
30744
|
if (allBoardDrills.length > 0) {
|
|
30742
30745
|
holeUnion = Manifold.union(allBoardDrills);
|
|
30743
30746
|
manifoldInstancesForCleanup.current.push(holeUnion);
|
|
30744
|
-
const
|
|
30747
|
+
const totalSubtractionOps = platedHoleSubtractOp ? Manifold.union([holeUnion, platedHoleSubtractOp]) : holeUnion;
|
|
30748
|
+
manifoldInstancesForCleanup.current.push(totalSubtractionOps);
|
|
30749
|
+
const nextBoardAfterDrills = currentBoardOp.subtract(totalSubtractionOps);
|
|
30745
30750
|
manifoldInstancesForCleanup.current.push(nextBoardAfterDrills);
|
|
30746
30751
|
currentBoardOp = nextBoardAfterDrills;
|
|
30752
|
+
if (platedHoleSubtractOp) {
|
|
30753
|
+
const cutPlatedCopper = platedHoleSubtractOp.subtract(holeUnion);
|
|
30754
|
+
manifoldInstancesForCleanup.current.push(cutPlatedCopper);
|
|
30755
|
+
const cutPlatedMesh = cutPlatedCopper.getMesh();
|
|
30756
|
+
const cutPlatedGeom = manifoldMeshToThreeGeometry(cutPlatedMesh);
|
|
30757
|
+
currentGeoms.platedHoles = [
|
|
30758
|
+
{
|
|
30759
|
+
key: "plated-holes-union",
|
|
30760
|
+
geometry: cutPlatedGeom,
|
|
30761
|
+
color: new THREE23.Color(
|
|
30762
|
+
colors.copper[0],
|
|
30763
|
+
colors.copper[1],
|
|
30764
|
+
colors.copper[2]
|
|
30765
|
+
)
|
|
30766
|
+
}
|
|
30767
|
+
];
|
|
30768
|
+
}
|
|
30747
30769
|
}
|
|
30748
30770
|
const { cutoutOps } = processCutoutsForManifold(
|
|
30749
30771
|
Manifold,
|