circuit-to-svg 0.0.300 → 0.0.302

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
@@ -2,10 +2,10 @@
2
2
  import { distance as distance2 } from "circuit-json";
3
3
  import { stringify } from "svgson";
4
4
  import {
5
- applyToPoint as applyToPoint34,
6
- compose as compose6,
5
+ applyToPoint as applyToPoint35,
6
+ compose as compose7,
7
7
  scale as scale3,
8
- translate as translate6
8
+ translate as translate7
9
9
  } from "transformation-matrix";
10
10
 
11
11
  // lib/pcb/svg-object-fns/create-svg-objects-from-pcb-trace-error.ts
@@ -622,6 +622,9 @@ function normalize(vector) {
622
622
  const length = Math.hypot(vector.x, vector.y) || 1;
623
623
  return { x: vector.x / length, y: vector.y / length };
624
624
  }
625
+ var TEXT_OFFSET_MULTIPLIER = 1.5;
626
+ var CHARACTER_WIDTH_MULTIPLIER = 0.6;
627
+ var TEXT_INTERSECTION_PADDING_MULTIPLIER = 0.3;
625
628
  function toPath(points) {
626
629
  return points.map(
627
630
  (point, index) => index === 0 ? `M ${point.x} ${point.y}` : `L ${point.x} ${point.y}`
@@ -640,7 +643,8 @@ function createSvgObjectsFromPcbFabricationNoteDimension(dimension, ctx) {
640
643
  pcb_component_id,
641
644
  pcb_fabrication_note_dimension_id,
642
645
  offset_distance,
643
- offset_direction
646
+ offset_direction,
647
+ text_ccw_rotation
644
648
  } = dimension;
645
649
  if (layerFilter && layer && layer !== layerFilter) return [];
646
650
  if (!from || !to || typeof from !== "object" || typeof to !== "object") {
@@ -751,12 +755,6 @@ function createSvgObjectsFromPcbFabricationNoteDimension(dimension, ctx) {
751
755
  x: (from.x + to.x) / 2 + offsetVector.x,
752
756
  y: (from.y + to.y) / 2 + offsetVector.y
753
757
  };
754
- const textOffset = arrowSize * 1.5;
755
- const textPoint = {
756
- x: midPoint.x + perpendicular.x * textOffset,
757
- y: midPoint.y + perpendicular.y * textOffset
758
- };
759
- const [textX, textY] = applyToPoint6(transform, [textPoint.x, textPoint.y]);
760
758
  const [screenFromX, screenFromY] = applyToPoint6(transform, [
761
759
  fromOffset.x,
762
760
  fromOffset.y
@@ -773,6 +771,25 @@ function createSvgObjectsFromPcbFabricationNoteDimension(dimension, ctx) {
773
771
  if (textAngle > 90 || textAngle < -90) {
774
772
  textAngle += 180;
775
773
  }
774
+ const finalTextAngle = typeof text_ccw_rotation === "number" && Number.isFinite(text_ccw_rotation) ? textAngle - text_ccw_rotation : textAngle;
775
+ let additionalOffset = 0;
776
+ if (text && typeof text_ccw_rotation === "number" && Number.isFinite(text_ccw_rotation)) {
777
+ const textWidth = text.length * font_size * CHARACTER_WIDTH_MULTIPLIER;
778
+ const textHeight = font_size;
779
+ const rotationRad = text_ccw_rotation * Math.PI / 180;
780
+ const sinRot = Math.abs(Math.sin(rotationRad));
781
+ const cosRot = Math.abs(Math.cos(rotationRad));
782
+ const halfWidth = textWidth / 2;
783
+ const halfHeight = textHeight / 2;
784
+ const maxExtension = halfWidth * sinRot + halfHeight * cosRot;
785
+ additionalOffset = maxExtension + font_size * TEXT_INTERSECTION_PADDING_MULTIPLIER;
786
+ }
787
+ const textOffset = arrowSize * TEXT_OFFSET_MULTIPLIER + additionalOffset;
788
+ const textPoint = {
789
+ x: midPoint.x + perpendicular.x * textOffset,
790
+ y: midPoint.y + perpendicular.y * textOffset
791
+ };
792
+ const [textX, textY] = applyToPoint6(transform, [textPoint.x, textPoint.y]);
776
793
  const transformedFontSize = font_size * Math.abs(transform.a);
777
794
  const children = [
778
795
  ...extensionSegments,
@@ -827,7 +844,7 @@ function createSvgObjectsFromPcbFabricationNoteDimension(dimension, ctx) {
827
844
  "text-anchor": "middle",
828
845
  "dominant-baseline": "central",
829
846
  class: "pcb-fabrication-note-dimension-text",
830
- transform: `rotate(${textAngle} ${textX} ${textY})`
847
+ transform: `rotate(${finalTextAngle} ${textX} ${textY})`
831
848
  },
832
849
  children: [
833
850
  {
@@ -1126,7 +1143,8 @@ function createSvgObjectsFromPcbNoteDimension(dimension, ctx) {
1126
1143
  color,
1127
1144
  arrow_size,
1128
1145
  offset_distance,
1129
- offset_direction
1146
+ offset_direction,
1147
+ text_ccw_rotation
1130
1148
  } = dimension;
1131
1149
  if (!from || !to) {
1132
1150
  console.error("Invalid pcb_note_dimension endpoints", { from, to });
@@ -1221,12 +1239,6 @@ function createSvgObjectsFromPcbNoteDimension(dimension, ctx) {
1221
1239
  x: (from.x + to.x) / 2 + offsetVector.x,
1222
1240
  y: (from.y + to.y) / 2 + offsetVector.y
1223
1241
  };
1224
- const textOffset = arrow_size * 1.5;
1225
- const textPoint = {
1226
- x: midPoint.x + perpendicular.x * textOffset,
1227
- y: midPoint.y + perpendicular.y * textOffset
1228
- };
1229
- const [textX, textY] = applyToPoint7(transform, [textPoint.x, textPoint.y]);
1230
1242
  const [screenFromX, screenFromY] = applyToPoint7(transform, [
1231
1243
  fromOffset.x,
1232
1244
  fromOffset.y
@@ -1243,6 +1255,25 @@ function createSvgObjectsFromPcbNoteDimension(dimension, ctx) {
1243
1255
  if (textAngle > 90 || textAngle < -90) {
1244
1256
  textAngle += 180;
1245
1257
  }
1258
+ const finalTextAngle = typeof text_ccw_rotation === "number" && Number.isFinite(text_ccw_rotation) ? textAngle - text_ccw_rotation : textAngle;
1259
+ let additionalOffset = 0;
1260
+ if (text && typeof text_ccw_rotation === "number" && Number.isFinite(text_ccw_rotation)) {
1261
+ const textWidth = text.length * font_size * 0.6;
1262
+ const textHeight = font_size;
1263
+ const rotationRad = text_ccw_rotation * Math.PI / 180;
1264
+ const sinRot = Math.abs(Math.sin(rotationRad));
1265
+ const cosRot = Math.abs(Math.cos(rotationRad));
1266
+ const halfWidth = textWidth / 2;
1267
+ const halfHeight = textHeight / 2;
1268
+ const maxExtension = halfWidth * sinRot + halfHeight * cosRot;
1269
+ additionalOffset = maxExtension + font_size * 0.3;
1270
+ }
1271
+ const textOffset = arrow_size * 1.5 + additionalOffset;
1272
+ const textPoint = {
1273
+ x: midPoint.x + perpendicular.x * textOffset,
1274
+ y: midPoint.y + perpendicular.y * textOffset
1275
+ };
1276
+ const [textX, textY] = applyToPoint7(transform, [textPoint.x, textPoint.y]);
1246
1277
  const transformedFontSize = font_size * Math.abs(transform.a);
1247
1278
  const children = [
1248
1279
  ...extensionSegments,
@@ -1297,7 +1328,7 @@ function createSvgObjectsFromPcbNoteDimension(dimension, ctx) {
1297
1328
  "text-anchor": "middle",
1298
1329
  "dominant-baseline": "central",
1299
1330
  class: "pcb-note-dimension-text",
1300
- transform: `rotate(${textAngle} ${textX} ${textY})`
1331
+ transform: `rotate(${finalTextAngle} ${textX} ${textY})`
1301
1332
  },
1302
1333
  children: [
1303
1334
  {
@@ -2720,6 +2751,8 @@ var DEFAULT_PCB_COLOR_MAP = {
2720
2751
  },
2721
2752
  boardOutline: "rgba(255, 255, 255, 0.5)",
2722
2753
  courtyard: "#FF00FF",
2754
+ keepout: "#FF6B6B",
2755
+ // Red color for keepout zones
2723
2756
  debugComponent: {
2724
2757
  fill: null,
2725
2758
  stroke: null
@@ -5097,21 +5130,108 @@ function createSvgObjectsFromPcbCutout(cutout, ctx) {
5097
5130
  return [];
5098
5131
  }
5099
5132
 
5100
- // lib/pcb/svg-object-fns/create-svg-objects-from-pcb-copper-pour.ts
5133
+ // lib/pcb/svg-object-fns/create-svg-objects-from-pcb-keepout.ts
5101
5134
  import {
5102
- applyToPoint as applyToPoint31,
5135
+ applyToPoint as applyToPoint30,
5103
5136
  compose as compose5,
5137
+ translate as translate5,
5138
+ toString as matrixToString8
5139
+ } from "transformation-matrix";
5140
+ function createSvgObjectsFromPcbKeepout(keepout, ctx) {
5141
+ const { transform, layer: layerFilter, colorMap: colorMap2 } = ctx;
5142
+ if (layerFilter && !keepout.layers.includes(layerFilter)) {
5143
+ return [];
5144
+ }
5145
+ const svgObjects = [];
5146
+ for (const layer of keepout.layers) {
5147
+ if (layerFilter && layer !== layerFilter) {
5148
+ continue;
5149
+ }
5150
+ if (keepout.shape === "rect") {
5151
+ const rectKeepout = keepout;
5152
+ const [cx, cy] = applyToPoint30(transform, [
5153
+ rectKeepout.center.x,
5154
+ rectKeepout.center.y
5155
+ ]);
5156
+ const scaledWidth = rectKeepout.width * Math.abs(transform.a);
5157
+ const scaledHeight = rectKeepout.height * Math.abs(transform.d);
5158
+ const transformedStrokeWidth = 0.1 * Math.abs(transform.a);
5159
+ const attributes = {
5160
+ class: "pcb-keepout pcb-keepout-rect",
5161
+ x: (-scaledWidth / 2).toString(),
5162
+ y: (-scaledHeight / 2).toString(),
5163
+ width: scaledWidth.toString(),
5164
+ height: scaledHeight.toString(),
5165
+ fill: "none",
5166
+ stroke: colorMap2.keepout ?? "#FF6B6B",
5167
+ "stroke-width": transformedStrokeWidth.toString(),
5168
+ "stroke-dasharray": `${transformedStrokeWidth * 3} ${transformedStrokeWidth * 2}`,
5169
+ transform: matrixToString8(compose5(translate5(cx, cy))),
5170
+ "data-type": "pcb_keepout",
5171
+ "data-pcb-layer": layer,
5172
+ "data-pcb-keepout-id": rectKeepout.pcb_keepout_id
5173
+ };
5174
+ if (rectKeepout.description) {
5175
+ attributes["data-description"] = rectKeepout.description;
5176
+ }
5177
+ svgObjects.push({
5178
+ name: "rect",
5179
+ type: "element",
5180
+ attributes,
5181
+ children: [],
5182
+ value: ""
5183
+ });
5184
+ } else if (keepout.shape === "circle") {
5185
+ const circleKeepout = keepout;
5186
+ const [cx, cy] = applyToPoint30(transform, [
5187
+ circleKeepout.center.x,
5188
+ circleKeepout.center.y
5189
+ ]);
5190
+ const scaledRadius = circleKeepout.radius * Math.abs(transform.a);
5191
+ const transformedStrokeWidth = 0.1 * Math.abs(transform.a);
5192
+ const attributes = {
5193
+ class: "pcb-keepout pcb-keepout-circle",
5194
+ cx: cx.toString(),
5195
+ cy: cy.toString(),
5196
+ r: scaledRadius.toString(),
5197
+ fill: "none",
5198
+ stroke: colorMap2.keepout ?? "#FF6B6B",
5199
+ "stroke-width": transformedStrokeWidth.toString(),
5200
+ "stroke-dasharray": `${transformedStrokeWidth * 3} ${transformedStrokeWidth * 2}`,
5201
+ "data-type": "pcb_keepout",
5202
+ "data-pcb-layer": layer,
5203
+ "data-pcb-keepout-id": circleKeepout.pcb_keepout_id
5204
+ };
5205
+ if (circleKeepout.description) {
5206
+ attributes["data-description"] = circleKeepout.description;
5207
+ }
5208
+ svgObjects.push({
5209
+ name: "circle",
5210
+ type: "element",
5211
+ attributes,
5212
+ children: [],
5213
+ value: ""
5214
+ });
5215
+ }
5216
+ }
5217
+ return svgObjects;
5218
+ }
5219
+
5220
+ // lib/pcb/svg-object-fns/create-svg-objects-from-pcb-copper-pour.ts
5221
+ import {
5222
+ applyToPoint as applyToPoint32,
5223
+ compose as compose6,
5104
5224
  rotate as rotate5,
5105
- toString as matrixToString8,
5106
- translate as translate5
5225
+ toString as matrixToString9,
5226
+ translate as translate6
5107
5227
  } from "transformation-matrix";
5108
5228
 
5109
5229
  // lib/utils/ring-to-path-d.ts
5110
- import { applyToPoint as applyToPoint30 } from "transformation-matrix";
5230
+ import { applyToPoint as applyToPoint31 } from "transformation-matrix";
5111
5231
  function ringToPathD(vertices, transform) {
5112
5232
  if (vertices.length === 0) return "";
5113
5233
  const transformedVertices = vertices.map((v) => {
5114
- const [x, y] = applyToPoint30(transform, [v.x, v.y]);
5234
+ const [x, y] = applyToPoint31(transform, [v.x, v.y]);
5115
5235
  return { ...v, x, y };
5116
5236
  });
5117
5237
  let d = `M ${transformedVertices[0].x} ${transformedVertices[0].y}`;
@@ -5200,7 +5320,7 @@ function createSvgObjectsFromPcbCopperPour(pour, ctx) {
5200
5320
  const maskOverlayColor = layer === "bottom" ? colorMap2.soldermaskOverCopper.bottom : colorMap2.soldermaskOverCopper.top;
5201
5321
  const maskOverlayOpacity = "0.9";
5202
5322
  if (pour.shape === "rect") {
5203
- const [cx, cy] = applyToPoint31(transform, [pour.center.x, pour.center.y]);
5323
+ const [cx, cy] = applyToPoint32(transform, [pour.center.x, pour.center.y]);
5204
5324
  const scaledWidth = pour.width * Math.abs(transform.a);
5205
5325
  const scaledHeight = pour.height * Math.abs(transform.d);
5206
5326
  const svgRotation = -(pour.rotation ?? 0);
@@ -5209,8 +5329,8 @@ function createSvgObjectsFromPcbCopperPour(pour, ctx) {
5209
5329
  y: (-scaledHeight / 2).toString(),
5210
5330
  width: scaledWidth.toString(),
5211
5331
  height: scaledHeight.toString(),
5212
- transform: matrixToString8(
5213
- compose5(translate5(cx, cy), rotate5(svgRotation * Math.PI / 180))
5332
+ transform: matrixToString9(
5333
+ compose6(translate6(cx, cy), rotate5(svgRotation * Math.PI / 180))
5214
5334
  )
5215
5335
  };
5216
5336
  const copperRect = {
@@ -5252,7 +5372,7 @@ function createSvgObjectsFromPcbCopperPour(pour, ctx) {
5252
5372
  if (pour.shape === "polygon") {
5253
5373
  if (!pour.points || pour.points.length === 0) return [];
5254
5374
  const transformedPoints = pour.points.map(
5255
- (p) => applyToPoint31(transform, [p.x, p.y])
5375
+ (p) => applyToPoint32(transform, [p.x, p.y])
5256
5376
  );
5257
5377
  const pointsString = transformedPoints.map((p) => `${p[0]},${p[1]}`).join(" ");
5258
5378
  const copperPolygon = {
@@ -5475,11 +5595,11 @@ function createMajorGridPatternChildren(cellSize, majorCellSize, lineColor, majo
5475
5595
  }
5476
5596
 
5477
5597
  // lib/pcb/svg-object-fns/create-svg-objects-from-pcb-component.ts
5478
- import { applyToPoint as applyToPoint32 } from "transformation-matrix";
5598
+ import { applyToPoint as applyToPoint33 } from "transformation-matrix";
5479
5599
  function createSvgObjectsFromPcbComponent(component, ctx) {
5480
5600
  const { transform, circuitJson } = ctx;
5481
5601
  const { center, width, height, rotation = 0 } = component;
5482
- const [x, y] = applyToPoint32(transform, [center.x, center.y]);
5602
+ const [x, y] = applyToPoint33(transform, [center.x, center.y]);
5483
5603
  const scaledWidth = width * Math.abs(transform.a);
5484
5604
  const scaledHeight = height * Math.abs(transform.d);
5485
5605
  const transformStr = `translate(${x}, ${y}) rotate(${-rotation}) scale(1, -1)`;
@@ -5551,7 +5671,7 @@ function getParentAnchorPosition(component, circuitJson) {
5551
5671
  }
5552
5672
 
5553
5673
  // lib/pcb/svg-object-fns/create-svg-objects-from-pcb-group.ts
5554
- import { applyToPoint as applyToPoint33 } from "transformation-matrix";
5674
+ import { applyToPoint as applyToPoint34 } from "transformation-matrix";
5555
5675
  var DEFAULT_GROUP_COLOR = "rgba(100, 200, 255, 0.6)";
5556
5676
  var DEFAULT_STROKE_WIDTH = 0.1;
5557
5677
  function createSvgObjectsFromPcbGroup(pcbGroup, ctx) {
@@ -5595,7 +5715,7 @@ function createSvgObjectsFromPcbGroup(pcbGroup, ctx) {
5595
5715
  (point) => point && typeof point.x === "number" && typeof point.y === "number"
5596
5716
  )) {
5597
5717
  const path = outline.map((point, index) => {
5598
- const [x, y] = applyToPoint33(transform, [point.x, point.y]);
5718
+ const [x, y] = applyToPoint34(transform, [point.x, point.y]);
5599
5719
  return index === 0 ? `M ${x} ${y}` : `L ${x} ${y}`;
5600
5720
  }).join(" ");
5601
5721
  svgObjects.push({
@@ -5616,11 +5736,11 @@ function createSvgObjectsFromPcbGroup(pcbGroup, ctx) {
5616
5736
  }
5617
5737
  const halfWidth = width / 2;
5618
5738
  const halfHeight = height / 2;
5619
- const [topLeftX, topLeftY] = applyToPoint33(transform, [
5739
+ const [topLeftX, topLeftY] = applyToPoint34(transform, [
5620
5740
  center.x - halfWidth,
5621
5741
  center.y + halfHeight
5622
5742
  ]);
5623
- const [bottomRightX, bottomRightY] = applyToPoint33(transform, [
5743
+ const [bottomRightX, bottomRightY] = applyToPoint34(transform, [
5624
5744
  center.x + halfWidth,
5625
5745
  center.y - halfHeight
5626
5746
  ]);
@@ -5674,7 +5794,7 @@ function getSoftwareUsedString(circuitJson) {
5674
5794
  var package_default = {
5675
5795
  name: "circuit-to-svg",
5676
5796
  type: "module",
5677
- version: "0.0.299",
5797
+ version: "0.0.301",
5678
5798
  description: "Convert Circuit JSON to SVG",
5679
5799
  main: "dist/index.js",
5680
5800
  files: [
@@ -5731,6 +5851,7 @@ var TYPE_PRIORITY = {
5731
5851
  pcb_panel: 5,
5732
5852
  pcb_board: 10,
5733
5853
  pcb_cutout: 15,
5854
+ pcb_keepout: 16,
5734
5855
  pcb_hole: 18,
5735
5856
  pcb_plated_hole_drill: 19,
5736
5857
  pcb_plated_hole: 20,
@@ -5889,6 +6010,7 @@ function convertCircuitJsonToPcbSvg(circuitJson, options) {
5889
6010
  },
5890
6011
  substrate: colorOverrides?.substrate ?? DEFAULT_PCB_COLOR_MAP.substrate,
5891
6012
  courtyard: colorOverrides?.courtyard ?? DEFAULT_PCB_COLOR_MAP.courtyard,
6013
+ keepout: colorOverrides?.keepout ?? DEFAULT_PCB_COLOR_MAP.keepout,
5892
6014
  debugComponent: {
5893
6015
  fill: colorOverrides?.debugComponent?.fill ?? DEFAULT_PCB_COLOR_MAP.debugComponent.fill,
5894
6016
  stroke: colorOverrides?.debugComponent?.stroke ?? DEFAULT_PCB_COLOR_MAP.debugComponent.stroke
@@ -5964,6 +6086,16 @@ function convertCircuitJsonToPcbSvg(circuitJson, options) {
5964
6086
  } else if (cutout.shape === "polygon") {
5965
6087
  updateTraceBounds(cutout.points);
5966
6088
  }
6089
+ } else if (circuitJsonElm.type === "pcb_keepout") {
6090
+ const keepout = circuitJsonElm;
6091
+ if (keepout.shape === "rect") {
6092
+ updateBounds(keepout.center, keepout.width, keepout.height);
6093
+ } else if (keepout.shape === "circle") {
6094
+ const radius = typeof keepout.radius === "number" ? keepout.radius : distance2.parse(keepout.radius) ?? 0;
6095
+ if (radius > 0) {
6096
+ updateBounds(keepout.center, radius * 2, radius * 2);
6097
+ }
6098
+ }
5967
6099
  } else if (circuitJsonElm.type === "pcb_silkscreen_text" || circuitJsonElm.type === "pcb_silkscreen_rect" || circuitJsonElm.type === "pcb_silkscreen_circle" || circuitJsonElm.type === "pcb_silkscreen_line") {
5968
6100
  updateSilkscreenBounds(circuitJsonElm);
5969
6101
  } else if (circuitJsonElm.type === "pcb_copper_text") {
@@ -6014,8 +6146,8 @@ function convertCircuitJsonToPcbSvg(circuitJson, options) {
6014
6146
  const scaleFactor = Math.min(scaleX, scaleY);
6015
6147
  const offsetX = (svgWidth - circuitWidth * scaleFactor) / 2;
6016
6148
  const offsetY = (svgHeight - circuitHeight * scaleFactor) / 2;
6017
- const transform = compose6(
6018
- translate6(
6149
+ const transform = compose7(
6150
+ translate7(
6019
6151
  offsetX - boundsMinX * scaleFactor + padding * scaleFactor,
6020
6152
  svgHeight - offsetY + boundsMinY * scaleFactor - padding * scaleFactor
6021
6153
  ),
@@ -6314,6 +6446,11 @@ function createSvgObjects({
6314
6446
  return createSvgObjectsFromPcbVia(elm, ctx);
6315
6447
  case "pcb_cutout":
6316
6448
  return createSvgObjectsFromPcbCutout(elm, ctx);
6449
+ case "pcb_keepout":
6450
+ return createSvgObjectsFromPcbKeepout(
6451
+ elm,
6452
+ ctx
6453
+ );
6317
6454
  case "pcb_group":
6318
6455
  return ctx.showPcbGroups ? createSvgObjectsFromPcbGroup(elm, ctx) : [];
6319
6456
  default:
@@ -6321,8 +6458,8 @@ function createSvgObjects({
6321
6458
  }
6322
6459
  }
6323
6460
  function createSvgObjectFromPcbBoundary(transform, minX, minY, maxX, maxY) {
6324
- const [x1, y1] = applyToPoint34(transform, [minX, minY]);
6325
- const [x2, y2] = applyToPoint34(transform, [maxX, maxY]);
6461
+ const [x1, y1] = applyToPoint35(transform, [minX, minY]);
6462
+ const [x2, y2] = applyToPoint35(transform, [maxX, maxY]);
6326
6463
  const width = Math.abs(x2 - x1);
6327
6464
  const height = Math.abs(y2 - y1);
6328
6465
  const x = Math.min(x1, x2);
@@ -6352,14 +6489,14 @@ var circuitJsonToPcbSvg = convertCircuitJsonToPcbSvg;
6352
6489
  import { stringify as stringify2 } from "svgson";
6353
6490
  import { su as su3 } from "@tscircuit/circuit-json-util";
6354
6491
  import {
6355
- applyToPoint as applyToPoint41,
6356
- compose as compose7,
6492
+ applyToPoint as applyToPoint42,
6493
+ compose as compose8,
6357
6494
  scale as scale4,
6358
- translate as translate7
6495
+ translate as translate8
6359
6496
  } from "transformation-matrix";
6360
6497
 
6361
6498
  // lib/assembly/svg-object-fns/create-svg-objects-from-assembly-board.ts
6362
- import { applyToPoint as applyToPoint35 } from "transformation-matrix";
6499
+ import { applyToPoint as applyToPoint36 } from "transformation-matrix";
6363
6500
  var DEFAULT_BOARD_STYLE = {
6364
6501
  fill: "none",
6365
6502
  stroke: "rgb(0,0,0)",
@@ -6371,25 +6508,25 @@ function createSvgObjectsFromAssemblyBoard(pcbBoard, transform, style = {}) {
6371
6508
  let path;
6372
6509
  if (outline && Array.isArray(outline) && outline.length >= 3) {
6373
6510
  path = outline.map((point, index) => {
6374
- const [x, y] = applyToPoint35(transform, [point.x, point.y]);
6511
+ const [x, y] = applyToPoint36(transform, [point.x, point.y]);
6375
6512
  return index === 0 ? `M ${x} ${y}` : `L ${x} ${y}`;
6376
6513
  }).join(" ");
6377
6514
  } else {
6378
6515
  const halfWidth = width / 2;
6379
6516
  const halfHeight = height / 2;
6380
- const topLeft = applyToPoint35(transform, [
6517
+ const topLeft = applyToPoint36(transform, [
6381
6518
  center.x - halfWidth,
6382
6519
  center.y - halfHeight
6383
6520
  ]);
6384
- const topRight = applyToPoint35(transform, [
6521
+ const topRight = applyToPoint36(transform, [
6385
6522
  center.x + halfWidth,
6386
6523
  center.y - halfHeight
6387
6524
  ]);
6388
- const bottomRight = applyToPoint35(transform, [
6525
+ const bottomRight = applyToPoint36(transform, [
6389
6526
  center.x + halfWidth,
6390
6527
  center.y + halfHeight
6391
6528
  ]);
6392
- const bottomLeft = applyToPoint35(transform, [
6529
+ const bottomLeft = applyToPoint36(transform, [
6393
6530
  center.x - halfWidth,
6394
6531
  center.y + halfHeight
6395
6532
  ]);
@@ -6415,7 +6552,7 @@ function createSvgObjectsFromAssemblyBoard(pcbBoard, transform, style = {}) {
6415
6552
  }
6416
6553
 
6417
6554
  // lib/assembly/svg-object-fns/create-svg-objects-from-assembly-component.ts
6418
- import { applyToPoint as applyToPoint37 } from "transformation-matrix";
6555
+ import { applyToPoint as applyToPoint38 } from "transformation-matrix";
6419
6556
 
6420
6557
  // lib/utils/get-sch-font-size.ts
6421
6558
  import "transformation-matrix";
@@ -6441,8 +6578,8 @@ function createSvgObjectsFromAssemblyComponent(params, ctx) {
6441
6578
  const { center, width, height, rotation = 0, layer = "top" } = elm;
6442
6579
  if (!center || typeof width !== "number" || typeof height !== "number")
6443
6580
  return null;
6444
- const [x, y] = applyToPoint37(transform, [center.x, center.y]);
6445
- const [pinX, pinY] = applyToPoint37(transform, [portPosition.x, portPosition.y]);
6581
+ const [x, y] = applyToPoint38(transform, [center.x, center.y]);
6582
+ const [pinX, pinY] = applyToPoint38(transform, [portPosition.x, portPosition.y]);
6446
6583
  const scaledWidth = width * Math.abs(transform.a);
6447
6584
  const scaledHeight = height * Math.abs(transform.d);
6448
6585
  const isTopLayer = layer === "top";
@@ -6604,11 +6741,11 @@ function getRectPathData(w, h, rotation) {
6604
6741
  }
6605
6742
 
6606
6743
  // lib/assembly/svg-object-fns/create-svg-objects-from-assembly-hole.ts
6607
- import { applyToPoint as applyToPoint38 } from "transformation-matrix";
6744
+ import { applyToPoint as applyToPoint39 } from "transformation-matrix";
6608
6745
  var HOLE_COLOR2 = "rgb(190, 190, 190)";
6609
6746
  function createSvgObjectsFromAssemblyHole(hole, ctx) {
6610
6747
  const { transform } = ctx;
6611
- const [x, y] = applyToPoint38(transform, [hole.x, hole.y]);
6748
+ const [x, y] = applyToPoint39(transform, [hole.x, hole.y]);
6612
6749
  if (hole.hole_shape === "circle" || hole.hole_shape === "square") {
6613
6750
  const scaledDiameter = hole.hole_diameter * Math.abs(transform.a);
6614
6751
  const radius = scaledDiameter / 2;
@@ -6672,12 +6809,12 @@ function createSvgObjectsFromAssemblyHole(hole, ctx) {
6672
6809
  }
6673
6810
 
6674
6811
  // lib/assembly/svg-object-fns/create-svg-objects-from-assembly-plated-hole.ts
6675
- import { applyToPoint as applyToPoint39 } from "transformation-matrix";
6812
+ import { applyToPoint as applyToPoint40 } from "transformation-matrix";
6676
6813
  var PAD_COLOR = "rgb(210, 210, 210)";
6677
6814
  var HOLE_COLOR3 = "rgb(190, 190, 190)";
6678
6815
  function createSvgObjectsFromAssemblyPlatedHole(hole, ctx) {
6679
6816
  const { transform } = ctx;
6680
- const [x, y] = applyToPoint39(transform, [hole.x, hole.y]);
6817
+ const [x, y] = applyToPoint40(transform, [hole.x, hole.y]);
6681
6818
  if (hole.shape === "pill") {
6682
6819
  const scaledOuterWidth = hole.outer_width * Math.abs(transform.a);
6683
6820
  const scaledOuterHeight = hole.outer_height * Math.abs(transform.a);
@@ -6772,7 +6909,7 @@ function createSvgObjectsFromAssemblyPlatedHole(hole, ctx) {
6772
6909
  const scaledRectPadHeight = circularHole.rect_pad_height * Math.abs(transform.a);
6773
6910
  const scaledRectBorderRadius = (circularHole.rect_border_radius ?? 0) * Math.abs(transform.a);
6774
6911
  const holeRadius = scaledHoleDiameter / 2;
6775
- const [holeCx, holeCy] = applyToPoint39(transform, [
6912
+ const [holeCx, holeCy] = applyToPoint40(transform, [
6776
6913
  circularHole.x + circularHole.hole_offset_x,
6777
6914
  circularHole.y + circularHole.hole_offset_y
6778
6915
  ]);
@@ -6830,7 +6967,7 @@ function createSvgObjectsFromAssemblyPlatedHole(hole, ctx) {
6830
6967
  const pillHoleWithOffsets = pillHole;
6831
6968
  const holeOffsetX = pillHoleWithOffsets.hole_offset_x ?? 0;
6832
6969
  const holeOffsetY = pillHoleWithOffsets.hole_offset_y ?? 0;
6833
- const [holeCenterX, holeCenterY] = applyToPoint39(transform, [
6970
+ const [holeCenterX, holeCenterY] = applyToPoint40(transform, [
6834
6971
  pillHole.x + holeOffsetX,
6835
6972
  pillHole.y + holeOffsetY
6836
6973
  ]);
@@ -6892,7 +7029,7 @@ function createSvgObjectsFromAssemblyPlatedHole(hole, ctx) {
6892
7029
  const rotatedHoleWithOffsets = rotatedHole;
6893
7030
  const holeOffsetX = rotatedHoleWithOffsets.hole_offset_x ?? 0;
6894
7031
  const holeOffsetY = rotatedHoleWithOffsets.hole_offset_y ?? 0;
6895
- const [holeCenterX, holeCenterY] = applyToPoint39(transform, [
7032
+ const [holeCenterX, holeCenterY] = applyToPoint40(transform, [
6896
7033
  rotatedHole.x + holeOffsetX,
6897
7034
  rotatedHole.y + holeOffsetY
6898
7035
  ]);
@@ -6948,14 +7085,14 @@ function createSvgObjectsFromAssemblyPlatedHole(hole, ctx) {
6948
7085
  }
6949
7086
 
6950
7087
  // lib/assembly/svg-object-fns/create-svg-objects-from-assembly-smt-pad.ts
6951
- import { applyToPoint as applyToPoint40 } from "transformation-matrix";
7088
+ import { applyToPoint as applyToPoint41 } from "transformation-matrix";
6952
7089
  var PAD_COLOR2 = "rgb(210, 210, 210)";
6953
7090
  function createSvgObjectsFromAssemblySmtPad(pad, ctx) {
6954
7091
  const { transform } = ctx;
6955
7092
  if (pad.shape === "rect" || pad.shape === "rotated_rect") {
6956
7093
  const width = pad.width * Math.abs(transform.a);
6957
7094
  const height = pad.height * Math.abs(transform.d);
6958
- const [x, y] = applyToPoint40(transform, [pad.x, pad.y]);
7095
+ const [x, y] = applyToPoint41(transform, [pad.x, pad.y]);
6959
7096
  const scaledBorderRadius = (pad.rect_border_radius ?? 0) * Math.abs(transform.a);
6960
7097
  if (pad.shape === "rotated_rect" && pad.ccw_rotation) {
6961
7098
  return [
@@ -7007,7 +7144,7 @@ function createSvgObjectsFromAssemblySmtPad(pad, ctx) {
7007
7144
  const width = pad.width * Math.abs(transform.a);
7008
7145
  const height = pad.height * Math.abs(transform.d);
7009
7146
  const radius = pad.radius * Math.abs(transform.a);
7010
- const [x, y] = applyToPoint40(transform, [pad.x, pad.y]);
7147
+ const [x, y] = applyToPoint41(transform, [pad.x, pad.y]);
7011
7148
  return [
7012
7149
  {
7013
7150
  name: "rect",
@@ -7030,7 +7167,7 @@ function createSvgObjectsFromAssemblySmtPad(pad, ctx) {
7030
7167
  }
7031
7168
  if (pad.shape === "circle") {
7032
7169
  const radius = pad.radius * Math.abs(transform.a);
7033
- const [x, y] = applyToPoint40(transform, [pad.x, pad.y]);
7170
+ const [x, y] = applyToPoint41(transform, [pad.x, pad.y]);
7034
7171
  return [
7035
7172
  {
7036
7173
  name: "circle",
@@ -7050,7 +7187,7 @@ function createSvgObjectsFromAssemblySmtPad(pad, ctx) {
7050
7187
  }
7051
7188
  if (pad.shape === "polygon") {
7052
7189
  const points = (pad.points ?? []).map(
7053
- (point) => applyToPoint40(transform, [point.x, point.y])
7190
+ (point) => applyToPoint41(transform, [point.x, point.y])
7054
7191
  );
7055
7192
  return [
7056
7193
  {
@@ -7104,8 +7241,8 @@ function convertCircuitJsonToAssemblySvg(soup, options) {
7104
7241
  const scaleFactor = Math.min(scaleX, scaleY);
7105
7242
  const offsetX = (svgWidth - circuitWidth * scaleFactor) / 2;
7106
7243
  const offsetY = (svgHeight - circuitHeight * scaleFactor) / 2;
7107
- const transform = compose7(
7108
- translate7(
7244
+ const transform = compose8(
7245
+ translate8(
7109
7246
  offsetX - minX * scaleFactor + padding * scaleFactor,
7110
7247
  svgHeight - offsetY + minY * scaleFactor - padding * scaleFactor
7111
7248
  ),
@@ -7234,8 +7371,8 @@ function createSvgObjects2(elm, ctx, soup) {
7234
7371
  }
7235
7372
  }
7236
7373
  function createSvgObjectFromAssemblyBoundary(transform, minX, minY, maxX, maxY) {
7237
- const [x1, y1] = applyToPoint41(transform, [minX, minY]);
7238
- const [x2, y2] = applyToPoint41(transform, [maxX, maxY]);
7374
+ const [x1, y1] = applyToPoint42(transform, [minX, minY]);
7375
+ const [x2, y2] = applyToPoint42(transform, [maxX, maxY]);
7239
7376
  const width = Math.abs(x2 - x1);
7240
7377
  const height = Math.abs(y2 - y1);
7241
7378
  const x = Math.min(x1, x2);
@@ -7258,13 +7395,13 @@ function createSvgObjectFromAssemblyBoundary(transform, minX, minY, maxX, maxY)
7258
7395
  // lib/pinout/convert-circuit-json-to-pinout-svg.ts
7259
7396
  import { stringify as stringify3 } from "svgson";
7260
7397
  import {
7261
- compose as compose8,
7398
+ compose as compose9,
7262
7399
  scale as matrixScale,
7263
- translate as translate8
7400
+ translate as translate9
7264
7401
  } from "transformation-matrix";
7265
7402
 
7266
7403
  // lib/pinout/svg-object-fns/create-svg-objects-from-pinout-board.ts
7267
- import { applyToPoint as applyToPoint42 } from "transformation-matrix";
7404
+ import { applyToPoint as applyToPoint43 } from "transformation-matrix";
7268
7405
  import { su as su4 } from "@tscircuit/circuit-json-util";
7269
7406
  var BOARD_FILL_COLOR = "rgb(26, 115, 143)";
7270
7407
  var BOARD_STROKE_COLOR = "rgba(0,0,0,0.9)";
@@ -7278,25 +7415,25 @@ function createSvgObjectsFromPinoutBoard(pcbBoard, ctx) {
7278
7415
  let path;
7279
7416
  if (outline && Array.isArray(outline) && outline.length >= 3) {
7280
7417
  path = outline.map((point, index) => {
7281
- const [x, y] = applyToPoint42(transform, [point.x, point.y]);
7418
+ const [x, y] = applyToPoint43(transform, [point.x, point.y]);
7282
7419
  return index === 0 ? `M ${x} ${y}` : `L ${x} ${y}`;
7283
7420
  }).join(" ");
7284
7421
  } else {
7285
7422
  const halfWidth = width / 2;
7286
7423
  const halfHeight = height / 2;
7287
- const topLeft = applyToPoint42(transform, [
7424
+ const topLeft = applyToPoint43(transform, [
7288
7425
  center.x - halfWidth,
7289
7426
  center.y - halfHeight
7290
7427
  ]);
7291
- const topRight = applyToPoint42(transform, [
7428
+ const topRight = applyToPoint43(transform, [
7292
7429
  center.x + halfWidth,
7293
7430
  center.y - halfHeight
7294
7431
  ]);
7295
- const bottomRight = applyToPoint42(transform, [
7432
+ const bottomRight = applyToPoint43(transform, [
7296
7433
  center.x + halfWidth,
7297
7434
  center.y + halfHeight
7298
7435
  ]);
7299
- const bottomLeft = applyToPoint42(transform, [
7436
+ const bottomLeft = applyToPoint43(transform, [
7300
7437
  center.x - halfWidth,
7301
7438
  center.y + halfHeight
7302
7439
  ]);
@@ -7314,10 +7451,10 @@ function createSvgObjectsFromPinoutBoard(pcbBoard, ctx) {
7314
7451
  const halfWidth = width2 / 2;
7315
7452
  const halfHeight = height2 / 2;
7316
7453
  const [tl, tr, br, bl] = [
7317
- applyToPoint42(transform, [x - halfWidth, y - halfHeight]),
7318
- applyToPoint42(transform, [x + halfWidth, y - halfHeight]),
7319
- applyToPoint42(transform, [x + halfWidth, y + halfHeight]),
7320
- applyToPoint42(transform, [x - halfWidth, y + halfHeight])
7454
+ applyToPoint43(transform, [x - halfWidth, y - halfHeight]),
7455
+ applyToPoint43(transform, [x + halfWidth, y - halfHeight]),
7456
+ applyToPoint43(transform, [x + halfWidth, y + halfHeight]),
7457
+ applyToPoint43(transform, [x - halfWidth, y + halfHeight])
7321
7458
  ];
7322
7459
  path += ` M ${tl[0]} ${tl[1]} L ${tr[0]} ${tr[1]} L ${br[0]} ${br[1]} L ${bl[0]} ${bl[1]} Z`;
7323
7460
  } else if (cutout.shape === "circle") {
@@ -7367,7 +7504,7 @@ function createSvgObjectsFromPinoutBoard(pcbBoard, ctx) {
7367
7504
 
7368
7505
  // lib/pinout/svg-object-fns/create-svg-objects-from-pinout-component.ts
7369
7506
  import { su as su5 } from "@tscircuit/circuit-json-util";
7370
- import { applyToPoint as applyToPoint43 } from "transformation-matrix";
7507
+ import { applyToPoint as applyToPoint44 } from "transformation-matrix";
7371
7508
  var COMPONENT_FILL_COLOR = "rgba(120, 120, 120, 0.6)";
7372
7509
  var COMPONENT_LABEL_COLOR = "rgba(255, 255, 255, 0.9)";
7373
7510
  function createSvgObjectsFromPinoutComponent(elm, ctx) {
@@ -7377,7 +7514,7 @@ function createSvgObjectsFromPinoutComponent(elm, ctx) {
7377
7514
  if (!center || typeof width !== "number" || typeof height !== "number" || width === 0 || height === 0) {
7378
7515
  return [];
7379
7516
  }
7380
- const [x, y] = applyToPoint43(transform, [center.x, center.y]);
7517
+ const [x, y] = applyToPoint44(transform, [center.x, center.y]);
7381
7518
  const scaledWidth = width * Math.abs(transform.a);
7382
7519
  const scaledHeight = height * Math.abs(transform.d);
7383
7520
  const transformStr = `translate(${x}, ${y})`;
@@ -7438,11 +7575,11 @@ function createSvgObjectsFromPinoutComponent(elm, ctx) {
7438
7575
  }
7439
7576
 
7440
7577
  // lib/pinout/svg-object-fns/create-svg-objects-from-pinout-hole.ts
7441
- import { applyToPoint as applyToPoint44 } from "transformation-matrix";
7578
+ import { applyToPoint as applyToPoint45 } from "transformation-matrix";
7442
7579
  var HOLE_COLOR4 = "rgb(50, 50, 50)";
7443
7580
  function createSvgObjectsFromPinoutHole(hole, ctx) {
7444
7581
  const { transform } = ctx;
7445
- const [x, y] = applyToPoint44(transform, [hole.x, hole.y]);
7582
+ const [x, y] = applyToPoint45(transform, [hole.x, hole.y]);
7446
7583
  if (hole.hole_shape === "circle" || hole.hole_shape === "square") {
7447
7584
  const scaledDiameter = hole.hole_diameter * Math.abs(transform.a);
7448
7585
  const radius = scaledDiameter / 2;
@@ -7506,12 +7643,12 @@ function createSvgObjectsFromPinoutHole(hole, ctx) {
7506
7643
  }
7507
7644
 
7508
7645
  // lib/pinout/svg-object-fns/create-svg-objects-from-pinout-plated-hole.ts
7509
- import { applyToPoint as applyToPoint45 } from "transformation-matrix";
7646
+ import { applyToPoint as applyToPoint46 } from "transformation-matrix";
7510
7647
  var PAD_COLOR3 = "rgb(218, 165, 32)";
7511
7648
  var HOLE_COLOR5 = "rgb(40, 40, 40)";
7512
7649
  function createSvgObjectsFromPinoutPlatedHole(hole, ctx) {
7513
7650
  const { transform } = ctx;
7514
- const [x, y] = applyToPoint45(transform, [hole.x, hole.y]);
7651
+ const [x, y] = applyToPoint46(transform, [hole.x, hole.y]);
7515
7652
  if (hole.shape === "pill") {
7516
7653
  const scaledOuterWidth = hole.outer_width * Math.abs(transform.a);
7517
7654
  const scaledOuterHeight = hole.outer_height * Math.abs(transform.a);
@@ -7746,14 +7883,14 @@ function createSvgObjectsFromPinoutPlatedHole(hole, ctx) {
7746
7883
  }
7747
7884
 
7748
7885
  // lib/pinout/svg-object-fns/create-svg-objects-from-pinout-smt-pad.ts
7749
- import { applyToPoint as applyToPoint46 } from "transformation-matrix";
7886
+ import { applyToPoint as applyToPoint47 } from "transformation-matrix";
7750
7887
  var PAD_COLOR4 = "rgb(218, 165, 32)";
7751
7888
  function createSvgObjectsFromPinoutSmtPad(pad, ctx) {
7752
7889
  const { transform } = ctx;
7753
7890
  if (pad.shape === "rect" || pad.shape === "rotated_rect") {
7754
7891
  const width = pad.width * Math.abs(transform.a);
7755
7892
  const height = pad.height * Math.abs(transform.d);
7756
- const [x, y] = applyToPoint46(transform, [pad.x, pad.y]);
7893
+ const [x, y] = applyToPoint47(transform, [pad.x, pad.y]);
7757
7894
  if (pad.shape === "rotated_rect" && pad.ccw_rotation) {
7758
7895
  return [
7759
7896
  {
@@ -7796,7 +7933,7 @@ function createSvgObjectsFromPinoutSmtPad(pad, ctx) {
7796
7933
  const width = pad.width * Math.abs(transform.a);
7797
7934
  const height = pad.height * Math.abs(transform.d);
7798
7935
  const radius = pad.radius * Math.abs(transform.a);
7799
- const [x, y] = applyToPoint46(transform, [pad.x, pad.y]);
7936
+ const [x, y] = applyToPoint47(transform, [pad.x, pad.y]);
7800
7937
  return [
7801
7938
  {
7802
7939
  name: "rect",
@@ -7819,7 +7956,7 @@ function createSvgObjectsFromPinoutSmtPad(pad, ctx) {
7819
7956
  }
7820
7957
  if (pad.shape === "circle") {
7821
7958
  const radius = pad.radius * Math.abs(transform.a);
7822
- const [x, y] = applyToPoint46(transform, [pad.x, pad.y]);
7959
+ const [x, y] = applyToPoint47(transform, [pad.x, pad.y]);
7823
7960
  return [
7824
7961
  {
7825
7962
  name: "circle",
@@ -7839,7 +7976,7 @@ function createSvgObjectsFromPinoutSmtPad(pad, ctx) {
7839
7976
  }
7840
7977
  if (pad.shape === "polygon") {
7841
7978
  const points = (pad.points ?? []).map(
7842
- (point) => applyToPoint46(transform, [point.x, point.y])
7979
+ (point) => applyToPoint47(transform, [point.x, point.y])
7843
7980
  );
7844
7981
  return [
7845
7982
  {
@@ -7860,7 +7997,7 @@ function createSvgObjectsFromPinoutSmtPad(pad, ctx) {
7860
7997
  }
7861
7998
 
7862
7999
  // lib/pinout/svg-object-fns/create-svg-objects-from-pinout-port.ts
7863
- import { applyToPoint as applyToPoint47 } from "transformation-matrix";
8000
+ import { applyToPoint as applyToPoint48 } from "transformation-matrix";
7864
8001
  import { calculateElbow } from "calculate-elbow";
7865
8002
 
7866
8003
  // lib/pinout/svg-object-fns/pinout-label-box.ts
@@ -7937,7 +8074,7 @@ function createSvgObjectsFromPinoutPort(pcb_port, ctx) {
7937
8074
  const label_info = ctx.label_positions.get(pcb_port.pcb_port_id);
7938
8075
  if (!label_info) return [];
7939
8076
  const { text: label, aliases, elbow_end, label_pos, edge } = label_info;
7940
- const [port_x, port_y] = applyToPoint47(ctx.transform, [pcb_port.x, pcb_port.y]);
8077
+ const [port_x, port_y] = applyToPoint48(ctx.transform, [pcb_port.x, pcb_port.y]);
7941
8078
  const start_facing_direction = edge === "left" ? "x-" : edge === "right" ? "x+" : edge === "top" ? "y-" : "y+";
7942
8079
  const end_facing_direction = edge === "left" ? "x+" : edge === "right" ? "x-" : edge === "top" ? "y+" : "y-";
7943
8080
  const elbow_path = calculateElbow(
@@ -8078,7 +8215,7 @@ function createSvgObjectsFromPinoutPort(pcb_port, ctx) {
8078
8215
  }
8079
8216
 
8080
8217
  // lib/pinout/calculate-label-positions.ts
8081
- import { applyToPoint as applyToPoint48 } from "transformation-matrix";
8218
+ import { applyToPoint as applyToPoint49 } from "transformation-matrix";
8082
8219
 
8083
8220
  // lib/pinout/constants.ts
8084
8221
  var LABEL_RECT_HEIGHT_BASE_MM = 1.6;
@@ -8116,7 +8253,7 @@ function calculateVerticalEdgeLabels(edge, pinout_labels, {
8116
8253
  );
8117
8254
  const mapToEdgePort = (pinout_label) => ({
8118
8255
  pcb_port: pinout_label.pcb_port,
8119
- y: applyToPoint48(transform, [
8256
+ y: applyToPoint49(transform, [
8120
8257
  pinout_label.pcb_port.x,
8121
8258
  pinout_label.pcb_port.y
8122
8259
  ])[1],
@@ -8131,7 +8268,7 @@ function calculateVerticalEdgeLabels(edge, pinout_labels, {
8131
8268
  } else {
8132
8269
  edge_ports = pinout_labels.map((pinout_label) => ({
8133
8270
  pcb_port: pinout_label.pcb_port,
8134
- y: applyToPoint48(transform, [
8271
+ y: applyToPoint49(transform, [
8135
8272
  pinout_label.pcb_port.x,
8136
8273
  pinout_label.pcb_port.y
8137
8274
  ])[1],
@@ -8139,7 +8276,7 @@ function calculateVerticalEdgeLabels(edge, pinout_labels, {
8139
8276
  })).sort((a, b) => a.y - b.y);
8140
8277
  }
8141
8278
  if (edge_ports.length === 0) return;
8142
- const board_edge_x = applyToPoint48(transform, [
8279
+ const board_edge_x = applyToPoint49(transform, [
8143
8280
  edge === "left" ? board_bounds.minX : board_bounds.maxX,
8144
8281
  0
8145
8282
  ])[0];
@@ -8459,8 +8596,8 @@ function convertCircuitJsonToPinoutSvg(soup, options) {
8459
8596
  const pxPerMm = Math.min(pxPerMmX, pxPerMmY);
8460
8597
  const offsetX = (svgWidth - circuitWidth * pxPerMm) / 2;
8461
8598
  const offsetY = (svgHeight - circuitHeight * pxPerMm) / 2;
8462
- const transform = compose8(
8463
- translate8(
8599
+ const transform = compose9(
8600
+ translate9(
8464
8601
  offsetX - expandedMinX * pxPerMm + paddingMm * pxPerMm,
8465
8602
  svgHeight - offsetY + minY * pxPerMm - paddingMm * pxPerMm
8466
8603
  ),
@@ -8561,14 +8698,14 @@ import {
8561
8698
  } from "transformation-matrix";
8562
8699
 
8563
8700
  // lib/sch/draw-schematic-grid.ts
8564
- import { applyToPoint as applyToPoint49 } from "transformation-matrix";
8701
+ import { applyToPoint as applyToPoint50 } from "transformation-matrix";
8565
8702
  function drawSchematicGrid(params) {
8566
8703
  const { minX, minY, maxX, maxY } = params.bounds;
8567
8704
  const cellSize = params.cellSize ?? 1;
8568
8705
  const labelCells = params.labelCells ?? false;
8569
8706
  const gridLines = [];
8570
8707
  const transformPoint = (x, y) => {
8571
- const [transformedX, transformedY] = applyToPoint49(params.transform, [x, y]);
8708
+ const [transformedX, transformedY] = applyToPoint50(params.transform, [x, y]);
8572
8709
  return { x: transformedX, y: transformedY };
8573
8710
  };
8574
8711
  for (let x = Math.floor(minX); x <= Math.ceil(maxX); x += cellSize) {
@@ -8649,15 +8786,15 @@ function drawSchematicGrid(params) {
8649
8786
  }
8650
8787
 
8651
8788
  // lib/sch/draw-schematic-labeled-points.ts
8652
- import { applyToPoint as applyToPoint50 } from "transformation-matrix";
8789
+ import { applyToPoint as applyToPoint51 } from "transformation-matrix";
8653
8790
  function drawSchematicLabeledPoints(params) {
8654
8791
  const { points, transform } = params;
8655
8792
  const labeledPointsGroup = [];
8656
8793
  for (const point of points) {
8657
- const [x1, y1] = applyToPoint50(transform, [point.x - 0.1, point.y - 0.1]);
8658
- const [x2, y2] = applyToPoint50(transform, [point.x + 0.1, point.y + 0.1]);
8659
- const [x3, y3] = applyToPoint50(transform, [point.x - 0.1, point.y + 0.1]);
8660
- const [x4, y4] = applyToPoint50(transform, [point.x + 0.1, point.y - 0.1]);
8794
+ const [x1, y1] = applyToPoint51(transform, [point.x - 0.1, point.y - 0.1]);
8795
+ const [x2, y2] = applyToPoint51(transform, [point.x + 0.1, point.y + 0.1]);
8796
+ const [x3, y3] = applyToPoint51(transform, [point.x - 0.1, point.y + 0.1]);
8797
+ const [x4, y4] = applyToPoint51(transform, [point.x + 0.1, point.y - 0.1]);
8661
8798
  labeledPointsGroup.push({
8662
8799
  name: "path",
8663
8800
  type: "element",
@@ -8668,7 +8805,7 @@ function drawSchematicLabeledPoints(params) {
8668
8805
  "stroke-opacity": "0.7"
8669
8806
  }
8670
8807
  });
8671
- const [labelX, labelY] = applyToPoint50(transform, [
8808
+ const [labelX, labelY] = applyToPoint51(transform, [
8672
8809
  point.x + 0.15,
8673
8810
  point.y - 0.15
8674
8811
  ]);
@@ -9786,8 +9923,8 @@ import { su as su7 } from "@tscircuit/circuit-json-util";
9786
9923
  import { symbols } from "schematic-symbols";
9787
9924
  import "svgson";
9788
9925
  import {
9789
- applyToPoint as applyToPoint52,
9790
- compose as compose10
9926
+ applyToPoint as applyToPoint53,
9927
+ compose as compose11
9791
9928
  } from "transformation-matrix";
9792
9929
 
9793
9930
  // lib/utils/get-sch-stroke-size.ts
@@ -9857,26 +9994,26 @@ var matchSchPortsToSymbolPorts = ({
9857
9994
  };
9858
9995
 
9859
9996
  // lib/utils/point-pairs-to-matrix.ts
9860
- import { compose as compose9, scale as scale5, translate as translate9 } from "transformation-matrix";
9997
+ import { compose as compose10, scale as scale5, translate as translate10 } from "transformation-matrix";
9861
9998
  function pointPairsToMatrix(a1, a2, b1, b2) {
9862
9999
  const tx = a2.x - a1.x;
9863
10000
  const ty = a2.y - a1.y;
9864
10001
  const originalDistance = Math.sqrt((b1.x - a1.x) ** 2 + (b1.y - a1.y) ** 2);
9865
10002
  const transformedDistance = Math.sqrt((b2.x - a2.x) ** 2 + (b2.y - a2.y) ** 2);
9866
10003
  const a = transformedDistance / originalDistance;
9867
- const translateMatrix = translate9(tx, ty);
10004
+ const translateMatrix = translate10(tx, ty);
9868
10005
  const scaleMatrix = scale5(a, a);
9869
- return compose9(translateMatrix, scaleMatrix);
10006
+ return compose10(translateMatrix, scaleMatrix);
9870
10007
  }
9871
10008
 
9872
10009
  // lib/sch/svg-object-fns/create-svg-error-text.ts
9873
- import { applyToPoint as applyToPoint51 } from "transformation-matrix";
10010
+ import { applyToPoint as applyToPoint52 } from "transformation-matrix";
9874
10011
  var createSvgSchErrorText = ({
9875
10012
  text,
9876
10013
  realCenter,
9877
10014
  realToScreenTransform
9878
10015
  }) => {
9879
- const screenCenter = applyToPoint51(realToScreenTransform, realCenter);
10016
+ const screenCenter = applyToPoint52(realToScreenTransform, realCenter);
9880
10017
  return {
9881
10018
  type: "element",
9882
10019
  name: "text",
@@ -9985,12 +10122,12 @@ var createSvgObjectsFromSchematicComponentWithSymbol = ({
9985
10122
  minY: Math.min(...paths.flatMap((p) => p.points.map((pt) => pt.y))),
9986
10123
  maxY: Math.max(...paths.flatMap((p) => p.points.map((pt) => pt.y)))
9987
10124
  };
9988
- const [screenMinX, screenMinY] = applyToPoint52(
9989
- compose10(realToScreenTransform, transformFromSymbolToReal),
10125
+ const [screenMinX, screenMinY] = applyToPoint53(
10126
+ compose11(realToScreenTransform, transformFromSymbolToReal),
9990
10127
  [bounds.minX, bounds.minY]
9991
10128
  );
9992
- const [screenMaxX, screenMaxY] = applyToPoint52(
9993
- compose10(realToScreenTransform, transformFromSymbolToReal),
10129
+ const [screenMaxX, screenMaxY] = applyToPoint53(
10130
+ compose11(realToScreenTransform, transformFromSymbolToReal),
9994
10131
  [bounds.maxX, bounds.maxY]
9995
10132
  );
9996
10133
  const rectHeight = Math.abs(screenMaxY - screenMinY);
@@ -10018,8 +10155,8 @@ var createSvgObjectsFromSchematicComponentWithSymbol = ({
10018
10155
  name: "path",
10019
10156
  attributes: {
10020
10157
  d: points.map((p, i) => {
10021
- const [x, y] = applyToPoint52(
10022
- compose10(realToScreenTransform, transformFromSymbolToReal),
10158
+ const [x, y] = applyToPoint53(
10159
+ compose11(realToScreenTransform, transformFromSymbolToReal),
10023
10160
  [p.x, p.y]
10024
10161
  );
10025
10162
  return `${i === 0 ? "M" : "L"} ${x} ${y}`;
@@ -10034,8 +10171,8 @@ var createSvgObjectsFromSchematicComponentWithSymbol = ({
10034
10171
  });
10035
10172
  }
10036
10173
  for (const text of texts) {
10037
- const screenTextPos = applyToPoint52(
10038
- compose10(realToScreenTransform, transformFromSymbolToReal),
10174
+ const screenTextPos = applyToPoint53(
10175
+ compose11(realToScreenTransform, transformFromSymbolToReal),
10039
10176
  text
10040
10177
  );
10041
10178
  let textValue = "";
@@ -10086,11 +10223,11 @@ var createSvgObjectsFromSchematicComponentWithSymbol = ({
10086
10223
  });
10087
10224
  }
10088
10225
  for (const box of boxes) {
10089
- const screenBoxPos = applyToPoint52(
10090
- compose10(realToScreenTransform, transformFromSymbolToReal),
10226
+ const screenBoxPos = applyToPoint53(
10227
+ compose11(realToScreenTransform, transformFromSymbolToReal),
10091
10228
  box
10092
10229
  );
10093
- const symbolToScreenScale = compose10(
10230
+ const symbolToScreenScale = compose11(
10094
10231
  realToScreenTransform,
10095
10232
  transformFromSymbolToReal
10096
10233
  ).a;
@@ -10110,8 +10247,8 @@ var createSvgObjectsFromSchematicComponentWithSymbol = ({
10110
10247
  }
10111
10248
  for (const port of symbol.ports) {
10112
10249
  if (connectedSymbolPorts.has(port)) continue;
10113
- const screenPortPos = applyToPoint52(
10114
- compose10(realToScreenTransform, transformFromSymbolToReal),
10250
+ const screenPortPos = applyToPoint53(
10251
+ compose11(realToScreenTransform, transformFromSymbolToReal),
10115
10252
  port
10116
10253
  );
10117
10254
  svgObjects.push({
@@ -10130,8 +10267,8 @@ var createSvgObjectsFromSchematicComponentWithSymbol = ({
10130
10267
  });
10131
10268
  }
10132
10269
  for (const circle of circles) {
10133
- const screenCirclePos = applyToPoint52(
10134
- compose10(realToScreenTransform, transformFromSymbolToReal),
10270
+ const screenCirclePos = applyToPoint53(
10271
+ compose11(realToScreenTransform, transformFromSymbolToReal),
10135
10272
  circle
10136
10273
  );
10137
10274
  const screenRadius = Math.abs(circle.radius * realToScreenTransform.a);
@@ -10157,14 +10294,14 @@ var createSvgObjectsFromSchematicComponentWithSymbol = ({
10157
10294
  import { su as su10 } from "@tscircuit/circuit-json-util";
10158
10295
  import "schematic-symbols";
10159
10296
  import "svgson";
10160
- import { applyToPoint as applyToPoint58 } from "transformation-matrix";
10297
+ import { applyToPoint as applyToPoint59 } from "transformation-matrix";
10161
10298
 
10162
10299
  // lib/sch/svg-object-fns/create-svg-objects-from-sch-port-on-box.ts
10163
10300
  import "transformation-matrix";
10164
10301
  import "@tscircuit/circuit-json-util";
10165
10302
 
10166
10303
  // lib/sch/svg-object-fns/create-svg-objects-for-sch-port-box-line.ts
10167
- import { applyToPoint as applyToPoint53 } from "transformation-matrix";
10304
+ import { applyToPoint as applyToPoint54 } from "transformation-matrix";
10168
10305
  import { su as su8 } from "@tscircuit/circuit-json-util";
10169
10306
  var PIN_CIRCLE_RADIUS_MM = 0.02;
10170
10307
  var createArrow = (tip, angle, size, color, strokeWidth) => {
@@ -10217,8 +10354,8 @@ var createSvgObjectsForSchPortBoxLine = ({
10217
10354
  realEdgePos.y += realPinLineLength;
10218
10355
  break;
10219
10356
  }
10220
- const screenSchPortPos = applyToPoint53(transform, schPort.center);
10221
- const screenRealEdgePos = applyToPoint53(transform, realEdgePos);
10357
+ const screenSchPortPos = applyToPoint54(transform, schPort.center);
10358
+ const screenRealEdgePos = applyToPoint54(transform, realEdgePos);
10222
10359
  const isConnected = isSourcePortConnected(circuitJson, schPort.source_port_id);
10223
10360
  const realLineEnd = { ...schPort.center };
10224
10361
  if (!isConnected) {
@@ -10237,7 +10374,7 @@ var createSvgObjectsForSchPortBoxLine = ({
10237
10374
  break;
10238
10375
  }
10239
10376
  }
10240
- const screenLineEnd = applyToPoint53(transform, realLineEnd);
10377
+ const screenLineEnd = applyToPoint54(transform, realLineEnd);
10241
10378
  svgObjects.push({
10242
10379
  name: "line",
10243
10380
  type: "element",
@@ -10358,7 +10495,7 @@ var createSvgObjectsForSchPortBoxLine = ({
10358
10495
  };
10359
10496
 
10360
10497
  // lib/sch/svg-object-fns/create-svg-objects-for-sch-port-pin-number-text.ts
10361
- import { applyToPoint as applyToPoint54 } from "transformation-matrix";
10498
+ import { applyToPoint as applyToPoint55 } from "transformation-matrix";
10362
10499
  var createSvgObjectsForSchPortPinNumberText = (params) => {
10363
10500
  const svgObjects = [];
10364
10501
  const { schPort, schComponent, transform, circuitJson } = params;
@@ -10376,7 +10513,7 @@ var createSvgObjectsForSchPortPinNumberText = (params) => {
10376
10513
  } else {
10377
10514
  realPinNumberPos.y += 0.02;
10378
10515
  }
10379
- const screenPinNumberTextPos = applyToPoint54(transform, realPinNumberPos);
10516
+ const screenPinNumberTextPos = applyToPoint55(transform, realPinNumberPos);
10380
10517
  svgObjects.push({
10381
10518
  name: "text",
10382
10519
  type: "element",
@@ -10406,7 +10543,7 @@ var createSvgObjectsForSchPortPinNumberText = (params) => {
10406
10543
  };
10407
10544
 
10408
10545
  // lib/sch/svg-object-fns/create-svg-objects-for-sch-port-pin-label.ts
10409
- import { applyToPoint as applyToPoint55 } from "transformation-matrix";
10546
+ import { applyToPoint as applyToPoint56 } from "transformation-matrix";
10410
10547
  var LABEL_DIST_FROM_EDGE_MM = 0.1;
10411
10548
  var createSvgObjectsForSchPortPinLabel = (params) => {
10412
10549
  const svgObjects = [];
@@ -10420,7 +10557,7 @@ var createSvgObjectsForSchPortPinLabel = (params) => {
10420
10557
  const realPinEdgeDistance = schPort.distance_from_component_edge ?? 0.4;
10421
10558
  realPinNumberPos.x += vecToEdge.x * (realPinEdgeDistance + LABEL_DIST_FROM_EDGE_MM);
10422
10559
  realPinNumberPos.y += vecToEdge.y * (realPinEdgeDistance + LABEL_DIST_FROM_EDGE_MM);
10423
- const screenPinNumberTextPos = applyToPoint55(transform, realPinNumberPos);
10560
+ const screenPinNumberTextPos = applyToPoint56(transform, realPinNumberPos);
10424
10561
  const label = schPort.display_pin_label ?? schComponent.port_labels?.[`${schPort.pin_number}`];
10425
10562
  if (!label) return [];
10426
10563
  const isNegated = label.startsWith("N_");
@@ -10468,13 +10605,13 @@ var createSvgObjectsFromSchPortOnBox = (params) => {
10468
10605
  };
10469
10606
 
10470
10607
  // lib/sch/svg-object-fns/create-svg-objects-for-sch-text.ts
10471
- import { applyToPoint as applyToPoint57 } from "transformation-matrix";
10608
+ import { applyToPoint as applyToPoint58 } from "transformation-matrix";
10472
10609
  var createSvgSchText = ({
10473
10610
  elm,
10474
10611
  transform,
10475
10612
  colorMap: colorMap2
10476
10613
  }) => {
10477
- const center = applyToPoint57(transform, elm.position);
10614
+ const center = applyToPoint58(transform, elm.position);
10478
10615
  const textAnchorMap = {
10479
10616
  center: "middle",
10480
10617
  center_right: "end",
@@ -10558,11 +10695,11 @@ var createSvgObjectsFromSchematicComponentWithBox = ({
10558
10695
  colorMap: colorMap2
10559
10696
  }) => {
10560
10697
  const svgObjects = [];
10561
- const componentScreenTopLeft = applyToPoint58(transform, {
10698
+ const componentScreenTopLeft = applyToPoint59(transform, {
10562
10699
  x: schComponent.center.x - schComponent.size.width / 2,
10563
10700
  y: schComponent.center.y + schComponent.size.height / 2
10564
10701
  });
10565
- const componentScreenBottomRight = applyToPoint58(transform, {
10702
+ const componentScreenBottomRight = applyToPoint59(transform, {
10566
10703
  x: schComponent.center.x + schComponent.size.width / 2,
10567
10704
  y: schComponent.center.y - schComponent.size.height / 2
10568
10705
  });
@@ -10648,13 +10785,13 @@ function createSvgObjectsFromSchematicComponent(params) {
10648
10785
  }
10649
10786
 
10650
10787
  // lib/sch/svg-object-fns/create-svg-objects-from-sch-voltage-probe.ts
10651
- import { applyToPoint as applyToPoint59 } from "transformation-matrix";
10788
+ import { applyToPoint as applyToPoint60 } from "transformation-matrix";
10652
10789
  function createSvgObjectsFromSchVoltageProbe({
10653
10790
  probe,
10654
10791
  transform,
10655
10792
  colorMap: colorMap2
10656
10793
  }) {
10657
- const [screenX, screenY] = applyToPoint59(transform, [
10794
+ const [screenX, screenY] = applyToPoint60(transform, [
10658
10795
  probe.position.x,
10659
10796
  probe.position.y
10660
10797
  ]);
@@ -10828,17 +10965,17 @@ function createSvgObjectsFromSchVoltageProbe({
10828
10965
  }
10829
10966
 
10830
10967
  // lib/sch/svg-object-fns/create-svg-objects-from-sch-debug-object.ts
10831
- import { applyToPoint as applyToPoint60 } from "transformation-matrix";
10968
+ import { applyToPoint as applyToPoint61 } from "transformation-matrix";
10832
10969
  function createSvgObjectsFromSchDebugObject({
10833
10970
  debugObject,
10834
10971
  transform
10835
10972
  }) {
10836
10973
  if (debugObject.shape === "rect") {
10837
- let [screenLeft, screenTop] = applyToPoint60(transform, [
10974
+ let [screenLeft, screenTop] = applyToPoint61(transform, [
10838
10975
  debugObject.center.x - debugObject.size.width / 2,
10839
10976
  debugObject.center.y - debugObject.size.height / 2
10840
10977
  ]);
10841
- let [screenRight, screenBottom] = applyToPoint60(transform, [
10978
+ let [screenRight, screenBottom] = applyToPoint61(transform, [
10842
10979
  debugObject.center.x + debugObject.size.width / 2,
10843
10980
  debugObject.center.y + debugObject.size.height / 2
10844
10981
  ]);
@@ -10848,7 +10985,7 @@ function createSvgObjectsFromSchDebugObject({
10848
10985
  ];
10849
10986
  const width = Math.abs(screenRight - screenLeft);
10850
10987
  const height = Math.abs(screenBottom - screenTop);
10851
- const [screenCenterX, screenCenterY] = applyToPoint60(transform, [
10988
+ const [screenCenterX, screenCenterY] = applyToPoint61(transform, [
10852
10989
  debugObject.center.x,
10853
10990
  debugObject.center.y
10854
10991
  ]);
@@ -10894,11 +11031,11 @@ function createSvgObjectsFromSchDebugObject({
10894
11031
  ];
10895
11032
  }
10896
11033
  if (debugObject.shape === "line") {
10897
- const [screenStartX, screenStartY] = applyToPoint60(transform, [
11034
+ const [screenStartX, screenStartY] = applyToPoint61(transform, [
10898
11035
  debugObject.start.x,
10899
11036
  debugObject.start.y
10900
11037
  ]);
10901
- const [screenEndX, screenEndY] = applyToPoint60(transform, [
11038
+ const [screenEndX, screenEndY] = applyToPoint61(transform, [
10902
11039
  debugObject.end.x,
10903
11040
  debugObject.end.y
10904
11041
  ]);
@@ -10948,7 +11085,7 @@ function createSvgObjectsFromSchDebugObject({
10948
11085
  }
10949
11086
 
10950
11087
  // lib/sch/svg-object-fns/create-svg-objects-from-sch-trace.ts
10951
- import { applyToPoint as applyToPoint61 } from "transformation-matrix";
11088
+ import { applyToPoint as applyToPoint62 } from "transformation-matrix";
10952
11089
  function createSchematicTrace({
10953
11090
  trace,
10954
11091
  transform,
@@ -10962,11 +11099,11 @@ function createSchematicTrace({
10962
11099
  for (let edgeIndex = 0; edgeIndex < edges.length; edgeIndex++) {
10963
11100
  const edge = edges[edgeIndex];
10964
11101
  if (edge.is_crossing) continue;
10965
- const [screenFromX, screenFromY] = applyToPoint61(transform, [
11102
+ const [screenFromX, screenFromY] = applyToPoint62(transform, [
10966
11103
  edge.from.x,
10967
11104
  edge.from.y
10968
11105
  ]);
10969
- const [screenToX, screenToY] = applyToPoint61(transform, [
11106
+ const [screenToX, screenToY] = applyToPoint62(transform, [
10970
11107
  edge.to.x,
10971
11108
  edge.to.y
10972
11109
  ]);
@@ -11010,11 +11147,11 @@ function createSchematicTrace({
11010
11147
  }
11011
11148
  for (const edge of edges) {
11012
11149
  if (!edge.is_crossing) continue;
11013
- const [screenFromX, screenFromY] = applyToPoint61(transform, [
11150
+ const [screenFromX, screenFromY] = applyToPoint62(transform, [
11014
11151
  edge.from.x,
11015
11152
  edge.from.y
11016
11153
  ]);
11017
- const [screenToX, screenToY] = applyToPoint61(transform, [
11154
+ const [screenToX, screenToY] = applyToPoint62(transform, [
11018
11155
  edge.to.x,
11019
11156
  edge.to.y
11020
11157
  ]);
@@ -11058,7 +11195,7 @@ function createSchematicTrace({
11058
11195
  }
11059
11196
  if (trace.junctions) {
11060
11197
  for (const junction of trace.junctions) {
11061
- const [screenX, screenY] = applyToPoint61(transform, [
11198
+ const [screenX, screenY] = applyToPoint62(transform, [
11062
11199
  junction.x,
11063
11200
  junction.y
11064
11201
  ]);
@@ -11113,20 +11250,20 @@ function createSchematicTrace({
11113
11250
 
11114
11251
  // lib/sch/svg-object-fns/create-svg-objects-for-sch-net-label.ts
11115
11252
  import {
11116
- applyToPoint as applyToPoint63,
11117
- compose as compose12,
11253
+ applyToPoint as applyToPoint64,
11254
+ compose as compose13,
11118
11255
  rotate as rotate7,
11119
11256
  scale as scale7,
11120
- translate as translate12
11257
+ translate as translate13
11121
11258
  } from "transformation-matrix";
11122
11259
 
11123
11260
  // lib/sch/svg-object-fns/create-svg-objects-for-sch-net-label-with-symbol.ts
11124
11261
  import {
11125
- applyToPoint as applyToPoint62,
11126
- compose as compose11,
11262
+ applyToPoint as applyToPoint63,
11263
+ compose as compose12,
11127
11264
  rotate as rotate6,
11128
11265
  scale as scale6,
11129
- translate as translate11
11266
+ translate as translate12
11130
11267
  } from "transformation-matrix";
11131
11268
  import { symbols as symbols3 } from "schematic-symbols";
11132
11269
  var createSvgObjectsForSchNetLabelWithSymbol = ({
@@ -11197,9 +11334,9 @@ var createSvgObjectsForSchNetLabelWithSymbol = ({
11197
11334
  x: symbolBounds.minX,
11198
11335
  y: (symbolBounds.minY + symbolBounds.maxY) / 2
11199
11336
  };
11200
- const rotatedSymbolEnd = applyToPoint62(rotationMatrix, symbolEndPoint);
11201
- const symbolToRealTransform = compose11(
11202
- translate11(
11337
+ const rotatedSymbolEnd = applyToPoint63(rotationMatrix, symbolEndPoint);
11338
+ const symbolToRealTransform = compose12(
11339
+ translate12(
11203
11340
  realAnchorPosition.x - rotatedSymbolEnd.x,
11204
11341
  realAnchorPosition.y - rotatedSymbolEnd.y
11205
11342
  ),
@@ -11207,12 +11344,12 @@ var createSvgObjectsForSchNetLabelWithSymbol = ({
11207
11344
  scale6(1)
11208
11345
  // Use full symbol size
11209
11346
  );
11210
- const [screenMinX, screenMinY] = applyToPoint62(
11211
- compose11(realToScreenTransform, symbolToRealTransform),
11347
+ const [screenMinX, screenMinY] = applyToPoint63(
11348
+ compose12(realToScreenTransform, symbolToRealTransform),
11212
11349
  [bounds.minX, bounds.minY]
11213
11350
  );
11214
- const [screenMaxX, screenMaxY] = applyToPoint62(
11215
- compose11(realToScreenTransform, symbolToRealTransform),
11351
+ const [screenMaxX, screenMaxY] = applyToPoint63(
11352
+ compose12(realToScreenTransform, symbolToRealTransform),
11216
11353
  [bounds.maxX, bounds.maxY]
11217
11354
  );
11218
11355
  const rectHeight = Math.abs(screenMaxY - screenMinY);
@@ -11235,8 +11372,8 @@ var createSvgObjectsForSchNetLabelWithSymbol = ({
11235
11372
  });
11236
11373
  for (const path of symbolPaths) {
11237
11374
  const symbolPath = path.points.map((p, i) => {
11238
- const [x, y] = applyToPoint62(
11239
- compose11(realToScreenTransform, symbolToRealTransform),
11375
+ const [x, y] = applyToPoint63(
11376
+ compose12(realToScreenTransform, symbolToRealTransform),
11240
11377
  [p.x, p.y]
11241
11378
  );
11242
11379
  return `${i === 0 ? "M" : "L"} ${x} ${y}`;
@@ -11256,8 +11393,8 @@ var createSvgObjectsForSchNetLabelWithSymbol = ({
11256
11393
  });
11257
11394
  }
11258
11395
  for (const text of symbolTexts) {
11259
- const screenTextPos = applyToPoint62(
11260
- compose11(realToScreenTransform, symbolToRealTransform),
11396
+ const screenTextPos = applyToPoint63(
11397
+ compose12(realToScreenTransform, symbolToRealTransform),
11261
11398
  text
11262
11399
  );
11263
11400
  let textValue = text.text;
@@ -11298,11 +11435,11 @@ var createSvgObjectsForSchNetLabelWithSymbol = ({
11298
11435
  });
11299
11436
  }
11300
11437
  for (const box of symbolBoxes) {
11301
- const screenBoxPos = applyToPoint62(
11302
- compose11(realToScreenTransform, symbolToRealTransform),
11438
+ const screenBoxPos = applyToPoint63(
11439
+ compose12(realToScreenTransform, symbolToRealTransform),
11303
11440
  box
11304
11441
  );
11305
- const symbolToScreenScale = compose11(
11442
+ const symbolToScreenScale = compose12(
11306
11443
  realToScreenTransform,
11307
11444
  symbolToRealTransform
11308
11445
  ).a;
@@ -11321,11 +11458,11 @@ var createSvgObjectsForSchNetLabelWithSymbol = ({
11321
11458
  });
11322
11459
  }
11323
11460
  for (const circle of symbolCircles) {
11324
- const screenCirclePos = applyToPoint62(
11325
- compose11(realToScreenTransform, symbolToRealTransform),
11461
+ const screenCirclePos = applyToPoint63(
11462
+ compose12(realToScreenTransform, symbolToRealTransform),
11326
11463
  circle
11327
11464
  );
11328
- const symbolToScreenScale = compose11(
11465
+ const symbolToScreenScale = compose12(
11329
11466
  realToScreenTransform,
11330
11467
  symbolToRealTransform
11331
11468
  ).a;
@@ -11366,14 +11503,14 @@ var createSvgObjectsForSchNetLabel = ({
11366
11503
  const fontSizePx = getSchScreenFontSize(realToScreenTransform, "net_label");
11367
11504
  const fontSizeMm = getSchMmFontSize("net_label");
11368
11505
  const textWidthFSR = estimateTextWidth(labelText || "");
11369
- const screenCenter = applyToPoint63(realToScreenTransform, schNetLabel.center);
11506
+ const screenCenter = applyToPoint64(realToScreenTransform, schNetLabel.center);
11370
11507
  const realTextGrowthVec = getUnitVectorFromOutsideToEdge(
11371
11508
  schNetLabel.anchor_side
11372
11509
  );
11373
11510
  const screenTextGrowthVec = { ...realTextGrowthVec };
11374
11511
  screenTextGrowthVec.y *= -1;
11375
11512
  const fullWidthFsr = textWidthFSR + ARROW_POINT_WIDTH_FSR * 2 + END_PADDING_EXTRA_PER_CHARACTER_FSR * labelText.length + END_PADDING_FSR;
11376
- const screenAnchorPosition = schNetLabel.anchor_position ? applyToPoint63(realToScreenTransform, schNetLabel.anchor_position) : {
11513
+ const screenAnchorPosition = schNetLabel.anchor_position ? applyToPoint64(realToScreenTransform, schNetLabel.anchor_position) : {
11377
11514
  x: screenCenter.x - screenTextGrowthVec.x * fullWidthFsr * fontSizePx / 2,
11378
11515
  y: screenCenter.y - screenTextGrowthVec.y * fullWidthFsr * fontSizePx / 2
11379
11516
  };
@@ -11414,10 +11551,10 @@ var createSvgObjectsForSchNetLabel = ({
11414
11551
  y: -0.6
11415
11552
  }
11416
11553
  ].map(
11417
- (fontRelativePoint) => applyToPoint63(
11418
- compose12(
11554
+ (fontRelativePoint) => applyToPoint64(
11555
+ compose13(
11419
11556
  realToScreenTransform,
11420
- translate12(realAnchorPosition.x, realAnchorPosition.y),
11557
+ translate13(realAnchorPosition.x, realAnchorPosition.y),
11421
11558
  scale7(fontSizeMm),
11422
11559
  rotate7(pathRotation / 180 * Math.PI)
11423
11560
  ),
@@ -11491,17 +11628,17 @@ var createSvgObjectsForSchNetLabel = ({
11491
11628
  };
11492
11629
 
11493
11630
  // lib/sch/svg-object-fns/create-svg-objects-from-sch-box.ts
11494
- import { applyToPoint as applyToPoint64 } from "transformation-matrix";
11631
+ import { applyToPoint as applyToPoint65 } from "transformation-matrix";
11495
11632
  var createSvgObjectsFromSchematicBox = ({
11496
11633
  schematicBox,
11497
11634
  transform,
11498
11635
  colorMap: colorMap2
11499
11636
  }) => {
11500
- const topLeft = applyToPoint64(transform, {
11637
+ const topLeft = applyToPoint65(transform, {
11501
11638
  x: schematicBox.x,
11502
11639
  y: schematicBox.y
11503
11640
  });
11504
- const bottomRight = applyToPoint64(transform, {
11641
+ const bottomRight = applyToPoint65(transform, {
11505
11642
  x: schematicBox.x + schematicBox.width,
11506
11643
  y: schematicBox.y + schematicBox.height
11507
11644
  });
@@ -11537,7 +11674,7 @@ var createSvgObjectsFromSchematicBox = ({
11537
11674
  };
11538
11675
 
11539
11676
  // lib/sch/svg-object-fns/create-svg-objects-from-sch-table.ts
11540
- import { applyToPoint as applyToPoint65 } from "transformation-matrix";
11677
+ import { applyToPoint as applyToPoint66 } from "transformation-matrix";
11541
11678
  var createSvgObjectsFromSchematicTable = ({
11542
11679
  schematicTable,
11543
11680
  transform,
@@ -11570,11 +11707,11 @@ var createSvgObjectsFromSchematicTable = ({
11570
11707
  const svgObjects = [];
11571
11708
  const borderStrokeWidth = border_width * Math.abs(transform.a);
11572
11709
  const gridStrokeWidth = getSchStrokeSize(transform);
11573
- const [screenTopLeftX, screenTopLeftY] = applyToPoint65(transform, [
11710
+ const [screenTopLeftX, screenTopLeftY] = applyToPoint66(transform, [
11574
11711
  topLeftX,
11575
11712
  topLeftY
11576
11713
  ]);
11577
- const [screenBottomRightX, screenBottomRightY] = applyToPoint65(transform, [
11714
+ const [screenBottomRightX, screenBottomRightY] = applyToPoint66(transform, [
11578
11715
  topLeftX + totalWidth,
11579
11716
  topLeftY - totalHeight
11580
11717
  ]);
@@ -11606,8 +11743,8 @@ var createSvgObjectsFromSchematicTable = ({
11606
11743
  (cell) => cell.start_column_index <= i && cell.end_column_index > i && cell.start_row_index <= j && cell.end_row_index >= j
11607
11744
  );
11608
11745
  if (!isMerged) {
11609
- const start = applyToPoint65(transform, { x: currentX, y: segmentStartY });
11610
- const end = applyToPoint65(transform, { x: currentX, y: segmentEndY });
11746
+ const start = applyToPoint66(transform, { x: currentX, y: segmentStartY });
11747
+ const end = applyToPoint66(transform, { x: currentX, y: segmentEndY });
11611
11748
  svgObjects.push({
11612
11749
  name: "line",
11613
11750
  type: "element",
@@ -11636,11 +11773,11 @@ var createSvgObjectsFromSchematicTable = ({
11636
11773
  (cell) => cell.start_row_index <= i && cell.end_row_index > i && cell.start_column_index <= j && cell.end_column_index >= j
11637
11774
  );
11638
11775
  if (!isMerged) {
11639
- const start = applyToPoint65(transform, {
11776
+ const start = applyToPoint66(transform, {
11640
11777
  x: segmentStartX,
11641
11778
  y: currentY
11642
11779
  });
11643
- const end = applyToPoint65(transform, { x: segmentEndX, y: currentY });
11780
+ const end = applyToPoint66(transform, { x: segmentEndX, y: currentY });
11644
11781
  svgObjects.push({
11645
11782
  name: "line",
11646
11783
  type: "element",
@@ -11682,7 +11819,7 @@ var createSvgObjectsFromSchematicTable = ({
11682
11819
  } else if (vertical_align === "bottom") {
11683
11820
  realTextAnchorPos.y = cellTopLeftY - cellHeight + cell_padding;
11684
11821
  }
11685
- const screenTextAnchorPos = applyToPoint65(transform, realTextAnchorPos);
11822
+ const screenTextAnchorPos = applyToPoint66(transform, realTextAnchorPos);
11686
11823
  const fontSize = getSchScreenFontSize(
11687
11824
  transform,
11688
11825
  "reference_designator",
@@ -11738,13 +11875,13 @@ var createSvgObjectsFromSchematicTable = ({
11738
11875
 
11739
11876
  // lib/sch/svg-object-fns/create-svg-objects-for-sch-port-hover.ts
11740
11877
  import { su as su11 } from "@tscircuit/circuit-json-util";
11741
- import { applyToPoint as applyToPoint66 } from "transformation-matrix";
11878
+ import { applyToPoint as applyToPoint67 } from "transformation-matrix";
11742
11879
  var PIN_CIRCLE_RADIUS_MM2 = 0.02;
11743
11880
  var createSvgObjectsForSchPortHover = ({
11744
11881
  schPort,
11745
11882
  transform
11746
11883
  }) => {
11747
- const screenSchPortPos = applyToPoint66(transform, schPort.center);
11884
+ const screenSchPortPos = applyToPoint67(transform, schPort.center);
11748
11885
  const pinRadiusPx = Math.abs(transform.a) * PIN_CIRCLE_RADIUS_MM2 * 2;
11749
11886
  return [
11750
11887
  {
@@ -11789,14 +11926,14 @@ var createSvgObjectsForSchComponentPortHovers = ({
11789
11926
  };
11790
11927
 
11791
11928
  // lib/sch/svg-object-fns/create-svg-objects-from-sch-line.ts
11792
- import { applyToPoint as applyToPoint67 } from "transformation-matrix";
11929
+ import { applyToPoint as applyToPoint68 } from "transformation-matrix";
11793
11930
  function createSvgObjectsFromSchematicLine({
11794
11931
  schLine,
11795
11932
  transform,
11796
11933
  colorMap: colorMap2
11797
11934
  }) {
11798
- const p1 = applyToPoint67(transform, { x: schLine.x1, y: schLine.y1 });
11799
- const p2 = applyToPoint67(transform, { x: schLine.x2, y: schLine.y2 });
11935
+ const p1 = applyToPoint68(transform, { x: schLine.x1, y: schLine.y1 });
11936
+ const p2 = applyToPoint68(transform, { x: schLine.x2, y: schLine.y2 });
11800
11937
  const strokeWidth = schLine.stroke_width ?? 0.02;
11801
11938
  const transformedStrokeWidth = Math.abs(transform.a) * strokeWidth;
11802
11939
  return [
@@ -11825,13 +11962,13 @@ function createSvgObjectsFromSchematicLine({
11825
11962
  }
11826
11963
 
11827
11964
  // lib/sch/svg-object-fns/create-svg-objects-from-sch-circle.ts
11828
- import { applyToPoint as applyToPoint68 } from "transformation-matrix";
11965
+ import { applyToPoint as applyToPoint69 } from "transformation-matrix";
11829
11966
  function createSvgObjectsFromSchematicCircle({
11830
11967
  schCircle,
11831
11968
  transform,
11832
11969
  colorMap: colorMap2
11833
11970
  }) {
11834
- const center = applyToPoint68(transform, schCircle.center);
11971
+ const center = applyToPoint69(transform, schCircle.center);
11835
11972
  const transformedRadius = Math.abs(transform.a) * schCircle.radius;
11836
11973
  const strokeWidth = schCircle.stroke_width ?? 0.02;
11837
11974
  const transformedStrokeWidth = Math.abs(transform.a) * strokeWidth;
@@ -11861,13 +11998,13 @@ function createSvgObjectsFromSchematicCircle({
11861
11998
  }
11862
11999
 
11863
12000
  // lib/sch/svg-object-fns/create-svg-objects-from-sch-rect.ts
11864
- import { applyToPoint as applyToPoint69 } from "transformation-matrix";
12001
+ import { applyToPoint as applyToPoint70 } from "transformation-matrix";
11865
12002
  function createSvgObjectsFromSchematicRect({
11866
12003
  schRect,
11867
12004
  transform,
11868
12005
  colorMap: colorMap2
11869
12006
  }) {
11870
- const center = applyToPoint69(transform, schRect.center);
12007
+ const center = applyToPoint70(transform, schRect.center);
11871
12008
  const transformedWidth = Math.abs(transform.a) * schRect.width;
11872
12009
  const transformedHeight = Math.abs(transform.d) * schRect.height;
11873
12010
  const strokeWidth = schRect.stroke_width ?? 0.02;
@@ -11903,13 +12040,13 @@ function createSvgObjectsFromSchematicRect({
11903
12040
  }
11904
12041
 
11905
12042
  // lib/sch/svg-object-fns/create-svg-objects-from-sch-arc.ts
11906
- import { applyToPoint as applyToPoint70 } from "transformation-matrix";
12043
+ import { applyToPoint as applyToPoint71 } from "transformation-matrix";
11907
12044
  function createSvgObjectsFromSchematicArc({
11908
12045
  schArc,
11909
12046
  transform,
11910
12047
  colorMap: colorMap2
11911
12048
  }) {
11912
- const center = applyToPoint70(transform, schArc.center);
12049
+ const center = applyToPoint71(transform, schArc.center);
11913
12050
  const transformedRadius = Math.abs(transform.a) * schArc.radius;
11914
12051
  const strokeWidth = schArc.stroke_width ?? 0.02;
11915
12052
  const transformedStrokeWidth = Math.abs(transform.a) * strokeWidth;
@@ -13029,18 +13166,18 @@ function formatNumber2(value) {
13029
13166
  import { distance as distance3 } from "circuit-json";
13030
13167
  import { stringify as stringify7 } from "svgson";
13031
13168
  import {
13032
- applyToPoint as applyToPoint73,
13033
- compose as compose15,
13169
+ applyToPoint as applyToPoint74,
13170
+ compose as compose16,
13034
13171
  scale as scale9,
13035
- translate as translate15
13172
+ translate as translate16
13036
13173
  } from "transformation-matrix";
13037
13174
 
13038
13175
  // lib/pcb/svg-object-fns/convert-circuit-json-to-solder-paste-mask.ts
13039
- import { applyToPoint as applyToPoint72 } from "transformation-matrix";
13176
+ import { applyToPoint as applyToPoint73 } from "transformation-matrix";
13040
13177
  function createSvgObjectsFromSolderPaste(solderPaste, ctx) {
13041
13178
  const { transform, layer: layerFilter } = ctx;
13042
13179
  if (layerFilter && solderPaste.layer !== layerFilter) return [];
13043
- const [x, y] = applyToPoint72(transform, [solderPaste.x, solderPaste.y]);
13180
+ const [x, y] = applyToPoint73(transform, [solderPaste.x, solderPaste.y]);
13044
13181
  if (solderPaste.shape === "rect" || solderPaste.shape === "rotated_rect") {
13045
13182
  const width = solderPaste.width * Math.abs(transform.a);
13046
13183
  const height = solderPaste.height * Math.abs(transform.d);
@@ -13164,8 +13301,8 @@ function convertCircuitJsonToSolderPasteMask(circuitJson, options) {
13164
13301
  const scaleFactor = Math.min(scaleX, scaleY);
13165
13302
  const offsetX = (svgWidth - circuitWidth * scaleFactor) / 2;
13166
13303
  const offsetY = (svgHeight - circuitHeight * scaleFactor) / 2;
13167
- const transform = compose15(
13168
- translate15(
13304
+ const transform = compose16(
13305
+ translate16(
13169
13306
  offsetX - minX * scaleFactor + padding * scaleFactor,
13170
13307
  svgHeight - offsetY + minY * scaleFactor - padding * scaleFactor
13171
13308
  ),
@@ -13266,8 +13403,8 @@ function createSvgObjects4({ elm, ctx }) {
13266
13403
  }
13267
13404
  }
13268
13405
  function createSvgObjectFromPcbBoundary2(transform, minX, minY, maxX, maxY) {
13269
- const [x1, y1] = applyToPoint73(transform, [minX, minY]);
13270
- const [x2, y2] = applyToPoint73(transform, [maxX, maxY]);
13406
+ const [x1, y1] = applyToPoint74(transform, [minX, minY]);
13407
+ const [x2, y2] = applyToPoint74(transform, [maxX, maxY]);
13271
13408
  const width = Math.abs(x2 - x1);
13272
13409
  const height = Math.abs(y2 - y1);
13273
13410
  const x = Math.min(x1, x2);