@tscircuit/3d-viewer 0.0.492 → 0.0.493
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 +7 -26
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -30825,7 +30825,7 @@ import * as THREE16 from "three";
|
|
|
30825
30825
|
// package.json
|
|
30826
30826
|
var package_default = {
|
|
30827
30827
|
name: "@tscircuit/3d-viewer",
|
|
30828
|
-
version: "0.0.
|
|
30828
|
+
version: "0.0.492",
|
|
30829
30829
|
main: "./dist/index.js",
|
|
30830
30830
|
module: "./dist/index.js",
|
|
30831
30831
|
type: "module",
|
|
@@ -32504,11 +32504,6 @@ var platedHole = (plated_hole, ctx, options = {}) => {
|
|
|
32504
32504
|
return (0, import_colors2.colorize)(colors.copper, (0, import_booleans2.subtract)(copperSolid, drill));
|
|
32505
32505
|
}
|
|
32506
32506
|
if (plated_hole.shape === "pill_hole_with_rect_pad") {
|
|
32507
|
-
if (plated_hole.hole_shape !== "pill" || plated_hole.pad_shape !== "rect") {
|
|
32508
|
-
throw new Error(
|
|
32509
|
-
`Invalid hole_shape or pad_shape for pill_hole_with_rect_pad`
|
|
32510
|
-
);
|
|
32511
|
-
}
|
|
32512
32507
|
const holeOffsetX = plated_hole.hole_offset_x || 0;
|
|
32513
32508
|
const holeOffsetY = plated_hole.hole_offset_y || 0;
|
|
32514
32509
|
const shouldRotate = plated_hole.hole_height > plated_hole.hole_width;
|
|
@@ -33184,9 +33179,6 @@ var BoardGeomBuilder = class {
|
|
|
33184
33179
|
if (ph.shape === "circle" || ph.shape === "circular_hole_with_rect_pad") {
|
|
33185
33180
|
let cyGeom = null;
|
|
33186
33181
|
if (ph.shape === "circular_hole_with_rect_pad") {
|
|
33187
|
-
if (ph.hole_shape !== "circle" || ph.pad_shape !== "rect") {
|
|
33188
|
-
return;
|
|
33189
|
-
}
|
|
33190
33182
|
cyGeom = (0, import_primitives7.cylinder)({
|
|
33191
33183
|
center: [
|
|
33192
33184
|
ph.x + (ph.hole_offset_x || 0),
|
|
@@ -33258,9 +33250,6 @@ var BoardGeomBuilder = class {
|
|
|
33258
33250
|
});
|
|
33259
33251
|
this.platedHoleGeoms.push(platedHoleGeom);
|
|
33260
33252
|
} else if (ph.shape === "pill_hole_with_rect_pad") {
|
|
33261
|
-
if (ph.hole_shape !== "pill" || ph.pad_shape !== "rect") {
|
|
33262
|
-
return;
|
|
33263
|
-
}
|
|
33264
33253
|
const shouldRotate = ph.hole_height > ph.hole_width;
|
|
33265
33254
|
const holeWidth = shouldRotate ? ph.hole_height : ph.hole_width;
|
|
33266
33255
|
const holeHeight = shouldRotate ? ph.hole_width : ph.hole_height;
|
|
@@ -36668,9 +36657,6 @@ function processPlatedHolesForManifold(Manifold, CrossSection, circuitJson, pcbT
|
|
|
36668
36657
|
color: COPPER_COLOR
|
|
36669
36658
|
});
|
|
36670
36659
|
} else if (ph.shape === "pill_hole_with_rect_pad") {
|
|
36671
|
-
if (ph.hole_shape !== "pill" || ph.pad_shape !== "rect") {
|
|
36672
|
-
return;
|
|
36673
|
-
}
|
|
36674
36660
|
const holeW = ph.hole_width;
|
|
36675
36661
|
const holeH = ph.hole_height;
|
|
36676
36662
|
const holeOffsetX = ph.hole_offset_x || 0;
|
|
@@ -36682,11 +36668,9 @@ function processPlatedHolesForManifold(Manifold, CrossSection, circuitJson, pcbT
|
|
|
36682
36668
|
const drillW = holeW + 2 * MANIFOLD_Z_OFFSET;
|
|
36683
36669
|
const drillH = holeH + 2 * MANIFOLD_Z_OFFSET;
|
|
36684
36670
|
const drillDepth = pcbThickness * 1.2;
|
|
36685
|
-
|
|
36686
|
-
|
|
36687
|
-
|
|
36688
|
-
drillDepth
|
|
36689
|
-
).translate([holeOffsetX, holeOffsetY, 0]);
|
|
36671
|
+
let boardPillDrillOp = createPillOp(drillW, drillH, drillDepth).translate(
|
|
36672
|
+
[holeOffsetX, holeOffsetY, 0]
|
|
36673
|
+
);
|
|
36690
36674
|
const translatedBoardPillDrill = boardPillDrillOp.translate([
|
|
36691
36675
|
ph.x,
|
|
36692
36676
|
ph.y,
|
|
@@ -36882,7 +36866,7 @@ function processPlatedHolesForManifold(Manifold, CrossSection, circuitJson, pcbT
|
|
|
36882
36866
|
}
|
|
36883
36867
|
const outerCrossSection = CrossSection.ofPolygons([outerPoints]);
|
|
36884
36868
|
manifoldInstancesForCleanup.push(outerCrossSection);
|
|
36885
|
-
|
|
36869
|
+
let outerCopperOp = Manifold.extrude(
|
|
36886
36870
|
outerCrossSection,
|
|
36887
36871
|
copperPartThickness,
|
|
36888
36872
|
0,
|
|
@@ -36901,7 +36885,7 @@ function processPlatedHolesForManifold(Manifold, CrossSection, circuitJson, pcbT
|
|
|
36901
36885
|
}
|
|
36902
36886
|
const innerCrossSection = CrossSection.ofPolygons([innerPoints]);
|
|
36903
36887
|
manifoldInstancesForCleanup.push(innerCrossSection);
|
|
36904
|
-
|
|
36888
|
+
let innerDrillOp = Manifold.extrude(
|
|
36905
36889
|
innerCrossSection,
|
|
36906
36890
|
copperPartThickness * 1.05,
|
|
36907
36891
|
0,
|
|
@@ -36936,9 +36920,6 @@ function processPlatedHolesForManifold(Manifold, CrossSection, circuitJson, pcbT
|
|
|
36936
36920
|
color: COPPER_COLOR
|
|
36937
36921
|
});
|
|
36938
36922
|
} else if (ph.shape === "circular_hole_with_rect_pad") {
|
|
36939
|
-
if (ph.hole_shape !== "circle" || ph.pad_shape !== "rect") {
|
|
36940
|
-
return;
|
|
36941
|
-
}
|
|
36942
36923
|
const holeOffsetX = ph.hole_offset_x || 0;
|
|
36943
36924
|
const holeOffsetY = ph.hole_offset_y || 0;
|
|
36944
36925
|
const translatedDrill = createCircleHoleDrill({
|
|
@@ -37029,7 +37010,7 @@ function processPlatedHolesForManifold(Manifold, CrossSection, circuitJson, pcbT
|
|
|
37029
37010
|
});
|
|
37030
37011
|
}
|
|
37031
37012
|
});
|
|
37032
|
-
let platedHoleSubtractOp;
|
|
37013
|
+
let platedHoleSubtractOp = void 0;
|
|
37033
37014
|
if (platedHoleCopperOpsForSubtract.length > 0) {
|
|
37034
37015
|
platedHoleSubtractOp = Manifold.union(platedHoleCopperOpsForSubtract);
|
|
37035
37016
|
manifoldInstancesForCleanup.push(platedHoleSubtractOp);
|