@tscircuit/3d-viewer 0.0.563 → 0.0.565
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.d.ts +3 -3
- package/dist/index.js +18 -5
- package/package.json +1 -1
package/dist/index.d.ts
CHANGED
|
@@ -1,13 +1,13 @@
|
|
|
1
|
-
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
2
|
-
import { AnyCircuitElement, PcbBoard } from 'circuit-json';
|
|
3
1
|
import * as React from 'react';
|
|
2
|
+
import React__default from 'react';
|
|
3
|
+
import { AnyCircuitElement, PcbBoard } from 'circuit-json';
|
|
4
4
|
import * as THREE from 'three';
|
|
5
5
|
import { GLTFExporterOptions } from 'three-stdlib';
|
|
6
6
|
import { ManifoldToplevel } from 'manifold-3d';
|
|
7
7
|
import { JSDOM } from 'jsdom';
|
|
8
8
|
import { OrbitControls } from 'three/examples/jsm/controls/OrbitControls.js';
|
|
9
9
|
|
|
10
|
-
declare const CadViewer: (props: any) =>
|
|
10
|
+
declare const CadViewer: (props: any) => React__default.JSX.Element;
|
|
11
11
|
|
|
12
12
|
interface CircuitToSvgOptions {
|
|
13
13
|
width?: number;
|
package/dist/index.js
CHANGED
|
@@ -32321,7 +32321,7 @@ import * as THREE20 from "three";
|
|
|
32321
32321
|
// package.json
|
|
32322
32322
|
var package_default = {
|
|
32323
32323
|
name: "@tscircuit/3d-viewer",
|
|
32324
|
-
version: "0.0.
|
|
32324
|
+
version: "0.0.564",
|
|
32325
32325
|
main: "./dist/index.js",
|
|
32326
32326
|
module: "./dist/index.js",
|
|
32327
32327
|
type: "module",
|
|
@@ -34726,13 +34726,19 @@ var BoardGeomBuilder = class {
|
|
|
34726
34726
|
this.platedHoleGeoms = this.platedHoleGeoms.map(
|
|
34727
34727
|
(phg) => (0, import_colors3.colorize)(colors.copper, (0, import_booleans4.subtract)(phg, copperCut))
|
|
34728
34728
|
);
|
|
34729
|
-
} else if (hole.hole_shape === "pill" || hole.hole_shape === "rotated_pill" || hole.hole_shape === "oval") {
|
|
34729
|
+
} else if (hole.hole_shape === "pill" || hole.hole_shape === "rotated_pill" || hole.hole_shape === "rect" || hole.hole_shape === "oval") {
|
|
34730
34730
|
const holeWidth = hole.hole_width ?? hole.hole_diameter;
|
|
34731
34731
|
const holeHeight = hole.hole_height ?? hole.hole_diameter;
|
|
34732
34732
|
const rotation = hole.ccw_rotation ?? hole.rotation ?? 0;
|
|
34733
34733
|
const copperInset = 0.02;
|
|
34734
34734
|
const createHoleGeom = (w, h2, depth, isOval) => {
|
|
34735
34735
|
if (w <= 0 || h2 <= 0) return null;
|
|
34736
|
+
if (hole.hole_shape === "rect") {
|
|
34737
|
+
return (0, import_primitives6.cuboid)({
|
|
34738
|
+
center: [0, 0, 0],
|
|
34739
|
+
size: [w, h2, depth]
|
|
34740
|
+
});
|
|
34741
|
+
}
|
|
34736
34742
|
if (isOval) {
|
|
34737
34743
|
return (0, import_transforms6.translate)(
|
|
34738
34744
|
[0, 0, -depth / 2],
|
|
@@ -37410,6 +37416,11 @@ function processNonPlatedHolesForManifold(Manifold, CrossSection, circuitJson, p
|
|
|
37410
37416
|
manifoldInstancesForCleanup.push(pillOp);
|
|
37411
37417
|
return pillOp;
|
|
37412
37418
|
};
|
|
37419
|
+
const createRectOp = (width10, height10, depth) => {
|
|
37420
|
+
const rectOp = Manifold.cube([width10, height10, depth], true);
|
|
37421
|
+
manifoldInstancesForCleanup.push(rectOp);
|
|
37422
|
+
return rectOp;
|
|
37423
|
+
};
|
|
37413
37424
|
const createEllipsePoints2 = (w, h2, segments) => {
|
|
37414
37425
|
const points = [];
|
|
37415
37426
|
for (let i = 0; i < segments; i++) {
|
|
@@ -37418,7 +37429,7 @@ function processNonPlatedHolesForManifold(Manifold, CrossSection, circuitJson, p
|
|
|
37418
37429
|
}
|
|
37419
37430
|
return points;
|
|
37420
37431
|
};
|
|
37421
|
-
|
|
37432
|
+
for (const hole of pcbHoles) {
|
|
37422
37433
|
const holeShape = hole.hole_shape;
|
|
37423
37434
|
const holeX = hole.x;
|
|
37424
37435
|
const holeY = hole.y;
|
|
@@ -37438,10 +37449,12 @@ function processNonPlatedHolesForManifold(Manifold, CrossSection, circuitJson, p
|
|
|
37438
37449
|
});
|
|
37439
37450
|
nonPlatedHoleBoardDrills.push(holeOp);
|
|
37440
37451
|
manifoldInstancesForCleanup.push(holeOp);
|
|
37441
|
-
|
|
37452
|
+
continue;
|
|
37442
37453
|
}
|
|
37443
37454
|
if (holeShape === "pill" || holeShape === "rotated_pill") {
|
|
37444
37455
|
holeOp = createPillOp(holeW, holeH, drillDepth);
|
|
37456
|
+
} else if (holeShape === "rect") {
|
|
37457
|
+
holeOp = createRectOp(holeW, holeH, drillDepth);
|
|
37445
37458
|
} else if (holeShape === "oval") {
|
|
37446
37459
|
let points = createEllipsePoints2(holeW, holeH, SMOOTH_CIRCLE_SEGMENTS);
|
|
37447
37460
|
let area = 0;
|
|
@@ -37476,7 +37489,7 @@ function processNonPlatedHolesForManifold(Manifold, CrossSection, circuitJson, p
|
|
|
37476
37489
|
manifoldInstancesForCleanup.push(translatedHole);
|
|
37477
37490
|
nonPlatedHoleBoardDrills.push(translatedHole);
|
|
37478
37491
|
}
|
|
37479
|
-
}
|
|
37492
|
+
}
|
|
37480
37493
|
return { nonPlatedHoleBoardDrills };
|
|
37481
37494
|
}
|
|
37482
37495
|
|