@tscircuit/3d-viewer 0.0.342 → 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 +68 -2
- package/package.json +1 -1
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",
|
|
@@ -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 };
|