@tscircuit/3d-viewer 0.0.555 → 0.0.556

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 +15 -4
  2. package/package.json +1 -1
package/dist/index.js CHANGED
@@ -31985,7 +31985,7 @@ import * as THREE20 from "three";
31985
31985
  // package.json
31986
31986
  var package_default = {
31987
31987
  name: "@tscircuit/3d-viewer",
31988
- version: "0.0.554",
31988
+ version: "0.0.555",
31989
31989
  main: "./dist/index.js",
31990
31990
  module: "./dist/index.js",
31991
31991
  type: "module",
@@ -35286,8 +35286,8 @@ function createCopperTextTextureForLayer({
35286
35286
  }
35287
35287
 
35288
35288
  // src/textures/create-copper-pour-texture-for-layer.ts
35289
- import * as THREE27 from "three";
35290
35289
  import { CircuitToCanvasDrawer as CircuitToCanvasDrawer4 } from "circuit-to-canvas";
35290
+ import * as THREE27 from "three";
35291
35291
  var toRgb = (colorArr) => {
35292
35292
  const [r = 0, g = 0, b = 0] = colorArr;
35293
35293
  return `rgb(${Math.round(r * 255)}, ${Math.round(g * 255)}, ${Math.round(
@@ -35308,6 +35308,16 @@ function createCopperPourTextureForLayer({
35308
35308
  const pcbRenderLayer = layer === "top" ? "top_copper" : "bottom_copper";
35309
35309
  const poursOnLayer = copperPours.filter((p) => p.layer === layer);
35310
35310
  if (poursOnLayer.length === 0) return null;
35311
+ const holes = circuitJson.filter((e) => e.type === "pcb_hole");
35312
+ const platedHolesOnLayer = circuitJson.filter((e) => {
35313
+ if (e.type !== "pcb_plated_hole") return false;
35314
+ return !Array.isArray(e.layers) || e.layers.includes(layer);
35315
+ });
35316
+ const viasOnLayer = circuitJson.filter((e) => {
35317
+ if (e.type !== "pcb_via") return false;
35318
+ return !Array.isArray(e.layers) || e.layers.includes(layer);
35319
+ });
35320
+ const drillElements = [...holes, ...platedHolesOnLayer, ...viasOnLayer];
35311
35321
  const boardOutlineBounds = calculateOutlineBounds(boardData);
35312
35322
  const canvas = document.createElement("canvas");
35313
35323
  const canvasWidth = Math.floor(
@@ -35329,6 +35339,7 @@ function createCopperPourTextureForLayer({
35329
35339
  const uncoveredColor = copperColor;
35330
35340
  const setColorAndDraw = (pours, copperPourColor) => {
35331
35341
  if (pours.length === 0) return;
35342
+ const elementsToDraw = [...pours, ...drillElements];
35332
35343
  const drawer = new CircuitToCanvasDrawer4(ctx);
35333
35344
  drawer.configure({
35334
35345
  colorOverrides: {
@@ -35370,14 +35381,14 @@ function createCopperPourTextureForLayer({
35370
35381
  minY: boardOutlineBounds.minY,
35371
35382
  maxY: boardOutlineBounds.maxY
35372
35383
  });
35373
- drawer.drawElements(pours, {
35384
+ drawer.drawElements(elementsToDraw, {
35374
35385
  layers: [pcbRenderLayer],
35375
35386
  drawSoldermask: false,
35376
35387
  drawSoldermaskTop: false,
35377
35388
  drawSoldermaskBottom: false
35378
35389
  });
35379
35390
  for (let i = 1; i < COPPER_POUR_OPACITY_COMPENSATION_PASSES; i += 1) {
35380
- drawer.drawElements(pours, {
35391
+ drawer.drawElements(elementsToDraw, {
35381
35392
  layers: [pcbRenderLayer],
35382
35393
  drawSoldermask: false,
35383
35394
  drawSoldermaskTop: false,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@tscircuit/3d-viewer",
3
- "version": "0.0.555",
3
+ "version": "0.0.556",
4
4
  "main": "./dist/index.js",
5
5
  "module": "./dist/index.js",
6
6
  "type": "module",