circuit-to-svg 0.0.184 → 0.0.186

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
@@ -1,10 +1,10 @@
1
1
  // lib/pcb/convert-circuit-json-to-pcb-svg.ts
2
2
  import { stringify } from "svgson";
3
3
  import {
4
- applyToPoint as applyToPoint18,
5
- compose as compose4,
4
+ applyToPoint as applyToPoint19,
5
+ compose as compose5,
6
6
  scale as scale2,
7
- translate as translate4
7
+ translate as translate5
8
8
  } from "transformation-matrix";
9
9
 
10
10
  // lib/pcb/svg-object-fns/create-svg-objects-from-pcb-trace-error.ts
@@ -1446,12 +1446,78 @@ function createSvgObjectsFromPcbCutout(cutout, ctx) {
1446
1446
  return [];
1447
1447
  }
1448
1448
 
1449
+ // lib/pcb/svg-object-fns/create-svg-objects-from-pcb-copper-pour.ts
1450
+ import {
1451
+ applyToPoint as applyToPoint17,
1452
+ compose as compose4,
1453
+ rotate as rotate4,
1454
+ toString as matrixToString7,
1455
+ translate as translate4
1456
+ } from "transformation-matrix";
1457
+ function createSvgObjectsFromPcbCopperPour(pour, ctx) {
1458
+ const { transform, layer: layerFilter, colorMap: colorMap2 } = ctx;
1459
+ const { layer } = pour;
1460
+ if (layerFilter && layer !== layerFilter) return [];
1461
+ const color = layerNameToColor(layer, colorMap2);
1462
+ const opacity = "0.5";
1463
+ if (pour.shape === "rect") {
1464
+ const [cx, cy] = applyToPoint17(transform, [pour.center.x, pour.center.y]);
1465
+ const scaledWidth = pour.width * Math.abs(transform.a);
1466
+ const scaledHeight = pour.height * Math.abs(transform.d);
1467
+ const svgRotation = -(pour.rotation ?? 0);
1468
+ return [
1469
+ {
1470
+ name: "rect",
1471
+ type: "element",
1472
+ attributes: {
1473
+ class: "pcb-copper-pour pcb-copper-pour-rect",
1474
+ x: (-scaledWidth / 2).toString(),
1475
+ y: (-scaledHeight / 2).toString(),
1476
+ width: scaledWidth.toString(),
1477
+ height: scaledHeight.toString(),
1478
+ fill: color,
1479
+ "fill-opacity": opacity,
1480
+ transform: matrixToString7(
1481
+ compose4(translate4(cx, cy), rotate4(svgRotation * Math.PI / 180))
1482
+ ),
1483
+ "data-layer": layer
1484
+ },
1485
+ children: [],
1486
+ value: ""
1487
+ }
1488
+ ];
1489
+ }
1490
+ if (pour.shape === "polygon") {
1491
+ if (!pour.points || pour.points.length === 0) return [];
1492
+ const transformedPoints = pour.points.map(
1493
+ (p) => applyToPoint17(transform, [p.x, p.y])
1494
+ );
1495
+ const pointsString = transformedPoints.map((p) => `${p[0]},${p[1]}`).join(" ");
1496
+ return [
1497
+ {
1498
+ name: "polygon",
1499
+ type: "element",
1500
+ attributes: {
1501
+ class: "pcb-copper-pour pcb-copper-pour-polygon",
1502
+ points: pointsString,
1503
+ fill: color,
1504
+ "fill-opacity": opacity,
1505
+ "data-layer": layer
1506
+ },
1507
+ children: [],
1508
+ value: ""
1509
+ }
1510
+ ];
1511
+ }
1512
+ return [];
1513
+ }
1514
+
1449
1515
  // lib/pcb/svg-object-fns/create-svg-objects-from-pcb-component.ts
