@tscircuit/3d-viewer 0.0.491 → 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.
Files changed (2) hide show
  1. package/dist/index.js +26 -7
  2. package/package.json +1 -1
package/dist/index.js CHANGED
@@ -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.490",
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;
@@ -33179,6 +33184,9 @@ var BoardGeomBuilder = class {
33179
33184
  if (ph.shape === "circle" || ph.shape === "circular_hole_with_rect_pad") {
33180
33185
  let cyGeom = null;
33181
33186
  if (ph.shape === "circular_hole_with_rect_pad") {
33187
+ if (ph.hole_shape !== "circle" || ph.pad_shape !== "rect") {
33188
+ return;
33189
+ }
33182
33190
  cyGeom = (0, import_primitives7.cylinder)({
33183
33191
  center: [
33184
33192
  ph.x + (ph.hole_offset_x || 0),
@@ -33250,6 +33258,9 @@ var BoardGeomBuilder = class {
33250
33258
  });
33251
33259
  this.platedHoleGeoms.push(platedHoleGeom);
33252
33260
  } else if (ph.shape === "pill_hole_with_rect_pad") {
33261
+ if (ph.hole_shape !== "pill" || ph.pad_shape !== "rect") {
33262
+ return;
33263
+ }
33253
33264
  const shouldRotate = ph.hole_height > ph.hole_width;
33254
33265
  const holeWidth = shouldRotate ? ph.hole_height : ph.hole_width;
33255
33266
  const holeHeight = shouldRotate ? ph.hole_width : ph.hole_height;
@@ -36657,6 +36668,9 @@ function processPlatedHolesForManifold(Manifold, CrossSection, circuitJson, pcbT
36657
36668
  color: COPPER_COLOR
36658
36669
  });
36659
36670
  } else if (ph.shape === "pill_hole_with_rect_pad") {
36671
+ if (ph.hole_shape !== "pill" || ph.pad_shape !== "rect") {
36672
+ return;
36673
+ }
36660
36674
  const holeW = ph.hole_width;
36661
36675
  const holeH = ph.hole_height;
36662
36676
  const holeOffsetX = ph.hole_offset_x || 0;
@@ -36668,9 +36682,11 @@ function processPlatedHolesForManifold(Manifold, CrossSection, circuitJson, pcbT
36668
36682
  const drillW = holeW + 2 * MANIFOLD_Z_OFFSET;
36669
36683
  const drillH = holeH + 2 * MANIFOLD_Z_OFFSET;
36670
36684
  const drillDepth = pcbThickness * 1.2;
36671
- let boardPillDrillOp = createPillOp(drillW, drillH, drillDepth).translate(
36672
- [holeOffsetX, holeOffsetY, 0]
36673
- );
36685
+ const boardPillDrillOp = createPillOp(
36686
+ drillW,
36687
+ drillH,
36688
+ drillDepth
36689
+ ).translate([holeOffsetX, holeOffsetY, 0]);
36674
36690
  const translatedBoardPillDrill = boardPillDrillOp.translate([
36675
36691
  ph.x,
36676
36692
  ph.y,
@@ -36866,7 +36882,7 @@ function processPlatedHolesForManifold(Manifold, CrossSection, circuitJson, pcbT
36866
36882
  }
36867
36883
  const outerCrossSection = CrossSection.ofPolygons([outerPoints]);
36868
36884
  manifoldInstancesForCleanup.push(outerCrossSection);
36869
- let outerCopperOp = Manifold.extrude(
36885
+ const outerCopperOp = Manifold.extrude(
36870
36886
  outerCrossSection,
36871
36887
  copperPartThickness,
36872
36888
  0,
@@ -36885,7 +36901,7 @@ function processPlatedHolesForManifold(Manifold, CrossSection, circuitJson, pcbT
36885
36901
  }
36886
36902
  const innerCrossSection = CrossSection.ofPolygons([innerPoints]);
36887
36903
  manifoldInstancesForCleanup.push(innerCrossSection);
36888
- let innerDrillOp = Manifold.extrude(
36904
+ const innerDrillOp = Manifold.extrude(
36889
36905
  innerCrossSection,
36890
36906
  copperPartThickness * 1.05,
36891
36907
  0,
@@ -36920,6 +36936,9 @@ function processPlatedHolesForManifold(Manifold, CrossSection, circuitJson, pcbT
36920
36936
  color: COPPER_COLOR
36921
36937
  });
36922
36938
  } else if (ph.shape === "circular_hole_with_rect_pad") {
36939
+ if (ph.hole_shape !== "circle" || ph.pad_shape !== "rect") {
36940
+ return;
36941
+ }
36923
36942
  const holeOffsetX = ph.hole_offset_x || 0;
36924
36943
  const holeOffsetY = ph.hole_offset_y || 0;
36925
36944
  const translatedDrill = createCircleHoleDrill({
@@ -37010,7 +37029,7 @@ function processPlatedHolesForManifold(Manifold, CrossSection, circuitJson, pcbT
37010
37029
  });
37011
37030
  }
37012
37031
  });
37013
- let platedHoleSubtractOp = void 0;
37032
+ let platedHoleSubtractOp;
37014
37033
  if (platedHoleCopperOpsForSubtract.length > 0) {
37015
37034
  platedHoleSubtractOp = Manifold.union(platedHoleCopperOpsForSubtract);
37016
37035
  manifoldInstancesForCleanup.push(platedHoleSubtractOp);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@tscircuit/3d-viewer",
3
- "version": "0.0.491",
3
+ "version": "0.0.492",
4
4
  "main": "./dist/index.js",
5
5
  "module": "./dist/index.js",
6
6
  "type": "module",