@tscircuit/3d-viewer 0.0.490 → 0.0.492
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 +149 -147
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -12269,7 +12269,7 @@ var require_expand = __commonJS({
|
|
|
12269
12269
|
var expandGeom2 = require_expandGeom2();
|
|
12270
12270
|
var expandGeom3 = require_expandGeom3();
|
|
12271
12271
|
var expandPath2 = require_expandPath2();
|
|
12272
|
-
var
|
|
12272
|
+
var expand2 = (options, ...objects) => {
|
|
12273
12273
|
objects = flatten(objects);
|
|
12274
12274
|
if (objects.length === 0) throw new Error("wrong number of arguments");
|
|
12275
12275
|
const results = objects.map((object) => {
|
|
@@ -12280,7 +12280,7 @@ var require_expand = __commonJS({
|
|
|
12280
12280
|
});
|
|
12281
12281
|
return results.length === 1 ? results[0] : results;
|
|
12282
12282
|
};
|
|
12283
|
-
module.exports =
|
|
12283
|
+
module.exports = expand2;
|
|
12284
12284
|
}
|
|
12285
12285
|
});
|
|
12286
12286
|
|
|
@@ -12478,7 +12478,7 @@ var require_extrudeRectangularPath2 = __commonJS({
|
|
|
12478
12478
|
"node_modules/@jscad/modeling/src/operations/extrusions/extrudeRectangularPath2.js"(exports, module) {
|
|
12479
12479
|
"use strict";
|
|
12480
12480
|
var path2 = require_path2();
|
|
12481
|
-
var
|
|
12481
|
+
var expand2 = require_expand();
|
|
12482
12482
|
var extrudeLinearGeom2 = require_extrudeLinearGeom2();
|
|
12483
12483
|
var extrudeRectangularPath2 = (options, geometry) => {
|
|
12484
12484
|
const defaults = {
|
|
@@ -12490,7 +12490,7 @@ var require_extrudeRectangularPath2 = __commonJS({
|
|
|
12490
12490
|
options.offset = [0, 0, height10];
|
|
12491
12491
|
const points = path2.toPoints(geometry);
|
|
12492
12492
|
if (points.length === 0) throw new Error("the given geometry cannot be empty");
|
|
12493
|
-
const newgeometry =
|
|
12493
|
+
const newgeometry = expand2(options, geometry);
|
|
12494
12494
|
return extrudeLinearGeom2(options, newgeometry);
|
|
12495
12495
|
};
|
|
12496
12496
|
module.exports = extrudeRectangularPath2;
|
|
@@ -12504,7 +12504,7 @@ var require_extrudeRectangularGeom2 = __commonJS({
|
|
|
12504
12504
|
var { area } = require_utils();
|
|
12505
12505
|
var geom2 = require_geom2();
|
|
12506
12506
|
var path2 = require_path2();
|
|
12507
|
-
var
|
|
12507
|
+
var expand2 = require_expand();
|
|
12508
12508
|
var extrudeLinearGeom2 = require_extrudeLinearGeom2();
|
|
12509
12509
|
var extrudeRectangularGeom2 = (options, geometry) => {
|
|
12510
12510
|
const defaults = {
|
|
@@ -12518,7 +12518,7 @@ var require_extrudeRectangularGeom2 = __commonJS({
|
|
|
12518
12518
|
if (outlines.length === 0) throw new Error("the given geometry cannot be empty");
|
|
12519
12519
|
const newparts = outlines.map((outline) => {
|
|
12520
12520
|
if (area(outline) < 0) outline.reverse();
|
|
12521
|
-
return
|
|
12521
|
+
return expand2(options, path2.fromPoints({ closed: true }, outline));
|
|
12522
12522
|
});
|
|
12523
12523
|
const allsides = newparts.reduce((sides2, part) => sides2.concat(geom2.toSides(part)), []);
|
|
12524
12524
|
const newgeometry = geom2.create(allsides);
|
|
@@ -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.491",
|
|
30829
30829
|
main: "./dist/index.js",
|
|
30830
30830
|
module: "./dist/index.js",
|
|
30831
30831
|
type: "module",
|
|
@@ -32504,6 +32504,11 @@ 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
|
+
}
|
|
32507
32512
|
const holeOffsetX = plated_hole.hole_offset_x || 0;
|
|
32508
32513
|
const holeOffsetY = plated_hole.hole_offset_y || 0;
|
|
32509
32514
|
const shouldRotate = plated_hole.hole_height > plated_hole.hole_width;
|
|
@@ -32705,7 +32710,6 @@ var platedHole = (plated_hole, ctx, options = {}) => {
|
|
|
32705
32710
|
|
|
32706
32711
|
// src/BoardGeomBuilder.ts
|
|
32707
32712
|
var import_extrusions4 = __toESM(require_extrusions(), 1);
|
|
32708
|
-
var import_expansions2 = __toESM(require_expansions(), 1);
|
|
32709
32713
|
|
|
32710
32714
|
// src/geoms/brep-converter.ts
|
|
32711
32715
|
var import_primitives5 = __toESM(require_primitives(), 1);
|
|
@@ -33180,6 +33184,9 @@ var BoardGeomBuilder = class {
|
|
|
33180
33184
|
if (ph.shape === "circle" || ph.shape === "circular_hole_with_rect_pad") {
|
|
33181
33185
|
let cyGeom = null;
|
|
33182
33186
|
if (ph.shape === "circular_hole_with_rect_pad") {
|
|
33187
|
+
if (ph.hole_shape !== "circle" || ph.pad_shape !== "rect") {
|
|
33188
|
+
return;
|
|
33189
|
+
}
|
|
33183
33190
|
cyGeom = (0, import_primitives7.cylinder)({
|
|
33184
33191
|
center: [
|
|
33185
33192
|
ph.x + (ph.hole_offset_x || 0),
|
|
@@ -33251,6 +33258,9 @@ var BoardGeomBuilder = class {
|
|
|
33251
33258
|
});
|
|
33252
33259
|
this.platedHoleGeoms.push(platedHoleGeom);
|
|
33253
33260
|
} else if (ph.shape === "pill_hole_with_rect_pad") {
|
|
33261
|
+
if (ph.hole_shape !== "pill" || ph.pad_shape !== "rect") {
|
|
33262
|
+
return;
|
|
33263
|
+
}
|
|
33254
33264
|
const shouldRotate = ph.hole_height > ph.hole_width;
|
|
33255
33265
|
const holeWidth = shouldRotate ? ph.hole_height : ph.hole_width;
|
|
33256
33266
|
const holeHeight = shouldRotate ? ph.hole_width : ph.hole_height;
|
|
@@ -33353,95 +33363,68 @@ var BoardGeomBuilder = class {
|
|
|
33353
33363
|
this.platedHoleGeoms = this.platedHoleGeoms.map(
|
|
33354
33364
|
(phg) => (0, import_colors3.colorize)(colors.copper, (0, import_booleans5.subtract)(phg, copperCut))
|
|
33355
33365
|
);
|
|
33356
|
-
} else if (hole.hole_shape === "pill" || hole.hole_shape === "rotated_pill") {
|
|
33357
|
-
const holeWidth = hole.hole_width;
|
|
33358
|
-
const holeHeight = hole.hole_height;
|
|
33359
|
-
const
|
|
33360
|
-
const
|
|
33361
|
-
const
|
|
33362
|
-
|
|
33363
|
-
|
|
33364
|
-
|
|
33365
|
-
|
|
33366
|
-
|
|
33367
|
-
|
|
33368
|
-
|
|
33369
|
-
|
|
33370
|
-
|
|
33371
|
-
|
|
33372
|
-
|
|
33373
|
-
|
|
33374
|
-
|
|
33375
|
-
|
|
33376
|
-
|
|
33377
|
-
height:
|
|
33378
|
-
|
|
33366
|
+
} else if (hole.hole_shape === "pill" || hole.hole_shape === "rotated_pill" || hole.hole_shape === "oval") {
|
|
33367
|
+
const holeWidth = hole.hole_width ?? hole.hole_diameter;
|
|
33368
|
+
const holeHeight = hole.hole_height ?? hole.hole_diameter;
|
|
33369
|
+
const rotation2 = hole.ccw_rotation ?? hole.rotation ?? 0;
|
|
33370
|
+
const copperInset2 = 0.02;
|
|
33371
|
+
const createHoleGeom = (w, h2, depth, isOval) => {
|
|
33372
|
+
if (w <= 0 || h2 <= 0) return null;
|
|
33373
|
+
if (isOval) {
|
|
33374
|
+
return (0, import_transforms6.translate)(
|
|
33375
|
+
[0, 0, -depth / 2],
|
|
33376
|
+
(0, import_extrusions4.extrudeLinear)(
|
|
33377
|
+
{ height: depth },
|
|
33378
|
+
(0, import_primitives7.ellipse)({ radius: [w / 2, h2 / 2] })
|
|
33379
|
+
)
|
|
33380
|
+
);
|
|
33381
|
+
}
|
|
33382
|
+
const radius = Math.min(w, h2) / 2;
|
|
33383
|
+
const length2 = Math.abs(w - h2);
|
|
33384
|
+
if (w > h2) {
|
|
33385
|
+
return (0, import_booleans5.union)(
|
|
33386
|
+
(0, import_primitives7.cuboid)({ center: [0, 0, 0], size: [length2, h2, depth] }),
|
|
33387
|
+
(0, import_primitives7.cylinder)({ center: [-length2 / 2, 0, 0], radius, height: depth }),
|
|
33388
|
+
(0, import_primitives7.cylinder)({ center: [length2 / 2, 0, 0], radius, height: depth })
|
|
33389
|
+
);
|
|
33390
|
+
}
|
|
33391
|
+
return (0, import_booleans5.union)(
|
|
33392
|
+
(0, import_primitives7.cuboid)({ center: [0, 0, 0], size: [w, length2, depth] }),
|
|
33393
|
+
(0, import_primitives7.cylinder)({ center: [0, -length2 / 2, 0], radius, height: depth }),
|
|
33394
|
+
(0, import_primitives7.cylinder)({ center: [0, length2 / 2, 0], radius, height: depth })
|
|
33379
33395
|
);
|
|
33380
|
-
}
|
|
33381
|
-
|
|
33382
|
-
|
|
33383
|
-
|
|
33384
|
-
|
|
33385
|
-
|
|
33386
|
-
|
|
33387
|
-
|
|
33388
|
-
|
|
33389
|
-
|
|
33390
|
-
|
|
33391
|
-
|
|
33392
|
-
|
|
33393
|
-
|
|
33394
|
-
|
|
33395
|
-
|
|
33396
|
+
};
|
|
33397
|
+
let boardHole = createHoleGeom(
|
|
33398
|
+
holeWidth,
|
|
33399
|
+
holeHeight,
|
|
33400
|
+
holeDepth,
|
|
33401
|
+
hole.hole_shape === "oval"
|
|
33402
|
+
);
|
|
33403
|
+
let copperCut = createHoleGeom(
|
|
33404
|
+
holeWidth - 2 * copperInset2,
|
|
33405
|
+
holeHeight - 2 * copperInset2,
|
|
33406
|
+
holeDepth,
|
|
33407
|
+
hole.hole_shape === "oval"
|
|
33408
|
+
);
|
|
33409
|
+
if (boardHole && rotation2 !== 0) {
|
|
33410
|
+
boardHole = (0, import_transforms6.rotateZ)(rotation2 * Math.PI / 180, boardHole);
|
|
33411
|
+
}
|
|
33412
|
+
if (copperCut && rotation2 !== 0) {
|
|
33413
|
+
copperCut = (0, import_transforms6.rotateZ)(rotation2 * Math.PI / 180, copperCut);
|
|
33414
|
+
}
|
|
33415
|
+
if (boardHole) {
|
|
33416
|
+
const positionedBoardHole = (0, import_transforms6.translate)([hole.x, hole.y, 0], boardHole);
|
|
33417
|
+
this.boardGeom = (0, import_booleans5.subtract)(this.boardGeom, positionedBoardHole);
|
|
33418
|
+
this.padGeoms = this.padGeoms.map(
|
|
33419
|
+
(pg) => (0, import_colors3.colorize)(colors.copper, (0, import_booleans5.subtract)(pg, positionedBoardHole))
|
|
33396
33420
|
);
|
|
33397
33421
|
}
|
|
33398
|
-
if (
|
|
33399
|
-
const
|
|
33400
|
-
|
|
33422
|
+
if (copperCut) {
|
|
33423
|
+
const positionedCopperCut = (0, import_transforms6.translate)([hole.x, hole.y, 0], copperCut);
|
|
33424
|
+
this.platedHoleGeoms = this.platedHoleGeoms.map(
|
|
33425
|
+
(phg) => (0, import_colors3.colorize)(colors.copper, (0, import_booleans5.subtract)(phg, positionedCopperCut))
|
|
33426
|
+
);
|
|
33401
33427
|
}
|
|
33402
|
-
this.boardGeom = (0, import_booleans5.subtract)(this.boardGeom, pillHole);
|
|
33403
|
-
this.padGeoms = this.padGeoms.map(
|
|
33404
|
-
(pg) => (0, import_colors3.colorize)(colors.copper, (0, import_booleans5.subtract)(pg, pillHole))
|
|
33405
|
-
);
|
|
33406
|
-
const copperPill = (0, import_expansions2.expand)({ delta: -copperInset }, pillHole);
|
|
33407
|
-
this.platedHoleGeoms = this.platedHoleGeoms.map(
|
|
33408
|
-
(phg) => (0, import_colors3.colorize)(colors.copper, (0, import_booleans5.subtract)(phg, copperPill))
|
|
33409
|
-
);
|
|
33410
|
-
} else if (hole.hole_shape === "oval") {
|
|
33411
|
-
const holeWidth = hole.hole_width;
|
|
33412
|
-
const holeHeight = hole.hole_height;
|
|
33413
|
-
const ellipseGeom = (0, import_transforms6.translate)(
|
|
33414
|
-
[hole.x, hole.y, 0],
|
|
33415
|
-
(0, import_transforms6.translate)(
|
|
33416
|
-
[0, 0, -holeDepth / 2],
|
|
33417
|
-
(0, import_extrusions4.extrudeLinear)(
|
|
33418
|
-
{ height: holeDepth },
|
|
33419
|
-
(0, import_primitives7.ellipse)({ radius: [holeWidth / 2, holeHeight / 2] })
|
|
33420
|
-
)
|
|
33421
|
-
)
|
|
33422
|
-
);
|
|
33423
|
-
this.boardGeom = (0, import_booleans5.subtract)(this.boardGeom, ellipseGeom);
|
|
33424
|
-
this.padGeoms = this.padGeoms.map(
|
|
33425
|
-
(pg) => (0, import_colors3.colorize)(colors.copper, (0, import_booleans5.subtract)(pg, ellipseGeom))
|
|
33426
|
-
);
|
|
33427
|
-
const copperEllipseGeom = (0, import_transforms6.translate)(
|
|
33428
|
-
[hole.x, hole.y, 0],
|
|
33429
|
-
(0, import_transforms6.translate)(
|
|
33430
|
-
[0, 0, -holeDepth / 2],
|
|
33431
|
-
(0, import_extrusions4.extrudeLinear)(
|
|
33432
|
-
{ height: holeDepth },
|
|
33433
|
-
(0, import_primitives7.ellipse)({
|
|
33434
|
-
radius: [
|
|
33435
|
-
holeWidth / 2 - copperInset,
|
|
33436
|
-
holeHeight / 2 - copperInset
|
|
33437
|
-
]
|
|
33438
|
-
})
|
|
33439
|
-
)
|
|
33440
|
-
)
|
|
33441
|
-
);
|
|
33442
|
-
this.platedHoleGeoms = this.platedHoleGeoms.map(
|
|
33443
|
-
(phg) => (0, import_colors3.colorize)(colors.copper, (0, import_booleans5.subtract)(phg, copperEllipseGeom))
|
|
33444
|
-
);
|
|
33445
33428
|
}
|
|
33446
33429
|
}
|
|
33447
33430
|
processPad(pad2) {
|
|
@@ -36344,16 +36327,7 @@ function createPlatedHoleDrill({
|
|
|
36344
36327
|
}
|
|
36345
36328
|
|
|
36346
36329
|
// src/utils/manifold/process-non-plated-holes.ts
|
|
36347
|
-
function
|
|
36348
|
-
return hole.hole_shape === "circle" && typeof hole.hole_diameter === "number";
|
|
36349
|
-
}
|
|
36350
|
-
function isPillHole(hole) {
|
|
36351
|
-
return hole.hole_shape === "pill" && typeof hole.hole_width === "number" && typeof hole.hole_height === "number";
|
|
36352
|
-
}
|
|
36353
|
-
function isRotatedPillHole(hole) {
|
|
36354
|
-
return hole.hole_shape === "rotated_pill" && typeof hole.hole_width === "number" && typeof hole.hole_height === "number" && typeof hole.ccw_rotation === "number";
|
|
36355
|
-
}
|
|
36356
|
-
function processNonPlatedHolesForManifold(Manifold, circuitJson, pcbThickness, manifoldInstancesForCleanup) {
|
|
36330
|
+
function processNonPlatedHolesForManifold(Manifold, CrossSection, circuitJson, pcbThickness, manifoldInstancesForCleanup) {
|
|
36357
36331
|
const nonPlatedHoleBoardDrills = [];
|
|
36358
36332
|
const pcbHoles = su14(circuitJson).pcb_hole.list();
|
|
36359
36333
|
const createPillOp = (width10, height10, depth) => {
|
|
@@ -36367,52 +36341,71 @@ function processNonPlatedHolesForManifold(Manifold, circuitJson, pcbThickness, m
|
|
|
36367
36341
|
manifoldInstancesForCleanup.push(pillOp);
|
|
36368
36342
|
return pillOp;
|
|
36369
36343
|
};
|
|
36344
|
+
const createEllipsePoints2 = (w, h2, segments) => {
|
|
36345
|
+
const points = [];
|
|
36346
|
+
for (let i = 0; i < segments; i++) {
|
|
36347
|
+
const theta = 2 * Math.PI * i / segments;
|
|
36348
|
+
points.push([w / 2 * Math.cos(theta), h2 / 2 * Math.sin(theta)]);
|
|
36349
|
+
}
|
|
36350
|
+
return points;
|
|
36351
|
+
};
|
|
36370
36352
|
pcbHoles.forEach((hole) => {
|
|
36371
|
-
|
|
36372
|
-
|
|
36353
|
+
const holeShape = hole.hole_shape;
|
|
36354
|
+
const holeX = hole.x;
|
|
36355
|
+
const holeY = hole.y;
|
|
36356
|
+
const drillDepth = pcbThickness * 1.2;
|
|
36357
|
+
const rotation2 = hole.ccw_rotation ?? hole.rotation ?? 0;
|
|
36358
|
+
const holeW = hole.hole_width ?? hole.hole_diameter;
|
|
36359
|
+
const holeH = hole.hole_height ?? hole.hole_diameter;
|
|
36360
|
+
let holeOp = null;
|
|
36361
|
+
if (holeShape === "circle") {
|
|
36362
|
+
holeOp = createCircleHoleDrill({
|
|
36373
36363
|
Manifold,
|
|
36374
|
-
x:
|
|
36375
|
-
y:
|
|
36364
|
+
x: holeX,
|
|
36365
|
+
y: holeY,
|
|
36376
36366
|
diameter: hole.hole_diameter,
|
|
36377
36367
|
thickness: pcbThickness,
|
|
36378
36368
|
segments: SMOOTH_CIRCLE_SEGMENTS
|
|
36379
36369
|
});
|
|
36380
|
-
|
|
36381
|
-
|
|
36382
|
-
|
|
36383
|
-
|
|
36384
|
-
|
|
36385
|
-
|
|
36386
|
-
|
|
36387
|
-
|
|
36388
|
-
|
|
36389
|
-
|
|
36390
|
-
|
|
36391
|
-
|
|
36392
|
-
|
|
36393
|
-
|
|
36394
|
-
|
|
36395
|
-
|
|
36396
|
-
|
|
36397
|
-
|
|
36398
|
-
|
|
36399
|
-
|
|
36400
|
-
|
|
36401
|
-
} else if (hole.hole_shape === "oval") {
|
|
36402
|
-
const holeW = hole.hole_width;
|
|
36403
|
-
const holeH = hole.hole_height;
|
|
36404
|
-
const drillDepth = pcbThickness * 1.2;
|
|
36405
|
-
const ovalDrillOp = Manifold.cylinder(
|
|
36370
|
+
nonPlatedHoleBoardDrills.push(holeOp);
|
|
36371
|
+
manifoldInstancesForCleanup.push(holeOp);
|
|
36372
|
+
return;
|
|
36373
|
+
}
|
|
36374
|
+
if (holeShape === "pill" || holeShape === "rotated_pill") {
|
|
36375
|
+
holeOp = createPillOp(holeW, holeH, drillDepth);
|
|
36376
|
+
} else if (holeShape === "oval") {
|
|
36377
|
+
let points = createEllipsePoints2(holeW, holeH, SMOOTH_CIRCLE_SEGMENTS);
|
|
36378
|
+
let area = 0;
|
|
36379
|
+
for (let i = 0; i < points.length; i++) {
|
|
36380
|
+
const j = (i + 1) % points.length;
|
|
36381
|
+
area += points[i][0] * points[j][1];
|
|
36382
|
+
area -= points[j][0] * points[i][1];
|
|
36383
|
+
}
|
|
36384
|
+
if (area <= 0) {
|
|
36385
|
+
points = points.reverse();
|
|
36386
|
+
}
|
|
36387
|
+
const crossSection = CrossSection.ofPolygons([points]);
|
|
36388
|
+
manifoldInstancesForCleanup.push(crossSection);
|
|
36389
|
+
holeOp = Manifold.extrude(
|
|
36390
|
+
crossSection,
|
|
36406
36391
|
drillDepth,
|
|
36407
|
-
|
|
36408
|
-
|
|
36409
|
-
|
|
36392
|
+
0,
|
|
36393
|
+
0,
|
|
36394
|
+
[1, 1],
|
|
36410
36395
|
true
|
|
36411
|
-
|
|
36412
|
-
|
|
36413
|
-
|
|
36414
|
-
|
|
36415
|
-
|
|
36396
|
+
// center
|
|
36397
|
+
);
|
|
36398
|
+
manifoldInstancesForCleanup.push(holeOp);
|
|
36399
|
+
}
|
|
36400
|
+
if (holeOp) {
|
|
36401
|
+
if (rotation2 !== 0) {
|
|
36402
|
+
const rotatedOp = holeOp.rotate([0, 0, rotation2]);
|
|
36403
|
+
manifoldInstancesForCleanup.push(rotatedOp);
|
|
36404
|
+
holeOp = rotatedOp;
|
|
36405
|
+
}
|
|
36406
|
+
const translatedHole = holeOp.translate([holeX, holeY, 0]);
|
|
36407
|
+
manifoldInstancesForCleanup.push(translatedHole);
|
|
36408
|
+
nonPlatedHoleBoardDrills.push(translatedHole);
|
|
36416
36409
|
}
|
|
36417
36410
|
});
|
|
36418
36411
|
return { nonPlatedHoleBoardDrills };
|
|
@@ -36675,6 +36668,9 @@ function processPlatedHolesForManifold(Manifold, CrossSection, circuitJson, pcbT
|
|
|
36675
36668
|
color: COPPER_COLOR
|
|
36676
36669
|
});
|
|
36677
36670
|
} else if (ph.shape === "pill_hole_with_rect_pad") {
|
|
36671
|
+
if (ph.hole_shape !== "pill" || ph.pad_shape !== "rect") {
|
|
36672
|
+
return;
|
|
36673
|
+
}
|
|
36678
36674
|
const holeW = ph.hole_width;
|
|
36679
36675
|
const holeH = ph.hole_height;
|
|
36680
36676
|
const holeOffsetX = ph.hole_offset_x || 0;
|
|
@@ -36686,9 +36682,11 @@ function processPlatedHolesForManifold(Manifold, CrossSection, circuitJson, pcbT
|
|
|
36686
36682
|
const drillW = holeW + 2 * MANIFOLD_Z_OFFSET;
|
|
36687
36683
|
const drillH = holeH + 2 * MANIFOLD_Z_OFFSET;
|
|
36688
36684
|
const drillDepth = pcbThickness * 1.2;
|
|
36689
|
-
|
|
36690
|
-
|
|
36691
|
-
|
|
36685
|
+
const boardPillDrillOp = createPillOp(
|
|
36686
|
+
drillW,
|
|
36687
|
+
drillH,
|
|
36688
|
+
drillDepth
|
|
36689
|
+
).translate([holeOffsetX, holeOffsetY, 0]);
|
|
36692
36690
|
const translatedBoardPillDrill = boardPillDrillOp.translate([
|
|
36693
36691
|
ph.x,
|
|
36694
36692
|
ph.y,
|
|
@@ -36884,7 +36882,7 @@ function processPlatedHolesForManifold(Manifold, CrossSection, circuitJson, pcbT
|
|
|
36884
36882
|
}
|
|
36885
36883
|
const outerCrossSection = CrossSection.ofPolygons([outerPoints]);
|
|
36886
36884
|
manifoldInstancesForCleanup.push(outerCrossSection);
|
|
36887
|
-
|
|
36885
|
+
const outerCopperOp = Manifold.extrude(
|
|
36888
36886
|
outerCrossSection,
|
|
36889
36887
|
copperPartThickness,
|
|
36890
36888
|
0,
|
|
@@ -36903,7 +36901,7 @@ function processPlatedHolesForManifold(Manifold, CrossSection, circuitJson, pcbT
|
|
|
36903
36901
|
}
|
|
36904
36902
|
const innerCrossSection = CrossSection.ofPolygons([innerPoints]);
|
|
36905
36903
|
manifoldInstancesForCleanup.push(innerCrossSection);
|
|
36906
|
-
|
|
36904
|
+
const innerDrillOp = Manifold.extrude(
|
|
36907
36905
|
innerCrossSection,
|
|
36908
36906
|
copperPartThickness * 1.05,
|
|
36909
36907
|
0,
|
|
@@ -36938,6 +36936,9 @@ function processPlatedHolesForManifold(Manifold, CrossSection, circuitJson, pcbT
|
|
|
36938
36936
|
color: COPPER_COLOR
|
|
36939
36937
|
});
|
|
36940
36938
|
} else if (ph.shape === "circular_hole_with_rect_pad") {
|
|
36939
|
+
if (ph.hole_shape !== "circle" || ph.pad_shape !== "rect") {
|
|
36940
|
+
return;
|
|
36941
|
+
}
|
|
36941
36942
|
const holeOffsetX = ph.hole_offset_x || 0;
|
|
36942
36943
|
const holeOffsetY = ph.hole_offset_y || 0;
|
|
36943
36944
|
const translatedDrill = createCircleHoleDrill({
|
|
@@ -37028,7 +37029,7 @@ function processPlatedHolesForManifold(Manifold, CrossSection, circuitJson, pcbT
|
|
|
37028
37029
|
});
|
|
37029
37030
|
}
|
|
37030
37031
|
});
|
|
37031
|
-
let platedHoleSubtractOp
|
|
37032
|
+
let platedHoleSubtractOp;
|
|
37032
37033
|
if (platedHoleCopperOpsForSubtract.length > 0) {
|
|
37033
37034
|
platedHoleSubtractOp = Manifold.union(platedHoleCopperOpsForSubtract);
|
|
37034
37035
|
manifoldInstancesForCleanup.push(platedHoleSubtractOp);
|
|
@@ -37712,6 +37713,7 @@ var useManifoldBoardBuilder = (manifoldJSModule, circuitJson) => {
|
|
|
37712
37713
|
let holeUnion = null;
|
|
37713
37714
|
const { nonPlatedHoleBoardDrills } = processNonPlatedHolesForManifold(
|
|
37714
37715
|
Manifold,
|
|
37716
|
+
CrossSection,
|
|
37715
37717
|
circuitJson,
|
|
37716
37718
|
currentPcbThickness,
|
|
37717
37719
|
manifoldInstancesForCleanup.current
|