@tscircuit/3d-viewer 0.0.341 → 0.0.343
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 +69 -3
- package/package.json +2 -2
package/dist/index.js
CHANGED
|
@@ -25340,7 +25340,7 @@ import * as THREE9 from "three";
|
|
|
25340
25340
|
// package.json
|
|
25341
25341
|
var package_default = {
|
|
25342
25342
|
name: "@tscircuit/3d-viewer",
|
|
25343
|
-
version: "0.0.
|
|
25343
|
+
version: "0.0.342",
|
|
25344
25344
|
main: "./dist/index.js",
|
|
25345
25345
|
module: "./dist/index.js",
|
|
25346
25346
|
type: "module",
|
|
@@ -25389,7 +25389,7 @@ var package_default = {
|
|
|
25389
25389
|
"@storybook/react-vite": "^9.1.2",
|
|
25390
25390
|
"@tscircuit/circuit-json-util": "^0.0.66",
|
|
25391
25391
|
"@tscircuit/core": "^0.0.631",
|
|
25392
|
-
"@tscircuit/props": "^0.0.
|
|
25392
|
+
"@tscircuit/props": "^0.0.288",
|
|
25393
25393
|
"@types/jsdom": "^21.1.7",
|
|
25394
25394
|
"@types/react": "19",
|
|
25395
25395
|
"@types/react-dom": "19",
|
|
@@ -27861,7 +27861,7 @@ function processPlatedHolesForManifold(Manifold, circuitJson, pcbThickness, mani
|
|
|
27861
27861
|
manifoldInstancesForCleanup.push(translatedDrill);
|
|
27862
27862
|
platedHoleBoardDrills.push(translatedDrill);
|
|
27863
27863
|
const copperPartThickness = pcbThickness + 2 * MANIFOLD_Z_OFFSET;
|
|
27864
|
-
|
|
27864
|
+
const platedPart = Manifold.cylinder(
|
|
27865
27865
|
copperPartThickness,
|
|
27866
27866
|
ph.outer_diameter / 2,
|
|
27867
27867
|
ph.outer_diameter / 2,
|
|
@@ -27983,6 +27983,72 @@ function processPlatedHolesForManifold(Manifold, circuitJson, pcbThickness, mani
|
|
|
27983
27983
|
geometry: threeGeom,
|
|
27984
27984
|
color: COPPER_COLOR
|
|
27985
27985
|
});
|
|
27986
|
+
} else if (ph.shape === "circular_hole_with_rect_pad") {
|
|
27987
|
+
const translatedDrill = createCircleHoleDrill({
|
|
27988
|
+
Manifold,
|
|
27989
|
+
x: ph.x,
|
|
27990
|
+
y: ph.y,
|
|
27991
|
+
diameter: ph.hole_diameter,
|
|
27992
|
+
thickness: pcbThickness,
|
|
27993
|
+
segments: SMOOTH_CIRCLE_SEGMENTS
|
|
27994
|
+
});
|
|
27995
|
+
manifoldInstancesForCleanup.push(translatedDrill);
|
|
27996
|
+
platedHoleBoardDrills.push(translatedDrill);
|
|
27997
|
+
const copperPartThickness = pcbThickness + 2 * MANIFOLD_Z_OFFSET;
|
|
27998
|
+
const holeRadius = ph.hole_diameter / 2;
|
|
27999
|
+
const barrelCylinder = Manifold.cylinder(
|
|
28000
|
+
copperPartThickness,
|
|
28001
|
+
holeRadius,
|
|
28002
|
+
holeRadius,
|
|
28003
|
+
SMOOTH_CIRCLE_SEGMENTS,
|
|
28004
|
+
true
|
|
28005
|
+
);
|
|
28006
|
+
manifoldInstancesForCleanup.push(barrelCylinder);
|
|
28007
|
+
const padWidth = ph.rect_pad_width ?? ph.hole_diameter;
|
|
28008
|
+
const padHeight = ph.rect_pad_height ?? ph.hole_diameter;
|
|
28009
|
+
const padThickness = DEFAULT_SMT_PAD_THICKNESS;
|
|
28010
|
+
const topPad = Manifold.cube(
|
|
28011
|
+
[padWidth, padHeight, padThickness],
|
|
28012
|
+
true
|
|
28013
|
+
).translate([
|
|
28014
|
+
0,
|
|
28015
|
+
0,
|
|
28016
|
+
pcbThickness / 2 + padThickness / 2 + MANIFOLD_Z_OFFSET
|
|
28017
|
+
]);
|
|
28018
|
+
const bottomPad = Manifold.cube(
|
|
28019
|
+
[padWidth, padHeight, padThickness],
|
|
28020
|
+
true
|
|
28021
|
+
).translate([
|
|
28022
|
+
0,
|
|
28023
|
+
0,
|
|
28024
|
+
-pcbThickness / 2 - padThickness / 2 - MANIFOLD_Z_OFFSET
|
|
28025
|
+
]);
|
|
28026
|
+
manifoldInstancesForCleanup.push(topPad, bottomPad);
|
|
28027
|
+
const copperUnionUncut = Manifold.union([
|
|
28028
|
+
barrelCylinder,
|
|
28029
|
+
topPad,
|
|
28030
|
+
bottomPad
|
|
28031
|
+
]);
|
|
28032
|
+
manifoldInstancesForCleanup.push(copperUnionUncut);
|
|
28033
|
+
const centerHoleRadius = Math.max(holeRadius - M, 0.01);
|
|
28034
|
+
const centerHole = Manifold.cylinder(
|
|
28035
|
+
copperPartThickness * 1.1,
|
|
28036
|
+
centerHoleRadius,
|
|
28037
|
+
centerHoleRadius,
|
|
28038
|
+
SMOOTH_CIRCLE_SEGMENTS,
|
|
28039
|
+
true
|
|
28040
|
+
);
|
|
28041
|
+
manifoldInstancesForCleanup.push(centerHole);
|
|
28042
|
+
const copperUnion = copperUnionUncut.subtract(centerHole);
|
|
28043
|
+
manifoldInstancesForCleanup.push(copperUnion);
|
|
28044
|
+
const translatedCopper = copperUnion.translate([ph.x, ph.y, 0]);
|
|
28045
|
+
manifoldInstancesForCleanup.push(translatedCopper);
|
|
28046
|
+
const threeGeom = manifoldMeshToThreeGeometry(translatedCopper.getMesh());
|
|
28047
|
+
platedHoleCopperGeoms.push({
|
|
28048
|
+
key: `ph-${ph.pcb_plated_hole_id || index}`,
|
|
28049
|
+
geometry: threeGeom,
|
|
28050
|
+
color: COPPER_COLOR
|
|
28051
|
+
});
|
|
27986
28052
|
}
|
|
27987
28053
|
});
|
|
27988
28054
|
return { platedHoleBoardDrills, platedHoleCopperGeoms };
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@tscircuit/3d-viewer",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.343",
|
|
4
4
|
"main": "./dist/index.js",
|
|
5
5
|
"module": "./dist/index.js",
|
|
6
6
|
"type": "module",
|
|
@@ -49,7 +49,7 @@
|
|
|
49
49
|
"@storybook/react-vite": "^9.1.2",
|
|
50
50
|
"@tscircuit/circuit-json-util": "^0.0.66",
|
|
51
51
|
"@tscircuit/core": "^0.0.631",
|
|
52
|
-
"@tscircuit/props": "^0.0.
|
|
52
|
+
"@tscircuit/props": "^0.0.288",
|
|
53
53
|
"@types/jsdom": "^21.1.7",
|
|
54
54
|
"@types/react": "19",
|
|
55
55
|
"@types/react-dom": "19",
|