@tscircuit/3d-viewer 0.0.563 → 0.0.564

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.
Files changed (2) hide show
  1. package/dist/index.js +18 -5
  2. package/package.json +1 -1
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.562",
32324
+ version: "0.0.563",
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
- pcbHoles.forEach((hole) => {
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
- return;
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
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@tscircuit/3d-viewer",
3
- "version": "0.0.563",
3
+ "version": "0.0.564",
4
4
  "main": "./dist/index.js",
5
5
  "module": "./dist/index.js",
6
6
  "type": "module",