@tscircuit/pcb-viewer 1.11.330 → 1.11.331

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 CHANGED
@@ -7813,7 +7813,7 @@ var colors_default = {
7813
7813
  anchor: "rgb(255, 38, 226)",
7814
7814
  aux_items: "rgb(255, 255, 255)",
7815
7815
  b_adhes: "rgb(0, 0, 132)",
7816
- b_crtyd: "rgb(255, 38, 226)",
7816
+ b_crtyd: "rgb(38, 233, 255)",
7817
7817
  b_fab: "rgb(88, 93, 132)",
7818
7818
  b_mask: "rgba(2, 255, 238, 0.400)",
7819
7819
  b_paste: "rgb(0, 194, 194)",
@@ -8083,6 +8083,8 @@ var LAYER_NAME_TO_COLOR = {
8083
8083
  keepout: colors_default.board.background,
8084
8084
  tkeepout: colors_default.board.b_crtyd,
8085
8085
  tplace: colors_default.board.b_silks,
8086
+ top_courtyard: colors_default.board.f_crtyd,
8087
+ bottom_courtyard: colors_default.board.b_crtyd,
8086
8088
  top_silkscreen: colors_default.board.f_silks,
8087
8089
  bottom_silkscreen: colors_default.board.b_silks,
8088
8090
  top_fabrication: colors_default.board.f_fab,
@@ -8109,7 +8111,9 @@ var DEFAULT_DRAW_ORDER = [
8109
8111
  "soldermask_top",
8110
8112
  "soldermask_with_copper_bottom",
8111
8113
  "soldermask_with_copper_top",
8114
+ "bottom_courtyard",
8112
8115
  "bottom_fabrication",
8116
+ "top_courtyard",
8113
8117
  "top_fabrication",
8114
8118
  "edge_cuts",
8115
8119
  "top_silkscreen",
@@ -8306,7 +8310,7 @@ var Drawer = class {
8306
8310
  this.pill(x, y, w, h);
8307
8311
  ctx.restore();
8308
8312
  }
8309
- circle(x, y, r, mesh_fill) {
8313
+ circle(x, y, r, mesh_fill, is_filled = true) {
8310
8314
  const r$ = scaleOnly(this.transform, r);
8311
8315
  const [x$, y$] = applyToPoint3(this.transform, [x, y]);
8312
8316
  this.applyAperture();
@@ -9482,6 +9486,36 @@ function drawPcbViaElementsForLayer({
9482
9486
  }
9483
9487
  }
9484
9488
 
9489
+ // src/lib/draw-courtyard.ts
9490
+ import {
9491
+ CircuitToCanvasDrawer as CircuitToCanvasDrawer15,
9492
+ DEFAULT_PCB_COLOR_MAP as DEFAULT_PCB_COLOR_MAP9
9493
+ } from "circuit-to-canvas";
9494
+ var PCB_VIEWER_COLOR_MAP3 = {
9495
+ ...DEFAULT_PCB_COLOR_MAP9,
9496
+ courtyard: {
9497
+ top: colors_default.board.f_crtyd,
9498
+ bottom: colors_default.board.b_crtyd
9499
+ }
9500
+ };
9501
+ function isCourtyardElement(element) {
9502
+ return element.type === "pcb_courtyard_circle" || element.type === "pcb_courtyard_rect";
9503
+ }
9504
+ function drawCourtyardElementsForLayer({
9505
+ canvas,
9506
+ elements,
9507
+ layers,
9508
+ realToCanvasMat
9509
+ }) {
9510
+ const drawer = new CircuitToCanvasDrawer15(canvas);
9511
+ drawer.configure({
9512
+ colorOverrides: PCB_VIEWER_COLOR_MAP3
9513
+ });
9514
+ drawer.realToCanvasMat = realToCanvasMat;
9515
+ const courtyardElements = elements.filter(isCourtyardElement);
9516
+ drawer.drawElements(courtyardElements, { layers });
9517
+ }
9518
+
9485
9519
  // src/components/CanvasPrimitiveRenderer.tsx
9486
9520
  import { useEffect as useEffect4, useRef as useRef2 } from "react";
9487
9521
  import { SuperGrid, toMMSI } from "react-supergrid";
@@ -9509,6 +9543,8 @@ var orderedLayers = [
9509
9543
  "top_notes",
9510
9544
  "top_silkscreen",
9511
9545
  "bottom_silkscreen",
9546
+ "top_courtyard",
9547
+ "bottom_courtyard",
9512
9548
  "other"
9513
9549
  ];
9514
9550
  var CanvasPrimitiveRenderer = ({
@@ -9756,6 +9792,24 @@ var CanvasPrimitiveRenderer = ({
9756
9792
  realToCanvasMat: transform
9757
9793
  });
9758
9794
  }
9795
+ const topCourtyardCanvas = canvasRefs.current.top_courtyard;
9796
+ if (topCourtyardCanvas) {
9797
+ drawCourtyardElementsForLayer({
9798
+ canvas: topCourtyardCanvas,
9799
+ elements,
9800
+ layers: ["top_courtyard"],
9801
+ realToCanvasMat: transform
9802
+ });
9803
+ }
9804
+ const bottomCourtyardCanvas = canvasRefs.current.bottom_courtyard;
9805
+ if (bottomCourtyardCanvas) {
9806
+ drawCourtyardElementsForLayer({
9807
+ canvas: bottomCourtyardCanvas,
9808
+ elements,
9809
+ layers: ["bottom_courtyard"],
9810
+ realToCanvasMat: transform
9811
+ });
9812
+ }
9759
9813
  const boardCanvas = canvasRefs.current.board;
9760
9814
  if (boardCanvas) {
9761
9815
  drawPcbPanelElements({
@@ -13830,7 +13884,7 @@ import { css as css3 } from "@emotion/css";
13830
13884
  // package.json
13831
13885
  var package_default = {
13832
13886
  name: "@tscircuit/pcb-viewer",
13833
- version: "1.11.329",
13887
+ version: "1.11.330",
13834
13888
  main: "dist/index.js",
13835
13889
  type: "module",
13836
13890
  repository: "tscircuit/pcb-viewer",
@@ -13883,9 +13937,9 @@ var package_default = {
13883
13937
  "@tscircuit/alphabet": "^0.0.20",
13884
13938
  "@tscircuit/math-utils": "^0.0.29",
13885
13939
  "@vitejs/plugin-react": "^5.0.2",
13886
- "circuit-json": "^0.0.356",
13887
- "circuit-to-canvas": "^0.0.62",
13888
- "circuit-to-svg": "^0.0.271",
13940
+ "circuit-json": "^0.0.374",
13941
+ "circuit-to-canvas": "^0.0.66",
13942
+ "circuit-to-svg": "^0.0.323",
13889
13943
  color: "^4.2.3",
13890
13944
  "react-supergrid": "^1.0.10",
13891
13945
  "react-toastify": "^10.0.5",