1450
- import { applyToPoint as applyToPoint17 } from "transformation-matrix";
1516
+ import { applyToPoint as applyToPoint18 } from "transformation-matrix";
1451
1517
  function createSvgObjectsFromPcbComponent(component, ctx) {
1452
1518
  const { transform } = ctx;
1453
1519
  const { center, width, height, rotation = 0 } = component;
1454
- const [x, y] = applyToPoint17(transform, [center.x, center.y]);
1520
+ const [x, y] = applyToPoint18(transform, [center.x, center.y]);
1455
1521
  const scaledWidth = width * Math.abs(transform.a);
1456
1522
  const scaledHeight = height * Math.abs(transform.d);
1457
1523
  const transformStr = `translate(${x}, ${y}) rotate(${-rotation}) scale(1, -1)`;
@@ -1520,10 +1586,10 @@ var package_default = {
1520
1586
  esbuild: "^0.20.2",
1521
1587
  "performance-now": "^2.1.0",
1522
1588
  react: "19.1.0",
1523
- "react-dom": "19.1.0",
1524
1589
  "react-cosmos": "7.0.0",
1525
1590
  "react-cosmos-plugin-vite": "7.0.0",
1526
- tscircuit: "^0.0.617",
1591
+ "react-dom": "19.1.0",
1592
+ tscircuit: "^0.0.622",
1527
1593
  tsup: "^8.0.2",
1528
1594
  typescript: "^5.4.5",
1529
1595
  "vite-tsconfig-paths": "^5.0.1"
@@ -1552,6 +1618,7 @@ var OBJECT_ORDER = [
1552
1618
  "pcb_silkscreen_path",
1553
1619
  "pcb_via",
1554
1620
  "pcb_cutout",
1621
+ "pcb_copper_pour",
1555
1622
  // Draw traces before SMT pads so pads appear on top
1556
1623
  "pcb_smtpad",
1557
1624
  "pcb_trace",
@@ -1622,6 +1689,16 @@ function convertCircuitJsonToPcbSvg(circuitJson, options) {
1622
1689
  updateTraceBounds(circuitJsonElm.route);
1623
1690
  } else if (circuitJsonElm.type === "pcb_silkscreen_text" || circuitJsonElm.type === "pcb_silkscreen_rect" || circuitJsonElm.type === "pcb_silkscreen_circle" || circuitJsonElm.type === "pcb_silkscreen_line") {
1624
1691
  updateSilkscreenBounds(circuitJsonElm);
1692
+ } else if (circuitJsonElm.type === "pcb_copper_pour") {
1693
+ if (circuitJsonElm.shape === "rect") {
1694
+ updateBounds(
1695
+ circuitJsonElm.center,
1696
+ circuitJsonElm.width,
1697
+ circuitJsonElm.height
1698
+ );
1699
+ } else if (circuitJsonElm.shape === "polygon") {
1700
+ updateTraceBounds(circuitJsonElm.points);
1701
+ }
1625
1702
  }
1626
1703
  }
1627
1704
  const padding = drawPaddingOutsideBoard ? 1 : 0;
@@ -1658,8 +1735,8 @@ function convertCircuitJsonToPcbSvg(circuitJson, options) {
1658
1735
  const scaleFactor = Math.min(scaleX, scaleY);
1659
1736
  const offsetX = (svgWidth - circuitWidth * scaleFactor) / 2;
1660
1737
  const offsetY = (svgHeight - circuitHeight * scaleFactor) / 2;
1661
- const transform = compose4(
1662
- translate4(
1738
+ const transform = compose5(
1739
+ translate5(
1663
1740
  offsetX - boundsMinX * scaleFactor + padding * scaleFactor,
1664
1741
  svgHeight - offsetY + boundsMinY * scaleFactor - padding * scaleFactor
1665
1742
  ),
@@ -1852,6 +1929,8 @@ function createSvgObjects({
1852
1929
  return createSvgObjectsFromPcbComponent(elm, ctx).filter(Boolean);
1853
1930
  case "pcb_trace":
1854
1931
  return createSvgObjectsFromPcbTrace(elm, ctx);
1932
+ case "pcb_copper_pour":
1933
+ return createSvgObjectsFromPcbCopperPour(elm, ctx);
1855
1934
  case "pcb_plated_hole":
1856
1935
  return createSvgObjectsFromPcbPlatedHole(elm, ctx).filter(Boolean);
1857
1936
  case "pcb_hole":
@@ -1883,8 +1962,8 @@ function createSvgObjects({
1883
1962
  }
1884
1963
  }
1885
1964
  function createSvgObjectFromPcbBoundary(transform, minX, minY, maxX, maxY) {
1886
- const [x1, y1] = applyToPoint18(transform, [minX, minY]);
1887
- const [x2, y2] = applyToPoint18(transform, [maxX, maxY]);
1965
+ const [x1, y1] = applyToPoint19(transform, [minX, minY]);
1966
+ const [x2, y2] = applyToPoint19(transform, [maxX, maxY]);
1888
1967
  const width = Math.abs(x2 - x1);
1889
1968
  const height = Math.abs(y2 - y1);
1890
1969
  const x = Math.min(x1, x2);
@@ -1912,14 +1991,14 @@ var circuitJsonToPcbSvg = convertCircuitJsonToPcbSvg;
1912
1991
  import { stringify as stringify2 } from "svgson";
1913
1992
  import { su as su3 } from "@tscircuit/circuit-json-util";
1914
1993
  import {
1915
- applyToPoint as applyToPoint25,
1916
- compose as compose5,
1994
+ applyToPoint as applyToPoint26,
1995
+ compose as compose6,
1917
1996
  scale as scale3,
1918
- translate as translate5
1997
+ translate as translate6
1919
1998
  } from "transformation-matrix";
1920
1999
 
1921
2000
  // lib/assembly/svg-object-fns/create-svg-objects-from-assembly-board.ts
1922
- import { applyToPoint as applyToPoint19 } from "transformation-matrix";
2001
+ import { applyToPoint as applyToPoint20 } from "transformation-matrix";
1923
2002
  var DEFAULT_BOARD_STYLE = {
1924
2003
  fill: "none",
1925
2004
  stroke: "rgb(0,0,0)",
@@ -1931,25 +2010,25 @@ function createSvgObjectsFromAssemblyBoard(pcbBoard, transform, style = {}) {
1931
2010
  let path;
1932
2011
  if (outline && Array.isArray(outline) && outline.length >= 3) {
1933
2012
  path = outline.map((point, index) => {
1934
- const [x, y] = applyToPoint19(transform, [point.x, point.y]);
2013
+ const [x, y] = applyToPoint20(transform, [point.x, point.y]);
1935
2014
  return index === 0 ? `M ${x} ${y}` : `L ${x} ${y}`;
1936
2015
  }).join(" ");
1937
2016
  } else {
1938
2017
  const halfWidth = width / 2;
1939
2018
  const halfHeight = height / 2;
1940
- const topLeft = applyToPoint19(transform, [
2019
+ const topLeft = applyToPoint20(transform, [
1941
2020
  center.x - halfWidth,
1942
2021
  center.y - halfHeight
1943
2022
  ]);
1944
- const topRight = applyToPoint19(transform, [
2023
+ const topRight = applyToPoint20(transform, [
1945
2024
  center.x + halfWidth,
1946
2025
  center.y - halfHeight
1947
2026
  ]);
1948
- const bottomRight = applyToPoint19(transform, [
2027
+ const bottomRight = applyToPoint20(transform, [
1949
2028
  center.x + halfWidth,
1950
2029
  center.y + halfHeight
1951
2030
  ]);
1952
- const bottomLeft = applyToPoint19(transform, [
2031
+ const bottomLeft = applyToPoint20(transform, [
1953
2032
  center.x - halfWidth,
1954
2033
  center.y + halfHeight
1955
2034
  ]);
@@ -1975,7 +2054,7 @@ function createSvgObjectsFromAssemblyBoard(pcbBoard, transform, style = {}) {
1975
2054
  }
1976
2055
 
1977
2056
  // lib/assembly/svg-object-fns/create-svg-objects-from-assembly-component.ts
1978
- import { applyToPoint as applyToPoint21 } from "transformation-matrix";
2057
+ import { applyToPoint as applyToPoint22 } from "transformation-matrix";
1979
2058
 
1980
2059
  // lib/utils/get-sch-font-size.ts
1981
2060
  import "transformation-matrix";
@@ -2001,8 +2080,8 @@ function createSvgObjectsFromAssemblyComponent(params, ctx) {
2001
2080
  const { center, width, height, rotation = 0, layer = "top" } = elm;
2002
2081
  if (!center || typeof width !== "number" || typeof height !== "number")
2003
2082
  return null;
2004
- const [x, y] = applyToPoint21(transform, [center.x, center.y]);
2005
- const [pinX, pinY] = applyToPoint21(transform, [portPosition.x, portPosition.y]);
2083
+ const [x, y] = applyToPoint22(transform, [center.x, center.y]);
2084
+ const [pinX, pinY] = applyToPoint22(transform, [portPosition.x, portPosition.y]);
2006
2085
  const scaledWidth = width * Math.abs(transform.a);
2007
2086
  const scaledHeight = height * Math.abs(transform.d);
2008
2087
  const isTopLayer = layer === "top";
@@ -2164,11 +2243,11 @@ function getRectPathData(w, h, rotation) {
2164
2243
  }
2165
2244
 
2166
2245
  // lib/assembly/svg-object-fns/create-svg-objects-from-assembly-hole.ts
2167
- import { applyToPoint as applyToPoint22 } from "transformation-matrix";
2246
+ import { applyToPoint as applyToPoint23 } from "transformation-matrix";
2168
2247
  var HOLE_COLOR2 = "rgb(190, 190, 190)";
2169
2248
  function createSvgObjectsFromAssemblyHole(hole, ctx) {
2170
2249
  const { transform } = ctx;
2171
- const [x, y] = applyToPoint22(transform, [hole.x, hole.y]);
2250
+ const [x, y] = applyToPoint23(transform, [hole.x, hole.y]);
2172
2251
  if (hole.hole_shape === "circle" || hole.hole_shape === "square") {
2173
2252
  const scaledDiameter = hole.hole_diameter * Math.abs(transform.a);
2174
2253
  const radius = scaledDiameter / 2;
@@ -2232,12 +2311,12 @@ function createSvgObjectsFromAssemblyHole(hole, ctx) {
2232
2311
  }
2233
2312
 
2234
2313
  // lib/assembly/svg-object-fns/create-svg-objects-from-assembly-plated-hole.ts
2235
- import { applyToPoint as applyToPoint23 } from "transformation-matrix";
2314
+ import { applyToPoint as applyToPoint24 } from "transformation-matrix";
2236
2315
  var PAD_COLOR = "rgb(210, 210, 210)";
2237
2316
  var HOLE_COLOR3 = "rgb(190, 190, 190)";
2238
2317
  function createSvgObjectsFromAssemblyPlatedHole(hole, ctx) {
2239
2318
  const { transform } = ctx;
2240
- const [x, y] = applyToPoint23(transform, [hole.x, hole.y]);
2319
+ const [x, y] = applyToPoint24(transform, [hole.x, hole.y]);
2241
2320
  if (hole.shape === "pill") {
2242
2321
  const scaledOuterWidth = hole.outer_width * Math.abs(transform.a);
2243
2322
  const scaledOuterHeight = hole.outer_height * Math.abs(transform.a);
@@ -2472,14 +2551,14 @@ function createSvgObjectsFromAssemblyPlatedHole(hole, ctx) {
2472
2551
  }
2473
2552
 
2474
2553
  // lib/assembly/svg-object-fns/create-svg-objects-from-assembly-smt-pad.ts
2475
- import { applyToPoint as applyToPoint24 } from "transformation-matrix";
2554
+ import { applyToPoint as applyToPoint25 } from "transformation-matrix";
2476
2555
  var PAD_COLOR2 = "rgb(210, 210, 210)";
2477
2556
  function createSvgObjectsFromAssemblySmtPad(pad, ctx) {
2478
2557
  const { transform } = ctx;
2479
2558
  if (pad.shape === "rect" || pad.shape === "rotated_rect") {
2480
2559
  const width = pad.width * Math.abs(transform.a);
2481
2560
  const height = pad.height * Math.abs(transform.d);
2482
- const [x, y] = applyToPoint24(transform, [pad.x, pad.y]);
2561
+ const [x, y] = applyToPoint25(transform, [pad.x, pad.y]);
2483
2562
  if (pad.shape === "rotated_rect" && pad.ccw_rotation) {
2484
2563
  return [
2485
2564
  {
@@ -2522,7 +2601,7 @@ function createSvgObjectsFromAssemblySmtPad(pad, ctx) {
2522
2601
  const width = pad.width * Math.abs(transform.a);
2523
2602
  const height = pad.height * Math.abs(transform.d);
2524
2603
  const radius = pad.radius * Math.abs(transform.a);
2525
- const [x, y] = applyToPoint24(transform, [pad.x, pad.y]);
2604
+ const [x, y] = applyToPoint25(transform, [pad.x, pad.y]);
2526
2605
  return [
2527
2606
  {
2528
2607
  name: "rect",
@@ -2545,7 +2624,7 @@ function createSvgObjectsFromAssemblySmtPad(pad, ctx) {
2545
2624
  }
2546
2625
  if (pad.shape === "circle") {
2547
2626
  const radius = pad.radius * Math.abs(transform.a);
2548
- const [x, y] = applyToPoint24(transform, [pad.x, pad.y]);
2627
+ const [x, y] = applyToPoint25(transform, [pad.x, pad.y]);
2549
2628
  return [
2550
2629
  {
2551
2630
  name: "circle",
@@ -2565,7 +2644,7 @@ function createSvgObjectsFromAssemblySmtPad(pad, ctx) {
2565
2644
  }
2566
2645
  if (pad.shape === "polygon") {
2567
2646
  const points = (pad.points ?? []).map(
2568
- (point) => applyToPoint24(transform, [point.x, point.y])
2647
+ (point) => applyToPoint25(transform, [point.x, point.y])
2569
2648
  );
2570
2649
  return [
2571
2650
  {
@@ -2619,8 +2698,8 @@ function convertCircuitJsonToAssemblySvg(soup, options) {
2619
2698
  const scaleFactor = Math.min(scaleX, scaleY);
2620
2699
  const offsetX = (svgWidth - circuitWidth * scaleFactor) / 2;
2621
2700
  const offsetY = (svgHeight - circuitHeight * scaleFactor) / 2;
2622
- const transform = compose5(
2623
- translate5(
2701
+ const transform = compose6(
2702
+ translate6(
2624
2703
  offsetX - minX * scaleFactor + padding * scaleFactor,
2625
2704
  svgHeight - offsetY + minY * scaleFactor - padding * scaleFactor
2626
2705
  ),
@@ -2742,8 +2821,8 @@ function createSvgObjects2(elm, ctx, soup) {
2742
2821
  }
2743
2822
  }
2744
2823
  function createSvgObjectFromAssemblyBoundary(transform, minX, minY, maxX, maxY) {
2745
- const [x1, y1] = applyToPoint25(transform, [minX, minY]);
2746
- const [x2, y2] = applyToPoint25(transform, [maxX, maxY]);
2824
+ const [x1, y1] = applyToPoint26(transform, [minX, minY]);
2825
+ const [x2, y2] = applyToPoint26(transform, [maxX, maxY]);
2747
2826
  const width = Math.abs(x2 - x1);
2748
2827
  const height = Math.abs(y2 - y1);
2749
2828
  const x = Math.min(x1, x2);
@@ -3010,14 +3089,14 @@ import {
3010
3089
  } from "transformation-matrix";
3011
3090
 
3012
3091
  // lib/sch/draw-schematic-grid.ts
3013
- import { applyToPoint as applyToPoint26 } from "transformation-matrix";
3092
+ import { applyToPoint as applyToPoint27 } from "transformation-matrix";
3014
3093
  function drawSchematicGrid(params) {
3015
3094
  const { minX, minY, maxX, maxY } = params.bounds;
3016
3095
  const cellSize = params.cellSize ?? 1;
3017
3096
  const labelCells = params.labelCells ?? false;
3018
3097
  const gridLines = [];
3019
3098
  const transformPoint = (x, y) => {
3020
- const [transformedX, transformedY] = applyToPoint26(params.transform, [x, y]);
3099
+ const [transformedX, transformedY] = applyToPoint27(params.transform, [x, y]);
3021
3100
  return { x: transformedX, y: transformedY };
3022
3101
  };
3023
3102
  for (let x = Math.floor(minX); x <= Math.ceil(maxX); x += cellSize) {
@@ -3098,15 +3177,15 @@ function drawSchematicGrid(params) {
3098
3177
  }
3099
3178
 
3100
3179
  // lib/sch/draw-schematic-labeled-points.ts
3101
- import { applyToPoint as applyToPoint27 } from "transformation-matrix";
3180
+ import { applyToPoint as applyToPoint28 } from "transformation-matrix";
3102
3181
  function drawSchematicLabeledPoints(params) {
3103
3182
  const { points, transform } = params;
3104
3183
  const labeledPointsGroup = [];
3105
3184
  for (const point of points) {
3106
- const [x1, y1] = applyToPoint27(transform, [point.x - 0.1, point.y - 0.1]);
3107
- const [x2, y2] = applyToPoint27(transform, [point.x + 0.1, point.y + 0.1]);
3108
- const [x3, y3] = applyToPoint27(transform, [point.x - 0.1, point.y + 0.1]);
3109
- const [x4, y4] = applyToPoint27(transform, [point.x + 0.1, point.y - 0.1]);
3185
+ const [x1, y1] = applyToPoint28(transform, [point.x - 0.1, point.y - 0.1]);
3186
+ const [x2, y2] = applyToPoint28(transform, [point.x + 0.1, point.y + 0.1]);
3187
+ const [x3, y3] = applyToPoint28(transform, [point.x - 0.1, point.y + 0.1]);
3188
+ const [x4, y4] = applyToPoint28(transform, [point.x + 0.1, point.y - 0.1]);
3110
3189
  labeledPointsGroup.push({
3111
3190
  name: "path",
3112
3191
  type: "element",
@@ -3117,7 +3196,7 @@ function drawSchematicLabeledPoints(params) {
3117
3196
  "stroke-opacity": "0.7"
3118
3197
  }
3119
3198
  });
3120
- const [labelX, labelY] = applyToPoint27(transform, [
3199
+ const [labelX, labelY] = applyToPoint28(transform, [
3121
3200
  point.x + 0.15,
3122
3201
  point.y - 0.15
3123
3202
  ]);
@@ -4190,8 +4269,8 @@ import { su as su4 } from "@tscircuit/circuit-json-util";
4190
4269
  import { symbols } from "schematic-symbols";
4191
4270
  import "svgson";
4192
4271
  import {
4193
- applyToPoint as applyToPoint29,
4194
- compose as compose7
4272
+ applyToPoint as applyToPoint30,
4273
+ compose as compose8
4195
4274
  } from "transformation-matrix";
4196
4275
 
4197
4276
  // lib/utils/get-sch-stroke-size.ts
@@ -4261,26 +4340,26 @@ var matchSchPortsToSymbolPorts = ({
4261
4340
  };
4262
4341
 
4263
4342
  // lib/utils/point-pairs-to-matrix.ts
4264
- import { compose as compose6, scale as scale4, translate as translate6 } from "transformation-matrix";
4343
+ import { compose as compose7, scale as scale4, translate as translate7 } from "transformation-matrix";
4265
4344
  function pointPairsToMatrix(a1, a2, b1, b2) {
4266
4345
  const tx = a2.x - a1.x;
4267
4346
  const ty = a2.y - a1.y;
4268
4347
  const originalDistance = Math.sqrt((b1.x - a1.x) ** 2 + (b1.y - a1.y) ** 2);
4269
4348
  const transformedDistance = Math.sqrt((b2.x - a2.x) ** 2 + (b2.y - a2.y) ** 2);
4270
4349
  const a = transformedDistance / originalDistance;
4271
- const translateMatrix = translate6(tx, ty);
4350
+ const translateMatrix = translate7(tx, ty);
4272
4351
  const scaleMatrix = scale4(a, a);
4273
- return compose6(translateMatrix, scaleMatrix);
4352
+ return compose7(translateMatrix, scaleMatrix);
4274
4353
  }
4275
4354
 
4276
4355
  // lib/sch/svg-object-fns/create-svg-error-text.ts
4277
- import { applyToPoint as applyToPoint28 } from "transformation-matrix";
4356
+ import { applyToPoint as applyToPoint29 } from "transformation-matrix";
4278
4357
  var createSvgSchErrorText = ({
4279
4358
  text,
4280
4359
  realCenter,
4281
4360
  realToScreenTransform
4282
4361
  }) => {
4283
- const screenCenter = applyToPoint28(realToScreenTransform, realCenter);
4362
+ const screenCenter = applyToPoint29(realToScreenTransform, realCenter);
4284
4363
  return {
4285
4364
  type: "element",
4286
4365
  name: "text",
@@ -4389,12 +4468,12 @@ var createSvgObjectsFromSchematicComponentWithSymbol = ({
4389
4468
  minY: Math.min(...paths.flatMap((p) => p.points.map((pt) => pt.y))),
4390
4469
  maxY: Math.max(...paths.flatMap((p) => p.points.map((pt) => pt.y)))
4391
4470
  };
4392
- const [screenMinX, screenMinY] = applyToPoint29(
4393
- compose7(realToScreenTransform, transformFromSymbolToReal),
4471
+ const [screenMinX, screenMinY] = applyToPoint30(
4472
+ compose8(realToScreenTransform, transformFromSymbolToReal),
4394
4473
  [bounds.minX, bounds.minY]
4395
4474
  );
4396
- const [screenMaxX, screenMaxY] = applyToPoint29(
4397
- compose7(realToScreenTransform, transformFromSymbolToReal),
4475
+ const [screenMaxX, screenMaxY] = applyToPoint30(
4476
+ compose8(realToScreenTransform, transformFromSymbolToReal),
4398
4477
  [bounds.maxX, bounds.maxY]
4399
4478
  );
4400
4479
  const rectHeight = Math.abs(screenMaxY - screenMinY);
@@ -4422,8 +4501,8 @@ var createSvgObjectsFromSchematicComponentWithSymbol = ({
4422
4501
  name: "path",
4423
4502
  attributes: {
4424
4503
  d: points.map((p, i) => {
4425
- const [x, y] = applyToPoint29(
4426
- compose7(realToScreenTransform, transformFromSymbolToReal),
4504
+ const [x, y] = applyToPoint30(
4505
+ compose8(realToScreenTransform, transformFromSymbolToReal),
4427
4506
  [p.x, p.y]
4428
4507
  );
4429
4508
  return `${i === 0 ? "M" : "L"} ${x} ${y}`;
@@ -4438,8 +4517,8 @@ var createSvgObjectsFromSchematicComponentWithSymbol = ({
4438
4517
  });
4439
4518
  }
4440
4519
  for (const text of texts) {
4441
- const screenTextPos = applyToPoint29(
4442
- compose7(realToScreenTransform, transformFromSymbolToReal),
4520
+ const screenTextPos = applyToPoint30(
4521
+ compose8(realToScreenTransform, transformFromSymbolToReal),
4443
4522
  text
4444
4523
  );
4445
4524
  let textValue = "";
@@ -4490,11 +4569,11 @@ var createSvgObjectsFromSchematicComponentWithSymbol = ({
4490
4569
  });
4491
4570
  }
4492
4571
  for (const box of boxes) {
4493
- const screenBoxPos = applyToPoint29(
4494
- compose7(realToScreenTransform, transformFromSymbolToReal),
4572
+ const screenBoxPos = applyToPoint30(
4573
+ compose8(realToScreenTransform, transformFromSymbolToReal),
4495
4574
  box
4496
4575
  );
4497
- const symbolToScreenScale = compose7(
4576
+ const symbolToScreenScale = compose8(
4498
4577
  realToScreenTransform,
4499
4578
  transformFromSymbolToReal
4500
4579
  ).a;
@@ -4514,8 +4593,8 @@ var createSvgObjectsFromSchematicComponentWithSymbol = ({
4514
4593
  }
4515
4594
  for (const port of symbol.ports) {
4516
4595
  if (connectedSymbolPorts.has(port)) continue;
4517
- const screenPortPos = applyToPoint29(
4518
- compose7(realToScreenTransform, transformFromSymbolToReal),
4596
+ const screenPortPos = applyToPoint30(
4597
+ compose8(realToScreenTransform, transformFromSymbolToReal),
4519
4598
  port
4520
4599
  );
4521
4600
  svgObjects.push({
@@ -4534,8 +4613,8 @@ var createSvgObjectsFromSchematicComponentWithSymbol = ({
4534
4613
  });
4535
4614
  }
4536
4615
  for (const circle of circles) {
4537
- const screenCirclePos = applyToPoint29(
4538
- compose7(realToScreenTransform, transformFromSymbolToReal),
4616
+ const screenCirclePos = applyToPoint30(
4617
+ compose8(realToScreenTransform, transformFromSymbolToReal),
4539
4618
  circle
4540
4619
  );
4541
4620
  const screenRadius = Math.abs(circle.radius * realToScreenTransform.a);
@@ -4561,14 +4640,14 @@ var createSvgObjectsFromSchematicComponentWithSymbol = ({
4561
4640
  import { su as su7 } from "@tscircuit/circuit-json-util";
4562
4641
  import "schematic-symbols";
4563
4642
  import "svgson";
4564
- import { applyToPoint as applyToPoint35 } from "transformation-matrix";
4643
+ import { applyToPoint as applyToPoint36 } from "transformation-matrix";
4565
4644
 
4566
4645
  // lib/sch/svg-object-fns/create-svg-objects-from-sch-port-on-box.ts
4567
4646
  import "transformation-matrix";
4568
4647
  import "@tscircuit/circuit-json-util";
4569
4648
 
4570
4649
  // lib/sch/svg-object-fns/create-svg-objects-for-sch-port-box-line.ts
4571
- import { applyToPoint as applyToPoint30 } from "transformation-matrix";
4650
+ import { applyToPoint as applyToPoint31 } from "transformation-matrix";
4572
4651
  import { su as su5 } from "@tscircuit/circuit-json-util";
4573
4652
  var PIN_CIRCLE_RADIUS_MM = 0.02;
4574
4653
  var createArrow = (tip, angle, size, color, strokeWidth) => {
@@ -4621,8 +4700,8 @@ var createSvgObjectsForSchPortBoxLine = ({
4621
4700
  realEdgePos.y += realPinLineLength;
4622
4701
  break;
4623
4702
  }
4624
- const screenSchPortPos = applyToPoint30(transform, schPort.center);
4625
- const screenRealEdgePos = applyToPoint30(transform, realEdgePos);
4703
+ const screenSchPortPos = applyToPoint31(transform, schPort.center);
4704
+ const screenRealEdgePos = applyToPoint31(transform, realEdgePos);
4626
4705
  const realLineEnd = { ...schPort.center };
4627
4706
  switch (schPort.side_of_component) {
4628
4707
  case "left":
@@ -4638,7 +4717,7 @@ var createSvgObjectsForSchPortBoxLine = ({
4638
4717
  realLineEnd.y += PIN_CIRCLE_RADIUS_MM;
4639
4718
  break;
4640
4719
  }
4641
- const screenLineEnd = applyToPoint30(transform, realLineEnd);
4720
+ const screenLineEnd = applyToPoint31(transform, realLineEnd);
4642
4721
  svgObjects.push({
4643
4722
  name: "line",
4644
4723
  type: "element",
@@ -4695,10 +4774,10 @@ var createSvgObjectsForSchPortBoxLine = ({
4695
4774
  });
4696
4775
  const { has_input_arrow, has_output_arrow } = schPort;
4697
4776
  if ((has_input_arrow || has_output_arrow) && schPort.side_of_component) {
4698
- const arrowSize = Math.abs(transform.a) * 0.15;
4777
+ const arrowSize = Math.abs(transform.a) * 0.1;
4699
4778
  const arrowColor = colorMap.schematic.component_outline;
4700
4779
  const arrowAxialLength = arrowSize * Math.cos(Math.PI / 6);
4701
- const strokeWidth = getSchStrokeSize(transform) / 2;
4780
+ const strokeWidth = getSchStrokeSize(transform) / 3;
4702
4781
  let inputAngleRads = 0;
4703
4782
  let outputAngleRads = 0;
4704
4783
  if (schPort.side_of_component === "left") {
@@ -4760,7 +4839,7 @@ var createSvgObjectsForSchPortBoxLine = ({
4760
4839
  };
4761
4840
 
4762
4841
  // lib/sch/svg-object-fns/create-svg-objects-for-sch-port-pin-number-text.ts
4763
- import { applyToPoint as applyToPoint31 } from "transformation-matrix";
4842
+ import { applyToPoint as applyToPoint32 } from "transformation-matrix";
4764
4843
  var createSvgObjectsForSchPortPinNumberText = (params) => {
4765
4844
  const svgObjects = [];
4766
4845
  const { schPort, schComponent, transform, circuitJson } = params;
@@ -4778,7 +4857,7 @@ var createSvgObjectsForSchPortPinNumberText = (params) => {
4778
4857
  } else {
4779
4858
  realPinNumberPos.y += 0.02;
4780
4859
  }
4781
- const screenPinNumberTextPos = applyToPoint31(transform, realPinNumberPos);
4860
+ const screenPinNumberTextPos = applyToPoint32(transform, realPinNumberPos);
4782
4861
  svgObjects.push({
4783
4862
  name: "text",
4784
4863
  type: "element",
@@ -4808,7 +4887,7 @@ var createSvgObjectsForSchPortPinNumberText = (params) => {
4808
4887
  };
4809
4888
 
4810
4889
  // lib/sch/svg-object-fns/create-svg-objects-for-sch-port-pin-label.ts
4811
- import { applyToPoint as applyToPoint32 } from "transformation-matrix";
4890
+ import { applyToPoint as applyToPoint33 } from "transformation-matrix";
4812
4891
  var LABEL_DIST_FROM_EDGE_MM = 0.1;
4813
4892
  var createSvgObjectsForSchPortPinLabel = (params) => {
4814
4893
  const svgObjects = [];
@@ -4822,7 +4901,7 @@ var createSvgObjectsForSchPortPinLabel = (params) => {
4822
4901
  const realPinEdgeDistance = schPort.distance_from_component_edge ?? 0.4;
4823
4902
  realPinNumberPos.x += vecToEdge.x * (realPinEdgeDistance + LABEL_DIST_FROM_EDGE_MM);
4824
4903
  realPinNumberPos.y += vecToEdge.y * (realPinEdgeDistance + LABEL_DIST_FROM_EDGE_MM);
4825
- const screenPinNumberTextPos = applyToPoint32(transform, realPinNumberPos);
4904
+ const screenPinNumberTextPos = applyToPoint33(transform, realPinNumberPos);
4826
4905
  const label = schPort.display_pin_label ?? schComponent.port_labels?.[`${schPort.pin_number}`];
4827
4906
  if (!label) return [];
4828
4907
  const isNegated = label.startsWith("N_");
@@ -4870,13 +4949,13 @@ var createSvgObjectsFromSchPortOnBox = (params) => {
4870
4949
  };
4871
4950
 
4872
4951
  // lib/sch/svg-object-fns/create-svg-objects-for-sch-text.ts
4873
- import { applyToPoint as applyToPoint34 } from "transformation-matrix";
4952
+ import { applyToPoint as applyToPoint35 } from "transformation-matrix";
4874
4953
  var createSvgSchText = ({
4875
4954
  elm,
4876
4955
  transform,
4877
4956
  colorMap: colorMap2
4878
4957
  }) => {
4879
- const center = applyToPoint34(transform, elm.position);
4958
+ const center = applyToPoint35(transform, elm.position);
4880
4959
  const textAnchorMap = {
4881
4960
  center: "middle",
4882
4961
  center_right: "end",
@@ -4960,11 +5039,11 @@ var createSvgObjectsFromSchematicComponentWithBox = ({
4960
5039
  colorMap: colorMap2
4961
5040
  }) => {
4962
5041
  const svgObjects = [];
4963
- const componentScreenTopLeft = applyToPoint35(transform, {
5042
+ const componentScreenTopLeft = applyToPoint36(transform, {
4964
5043
  x: schComponent.center.x - schComponent.size.width / 2,
4965
5044
  y: schComponent.center.y + schComponent.size.height / 2
4966
5045
  });
4967
- const componentScreenBottomRight = applyToPoint35(transform, {
5046
+ const componentScreenBottomRight = applyToPoint36(transform, {
4968
5047
  x: schComponent.center.x + schComponent.size.width / 2,
4969
5048
  y: schComponent.center.y - schComponent.size.height / 2
4970
5049
  });
@@ -5047,13 +5126,13 @@ function createSvgObjectsFromSchematicComponent(params) {
5047
5126
  }
5048
5127
 
5049
5128
  // lib/sch/svg-object-fns/create-svg-objects-from-sch-voltage-probe.ts
5050
- import { applyToPoint as applyToPoint36 } from "transformation-matrix";
5129
+ import { applyToPoint as applyToPoint37 } from "transformation-matrix";
5051
5130
  function createSvgObjectsFromSchVoltageProbe({
5052
5131
  probe,
5053
5132
  transform,
5054
5133
  colorMap: colorMap2
5055
5134
  }) {
5056
- const [screenX, screenY] = applyToPoint36(transform, [
5135
+ const [screenX, screenY] = applyToPoint37(transform, [
5057
5136
  probe.position.x,
5058
5137
  probe.position.y
5059
5138
  ]);
@@ -5113,17 +5192,17 @@ function createSvgObjectsFromSchVoltageProbe({
5113
5192
  }
5114
5193
 
5115
5194
  // lib/sch/svg-object-fns/create-svg-objects-from-sch-debug-object.ts
5116
- import { applyToPoint as applyToPoint37 } from "transformation-matrix";
5195
+ import { applyToPoint as applyToPoint38 } from "transformation-matrix";
5117
5196
  function createSvgObjectsFromSchDebugObject({
5118
5197
  debugObject,
5119
5198
  transform
5120
5199
  }) {
5121
5200
  if (debugObject.shape === "rect") {
5122
- let [screenLeft, screenTop] = applyToPoint37(transform, [
5201
+ let [screenLeft, screenTop] = applyToPoint38(transform, [
5123
5202
  debugObject.center.x - debugObject.size.width / 2,
5124
5203
  debugObject.center.y - debugObject.size.height / 2
5125
5204
  ]);
5126
- let [screenRight, screenBottom] = applyToPoint37(transform, [
5205
+ let [screenRight, screenBottom] = applyToPoint38(transform, [
5127
5206
  debugObject.center.x + debugObject.size.width / 2,
5128
5207
  debugObject.center.y + debugObject.size.height / 2
5129
5208
  ]);
@@ -5133,7 +5212,7 @@ function createSvgObjectsFromSchDebugObject({
5133
5212
  ];
5134
5213
  const width = Math.abs(screenRight - screenLeft);
5135
5214
  const height = Math.abs(screenBottom - screenTop);
5136
- const [screenCenterX, screenCenterY] = applyToPoint37(transform, [
5215
+ const [screenCenterX, screenCenterY] = applyToPoint38(transform, [
5137
5216
  debugObject.center.x,
5138
5217
  debugObject.center.y
5139
5218
  ]);
@@ -5179,11 +5258,11 @@ function createSvgObjectsFromSchDebugObject({
5179
5258
  ];
5180
5259
  }
5181
5260
  if (debugObject.shape === "line") {
5182
- const [screenStartX, screenStartY] = applyToPoint37(transform, [
5261
+ const [screenStartX, screenStartY] = applyToPoint38(transform, [
5183
5262
  debugObject.start.x,
5184
5263
  debugObject.start.y
5185
5264
  ]);
5186
- const [screenEndX, screenEndY] = applyToPoint37(transform, [
5265
+ const [screenEndX, screenEndY] = applyToPoint38(transform, [
5187
5266
  debugObject.end.x,
5188
5267
  debugObject.end.y
5189
5268
  ]);
@@ -5233,7 +5312,7 @@ function createSvgObjectsFromSchDebugObject({
5233
5312
  }
5234
5313
 
5235
5314
  // lib/sch/svg-object-fns/create-svg-objects-from-sch-trace.ts
5236
- import { applyToPoint as applyToPoint38 } from "transformation-matrix";
5315
+ import { applyToPoint as applyToPoint39 } from "transformation-matrix";
5237
5316
  function createSchematicTrace({
5238
5317
  trace,
5239
5318
  transform,
@@ -5247,11 +5326,11 @@ function createSchematicTrace({
5247
5326
  for (let edgeIndex = 0; edgeIndex < edges.length; edgeIndex++) {
5248
5327
  const edge = edges[edgeIndex];
5249
5328
  if (edge.is_crossing) continue;
5250
- const [screenFromX, screenFromY] = applyToPoint38(transform, [
5329
+ const [screenFromX, screenFromY] = applyToPoint39(transform, [
5251
5330
  edge.from.x,
5252
5331
  edge.from.y
5253
5332
  ]);
5254
- const [screenToX, screenToY] = applyToPoint38(transform, [
5333
+ const [screenToX, screenToY] = applyToPoint39(transform, [
5255
5334
  edge.to.x,
5256
5335
  edge.to.y
5257
5336
  ]);
@@ -5295,11 +5374,11 @@ function createSchematicTrace({
5295
5374
  }
5296
5375
  for (const edge of edges) {
5297
5376
  if (!edge.is_crossing) continue;
5298
- const [screenFromX, screenFromY] = applyToPoint38(transform, [
5377
+ const [screenFromX, screenFromY] = applyToPoint39(transform, [
5299
5378
  edge.from.x,
5300
5379
  edge.from.y
5301
5380
  ]);
5302
- const [screenToX, screenToY] = applyToPoint38(transform, [
5381
+ const [screenToX, screenToY] = applyToPoint39(transform, [
5303
5382
  edge.to.x,
5304
5383
  edge.to.y
5305
5384
  ]);
@@ -5343,7 +5422,7 @@ function createSchematicTrace({
5343
5422
  }
5344
5423
  if (trace.junctions) {
5345
5424
  for (const junction of trace.junctions) {
5346
- const [screenX, screenY] = applyToPoint38(transform, [
5425
+ const [screenX, screenY] = applyToPoint39(transform, [
5347
5426
  junction.x,
5348
5427
  junction.y
5349
5428
  ]);
@@ -5398,20 +5477,20 @@ function createSchematicTrace({
5398
5477
 
5399
5478
  // lib/sch/svg-object-fns/create-svg-objects-for-sch-net-label.ts
5400
5479
  import {
5401
- applyToPoint as applyToPoint40,
5402
- compose as compose9,
5403
- rotate as rotate5,
5480
+ applyToPoint as applyToPoint41,
5481
+ compose as compose10,
5482
+ rotate as rotate6,
5404
5483
  scale as scale6,
5405
- translate as translate9
5484
+ translate as translate10
5406
5485
  } from "transformation-matrix";
5407
5486
 
5408
5487
  // lib/sch/svg-object-fns/create-svg-objects-for-sch-net-label-with-symbol.ts
5409
5488
  import {
5410
- applyToPoint as applyToPoint39,
5411
- compose as compose8,
5412
- rotate as rotate4,
5489
+ applyToPoint as applyToPoint40,
5490
+ compose as compose9,
5491
+ rotate as rotate5,
5413
5492
  scale as scale5,
5414
- translate as translate8
5493
+ translate as translate9
5415
5494
  } from "transformation-matrix";
5416
5495
  import { symbols as symbols3 } from "schematic-symbols";
5417
5496
  var createSvgObjectsForSchNetLabelWithSymbol = ({
@@ -5455,7 +5534,7 @@ var createSvgObjectsForSchNetLabelWithSymbol = ({
5455
5534
  y: schNetLabel.center.y - realTextGrowthVec.y * fullWidthFsr * fontSizeMm / 2
5456
5535
  };
5457
5536
  const pathRotation = 0;
5458
- const rotationMatrix = rotate4(pathRotation / 180 * Math.PI);
5537
+ const rotationMatrix = rotate5(pathRotation / 180 * Math.PI);
5459
5538
  const symbolBounds = {
5460
5539
  minX: Math.min(
5461
5540
  ...symbol.primitives.flatMap(
@@ -5482,9 +5561,9 @@ var createSvgObjectsForSchNetLabelWithSymbol = ({
5482
5561
  x: symbolBounds.minX,
5483
5562
  y: (symbolBounds.minY + symbolBounds.maxY) / 2
5484
5563
  };
5485
- const rotatedSymbolEnd = applyToPoint39(rotationMatrix, symbolEndPoint);
5486
- const symbolToRealTransform = compose8(
5487
- translate8(
5564
+ const rotatedSymbolEnd = applyToPoint40(rotationMatrix, symbolEndPoint);
5565
+ const symbolToRealTransform = compose9(
5566
+ translate9(
5488
5567
  realAnchorPosition.x - rotatedSymbolEnd.x,
5489
5568
  realAnchorPosition.y - rotatedSymbolEnd.y
5490
5569
  ),
@@ -5492,12 +5571,12 @@ var createSvgObjectsForSchNetLabelWithSymbol = ({
5492
5571
  scale5(1)
5493
5572
  // Use full symbol size
5494
5573
  );
5495
- const [screenMinX, screenMinY] = applyToPoint39(
5496
- compose8(realToScreenTransform, symbolToRealTransform),
5574
+ const [screenMinX, screenMinY] = applyToPoint40(
5575
+ compose9(realToScreenTransform, symbolToRealTransform),
5497
5576
  [bounds.minX, bounds.minY]
5498
5577
  );
5499
- const [screenMaxX, screenMaxY] = applyToPoint39(
5500
- compose8(realToScreenTransform, symbolToRealTransform),
5578
+ const [screenMaxX, screenMaxY] = applyToPoint40(
5579
+ compose9(realToScreenTransform, symbolToRealTransform),
5501
5580
  [bounds.maxX, bounds.maxY]
5502
5581
  );
5503
5582
  const rectHeight = Math.abs(screenMaxY - screenMinY);
@@ -5520,8 +5599,8 @@ var createSvgObjectsForSchNetLabelWithSymbol = ({
5520
5599
  });
5521
5600
  for (const path of symbolPaths) {
5522
5601
  const symbolPath = path.points.map((p, i) => {
5523
- const [x, y] = applyToPoint39(
5524
- compose8(realToScreenTransform, symbolToRealTransform),
5602
+ const [x, y] = applyToPoint40(
5603
+ compose9(realToScreenTransform, symbolToRealTransform),
5525
5604
  [p.x, p.y]
5526
5605
  );
5527
5606
  return `${i === 0 ? "M" : "L"} ${x} ${y}`;
@@ -5541,8 +5620,8 @@ var createSvgObjectsForSchNetLabelWithSymbol = ({
5541
5620
  });
5542
5621
  }
5543
5622
  for (const text of symbolTexts) {
5544
- const screenTextPos = applyToPoint39(
5545
- compose8(realToScreenTransform, symbolToRealTransform),
5623
+ const screenTextPos = applyToPoint40(
5624
+ compose9(realToScreenTransform, symbolToRealTransform),
5546
5625
  text
5547
5626
  );
5548
5627
  let textValue = text.text;
@@ -5583,11 +5662,11 @@ var createSvgObjectsForSchNetLabelWithSymbol = ({
5583
5662
  });
5584
5663
  }
5585
5664
  for (const box of symbolBoxes) {
5586
- const screenBoxPos = applyToPoint39(
5587
- compose8(realToScreenTransform, symbolToRealTransform),
5665
+ const screenBoxPos = applyToPoint40(
5666
+ compose9(realToScreenTransform, symbolToRealTransform),
5588
5667
  box
5589
5668
  );
5590
- const symbolToScreenScale = compose8(
5669
+ const symbolToScreenScale = compose9(
5591
5670
  realToScreenTransform,
5592
5671
  symbolToRealTransform
5593
5672
  ).a;
@@ -5606,11 +5685,11 @@ var createSvgObjectsForSchNetLabelWithSymbol = ({
5606
5685
  });
5607
5686
  }
5608
5687
  for (const circle of symbolCircles) {
5609
- const screenCirclePos = applyToPoint39(
5610
- compose8(realToScreenTransform, symbolToRealTransform),
5688
+ const screenCirclePos = applyToPoint40(
5689
+ compose9(realToScreenTransform, symbolToRealTransform),
5611
5690
  circle
5612
5691
  );
5613
- const symbolToScreenScale = compose8(
5692
+ const symbolToScreenScale = compose9(
5614
5693
  realToScreenTransform,
5615
5694
  symbolToRealTransform
5616
5695
  ).a;
@@ -5651,14 +5730,14 @@ var createSvgObjectsForSchNetLabel = ({
5651
5730
  const fontSizePx = getSchScreenFontSize(realToScreenTransform, "net_label");
5652
5731
  const fontSizeMm = getSchMmFontSize("net_label");
5653
5732
  const textWidthFSR = estimateTextWidth(labelText || "");
5654
- const screenCenter = applyToPoint40(realToScreenTransform, schNetLabel.center);
5733
+ const screenCenter = applyToPoint41(realToScreenTransform, schNetLabel.center);
5655
5734
  const realTextGrowthVec = getUnitVectorFromOutsideToEdge(
5656
5735
  schNetLabel.anchor_side
5657
5736
  );
5658
5737
  const screenTextGrowthVec = { ...realTextGrowthVec };
5659
5738
  screenTextGrowthVec.y *= -1;
5660
5739
  const fullWidthFsr = textWidthFSR + ARROW_POINT_WIDTH_FSR * 2 + END_PADDING_EXTRA_PER_CHARACTER_FSR * labelText.length + END_PADDING_FSR;
5661
- const screenAnchorPosition = schNetLabel.anchor_position ? applyToPoint40(realToScreenTransform, schNetLabel.anchor_position) : {
5740
+ const screenAnchorPosition = schNetLabel.anchor_position ? applyToPoint41(realToScreenTransform, schNetLabel.anchor_position) : {
5662
5741
  x: screenCenter.x - screenTextGrowthVec.x * fullWidthFsr * fontSizePx / 2,
5663
5742
  y: screenCenter.y - screenTextGrowthVec.y * fullWidthFsr * fontSizePx / 2
5664
5743
  };
@@ -5699,12 +5778,12 @@ var createSvgObjectsForSchNetLabel = ({
5699
5778
  y: -0.6
5700
5779
  }
5701
5780
  ].map(
5702
- (fontRelativePoint) => applyToPoint40(
5703
- compose9(
5781
+ (fontRelativePoint) => applyToPoint41(
5782
+ compose10(
5704
5783
  realToScreenTransform,
5705
- translate9(realAnchorPosition.x, realAnchorPosition.y),
5784
+ translate10(realAnchorPosition.x, realAnchorPosition.y),
5706
5785
  scale6(fontSizeMm),
5707
- rotate5(pathRotation / 180 * Math.PI)
5786
+ rotate6(pathRotation / 180 * Math.PI)
5708
5787
  ),
5709
5788
  fontRelativePoint
5710
5789
  )
@@ -5776,17 +5855,17 @@ var createSvgObjectsForSchNetLabel = ({
5776
5855
  };
5777
5856
 
5778
5857
  // lib/sch/svg-object-fns/create-svg-objects-from-sch-box.ts
5779
- import { applyToPoint as applyToPoint41 } from "transformation-matrix";
5858
+ import { applyToPoint as applyToPoint42 } from "transformation-matrix";
5780
5859
  var createSvgObjectsFromSchematicBox = ({
5781
5860
  schematicBox,
5782
5861
  transform,
5783
5862
  colorMap: colorMap2
5784
5863
  }) => {
5785
- const topLeft = applyToPoint41(transform, {
5864
+ const topLeft = applyToPoint42(transform, {
5786
5865
  x: schematicBox.x,
5787
5866
  y: schematicBox.y
5788
5867
  });
5789
- const bottomRight = applyToPoint41(transform, {
5868
+ const bottomRight = applyToPoint42(transform, {
5790
5869
  x: schematicBox.x + schematicBox.width,
5791
5870
  y: schematicBox.y + schematicBox.height
5792
5871
  });
@@ -5822,7 +5901,7 @@ var createSvgObjectsFromSchematicBox = ({
5822
5901
  };
5823
5902
 
5824
5903
  // lib/sch/svg-object-fns/create-svg-objects-from-sch-table.ts
5825
- import { applyToPoint as applyToPoint42 } from "transformation-matrix";
5904
+ import { applyToPoint as applyToPoint43 } from "transformation-matrix";
5826
5905
  var createSvgObjectsFromSchematicTable = ({
5827
5906
  schematicTable,
5828
5907
  transform,
@@ -5855,11 +5934,11 @@ var createSvgObjectsFromSchematicTable = ({
5855
5934
  const svgObjects = [];
5856
5935
  const borderStrokeWidth = border_width * Math.abs(transform.a);
5857
5936
  const gridStrokeWidth = getSchStrokeSize(transform);
5858
- const [screenTopLeftX, screenTopLeftY] = applyToPoint42(transform, [
5937
+ const [screenTopLeftX, screenTopLeftY] = applyToPoint43(transform, [
5859
5938
  topLeftX,
5860
5939
  topLeftY
5861
5940
  ]);
5862
- const [screenBottomRightX, screenBottomRightY] = applyToPoint42(transform, [
5941
+ const [screenBottomRightX, screenBottomRightY] = applyToPoint43(transform, [
5863
5942
  topLeftX + totalWidth,
5864
5943
  topLeftY - totalHeight
5865
5944
  ]);
@@ -5891,8 +5970,8 @@ var createSvgObjectsFromSchematicTable = ({
5891
5970
  (cell) => cell.start_column_index <= i && cell.end_column_index > i && cell.start_row_index <= j && cell.end_row_index >= j
5892
5971
  );
5893
5972
  if (!isMerged) {
5894
- const start = applyToPoint42(transform, { x: currentX, y: segmentStartY });
5895
- const end = applyToPoint42(transform, { x: currentX, y: segmentEndY });
5973
+ const start = applyToPoint43(transform, { x: currentX, y: segmentStartY });
5974
+ const end = applyToPoint43(transform, { x: currentX, y: segmentEndY });
5896
5975
  svgObjects.push({
5897
5976
  name: "line",
5898
5977
  type: "element",
@@ -5921,11 +6000,11 @@ var createSvgObjectsFromSchematicTable = ({
5921
6000
  (cell) => cell.start_row_index <= i && cell.end_row_index > i && cell.start_column_index <= j && cell.end_column_index >= j
5922
6001
  );
5923
6002
  if (!isMerged) {
5924
- const start = applyToPoint42(transform, {
6003
+ const start = applyToPoint43(transform, {
5925
6004
  x: segmentStartX,
5926
6005
  y: currentY
5927
6006
  });
5928
- const end = applyToPoint42(transform, { x: segmentEndX, y: currentY });
6007
+ const end = applyToPoint43(transform, { x: segmentEndX, y: currentY });
5929
6008
  svgObjects.push({
5930
6009
  name: "line",
5931
6010
  type: "element",
@@ -5967,7 +6046,7 @@ var createSvgObjectsFromSchematicTable = ({
5967
6046
  } else if (vertical_align === "bottom") {
5968
6047
  realTextAnchorPos.y = cellTopLeftY - cellHeight + cell_padding;
5969
6048
  }
5970
- const screenTextAnchorPos = applyToPoint42(transform, realTextAnchorPos);
6049
+ const screenTextAnchorPos = applyToPoint43(transform, realTextAnchorPos);
5971
6050
  const fontSize = getSchScreenFontSize(
5972
6051
  transform,
5973
6052
  "reference_designator",
@@ -6023,13 +6102,13 @@ var createSvgObjectsFromSchematicTable = ({
6023
6102
 
6024
6103
  // lib/sch/svg-object-fns/create-svg-objects-for-sch-port-hover.ts
6025
6104
  import { su as su8 } from "@tscircuit/circuit-json-util";
6026
- import { applyToPoint as applyToPoint43 } from "transformation-matrix";
6105
+ import { applyToPoint as applyToPoint44 } from "transformation-matrix";
6027
6106
  var PIN_CIRCLE_RADIUS_MM2 = 0.02;
6028
6107
  var createSvgObjectsForSchPortHover = ({
6029
6108
  schPort,
6030
6109
  transform
6031
6110
  }) => {
6032
- const screenSchPortPos = applyToPoint43(transform, schPort.center);
6111
+ const screenSchPortPos = applyToPoint44(transform, schPort.center);
6033
6112
  const pinRadiusPx = Math.abs(transform.a) * PIN_CIRCLE_RADIUS_MM2 * 2;
6034
6113
  return [
6035
6114
  {
@@ -6337,18 +6416,18 @@ var circuitJsonToSchematicSvg = convertCircuitJsonToSchematicSvg;
6337
6416
  // lib/pcb/convert-circuit-json-to-solder-paste-mask.ts
6338
6417
  import { stringify as stringify4 } from "svgson";
6339
6418
  import {
6340
- applyToPoint as applyToPoint46,
6341
- compose as compose11,
6419
+ applyToPoint as applyToPoint47,
6420
+ compose as compose12,
6342
6421
  scale as scale8,
6343
- translate as translate11
6422
+ translate as translate12
6344
6423
  } from "transformation-matrix";
6345
6424
 
6346
6425
  // lib/pcb/svg-object-fns/convert-circuit-json-to-solder-paste-mask.ts
6347
- import { applyToPoint as applyToPoint45 } from "transformation-matrix";
6426
+ import { applyToPoint as applyToPoint46 } from "transformation-matrix";
6348
6427
  function createSvgObjectsFromSolderPaste(solderPaste, ctx) {
6349
6428
  const { transform, layer: layerFilter } = ctx;
6350
6429
  if (layerFilter && solderPaste.layer !== layerFilter) return [];
6351
- const [x, y] = applyToPoint45(transform, [solderPaste.x, solderPaste.y]);
6430
+ const [x, y] = applyToPoint46(transform, [solderPaste.x, solderPaste.y]);
6352
6431
  if (solderPaste.shape === "rect" || solderPaste.shape === "rotated_rect") {
6353
6432
  const width = solderPaste.width * Math.abs(transform.a);
6354
6433
  const height = solderPaste.height * Math.abs(transform.d);
@@ -6456,8 +6535,8 @@ function convertCircuitJsonToSolderPasteMask(circuitJson, options) {
6456
6535
  const scaleFactor = Math.min(scaleX, scaleY);
6457
6536
  const offsetX = (svgWidth - circuitWidth * scaleFactor) / 2;
6458
6537
  const offsetY = (svgHeight - circuitHeight * scaleFactor) / 2;
6459
- const transform = compose11(
6460
- translate11(
6538
+ const transform = compose12(
6539
+ translate12(
6461
6540
  offsetX - minX * scaleFactor + padding * scaleFactor,
6462
6541
  svgHeight - offsetY + minY * scaleFactor - padding * scaleFactor
6463
6542
  ),
@@ -6551,8 +6630,8 @@ function createSvgObjects3({ elm, ctx }) {
6551
6630
  }
6552
6631
  }
6553
6632
  function createSvgObjectFromPcbBoundary2(transform, minX, minY, maxX, maxY) {
6554
- const [x1, y1] = applyToPoint46(transform, [minX, minY]);
6555
- const [x2, y2] = applyToPoint46(transform, [maxX, maxY]);
6633
+ const [x1, y1] = applyToPoint47(transform, [minX, minY]);
6634
+ const [x2, y2] = applyToPoint47(transform, [maxX, maxY]);
6556
6635
  const width = Math.abs(x2 - x1);
6557
6636
  const height = Math.abs(y2 - y1);
6558
6637
  const x = Math.min(x1, x2);