circuit-to-svg 0.0.299 → 0.0.301

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,7 +2,7 @@
2
2
  import { distance as distance2 } from "circuit-json";
3
3
  import { stringify } from "svgson";
4
4
  import {
5
- applyToPoint as applyToPoint33,
5
+ applyToPoint as applyToPoint34,
6
6
  compose as compose6,
7
7
  scale as scale3,
8
8
  translate as translate6
@@ -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
  {
@@ -3083,8 +3114,55 @@ function createSvgObjectsFromPcbSilkscreenLine(pcbSilkscreenLine, ctx) {
3083
3114
  ];
3084
3115
  }
3085
3116
 
3086
- // lib/pcb/svg-object-fns/create-svg-objects-from-pcb-courtyard-rect.ts
3117
+ // lib/pcb/svg-object-fns/create-svg-objects-from-pcb-silkscreen-pill.ts
3087
3118
  import { applyToPoint as applyToPoint19 } from "transformation-matrix";
3119
+ function createSvgObjectsFromPcbSilkscreenPill(pcbSilkscreenPill, ctx) {
3120
+ const { transform, layer: layerFilter, colorMap: colorMap2 } = ctx;
3121
+ const {
3122
+ center,
3123
+ width,
3124
+ height,
3125
+ layer = "top",
3126
+ pcb_silkscreen_pill_id
3127
+ } = pcbSilkscreenPill;
3128
+ if (layerFilter && layer !== layerFilter) return [];
3129
+ const [transformedX, transformedY] = applyToPoint19(transform, [
3130
+ center.x,
3131
+ center.y
3132
+ ]);
3133
+ const transformedWidth = width * Math.abs(transform.a);
3134
+ const transformedHeight = height * Math.abs(transform.d);
3135
+ const minDimension = Math.min(width, height);
3136
+ const baseCornerRadius = minDimension / 2;
3137
+ const transformedCornerRadiusX = baseCornerRadius * Math.abs(transform.a);
3138
+ const transformedCornerRadiusY = baseCornerRadius * Math.abs(transform.d);
3139
+ const color = layer === "bottom" ? colorMap2.silkscreen.bottom : colorMap2.silkscreen.top;
3140
+ const svgObject = {
3141
+ name: "rect",
3142
+ type: "element",
3143
+ attributes: {
3144
+ x: (transformedX - transformedWidth / 2).toString(),
3145
+ y: (transformedY - transformedHeight / 2).toString(),
3146
+ width: transformedWidth.toString(),
3147
+ height: transformedHeight.toString(),
3148
+ rx: transformedCornerRadiusX.toString(),
3149
+ ry: transformedCornerRadiusY.toString(),
3150
+ fill: "none",
3151
+ stroke: color,
3152
+ "stroke-width": (0.1 * Math.abs(transform.a)).toString(),
3153
+ class: `pcb-silkscreen-pill pcb-silkscreen-${layer}`,
3154
+ "data-pcb-silkscreen-pill-id": pcb_silkscreen_pill_id,
3155
+ "data-type": "pcb_silkscreen_pill",
3156
+ "data-pcb-layer": layer
3157
+ },
3158
+ value: "",
3159
+ children: []
3160
+ };
3161
+ return [svgObject];
3162
+ }
3163
+
3164
+ // lib/pcb/svg-object-fns/create-svg-objects-from-pcb-courtyard-rect.ts
3165
+ import { applyToPoint as applyToPoint20 } from "transformation-matrix";
3088
3166
  function createSvgObjectsFromPcbCourtyardRect(pcbCourtyardRect, ctx) {
3089
3167
  const { transform, layer: layerFilter, colorMap: colorMap2 } = ctx;
3090
3168
  const {
@@ -3103,7 +3181,7 @@ function createSvgObjectsFromPcbCourtyardRect(pcbCourtyardRect, ctx) {
3103
3181
  });
3104
3182
  return [];
3105
3183
  }
3106
- const [transformedX, transformedY] = applyToPoint19(transform, [
3184
+ const [transformedX, transformedY] = applyToPoint20(transform, [
3107
3185
  center.x,
3108
3186
  center.y
3109
3187
  ]);
@@ -3144,7 +3222,7 @@ function pairs(arr) {
3144
3222
  }
3145
3223
 
3146
3224
  // lib/pcb/svg-object-fns/create-svg-objects-from-pcb-trace.ts
3147
- import { applyToPoint as applyToPoint20 } from "transformation-matrix";
3225
+ import { applyToPoint as applyToPoint21 } from "transformation-matrix";
3148
3226
  function createSvgObjectsFromPcbTrace(trace, ctx) {
3149
3227
  const { transform, layer: layerFilter, colorMap: colorMap2, showSolderMask } = ctx;
3150
3228
  if (!trace.route || !Array.isArray(trace.route) || trace.route.length < 2)
@@ -3152,8 +3230,8 @@ function createSvgObjectsFromPcbTrace(trace, ctx) {
3152
3230
  const segments = pairs(trace.route);
3153
3231
  const svgObjects = [];
3154
3232
  for (const [start, end] of segments) {
3155
- const startPoint = applyToPoint20(transform, [start.x, start.y]);
3156
- const endPoint = applyToPoint20(transform, [end.x, end.y]);
3233
+ const startPoint = applyToPoint21(transform, [start.x, start.y]);
3234
+ const endPoint = applyToPoint21(transform, [end.x, end.y]);
3157
3235
  const layer = "layer" in start ? start.layer : "layer" in end ? end.layer : null;
3158
3236
  if (!layer) continue;
3159
3237
  if (layerFilter && layer !== layerFilter) continue;
@@ -3208,7 +3286,7 @@ function createSvgObjectsFromPcbTrace(trace, ctx) {
3208
3286
  }
3209
3287
 
3210
3288
  // lib/pcb/svg-object-fns/create-svg-objects-from-smt-pads.ts
3211
- import { applyToPoint as applyToPoint21 } from "transformation-matrix";
3289
+ import { applyToPoint as applyToPoint22 } from "transformation-matrix";
3212
3290
  function createSvgObjectsFromSmtPad(pad, ctx) {
3213
3291
  const { transform, layer: layerFilter, colorMap: colorMap2, showSolderMask } = ctx;
3214
3292
  if (layerFilter && pad.layer !== layerFilter) return [];
@@ -3219,7 +3297,7 @@ function createSvgObjectsFromSmtPad(pad, ctx) {
3219
3297
  if (pad.shape === "rect" || pad.shape === "rotated_rect") {
3220
3298
  const width = pad.width * Math.abs(transform.a);
3221
3299
  const height = pad.height * Math.abs(transform.d);
3222
- const [x, y] = applyToPoint21(transform, [pad.x, pad.y]);
3300
+ const [x, y] = applyToPoint22(transform, [pad.x, pad.y]);
3223
3301
  const cornerRadiusValue = pad.corner_radius ?? pad.rect_border_radius ?? 0;
3224
3302
  const scaledBorderRadius = cornerRadiusValue * Math.abs(transform.a);
3225
3303
  if (pad.shape === "rotated_rect" && pad.ccw_rotation) {
@@ -3461,7 +3539,7 @@ function createSvgObjectsFromSmtPad(pad, ctx) {
3461
3539
  const width = pad.width * Math.abs(transform.a);
3462
3540
  const height = pad.height * Math.abs(transform.d);
3463
3541
  const radius = pad.radius * Math.abs(transform.a);
3464
- const [x, y] = applyToPoint21(transform, [pad.x, pad.y]);
3542
+ const [x, y] = applyToPoint22(transform, [pad.x, pad.y]);
3465
3543
  const rotationTransformAttributes = isRotated ? {
3466
3544
  transform: `translate(${x} ${y}) rotate(${-(pad.ccw_rotation ?? 0)})`
3467
3545
  } : void 0;
@@ -3579,7 +3657,7 @@ function createSvgObjectsFromSmtPad(pad, ctx) {
3579
3657
  }
3580
3658
  if (pad.shape === "circle") {
3581
3659
  const radius = pad.radius * Math.abs(transform.a);
3582
- const [x, y] = applyToPoint21(transform, [pad.x, pad.y]);
3660
+ const [x, y] = applyToPoint22(transform, [pad.x, pad.y]);
3583
3661
  const padElement = {
3584
3662
  name: "circle",
3585
3663
  type: "element",
@@ -3669,7 +3747,7 @@ function createSvgObjectsFromSmtPad(pad, ctx) {
3669
3747
  }
3670
3748
  if (pad.shape === "polygon") {
3671
3749
  const points = (pad.points ?? []).map(
3672
- (point) => applyToPoint21(transform, [point.x, point.y])
3750
+ (point) => applyToPoint22(transform, [point.x, point.y])
3673
3751
  );
3674
3752
  const padElement = {
3675
3753
  name: "polygon",
@@ -3768,10 +3846,10 @@ function createSvgObjectsFromSmtPad(pad, ctx) {
3768
3846
  }
3769
3847
 
3770
3848
  // lib/pcb/svg-object-fns/create-svg-objects-from-pcb-board.ts
3771
- import { applyToPoint as applyToPoint23 } from "transformation-matrix";
3849
+ import { applyToPoint as applyToPoint24 } from "transformation-matrix";
3772
3850
 
3773
3851
  // lib/utils/create-pcb-component-anchor-offset-indicators.ts
3774
- import { applyToPoint as applyToPoint22 } from "transformation-matrix";
3852
+ import { applyToPoint as applyToPoint23 } from "transformation-matrix";
3775
3853
  var OFFSET_THRESHOLD_MM = 0.05;
3776
3854
  var TICK_SIZE_PX = 4;
3777
3855
  var LABEL_GAP_PX = 8;
@@ -3798,11 +3876,11 @@ function createAnchorOffsetIndicators(params) {
3798
3876
  displayYOffset
3799
3877
  } = params;
3800
3878
  const objects = [];
3801
- const [screenGroupAnchorX, screenGroupAnchorY] = applyToPoint22(transform, [
3879
+ const [screenGroupAnchorX, screenGroupAnchorY] = applyToPoint23(transform, [
3802
3880
  groupAnchorPosition.x,
3803
3881
  groupAnchorPosition.y
3804
3882
  ]);
3805
- const [screenComponentX, screenComponentY] = applyToPoint22(transform, [
3883
+ const [screenComponentX, screenComponentY] = applyToPoint23(transform, [
3806
3884
  componentPosition.x,
3807
3885
  componentPosition.y
3808
3886
  ]);
@@ -4153,25 +4231,25 @@ function createSvgObjectsFromPcbBoard(pcbBoard, ctx) {
4153
4231
  let path;
4154
4232
  if (outline && Array.isArray(outline) && outline.length >= 3) {
4155
4233
  path = outline.map((point, index) => {
4156
- const [x, y] = applyToPoint23(transform, [point.x, point.y]);
4234
+ const [x, y] = applyToPoint24(transform, [point.x, point.y]);
4157
4235
  return index === 0 ? `M ${x} ${y}` : `L ${x} ${y}`;
4158
4236
  }).join(" ");
4159
4237
  } else {
4160
4238
  const halfWidth = width / 2;
4161
4239
  const halfHeight = height / 2;
4162
- const topLeft = applyToPoint23(transform, [
4240
+ const topLeft = applyToPoint24(transform, [
4163
4241
  center.x - halfWidth,
4164
4242
  center.y - halfHeight
4165
4243
  ]);
4166
- const topRight = applyToPoint23(transform, [
4244
+ const topRight = applyToPoint24(transform, [
4167
4245
  center.x + halfWidth,
4168
4246
  center.y - halfHeight
4169
4247
  ]);
4170
- const bottomRight = applyToPoint23(transform, [
4248
+ const bottomRight = applyToPoint24(transform, [
4171
4249
  center.x + halfWidth,
4172
4250
  center.y + halfHeight
4173
4251
  ]);
4174
- const bottomLeft = applyToPoint23(transform, [
4252
+ const bottomLeft = applyToPoint24(transform, [
4175
4253
  center.x - halfWidth,
4176
4254
  center.y + halfHeight
4177
4255
  ]);
@@ -4238,7 +4316,7 @@ function createSvgObjectsFromPcbBoard(pcbBoard, ctx) {
4238
4316
  }
4239
4317
 
4240
4318
  // lib/pcb/svg-object-fns/create-svg-objects-from-pcb-panel.ts
4241
- import { applyToPoint as applyToPoint24 } from "transformation-matrix";
4319
+ import { applyToPoint as applyToPoint25 } from "transformation-matrix";
4242
4320
  function createSvgObjectsFromPcbPanel(pcbPanel, ctx) {
4243
4321
  const { transform, colorMap: colorMap2, showSolderMask } = ctx;
4244
4322
  const width = Number(pcbPanel.width);
@@ -4246,19 +4324,19 @@ function createSvgObjectsFromPcbPanel(pcbPanel, ctx) {
4246
4324
  const center = pcbPanel.center ?? { x: width / 2, y: height / 2 };
4247
4325
  const halfWidth = width / 2;
4248
4326
  const halfHeight = height / 2;
4249
- const topLeft = applyToPoint24(transform, [
4327
+ const topLeft = applyToPoint25(transform, [
4250
4328
  center.x - halfWidth,
4251
4329
  center.y - halfHeight
4252
4330
  ]);
4253
- const topRight = applyToPoint24(transform, [
4331
+ const topRight = applyToPoint25(transform, [
4254
4332
  center.x + halfWidth,
4255
4333
  center.y - halfHeight
4256
4334
  ]);
4257
- const bottomRight = applyToPoint24(transform, [
4335
+ const bottomRight = applyToPoint25(transform, [
4258
4336
  center.x + halfWidth,
4259
4337
  center.y + halfHeight
4260
4338
  ]);
4261
- const bottomLeft = applyToPoint24(transform, [
4339
+ const bottomLeft = applyToPoint25(transform, [
4262
4340
  center.x - halfWidth,
4263
4341
  center.y + halfHeight
4264
4342
  ]);
@@ -4287,10 +4365,10 @@ function createSvgObjectsFromPcbPanel(pcbPanel, ctx) {
4287
4365
  }
4288
4366
 
4289
4367
  // lib/pcb/svg-object-fns/create-svg-objects-from-pcb-via.ts
4290
- import { applyToPoint as applyToPoint25 } from "transformation-matrix";
4368
+ import { applyToPoint as applyToPoint26 } from "transformation-matrix";
4291
4369
  function createSvgObjectsFromPcbVia(hole, ctx) {
4292
4370
  const { transform, colorMap: colorMap2 } = ctx;
4293
- const [x, y] = applyToPoint25(transform, [hole.x, hole.y]);
4371
+ const [x, y] = applyToPoint26(transform, [hole.x, hole.y]);
4294
4372
  const scaledOuterWidth = hole.outer_diameter * Math.abs(transform.a);
4295
4373
  const scaledOuterHeight = hole.outer_diameter * Math.abs(transform.a);
4296
4374
  const scaledHoleWidth = hole.hole_diameter * Math.abs(transform.a);
@@ -4336,11 +4414,11 @@ function createSvgObjectsFromPcbVia(hole, ctx) {
4336
4414
  }
4337
4415
 
4338
4416
  // lib/pcb/svg-object-fns/create-svg-objects-from-pcb-hole.ts
4339
- import { applyToPoint as applyToPoint26 } from "transformation-matrix";
4417
+ import { applyToPoint as applyToPoint27 } from "transformation-matrix";
4340
4418
  function createSvgObjectsFromPcbHole(hole, ctx) {
4341
4419
  const { transform, colorMap: colorMap2, showSolderMask } = ctx;
4342
4420
  const layer = ctx.layer ?? "top";
4343
- const [x, y] = applyToPoint26(transform, [hole.x, hole.y]);
4421
+ const [x, y] = applyToPoint27(transform, [hole.x, hole.y]);
4344
4422
  const isCoveredWithSolderMask = Boolean(hole.is_covered_with_solder_mask);
4345
4423
  const soldermaskMargin = (hole.soldermask_margin ?? 0) * Math.abs(transform.a);
4346
4424
  const shouldShowSolderMask = showSolderMask && isCoveredWithSolderMask && soldermaskMargin !== 0;
@@ -4837,7 +4915,7 @@ import {
4837
4915
  getFullConnectivityMapFromCircuitJson
4838
4916
  } from "circuit-json-to-connectivity-map";
4839
4917
  import "svgson";
4840
- import { applyToPoint as applyToPoint27 } from "transformation-matrix";
4918
+ import { applyToPoint as applyToPoint28 } from "transformation-matrix";
4841
4919
 
4842
4920
  // lib/pcb/create-svg-objects-from-pcb-rats-nest/get-element-position.ts
4843
4921
  import { su } from "@tscircuit/circuit-json-util";
@@ -4917,11 +4995,11 @@ function createSvgObjectsForRatsNest(circuitJson, ctx) {
4917
4995
  });
4918
4996
  const svgObjects = [];
4919
4997
  for (const line of ratsNestLines) {
4920
- const transformedStart = applyToPoint27(transform, [
4998
+ const transformedStart = applyToPoint28(transform, [
4921
4999
  line.startPoint.x,
4922
5000
  line.startPoint.y
4923
5001
  ]);
4924
- const transformedEnd = applyToPoint27(transform, [
5002
+ const transformedEnd = applyToPoint28(transform, [
4925
5003
  line.endPoint.x,
4926
5004
  line.endPoint.y
4927
5005
  ]);
@@ -4949,7 +5027,7 @@ function createSvgObjectsForRatsNest(circuitJson, ctx) {
4949
5027
 
4950
5028
  // lib/pcb/svg-object-fns/create-svg-objects-from-pcb-cutout.ts
4951
5029
  import {
4952
- applyToPoint as applyToPoint28,
5030
+ applyToPoint as applyToPoint29,
4953
5031
  compose as compose4,
4954
5032
  rotate as rotate4,
4955
5033
  translate as translate4,
@@ -4959,7 +5037,7 @@ function createSvgObjectsFromPcbCutout(cutout, ctx) {
4959
5037
  const { transform, colorMap: colorMap2 } = ctx;
4960
5038
  if (cutout.shape === "rect") {
4961
5039
  const rectCutout = cutout;
4962
- const [cx, cy] = applyToPoint28(transform, [
5040
+ const [cx, cy] = applyToPoint29(transform, [
4963
5041
  rectCutout.center.x,
4964
5042
  rectCutout.center.y
4965
5043
  ]);
@@ -5001,7 +5079,7 @@ function createSvgObjectsFromPcbCutout(cutout, ctx) {
5001
5079
  }
5002
5080
  if (cutout.shape === "circle") {
5003
5081
  const circleCutout = cutout;
5004
- const [cx, cy] = applyToPoint28(transform, [
5082
+ const [cx, cy] = applyToPoint29(transform, [
5005
5083
  circleCutout.center.x,
5006
5084
  circleCutout.center.y
5007
5085
  ]);
@@ -5028,7 +5106,7 @@ function createSvgObjectsFromPcbCutout(cutout, ctx) {
5028
5106
  const polygonCutout = cutout;
5029
5107
  if (!polygonCutout.points || polygonCutout.points.length === 0) return [];
5030
5108
  const transformedPoints = polygonCutout.points.map(
5031
- (p) => applyToPoint28(transform, [p.x, p.y])
5109
+ (p) => applyToPoint29(transform, [p.x, p.y])
5032
5110
  );
5033
5111
  const pointsString = transformedPoints.map((p) => `${p[0]},${p[1]}`).join(" ");
5034
5112
  return [
@@ -5052,7 +5130,7 @@ function createSvgObjectsFromPcbCutout(cutout, ctx) {
5052
5130
 
5053
5131
  // lib/pcb/svg-object-fns/create-svg-objects-from-pcb-copper-pour.ts
5054
5132
  import {
5055
- applyToPoint as applyToPoint30,
5133
+ applyToPoint as applyToPoint31,
5056
5134
  compose as compose5,
5057
5135
  rotate as rotate5,
5058
5136
  toString as matrixToString8,
@@ -5060,11 +5138,11 @@ import {
5060
5138
  } from "transformation-matrix";
5061
5139
 
5062
5140
  // lib/utils/ring-to-path-d.ts
5063
- import { applyToPoint as applyToPoint29 } from "transformation-matrix";
5141
+ import { applyToPoint as applyToPoint30 } from "transformation-matrix";
5064
5142
  function ringToPathD(vertices, transform) {
5065
5143
  if (vertices.length === 0) return "";
5066
5144
  const transformedVertices = vertices.map((v) => {
5067
- const [x, y] = applyToPoint29(transform, [v.x, v.y]);
5145
+ const [x, y] = applyToPoint30(transform, [v.x, v.y]);
5068
5146
  return { ...v, x, y };
5069
5147
  });
5070
5148
  let d = `M ${transformedVertices[0].x} ${transformedVertices[0].y}`;
@@ -5153,7 +5231,7 @@ function createSvgObjectsFromPcbCopperPour(pour, ctx) {
5153
5231
  const maskOverlayColor = layer === "bottom" ? colorMap2.soldermaskOverCopper.bottom : colorMap2.soldermaskOverCopper.top;
5154
5232
  const maskOverlayOpacity = "0.9";
5155
5233
  if (pour.shape === "rect") {
5156
- const [cx, cy] = applyToPoint30(transform, [pour.center.x, pour.center.y]);
5234
+ const [cx, cy] = applyToPoint31(transform, [pour.center.x, pour.center.y]);
5157
5235
  const scaledWidth = pour.width * Math.abs(transform.a);
5158
5236
  const scaledHeight = pour.height * Math.abs(transform.d);
5159
5237
  const svgRotation = -(pour.rotation ?? 0);
@@ -5205,7 +5283,7 @@ function createSvgObjectsFromPcbCopperPour(pour, ctx) {
5205
5283
  if (pour.shape === "polygon") {
5206
5284
  if (!pour.points || pour.points.length === 0) return [];
5207
5285
  const transformedPoints = pour.points.map(
5208
- (p) => applyToPoint30(transform, [p.x, p.y])
5286
+ (p) => applyToPoint31(transform, [p.x, p.y])
5209
5287
  );
5210
5288
  const pointsString = transformedPoints.map((p) => `${p[0]},${p[1]}`).join(" ");
5211
5289
  const copperPolygon = {
@@ -5428,11 +5506,11 @@ function createMajorGridPatternChildren(cellSize, majorCellSize, lineColor, majo
5428
5506
  }
5429
5507
 
5430
5508
  // lib/pcb/svg-object-fns/create-svg-objects-from-pcb-component.ts
5431
- import { applyToPoint as applyToPoint31 } from "transformation-matrix";
5509
+ import { applyToPoint as applyToPoint32 } from "transformation-matrix";
5432
5510
  function createSvgObjectsFromPcbComponent(component, ctx) {
5433
5511
  const { transform, circuitJson } = ctx;
5434
5512
  const { center, width, height, rotation = 0 } = component;
5435
- const [x, y] = applyToPoint31(transform, [center.x, center.y]);
5513
+ const [x, y] = applyToPoint32(transform, [center.x, center.y]);
5436
5514
  const scaledWidth = width * Math.abs(transform.a);
5437
5515
  const scaledHeight = height * Math.abs(transform.d);
5438
5516
  const transformStr = `translate(${x}, ${y}) rotate(${-rotation}) scale(1, -1)`;
@@ -5504,7 +5582,7 @@ function getParentAnchorPosition(component, circuitJson) {
5504
5582
  }
5505
5583
 
5506
5584
  // lib/pcb/svg-object-fns/create-svg-objects-from-pcb-group.ts
5507
- import { applyToPoint as applyToPoint32 } from "transformation-matrix";
5585
+ import { applyToPoint as applyToPoint33 } from "transformation-matrix";
5508
5586
  var DEFAULT_GROUP_COLOR = "rgba(100, 200, 255, 0.6)";
5509
5587
  var DEFAULT_STROKE_WIDTH = 0.1;
5510
5588
  function createSvgObjectsFromPcbGroup(pcbGroup, ctx) {
@@ -5548,7 +5626,7 @@ function createSvgObjectsFromPcbGroup(pcbGroup, ctx) {
5548
5626
  (point) => point && typeof point.x === "number" && typeof point.y === "number"
5549
5627
  )) {
5550
5628
  const path = outline.map((point, index) => {
5551
- const [x, y] = applyToPoint32(transform, [point.x, point.y]);
5629
+ const [x, y] = applyToPoint33(transform, [point.x, point.y]);
5552
5630
  return index === 0 ? `M ${x} ${y}` : `L ${x} ${y}`;
5553
5631
  }).join(" ");
5554
5632
  svgObjects.push({
@@ -5569,11 +5647,11 @@ function createSvgObjectsFromPcbGroup(pcbGroup, ctx) {
5569
5647
  }
5570
5648
  const halfWidth = width / 2;
5571
5649
  const halfHeight = height / 2;
5572
- const [topLeftX, topLeftY] = applyToPoint32(transform, [
5650
+ const [topLeftX, topLeftY] = applyToPoint33(transform, [
5573
5651
  center.x - halfWidth,
5574
5652
  center.y + halfHeight
5575
5653
  ]);
5576
- const [bottomRightX, bottomRightY] = applyToPoint32(transform, [
5654
+ const [bottomRightX, bottomRightY] = applyToPoint33(transform, [
5577
5655
  center.x + halfWidth,
5578
5656
  center.y - halfHeight
5579
5657
  ]);
@@ -5627,7 +5705,7 @@ function getSoftwareUsedString(circuitJson) {
5627
5705
  var package_default = {
5628
5706
  name: "circuit-to-svg",
5629
5707
  type: "module",
5630
- version: "0.0.298",
5708
+ version: "0.0.300",
5631
5709
  description: "Convert Circuit JSON to SVG",
5632
5710
  main: "dist/index.js",
5633
5711
  files: [
@@ -6232,6 +6310,8 @@ function createSvgObjects({
6232
6310
  return createSvgObjectsFromPcbSilkscreenCircle(elm, ctx);
6233
6311
  case "pcb_silkscreen_line":
6234
6312
  return createSvgObjectsFromPcbSilkscreenLine(elm, ctx);
6313
+ case "pcb_silkscreen_pill":
6314
+ return createSvgObjectsFromPcbSilkscreenPill(elm, ctx);
6235
6315
  case "pcb_copper_text":
6236
6316
  return createSvgObjectsFromPcbCopperText(elm, ctx);
6237
6317
  case "pcb_courtyard_rect":
@@ -6272,8 +6352,8 @@ function createSvgObjects({
6272
6352
  }
6273
6353
  }
6274
6354
  function createSvgObjectFromPcbBoundary(transform, minX, minY, maxX, maxY) {
6275
- const [x1, y1] = applyToPoint33(transform, [minX, minY]);
6276
- const [x2, y2] = applyToPoint33(transform, [maxX, maxY]);
6355
+ const [x1, y1] = applyToPoint34(transform, [minX, minY]);
6356
+ const [x2, y2] = applyToPoint34(transform, [maxX, maxY]);
6277
6357
  const width = Math.abs(x2 - x1);
6278
6358
  const height = Math.abs(y2 - y1);
6279
6359
  const x = Math.min(x1, x2);
@@ -6303,14 +6383,14 @@ var circuitJsonToPcbSvg = convertCircuitJsonToPcbSvg;
6303
6383
  import { stringify as stringify2 } from "svgson";
6304
6384
  import { su as su3 } from "@tscircuit/circuit-json-util";
6305
6385
  import {
6306
- applyToPoint as applyToPoint40,
6386
+ applyToPoint as applyToPoint41,
6307
6387
  compose as compose7,
6308
6388
  scale as scale4,
6309
6389
  translate as translate7
6310
6390
  } from "transformation-matrix";
6311
6391
 
6312
6392
  // lib/assembly/svg-object-fns/create-svg-objects-from-assembly-board.ts
6313
- import { applyToPoint as applyToPoint34 } from "transformation-matrix";
6393
+ import { applyToPoint as applyToPoint35 } from "transformation-matrix";
6314
6394
  var DEFAULT_BOARD_STYLE = {
6315
6395
  fill: "none",
6316
6396
  stroke: "rgb(0,0,0)",
@@ -6322,25 +6402,25 @@ function createSvgObjectsFromAssemblyBoard(pcbBoard, transform, style = {}) {
6322
6402
  let path;
6323
6403
  if (outline && Array.isArray(outline) && outline.length >= 3) {
6324
6404
  path = outline.map((point, index) => {
6325
- const [x, y] = applyToPoint34(transform, [point.x, point.y]);
6405
+ const [x, y] = applyToPoint35(transform, [point.x, point.y]);
6326
6406
  return index === 0 ? `M ${x} ${y}` : `L ${x} ${y}`;
6327
6407
  }).join(" ");
6328
6408
  } else {
6329
6409
  const halfWidth = width / 2;
6330
6410
  const halfHeight = height / 2;
6331
- const topLeft = applyToPoint34(transform, [
6411
+ const topLeft = applyToPoint35(transform, [
6332
6412
  center.x - halfWidth,
6333
6413
  center.y - halfHeight
6334
6414
  ]);
6335
- const topRight = applyToPoint34(transform, [
6415
+ const topRight = applyToPoint35(transform, [
6336
6416
  center.x + halfWidth,
6337
6417
  center.y - halfHeight
6338
6418
  ]);
6339
- const bottomRight = applyToPoint34(transform, [
6419
+ const bottomRight = applyToPoint35(transform, [
6340
6420
  center.x + halfWidth,
6341
6421
  center.y + halfHeight
6342
6422
  ]);
6343
- const bottomLeft = applyToPoint34(transform, [
6423
+ const bottomLeft = applyToPoint35(transform, [
6344
6424
  center.x - halfWidth,
6345
6425
  center.y + halfHeight
6346
6426
  ]);
@@ -6366,7 +6446,7 @@ function createSvgObjectsFromAssemblyBoard(pcbBoard, transform, style = {}) {
6366
6446
  }
6367
6447
 
6368
6448
  // lib/assembly/svg-object-fns/create-svg-objects-from-assembly-component.ts
6369
- import { applyToPoint as applyToPoint36 } from "transformation-matrix";
6449
+ import { applyToPoint as applyToPoint37 } from "transformation-matrix";
6370
6450
 
6371
6451
  // lib/utils/get-sch-font-size.ts
6372
6452
  import "transformation-matrix";
@@ -6392,8 +6472,8 @@ function createSvgObjectsFromAssemblyComponent(params, ctx) {
6392
6472
  const { center, width, height, rotation = 0, layer = "top" } = elm;
6393
6473
  if (!center || typeof width !== "number" || typeof height !== "number")
6394
6474
  return null;
6395
- const [x, y] = applyToPoint36(transform, [center.x, center.y]);
6396
- const [pinX, pinY] = applyToPoint36(transform, [portPosition.x, portPosition.y]);
6475
+ const [x, y] = applyToPoint37(transform, [center.x, center.y]);
6476
+ const [pinX, pinY] = applyToPoint37(transform, [portPosition.x, portPosition.y]);
6397
6477
  const scaledWidth = width * Math.abs(transform.a);
6398
6478
  const scaledHeight = height * Math.abs(transform.d);
6399
6479
  const isTopLayer = layer === "top";
@@ -6555,11 +6635,11 @@ function getRectPathData(w, h, rotation) {
6555
6635
  }
6556
6636
 
6557
6637
  // lib/assembly/svg-object-fns/create-svg-objects-from-assembly-hole.ts
6558
- import { applyToPoint as applyToPoint37 } from "transformation-matrix";
6638
+ import { applyToPoint as applyToPoint38 } from "transformation-matrix";
6559
6639
  var HOLE_COLOR2 = "rgb(190, 190, 190)";
6560
6640
  function createSvgObjectsFromAssemblyHole(hole, ctx) {
6561
6641
  const { transform } = ctx;
6562
- const [x, y] = applyToPoint37(transform, [hole.x, hole.y]);
6642
+ const [x, y] = applyToPoint38(transform, [hole.x, hole.y]);
6563
6643
  if (hole.hole_shape === "circle" || hole.hole_shape === "square") {
6564
6644
  const scaledDiameter = hole.hole_diameter * Math.abs(transform.a);
6565
6645
  const radius = scaledDiameter / 2;
@@ -6623,12 +6703,12 @@ function createSvgObjectsFromAssemblyHole(hole, ctx) {
6623
6703
  }
6624
6704
 
6625
6705
  // lib/assembly/svg-object-fns/create-svg-objects-from-assembly-plated-hole.ts
6626
- import { applyToPoint as applyToPoint38 } from "transformation-matrix";
6706
+ import { applyToPoint as applyToPoint39 } from "transformation-matrix";
6627
6707
  var PAD_COLOR = "rgb(210, 210, 210)";
6628
6708
  var HOLE_COLOR3 = "rgb(190, 190, 190)";
6629
6709
  function createSvgObjectsFromAssemblyPlatedHole(hole, ctx) {
6630
6710
  const { transform } = ctx;
6631
- const [x, y] = applyToPoint38(transform, [hole.x, hole.y]);
6711
+ const [x, y] = applyToPoint39(transform, [hole.x, hole.y]);
6632
6712
  if (hole.shape === "pill") {
6633
6713
  const scaledOuterWidth = hole.outer_width * Math.abs(transform.a);
6634
6714
  const scaledOuterHeight = hole.outer_height * Math.abs(transform.a);
@@ -6723,7 +6803,7 @@ function createSvgObjectsFromAssemblyPlatedHole(hole, ctx) {
6723
6803
  const scaledRectPadHeight = circularHole.rect_pad_height * Math.abs(transform.a);
6724
6804
  const scaledRectBorderRadius = (circularHole.rect_border_radius ?? 0) * Math.abs(transform.a);
6725
6805
  const holeRadius = scaledHoleDiameter / 2;
6726
- const [holeCx, holeCy] = applyToPoint38(transform, [
6806
+ const [holeCx, holeCy] = applyToPoint39(transform, [
6727
6807
  circularHole.x + circularHole.hole_offset_x,
6728
6808
  circularHole.y + circularHole.hole_offset_y
6729
6809
  ]);
@@ -6781,7 +6861,7 @@ function createSvgObjectsFromAssemblyPlatedHole(hole, ctx) {
6781
6861
  const pillHoleWithOffsets = pillHole;
6782
6862
  const holeOffsetX = pillHoleWithOffsets.hole_offset_x ?? 0;
6783
6863
  const holeOffsetY = pillHoleWithOffsets.hole_offset_y ?? 0;
6784
- const [holeCenterX, holeCenterY] = applyToPoint38(transform, [
6864
+ const [holeCenterX, holeCenterY] = applyToPoint39(transform, [
6785
6865
  pillHole.x + holeOffsetX,
6786
6866
  pillHole.y + holeOffsetY
6787
6867
  ]);
@@ -6843,7 +6923,7 @@ function createSvgObjectsFromAssemblyPlatedHole(hole, ctx) {
6843
6923
  const rotatedHoleWithOffsets = rotatedHole;
6844
6924
  const holeOffsetX = rotatedHoleWithOffsets.hole_offset_x ?? 0;
6845
6925
  const holeOffsetY = rotatedHoleWithOffsets.hole_offset_y ?? 0;
6846
- const [holeCenterX, holeCenterY] = applyToPoint38(transform, [
6926
+ const [holeCenterX, holeCenterY] = applyToPoint39(transform, [
6847
6927
  rotatedHole.x + holeOffsetX,
6848
6928
  rotatedHole.y + holeOffsetY
6849
6929
  ]);
@@ -6899,14 +6979,14 @@ function createSvgObjectsFromAssemblyPlatedHole(hole, ctx) {
6899
6979
  }
6900
6980
 
6901
6981
  // lib/assembly/svg-object-fns/create-svg-objects-from-assembly-smt-pad.ts
6902
- import { applyToPoint as applyToPoint39 } from "transformation-matrix";
6982
+ import { applyToPoint as applyToPoint40 } from "transformation-matrix";
6903
6983
  var PAD_COLOR2 = "rgb(210, 210, 210)";
6904
6984
  function createSvgObjectsFromAssemblySmtPad(pad, ctx) {
6905
6985
  const { transform } = ctx;
6906
6986
  if (pad.shape === "rect" || pad.shape === "rotated_rect") {
6907
6987
  const width = pad.width * Math.abs(transform.a);
6908
6988
  const height = pad.height * Math.abs(transform.d);
6909
- const [x, y] = applyToPoint39(transform, [pad.x, pad.y]);
6989
+ const [x, y] = applyToPoint40(transform, [pad.x, pad.y]);
6910
6990
  const scaledBorderRadius = (pad.rect_border_radius ?? 0) * Math.abs(transform.a);
6911
6991
  if (pad.shape === "rotated_rect" && pad.ccw_rotation) {
6912
6992
  return [
@@ -6958,7 +7038,7 @@ function createSvgObjectsFromAssemblySmtPad(pad, ctx) {
6958
7038
  const width = pad.width * Math.abs(transform.a);
6959
7039
  const height = pad.height * Math.abs(transform.d);
6960
7040
  const radius = pad.radius * Math.abs(transform.a);
6961
- const [x, y] = applyToPoint39(transform, [pad.x, pad.y]);
7041
+ const [x, y] = applyToPoint40(transform, [pad.x, pad.y]);
6962
7042
  return [
6963
7043
  {
6964
7044
  name: "rect",
@@ -6981,7 +7061,7 @@ function createSvgObjectsFromAssemblySmtPad(pad, ctx) {
6981
7061
  }
6982
7062
  if (pad.shape === "circle") {
6983
7063
  const radius = pad.radius * Math.abs(transform.a);
6984
- const [x, y] = applyToPoint39(transform, [pad.x, pad.y]);
7064
+ const [x, y] = applyToPoint40(transform, [pad.x, pad.y]);
6985
7065
  return [
6986
7066
  {
6987
7067
  name: "circle",
@@ -7001,7 +7081,7 @@ function createSvgObjectsFromAssemblySmtPad(pad, ctx) {
7001
7081
  }
7002
7082
  if (pad.shape === "polygon") {
7003
7083
  const points = (pad.points ?? []).map(
7004
- (point) => applyToPoint39(transform, [point.x, point.y])
7084
+ (point) => applyToPoint40(transform, [point.x, point.y])
7005
7085
  );
7006
7086
  return [
7007
7087
  {
@@ -7185,8 +7265,8 @@ function createSvgObjects2(elm, ctx, soup) {
7185
7265
  }
7186
7266
  }
7187
7267
  function createSvgObjectFromAssemblyBoundary(transform, minX, minY, maxX, maxY) {
7188
- const [x1, y1] = applyToPoint40(transform, [minX, minY]);
7189
- const [x2, y2] = applyToPoint40(transform, [maxX, maxY]);
7268
+ const [x1, y1] = applyToPoint41(transform, [minX, minY]);
7269
+ const [x2, y2] = applyToPoint41(transform, [maxX, maxY]);
7190
7270
  const width = Math.abs(x2 - x1);
7191
7271
  const height = Math.abs(y2 - y1);
7192
7272
  const x = Math.min(x1, x2);
@@ -7215,7 +7295,7 @@ import {
7215
7295
  } from "transformation-matrix";
7216
7296
 
7217
7297
  // lib/pinout/svg-object-fns/create-svg-objects-from-pinout-board.ts
7218
- import { applyToPoint as applyToPoint41 } from "transformation-matrix";
7298
+ import { applyToPoint as applyToPoint42 } from "transformation-matrix";
7219
7299
  import { su as su4 } from "@tscircuit/circuit-json-util";
7220
7300
  var BOARD_FILL_COLOR = "rgb(26, 115, 143)";
7221
7301
  var BOARD_STROKE_COLOR = "rgba(0,0,0,0.9)";
@@ -7229,25 +7309,25 @@ function createSvgObjectsFromPinoutBoard(pcbBoard, ctx) {
7229
7309
  let path;
7230
7310
  if (outline && Array.isArray(outline) && outline.length >= 3) {
7231
7311
  path = outline.map((point, index) => {
7232
- const [x, y] = applyToPoint41(transform, [point.x, point.y]);
7312
+ const [x, y] = applyToPoint42(transform, [point.x, point.y]);
7233
7313
  return index === 0 ? `M ${x} ${y}` : `L ${x} ${y}`;
7234
7314
  }).join(" ");
7235
7315
  } else {
7236
7316
  const halfWidth = width / 2;
7237
7317
  const halfHeight = height / 2;
7238
- const topLeft = applyToPoint41(transform, [
7318
+ const topLeft = applyToPoint42(transform, [
7239
7319
  center.x - halfWidth,
7240
7320
  center.y - halfHeight
7241
7321
  ]);
7242
- const topRight = applyToPoint41(transform, [
7322
+ const topRight = applyToPoint42(transform, [
7243
7323
  center.x + halfWidth,
7244
7324
  center.y - halfHeight
7245
7325
  ]);
7246
- const bottomRight = applyToPoint41(transform, [
7326
+ const bottomRight = applyToPoint42(transform, [
7247
7327
  center.x + halfWidth,
7248
7328
  center.y + halfHeight
7249
7329
  ]);
7250
- const bottomLeft = applyToPoint41(transform, [
7330
+ const bottomLeft = applyToPoint42(transform, [
7251
7331
  center.x - halfWidth,
7252
7332
  center.y + halfHeight
7253
7333
  ]);
@@ -7265,10 +7345,10 @@ function createSvgObjectsFromPinoutBoard(pcbBoard, ctx) {
7265
7345
  const halfWidth = width2 / 2;
7266
7346
  const halfHeight = height2 / 2;
7267
7347
  const [tl, tr, br, bl] = [
7268
- applyToPoint41(transform, [x - halfWidth, y - halfHeight]),
7269
- applyToPoint41(transform, [x + halfWidth, y - halfHeight]),
7270
- applyToPoint41(transform, [x + halfWidth, y + halfHeight]),
7271
- applyToPoint41(transform, [x - halfWidth, y + halfHeight])
7348
+ applyToPoint42(transform, [x - halfWidth, y - halfHeight]),
7349
+ applyToPoint42(transform, [x + halfWidth, y - halfHeight]),
7350
+ applyToPoint42(transform, [x + halfWidth, y + halfHeight]),
7351
+ applyToPoint42(transform, [x - halfWidth, y + halfHeight])
7272
7352
  ];
7273
7353
  path += ` M ${tl[0]} ${tl[1]} L ${tr[0]} ${tr[1]} L ${br[0]} ${br[1]} L ${bl[0]} ${bl[1]} Z`;
7274
7354
  } else if (cutout.shape === "circle") {
@@ -7318,7 +7398,7 @@ function createSvgObjectsFromPinoutBoard(pcbBoard, ctx) {
7318
7398
 
7319
7399
  // lib/pinout/svg-object-fns/create-svg-objects-from-pinout-component.ts
7320
7400
  import { su as su5 } from "@tscircuit/circuit-json-util";
7321
- import { applyToPoint as applyToPoint42 } from "transformation-matrix";
7401
+ import { applyToPoint as applyToPoint43 } from "transformation-matrix";
7322
7402
  var COMPONENT_FILL_COLOR = "rgba(120, 120, 120, 0.6)";
7323
7403
  var COMPONENT_LABEL_COLOR = "rgba(255, 255, 255, 0.9)";
7324
7404
  function createSvgObjectsFromPinoutComponent(elm, ctx) {
@@ -7328,7 +7408,7 @@ function createSvgObjectsFromPinoutComponent(elm, ctx) {
7328
7408
  if (!center || typeof width !== "number" || typeof height !== "number" || width === 0 || height === 0) {
7329
7409
  return [];
7330
7410
  }
7331
- const [x, y] = applyToPoint42(transform, [center.x, center.y]);
7411
+ const [x, y] = applyToPoint43(transform, [center.x, center.y]);
7332
7412
  const scaledWidth = width * Math.abs(transform.a);
7333
7413
  const scaledHeight = height * Math.abs(transform.d);
7334
7414
  const transformStr = `translate(${x}, ${y})`;
@@ -7389,11 +7469,11 @@ function createSvgObjectsFromPinoutComponent(elm, ctx) {
7389
7469
  }
7390
7470
 
7391
7471
  // lib/pinout/svg-object-fns/create-svg-objects-from-pinout-hole.ts
7392
- import { applyToPoint as applyToPoint43 } from "transformation-matrix";
7472
+ import { applyToPoint as applyToPoint44 } from "transformation-matrix";
7393
7473
  var HOLE_COLOR4 = "rgb(50, 50, 50)";
7394
7474
  function createSvgObjectsFromPinoutHole(hole, ctx) {
7395
7475
  const { transform } = ctx;
7396
- const [x, y] = applyToPoint43(transform, [hole.x, hole.y]);
7476
+ const [x, y] = applyToPoint44(transform, [hole.x, hole.y]);
7397
7477
  if (hole.hole_shape === "circle" || hole.hole_shape === "square") {
7398
7478
  const scaledDiameter = hole.hole_diameter * Math.abs(transform.a);
7399
7479
  const radius = scaledDiameter / 2;
@@ -7457,12 +7537,12 @@ function createSvgObjectsFromPinoutHole(hole, ctx) {
7457
7537
  }
7458
7538
 
7459
7539
  // lib/pinout/svg-object-fns/create-svg-objects-from-pinout-plated-hole.ts
7460
- import { applyToPoint as applyToPoint44 } from "transformation-matrix";
7540
+ import { applyToPoint as applyToPoint45 } from "transformation-matrix";
7461
7541
  var PAD_COLOR3 = "rgb(218, 165, 32)";
7462
7542
  var HOLE_COLOR5 = "rgb(40, 40, 40)";
7463
7543
  function createSvgObjectsFromPinoutPlatedHole(hole, ctx) {
7464
7544
  const { transform } = ctx;
7465
- const [x, y] = applyToPoint44(transform, [hole.x, hole.y]);
7545
+ const [x, y] = applyToPoint45(transform, [hole.x, hole.y]);
7466
7546
  if (hole.shape === "pill") {
7467
7547
  const scaledOuterWidth = hole.outer_width * Math.abs(transform.a);
7468
7548
  const scaledOuterHeight = hole.outer_height * Math.abs(transform.a);
@@ -7697,14 +7777,14 @@ function createSvgObjectsFromPinoutPlatedHole(hole, ctx) {
7697
7777
  }
7698
7778
 
7699
7779
  // lib/pinout/svg-object-fns/create-svg-objects-from-pinout-smt-pad.ts
7700
- import { applyToPoint as applyToPoint45 } from "transformation-matrix";
7780
+ import { applyToPoint as applyToPoint46 } from "transformation-matrix";
7701
7781
  var PAD_COLOR4 = "rgb(218, 165, 32)";
7702
7782
  function createSvgObjectsFromPinoutSmtPad(pad, ctx) {
7703
7783
  const { transform } = ctx;
7704
7784
  if (pad.shape === "rect" || pad.shape === "rotated_rect") {
7705
7785
  const width = pad.width * Math.abs(transform.a);
7706
7786
  const height = pad.height * Math.abs(transform.d);
7707
- const [x, y] = applyToPoint45(transform, [pad.x, pad.y]);
7787
+ const [x, y] = applyToPoint46(transform, [pad.x, pad.y]);
7708
7788
  if (pad.shape === "rotated_rect" && pad.ccw_rotation) {
7709
7789
  return [
7710
7790
  {
@@ -7747,7 +7827,7 @@ function createSvgObjectsFromPinoutSmtPad(pad, ctx) {
7747
7827
  const width = pad.width * Math.abs(transform.a);
7748
7828
  const height = pad.height * Math.abs(transform.d);
7749
7829
  const radius = pad.radius * Math.abs(transform.a);
7750
- const [x, y] = applyToPoint45(transform, [pad.x, pad.y]);
7830
+ const [x, y] = applyToPoint46(transform, [pad.x, pad.y]);
7751
7831
  return [
7752
7832
  {
7753
7833
  name: "rect",
@@ -7770,7 +7850,7 @@ function createSvgObjectsFromPinoutSmtPad(pad, ctx) {
7770
7850
  }
7771
7851
  if (pad.shape === "circle") {
7772
7852
  const radius = pad.radius * Math.abs(transform.a);
7773
- const [x, y] = applyToPoint45(transform, [pad.x, pad.y]);
7853
+ const [x, y] = applyToPoint46(transform, [pad.x, pad.y]);
7774
7854
  return [
7775
7855
  {
7776
7856
  name: "circle",
@@ -7790,7 +7870,7 @@ function createSvgObjectsFromPinoutSmtPad(pad, ctx) {
7790
7870
  }
7791
7871
  if (pad.shape === "polygon") {
7792
7872
  const points = (pad.points ?? []).map(
7793
- (point) => applyToPoint45(transform, [point.x, point.y])
7873
+ (point) => applyToPoint46(transform, [point.x, point.y])
7794
7874
  );
7795
7875
  return [
7796
7876
  {
@@ -7811,7 +7891,7 @@ function createSvgObjectsFromPinoutSmtPad(pad, ctx) {
7811
7891
  }
7812
7892
 
7813
7893
  // lib/pinout/svg-object-fns/create-svg-objects-from-pinout-port.ts
7814
- import { applyToPoint as applyToPoint46 } from "transformation-matrix";
7894
+ import { applyToPoint as applyToPoint47 } from "transformation-matrix";
7815
7895
  import { calculateElbow } from "calculate-elbow";
7816
7896
 
7817
7897
  // lib/pinout/svg-object-fns/pinout-label-box.ts
@@ -7888,7 +7968,7 @@ function createSvgObjectsFromPinoutPort(pcb_port, ctx) {
7888
7968
  const label_info = ctx.label_positions.get(pcb_port.pcb_port_id);
7889
7969
  if (!label_info) return [];
7890
7970
  const { text: label, aliases, elbow_end, label_pos, edge } = label_info;
7891
- const [port_x, port_y] = applyToPoint46(ctx.transform, [pcb_port.x, pcb_port.y]);
7971
+ const [port_x, port_y] = applyToPoint47(ctx.transform, [pcb_port.x, pcb_port.y]);
7892
7972
  const start_facing_direction = edge === "left" ? "x-" : edge === "right" ? "x+" : edge === "top" ? "y-" : "y+";
7893
7973
  const end_facing_direction = edge === "left" ? "x+" : edge === "right" ? "x-" : edge === "top" ? "y+" : "y-";
7894
7974
  const elbow_path = calculateElbow(
@@ -8029,7 +8109,7 @@ function createSvgObjectsFromPinoutPort(pcb_port, ctx) {
8029
8109
  }
8030
8110
 
8031
8111
  // lib/pinout/calculate-label-positions.ts
8032
- import { applyToPoint as applyToPoint47 } from "transformation-matrix";
8112
+ import { applyToPoint as applyToPoint48 } from "transformation-matrix";
8033
8113
 
8034
8114
  // lib/pinout/constants.ts
8035
8115
  var LABEL_RECT_HEIGHT_BASE_MM = 1.6;
@@ -8067,7 +8147,7 @@ function calculateVerticalEdgeLabels(edge, pinout_labels, {
8067
8147
  );
8068
8148
  const mapToEdgePort = (pinout_label) => ({
8069
8149
  pcb_port: pinout_label.pcb_port,
8070
- y: applyToPoint47(transform, [
8150
+ y: applyToPoint48(transform, [
8071
8151
  pinout_label.pcb_port.x,
8072
8152
  pinout_label.pcb_port.y
8073
8153
  ])[1],
@@ -8082,7 +8162,7 @@ function calculateVerticalEdgeLabels(edge, pinout_labels, {
8082
8162
  } else {
8083
8163
  edge_ports = pinout_labels.map((pinout_label) => ({
8084
8164
  pcb_port: pinout_label.pcb_port,
8085
- y: applyToPoint47(transform, [
8165
+ y: applyToPoint48(transform, [
8086
8166
  pinout_label.pcb_port.x,
8087
8167
  pinout_label.pcb_port.y
8088
8168
  ])[1],
@@ -8090,7 +8170,7 @@ function calculateVerticalEdgeLabels(edge, pinout_labels, {
8090
8170
  })).sort((a, b) => a.y - b.y);
8091
8171
  }
8092
8172
  if (edge_ports.length === 0) return;
8093
- const board_edge_x = applyToPoint47(transform, [
8173
+ const board_edge_x = applyToPoint48(transform, [
8094
8174
  edge === "left" ? board_bounds.minX : board_bounds.maxX,
8095
8175
  0
8096
8176
  ])[0];
@@ -8512,14 +8592,14 @@ import {
8512
8592
  } from "transformation-matrix";
8513
8593
 
8514
8594
  // lib/sch/draw-schematic-grid.ts
8515
- import { applyToPoint as applyToPoint48 } from "transformation-matrix";
8595
+ import { applyToPoint as applyToPoint49 } from "transformation-matrix";
8516
8596
  function drawSchematicGrid(params) {
8517
8597
  const { minX, minY, maxX, maxY } = params.bounds;
8518
8598
  const cellSize = params.cellSize ?? 1;
8519
8599
  const labelCells = params.labelCells ?? false;
8520
8600
  const gridLines = [];
8521
8601
  const transformPoint = (x, y) => {
8522
- const [transformedX, transformedY] = applyToPoint48(params.transform, [x, y]);
8602
+ const [transformedX, transformedY] = applyToPoint49(params.transform, [x, y]);
8523
8603
  return { x: transformedX, y: transformedY };
8524
8604
  };
8525
8605
  for (let x = Math.floor(minX); x <= Math.ceil(maxX); x += cellSize) {
@@ -8600,15 +8680,15 @@ function drawSchematicGrid(params) {
8600
8680
  }
8601
8681
 
8602
8682
  // lib/sch/draw-schematic-labeled-points.ts
8603
- import { applyToPoint as applyToPoint49 } from "transformation-matrix";
8683
+ import { applyToPoint as applyToPoint50 } from "transformation-matrix";
8604
8684
  function drawSchematicLabeledPoints(params) {
8605
8685
  const { points, transform } = params;
8606
8686
  const labeledPointsGroup = [];
8607
8687
  for (const point of points) {
8608
- const [x1, y1] = applyToPoint49(transform, [point.x - 0.1, point.y - 0.1]);
8609
- const [x2, y2] = applyToPoint49(transform, [point.x + 0.1, point.y + 0.1]);
8610
- const [x3, y3] = applyToPoint49(transform, [point.x - 0.1, point.y + 0.1]);
8611
- const [x4, y4] = applyToPoint49(transform, [point.x + 0.1, point.y - 0.1]);
8688
+ const [x1, y1] = applyToPoint50(transform, [point.x - 0.1, point.y - 0.1]);
8689
+ const [x2, y2] = applyToPoint50(transform, [point.x + 0.1, point.y + 0.1]);
8690
+ const [x3, y3] = applyToPoint50(transform, [point.x - 0.1, point.y + 0.1]);
8691
+ const [x4, y4] = applyToPoint50(transform, [point.x + 0.1, point.y - 0.1]);
8612
8692
  labeledPointsGroup.push({
8613
8693
  name: "path",
8614
8694
  type: "element",
@@ -8619,7 +8699,7 @@ function drawSchematicLabeledPoints(params) {
8619
8699
  "stroke-opacity": "0.7"
8620
8700
  }
8621
8701
  });
8622
- const [labelX, labelY] = applyToPoint49(transform, [
8702
+ const [labelX, labelY] = applyToPoint50(transform, [
8623
8703
  point.x + 0.15,
8624
8704
  point.y - 0.15
8625
8705
  ]);
@@ -9737,7 +9817,7 @@ import { su as su7 } from "@tscircuit/circuit-json-util";
9737
9817
  import { symbols } from "schematic-symbols";
9738
9818
  import "svgson";
9739
9819
  import {
9740
- applyToPoint as applyToPoint51,
9820
+ applyToPoint as applyToPoint52,
9741
9821
  compose as compose10
9742
9822
  } from "transformation-matrix";
9743
9823
 
@@ -9821,13 +9901,13 @@ function pointPairsToMatrix(a1, a2, b1, b2) {
9821
9901
  }
9822
9902
 
9823
9903
  // lib/sch/svg-object-fns/create-svg-error-text.ts
9824
- import { applyToPoint as applyToPoint50 } from "transformation-matrix";
9904
+ import { applyToPoint as applyToPoint51 } from "transformation-matrix";
9825
9905
  var createSvgSchErrorText = ({
9826
9906
  text,
9827
9907
  realCenter,
9828
9908
  realToScreenTransform
9829
9909
  }) => {
9830
- const screenCenter = applyToPoint50(realToScreenTransform, realCenter);
9910
+ const screenCenter = applyToPoint51(realToScreenTransform, realCenter);
9831
9911
  return {
9832
9912
  type: "element",
9833
9913
  name: "text",
@@ -9936,11 +10016,11 @@ var createSvgObjectsFromSchematicComponentWithSymbol = ({
9936
10016
  minY: Math.min(...paths.flatMap((p) => p.points.map((pt) => pt.y))),
9937
10017
  maxY: Math.max(...paths.flatMap((p) => p.points.map((pt) => pt.y)))
9938
10018
  };
9939
- const [screenMinX, screenMinY] = applyToPoint51(
10019
+ const [screenMinX, screenMinY] = applyToPoint52(
9940
10020
  compose10(realToScreenTransform, transformFromSymbolToReal),
9941
10021
  [bounds.minX, bounds.minY]
9942
10022
  );
9943
- const [screenMaxX, screenMaxY] = applyToPoint51(
10023
+ const [screenMaxX, screenMaxY] = applyToPoint52(
9944
10024
  compose10(realToScreenTransform, transformFromSymbolToReal),
9945
10025
  [bounds.maxX, bounds.maxY]
9946
10026
  );
@@ -9969,7 +10049,7 @@ var createSvgObjectsFromSchematicComponentWithSymbol = ({
9969
10049
  name: "path",
9970
10050
  attributes: {
9971
10051
  d: points.map((p, i) => {
9972
- const [x, y] = applyToPoint51(
10052
+ const [x, y] = applyToPoint52(
9973
10053
  compose10(realToScreenTransform, transformFromSymbolToReal),
9974
10054
  [p.x, p.y]
9975
10055
  );
@@ -9985,7 +10065,7 @@ var createSvgObjectsFromSchematicComponentWithSymbol = ({
9985
10065
  });
9986
10066
  }
9987
10067
  for (const text of texts) {
9988
- const screenTextPos = applyToPoint51(
10068
+ const screenTextPos = applyToPoint52(
9989
10069
  compose10(realToScreenTransform, transformFromSymbolToReal),
9990
10070
  text
9991
10071
  );
@@ -10037,7 +10117,7 @@ var createSvgObjectsFromSchematicComponentWithSymbol = ({
10037
10117
  });
10038
10118
  }
10039
10119
  for (const box of boxes) {
10040
- const screenBoxPos = applyToPoint51(
10120
+ const screenBoxPos = applyToPoint52(
10041
10121
  compose10(realToScreenTransform, transformFromSymbolToReal),
10042
10122
  box
10043
10123
  );
@@ -10061,7 +10141,7 @@ var createSvgObjectsFromSchematicComponentWithSymbol = ({
10061
10141
  }
10062
10142
  for (const port of symbol.ports) {
10063
10143
  if (connectedSymbolPorts.has(port)) continue;
10064
- const screenPortPos = applyToPoint51(
10144
+ const screenPortPos = applyToPoint52(
10065
10145
  compose10(realToScreenTransform, transformFromSymbolToReal),
10066
10146
  port
10067
10147
  );
@@ -10081,7 +10161,7 @@ var createSvgObjectsFromSchematicComponentWithSymbol = ({
10081
10161
  });
10082
10162
  }
10083
10163
  for (const circle of circles) {
10084
- const screenCirclePos = applyToPoint51(
10164
+ const screenCirclePos = applyToPoint52(
10085
10165
  compose10(realToScreenTransform, transformFromSymbolToReal),
10086
10166
  circle
10087
10167
  );
@@ -10108,14 +10188,14 @@ var createSvgObjectsFromSchematicComponentWithSymbol = ({
10108
10188
  import { su as su10 } from "@tscircuit/circuit-json-util";
10109
10189
  import "schematic-symbols";
10110
10190
  import "svgson";
10111
- import { applyToPoint as applyToPoint57 } from "transformation-matrix";
10191
+ import { applyToPoint as applyToPoint58 } from "transformation-matrix";
10112
10192
 
10113
10193
  // lib/sch/svg-object-fns/create-svg-objects-from-sch-port-on-box.ts
10114
10194
  import "transformation-matrix";
10115
10195
  import "@tscircuit/circuit-json-util";
10116
10196
 
10117
10197
  // lib/sch/svg-object-fns/create-svg-objects-for-sch-port-box-line.ts
10118
- import { applyToPoint as applyToPoint52 } from "transformation-matrix";
10198
+ import { applyToPoint as applyToPoint53 } from "transformation-matrix";
10119
10199
  import { su as su8 } from "@tscircuit/circuit-json-util";
10120
10200
  var PIN_CIRCLE_RADIUS_MM = 0.02;
10121
10201
  var createArrow = (tip, angle, size, color, strokeWidth) => {
@@ -10168,8 +10248,8 @@ var createSvgObjectsForSchPortBoxLine = ({
10168
10248
  realEdgePos.y += realPinLineLength;
10169
10249
  break;
10170
10250
  }
10171
- const screenSchPortPos = applyToPoint52(transform, schPort.center);
10172
- const screenRealEdgePos = applyToPoint52(transform, realEdgePos);
10251
+ const screenSchPortPos = applyToPoint53(transform, schPort.center);
10252
+ const screenRealEdgePos = applyToPoint53(transform, realEdgePos);
10173
10253
  const isConnected = isSourcePortConnected(circuitJson, schPort.source_port_id);
10174
10254
  const realLineEnd = { ...schPort.center };
10175
10255
  if (!isConnected) {
@@ -10188,7 +10268,7 @@ var createSvgObjectsForSchPortBoxLine = ({
10188
10268
  break;
10189
10269
  }
10190
10270
  }
10191
- const screenLineEnd = applyToPoint52(transform, realLineEnd);
10271
+ const screenLineEnd = applyToPoint53(transform, realLineEnd);
10192
10272
  svgObjects.push({
10193
10273
  name: "line",
10194
10274
  type: "element",
@@ -10309,7 +10389,7 @@ var createSvgObjectsForSchPortBoxLine = ({
10309
10389
  };
10310
10390
 
10311
10391
  // lib/sch/svg-object-fns/create-svg-objects-for-sch-port-pin-number-text.ts
10312
- import { applyToPoint as applyToPoint53 } from "transformation-matrix";
10392
+ import { applyToPoint as applyToPoint54 } from "transformation-matrix";
10313
10393
  var createSvgObjectsForSchPortPinNumberText = (params) => {
10314
10394
  const svgObjects = [];
10315
10395
  const { schPort, schComponent, transform, circuitJson } = params;
@@ -10327,7 +10407,7 @@ var createSvgObjectsForSchPortPinNumberText = (params) => {
10327
10407
  } else {
10328
10408
  realPinNumberPos.y += 0.02;
10329
10409
  }
10330
- const screenPinNumberTextPos = applyToPoint53(transform, realPinNumberPos);
10410
+ const screenPinNumberTextPos = applyToPoint54(transform, realPinNumberPos);
10331
10411
  svgObjects.push({
10332
10412
  name: "text",
10333
10413
  type: "element",
@@ -10357,7 +10437,7 @@ var createSvgObjectsForSchPortPinNumberText = (params) => {
10357
10437
  };
10358
10438
 
10359
10439
  // lib/sch/svg-object-fns/create-svg-objects-for-sch-port-pin-label.ts
10360
- import { applyToPoint as applyToPoint54 } from "transformation-matrix";
10440
+ import { applyToPoint as applyToPoint55 } from "transformation-matrix";
10361
10441
  var LABEL_DIST_FROM_EDGE_MM = 0.1;
10362
10442
  var createSvgObjectsForSchPortPinLabel = (params) => {
10363
10443
  const svgObjects = [];
@@ -10371,7 +10451,7 @@ var createSvgObjectsForSchPortPinLabel = (params) => {
10371
10451
  const realPinEdgeDistance = schPort.distance_from_component_edge ?? 0.4;
10372
10452
  realPinNumberPos.x += vecToEdge.x * (realPinEdgeDistance + LABEL_DIST_FROM_EDGE_MM);
10373
10453
  realPinNumberPos.y += vecToEdge.y * (realPinEdgeDistance + LABEL_DIST_FROM_EDGE_MM);
10374
- const screenPinNumberTextPos = applyToPoint54(transform, realPinNumberPos);
10454
+ const screenPinNumberTextPos = applyToPoint55(transform, realPinNumberPos);
10375
10455
  const label = schPort.display_pin_label ?? schComponent.port_labels?.[`${schPort.pin_number}`];
10376
10456
  if (!label) return [];
10377
10457
  const isNegated = label.startsWith("N_");
@@ -10419,13 +10499,13 @@ var createSvgObjectsFromSchPortOnBox = (params) => {
10419
10499
  };
10420
10500
 
10421
10501
  // lib/sch/svg-object-fns/create-svg-objects-for-sch-text.ts
10422
- import { applyToPoint as applyToPoint56 } from "transformation-matrix";
10502
+ import { applyToPoint as applyToPoint57 } from "transformation-matrix";
10423
10503
  var createSvgSchText = ({
10424
10504
  elm,
10425
10505
  transform,
10426
10506
  colorMap: colorMap2
10427
10507
  }) => {
10428
- const center = applyToPoint56(transform, elm.position);
10508
+ const center = applyToPoint57(transform, elm.position);
10429
10509
  const textAnchorMap = {
10430
10510
  center: "middle",
10431
10511
  center_right: "end",
@@ -10509,11 +10589,11 @@ var createSvgObjectsFromSchematicComponentWithBox = ({
10509
10589
  colorMap: colorMap2
10510
10590
  }) => {
10511
10591
  const svgObjects = [];
10512
- const componentScreenTopLeft = applyToPoint57(transform, {
10592
+ const componentScreenTopLeft = applyToPoint58(transform, {
10513
10593
  x: schComponent.center.x - schComponent.size.width / 2,
10514
10594
  y: schComponent.center.y + schComponent.size.height / 2
10515
10595
  });
10516
- const componentScreenBottomRight = applyToPoint57(transform, {
10596
+ const componentScreenBottomRight = applyToPoint58(transform, {
10517
10597
  x: schComponent.center.x + schComponent.size.width / 2,
10518
10598
  y: schComponent.center.y - schComponent.size.height / 2
10519
10599
  });
@@ -10599,13 +10679,13 @@ function createSvgObjectsFromSchematicComponent(params) {
10599
10679
  }
10600
10680
 
10601
10681
  // lib/sch/svg-object-fns/create-svg-objects-from-sch-voltage-probe.ts
10602
- import { applyToPoint as applyToPoint58 } from "transformation-matrix";
10682
+ import { applyToPoint as applyToPoint59 } from "transformation-matrix";
10603
10683
  function createSvgObjectsFromSchVoltageProbe({
10604
10684
  probe,
10605
10685
  transform,
10606
10686
  colorMap: colorMap2
10607
10687
  }) {
10608
- const [screenX, screenY] = applyToPoint58(transform, [
10688
+ const [screenX, screenY] = applyToPoint59(transform, [
10609
10689
  probe.position.x,
10610
10690
  probe.position.y
10611
10691
  ]);
@@ -10779,17 +10859,17 @@ function createSvgObjectsFromSchVoltageProbe({
10779
10859
  }
10780
10860
 
10781
10861
  // lib/sch/svg-object-fns/create-svg-objects-from-sch-debug-object.ts
10782
- import { applyToPoint as applyToPoint59 } from "transformation-matrix";
10862
+ import { applyToPoint as applyToPoint60 } from "transformation-matrix";
10783
10863
  function createSvgObjectsFromSchDebugObject({
10784
10864
  debugObject,
10785
10865
  transform
10786
10866
  }) {
10787
10867
  if (debugObject.shape === "rect") {
10788
- let [screenLeft, screenTop] = applyToPoint59(transform, [
10868
+ let [screenLeft, screenTop] = applyToPoint60(transform, [
10789
10869
  debugObject.center.x - debugObject.size.width / 2,
10790
10870
  debugObject.center.y - debugObject.size.height / 2
10791
10871
  ]);
10792
- let [screenRight, screenBottom] = applyToPoint59(transform, [
10872
+ let [screenRight, screenBottom] = applyToPoint60(transform, [
10793
10873
  debugObject.center.x + debugObject.size.width / 2,
10794
10874
  debugObject.center.y + debugObject.size.height / 2
10795
10875
  ]);
@@ -10799,7 +10879,7 @@ function createSvgObjectsFromSchDebugObject({
10799
10879
  ];
10800
10880
  const width = Math.abs(screenRight - screenLeft);
10801
10881
  const height = Math.abs(screenBottom - screenTop);
10802
- const [screenCenterX, screenCenterY] = applyToPoint59(transform, [
10882
+ const [screenCenterX, screenCenterY] = applyToPoint60(transform, [
10803
10883
  debugObject.center.x,
10804
10884
  debugObject.center.y
10805
10885
  ]);
@@ -10845,11 +10925,11 @@ function createSvgObjectsFromSchDebugObject({
10845
10925
  ];
10846
10926
  }
10847
10927
  if (debugObject.shape === "line") {
10848
- const [screenStartX, screenStartY] = applyToPoint59(transform, [
10928
+ const [screenStartX, screenStartY] = applyToPoint60(transform, [
10849
10929
  debugObject.start.x,
10850
10930
  debugObject.start.y
10851
10931
  ]);
10852
- const [screenEndX, screenEndY] = applyToPoint59(transform, [
10932
+ const [screenEndX, screenEndY] = applyToPoint60(transform, [
10853
10933
  debugObject.end.x,
10854
10934
  debugObject.end.y
10855
10935
  ]);
@@ -10899,7 +10979,7 @@ function createSvgObjectsFromSchDebugObject({
10899
10979
  }
10900
10980
 
10901
10981
  // lib/sch/svg-object-fns/create-svg-objects-from-sch-trace.ts
10902
- import { applyToPoint as applyToPoint60 } from "transformation-matrix";
10982
+ import { applyToPoint as applyToPoint61 } from "transformation-matrix";
10903
10983
  function createSchematicTrace({
10904
10984
  trace,
10905
10985
  transform,
@@ -10913,11 +10993,11 @@ function createSchematicTrace({
10913
10993
  for (let edgeIndex = 0; edgeIndex < edges.length; edgeIndex++) {
10914
10994
  const edge = edges[edgeIndex];
10915
10995
  if (edge.is_crossing) continue;
10916
- const [screenFromX, screenFromY] = applyToPoint60(transform, [
10996
+ const [screenFromX, screenFromY] = applyToPoint61(transform, [
10917
10997
  edge.from.x,
10918
10998
  edge.from.y
10919
10999
  ]);
10920
- const [screenToX, screenToY] = applyToPoint60(transform, [
11000
+ const [screenToX, screenToY] = applyToPoint61(transform, [
10921
11001
  edge.to.x,
10922
11002
  edge.to.y
10923
11003
  ]);
@@ -10961,11 +11041,11 @@ function createSchematicTrace({
10961
11041
  }
10962
11042
  for (const edge of edges) {
10963
11043
  if (!edge.is_crossing) continue;
10964
- const [screenFromX, screenFromY] = applyToPoint60(transform, [
11044
+ const [screenFromX, screenFromY] = applyToPoint61(transform, [
10965
11045
  edge.from.x,
10966
11046
  edge.from.y
10967
11047
  ]);
10968
- const [screenToX, screenToY] = applyToPoint60(transform, [
11048
+ const [screenToX, screenToY] = applyToPoint61(transform, [
10969
11049
  edge.to.x,
10970
11050
  edge.to.y
10971
11051
  ]);
@@ -11009,7 +11089,7 @@ function createSchematicTrace({
11009
11089
  }
11010
11090
  if (trace.junctions) {
11011
11091
  for (const junction of trace.junctions) {
11012
- const [screenX, screenY] = applyToPoint60(transform, [
11092
+ const [screenX, screenY] = applyToPoint61(transform, [
11013
11093
  junction.x,
11014
11094
  junction.y
11015
11095
  ]);
@@ -11064,7 +11144,7 @@ function createSchematicTrace({
11064
11144
 
11065
11145
  // lib/sch/svg-object-fns/create-svg-objects-for-sch-net-label.ts
11066
11146
  import {
11067
- applyToPoint as applyToPoint62,
11147
+ applyToPoint as applyToPoint63,
11068
11148
  compose as compose12,
11069
11149
  rotate as rotate7,
11070
11150
  scale as scale7,
@@ -11073,7 +11153,7 @@ import {
11073
11153
 
11074
11154
  // lib/sch/svg-object-fns/create-svg-objects-for-sch-net-label-with-symbol.ts
11075
11155
  import {
11076
- applyToPoint as applyToPoint61,
11156
+ applyToPoint as applyToPoint62,
11077
11157
  compose as compose11,
11078
11158
  rotate as rotate6,
11079
11159
  scale as scale6,
@@ -11148,7 +11228,7 @@ var createSvgObjectsForSchNetLabelWithSymbol = ({
11148
11228
  x: symbolBounds.minX,
11149
11229
  y: (symbolBounds.minY + symbolBounds.maxY) / 2
11150
11230
  };
11151
- const rotatedSymbolEnd = applyToPoint61(rotationMatrix, symbolEndPoint);
11231
+ const rotatedSymbolEnd = applyToPoint62(rotationMatrix, symbolEndPoint);
11152
11232
  const symbolToRealTransform = compose11(
11153
11233
  translate11(
11154
11234
  realAnchorPosition.x - rotatedSymbolEnd.x,
@@ -11158,11 +11238,11 @@ var createSvgObjectsForSchNetLabelWithSymbol = ({
11158
11238
  scale6(1)
11159
11239
  // Use full symbol size
11160
11240
  );
11161
- const [screenMinX, screenMinY] = applyToPoint61(
11241
+ const [screenMinX, screenMinY] = applyToPoint62(
11162
11242
  compose11(realToScreenTransform, symbolToRealTransform),
11163
11243
  [bounds.minX, bounds.minY]
11164
11244
  );
11165
- const [screenMaxX, screenMaxY] = applyToPoint61(
11245
+ const [screenMaxX, screenMaxY] = applyToPoint62(
11166
11246
  compose11(realToScreenTransform, symbolToRealTransform),
11167
11247
  [bounds.maxX, bounds.maxY]
11168
11248
  );
@@ -11186,7 +11266,7 @@ var createSvgObjectsForSchNetLabelWithSymbol = ({
11186
11266
  });
11187
11267
  for (const path of symbolPaths) {
11188
11268
  const symbolPath = path.points.map((p, i) => {
11189
- const [x, y] = applyToPoint61(
11269
+ const [x, y] = applyToPoint62(
11190
11270
  compose11(realToScreenTransform, symbolToRealTransform),
11191
11271
  [p.x, p.y]
11192
11272
  );
@@ -11207,7 +11287,7 @@ var createSvgObjectsForSchNetLabelWithSymbol = ({
11207
11287
  });
11208
11288
  }
11209
11289
  for (const text of symbolTexts) {
11210
- const screenTextPos = applyToPoint61(
11290
+ const screenTextPos = applyToPoint62(
11211
11291
  compose11(realToScreenTransform, symbolToRealTransform),
11212
11292
  text
11213
11293
  );
@@ -11249,7 +11329,7 @@ var createSvgObjectsForSchNetLabelWithSymbol = ({
11249
11329
  });
11250
11330
  }
11251
11331
  for (const box of symbolBoxes) {
11252
- const screenBoxPos = applyToPoint61(
11332
+ const screenBoxPos = applyToPoint62(
11253
11333
  compose11(realToScreenTransform, symbolToRealTransform),
11254
11334
  box
11255
11335
  );
@@ -11272,7 +11352,7 @@ var createSvgObjectsForSchNetLabelWithSymbol = ({
11272
11352
  });
11273
11353
  }
11274
11354
  for (const circle of symbolCircles) {
11275
- const screenCirclePos = applyToPoint61(
11355
+ const screenCirclePos = applyToPoint62(
11276
11356
  compose11(realToScreenTransform, symbolToRealTransform),
11277
11357
  circle
11278
11358
  );
@@ -11317,14 +11397,14 @@ var createSvgObjectsForSchNetLabel = ({
11317
11397
  const fontSizePx = getSchScreenFontSize(realToScreenTransform, "net_label");
11318
11398
  const fontSizeMm = getSchMmFontSize("net_label");
11319
11399
  const textWidthFSR = estimateTextWidth(labelText || "");
11320
- const screenCenter = applyToPoint62(realToScreenTransform, schNetLabel.center);
11400
+ const screenCenter = applyToPoint63(realToScreenTransform, schNetLabel.center);
11321
11401
  const realTextGrowthVec = getUnitVectorFromOutsideToEdge(
11322
11402
  schNetLabel.anchor_side
11323
11403
  );
11324
11404
  const screenTextGrowthVec = { ...realTextGrowthVec };
11325
11405
  screenTextGrowthVec.y *= -1;
11326
11406
  const fullWidthFsr = textWidthFSR + ARROW_POINT_WIDTH_FSR * 2 + END_PADDING_EXTRA_PER_CHARACTER_FSR * labelText.length + END_PADDING_FSR;
11327
- const screenAnchorPosition = schNetLabel.anchor_position ? applyToPoint62(realToScreenTransform, schNetLabel.anchor_position) : {
11407
+ const screenAnchorPosition = schNetLabel.anchor_position ? applyToPoint63(realToScreenTransform, schNetLabel.anchor_position) : {
11328
11408
  x: screenCenter.x - screenTextGrowthVec.x * fullWidthFsr * fontSizePx / 2,
11329
11409
  y: screenCenter.y - screenTextGrowthVec.y * fullWidthFsr * fontSizePx / 2
11330
11410
  };
@@ -11365,7 +11445,7 @@ var createSvgObjectsForSchNetLabel = ({
11365
11445
  y: -0.6
11366
11446
  }
11367
11447
  ].map(
11368
- (fontRelativePoint) => applyToPoint62(
11448
+ (fontRelativePoint) => applyToPoint63(
11369
11449
  compose12(
11370
11450
  realToScreenTransform,
11371
11451
  translate12(realAnchorPosition.x, realAnchorPosition.y),
@@ -11442,17 +11522,17 @@ var createSvgObjectsForSchNetLabel = ({
11442
11522
  };
11443
11523
 
11444
11524
  // lib/sch/svg-object-fns/create-svg-objects-from-sch-box.ts
11445
- import { applyToPoint as applyToPoint63 } from "transformation-matrix";
11525
+ import { applyToPoint as applyToPoint64 } from "transformation-matrix";
11446
11526
  var createSvgObjectsFromSchematicBox = ({
11447
11527
  schematicBox,
11448
11528
  transform,
11449
11529
  colorMap: colorMap2
11450
11530
  }) => {
11451
- const topLeft = applyToPoint63(transform, {
11531
+ const topLeft = applyToPoint64(transform, {
11452
11532
  x: schematicBox.x,
11453
11533
  y: schematicBox.y
11454
11534
  });
11455
- const bottomRight = applyToPoint63(transform, {
11535
+ const bottomRight = applyToPoint64(transform, {
11456
11536
  x: schematicBox.x + schematicBox.width,
11457
11537
  y: schematicBox.y + schematicBox.height
11458
11538
  });
@@ -11488,7 +11568,7 @@ var createSvgObjectsFromSchematicBox = ({
11488
11568
  };
11489
11569
 
11490
11570
  // lib/sch/svg-object-fns/create-svg-objects-from-sch-table.ts
11491
- import { applyToPoint as applyToPoint64 } from "transformation-matrix";
11571
+ import { applyToPoint as applyToPoint65 } from "transformation-matrix";
11492
11572
  var createSvgObjectsFromSchematicTable = ({
11493
11573
  schematicTable,
11494
11574
  transform,
@@ -11521,11 +11601,11 @@ var createSvgObjectsFromSchematicTable = ({
11521
11601
  const svgObjects = [];
11522
11602
  const borderStrokeWidth = border_width * Math.abs(transform.a);
11523
11603
  const gridStrokeWidth = getSchStrokeSize(transform);
11524
- const [screenTopLeftX, screenTopLeftY] = applyToPoint64(transform, [
11604
+ const [screenTopLeftX, screenTopLeftY] = applyToPoint65(transform, [
11525
11605
  topLeftX,
11526
11606
  topLeftY
11527
11607
  ]);
11528
- const [screenBottomRightX, screenBottomRightY] = applyToPoint64(transform, [
11608
+ const [screenBottomRightX, screenBottomRightY] = applyToPoint65(transform, [
11529
11609
  topLeftX + totalWidth,
11530
11610
  topLeftY - totalHeight
11531
11611
  ]);
@@ -11557,8 +11637,8 @@ var createSvgObjectsFromSchematicTable = ({
11557
11637
  (cell) => cell.start_column_index <= i && cell.end_column_index > i && cell.start_row_index <= j && cell.end_row_index >= j
11558
11638
  );
11559
11639
  if (!isMerged) {
11560
- const start = applyToPoint64(transform, { x: currentX, y: segmentStartY });
11561
- const end = applyToPoint64(transform, { x: currentX, y: segmentEndY });
11640
+ const start = applyToPoint65(transform, { x: currentX, y: segmentStartY });
11641
+ const end = applyToPoint65(transform, { x: currentX, y: segmentEndY });
11562
11642
  svgObjects.push({
11563
11643
  name: "line",
11564
11644
  type: "element",
@@ -11587,11 +11667,11 @@ var createSvgObjectsFromSchematicTable = ({
11587
11667
  (cell) => cell.start_row_index <= i && cell.end_row_index > i && cell.start_column_index <= j && cell.end_column_index >= j
11588
11668
  );
11589
11669
  if (!isMerged) {
11590
- const start = applyToPoint64(transform, {
11670
+ const start = applyToPoint65(transform, {
11591
11671
  x: segmentStartX,
11592
11672
  y: currentY
11593
11673
  });
11594
- const end = applyToPoint64(transform, { x: segmentEndX, y: currentY });
11674
+ const end = applyToPoint65(transform, { x: segmentEndX, y: currentY });
11595
11675
  svgObjects.push({
11596
11676
  name: "line",
11597
11677
  type: "element",
@@ -11633,7 +11713,7 @@ var createSvgObjectsFromSchematicTable = ({
11633
11713
  } else if (vertical_align === "bottom") {
11634
11714
  realTextAnchorPos.y = cellTopLeftY - cellHeight + cell_padding;
11635
11715
  }
11636
- const screenTextAnchorPos = applyToPoint64(transform, realTextAnchorPos);
11716
+ const screenTextAnchorPos = applyToPoint65(transform, realTextAnchorPos);
11637
11717
  const fontSize = getSchScreenFontSize(
11638
11718
  transform,
11639
11719
  "reference_designator",
@@ -11689,13 +11769,13 @@ var createSvgObjectsFromSchematicTable = ({
11689
11769
 
11690
11770
  // lib/sch/svg-object-fns/create-svg-objects-for-sch-port-hover.ts
11691
11771
  import { su as su11 } from "@tscircuit/circuit-json-util";
11692
- import { applyToPoint as applyToPoint65 } from "transformation-matrix";
11772
+ import { applyToPoint as applyToPoint66 } from "transformation-matrix";
11693
11773
  var PIN_CIRCLE_RADIUS_MM2 = 0.02;
11694
11774
  var createSvgObjectsForSchPortHover = ({
11695
11775
  schPort,
11696
11776
  transform
11697
11777
  }) => {
11698
- const screenSchPortPos = applyToPoint65(transform, schPort.center);
11778
+ const screenSchPortPos = applyToPoint66(transform, schPort.center);
11699
11779
  const pinRadiusPx = Math.abs(transform.a) * PIN_CIRCLE_RADIUS_MM2 * 2;
11700
11780
  return [
11701
11781
  {
@@ -11740,14 +11820,14 @@ var createSvgObjectsForSchComponentPortHovers = ({
11740
11820
  };
11741
11821
 
11742
11822
  // lib/sch/svg-object-fns/create-svg-objects-from-sch-line.ts
11743
- import { applyToPoint as applyToPoint66 } from "transformation-matrix";
11823
+ import { applyToPoint as applyToPoint67 } from "transformation-matrix";
11744
11824
  function createSvgObjectsFromSchematicLine({
11745
11825
  schLine,
11746
11826
  transform,
11747
11827
  colorMap: colorMap2
11748
11828
  }) {
11749
- const p1 = applyToPoint66(transform, { x: schLine.x1, y: schLine.y1 });
11750
- const p2 = applyToPoint66(transform, { x: schLine.x2, y: schLine.y2 });
11829
+ const p1 = applyToPoint67(transform, { x: schLine.x1, y: schLine.y1 });
11830
+ const p2 = applyToPoint67(transform, { x: schLine.x2, y: schLine.y2 });
11751
11831
  const strokeWidth = schLine.stroke_width ?? 0.02;
11752
11832
  const transformedStrokeWidth = Math.abs(transform.a) * strokeWidth;
11753
11833
  return [
@@ -11776,13 +11856,13 @@ function createSvgObjectsFromSchematicLine({
11776
11856
  }
11777
11857
 
11778
11858
  // lib/sch/svg-object-fns/create-svg-objects-from-sch-circle.ts
11779
- import { applyToPoint as applyToPoint67 } from "transformation-matrix";
11859
+ import { applyToPoint as applyToPoint68 } from "transformation-matrix";
11780
11860
  function createSvgObjectsFromSchematicCircle({
11781
11861
  schCircle,
11782
11862
  transform,
11783
11863
  colorMap: colorMap2
11784
11864
  }) {
11785
- const center = applyToPoint67(transform, schCircle.center);
11865
+ const center = applyToPoint68(transform, schCircle.center);
11786
11866
  const transformedRadius = Math.abs(transform.a) * schCircle.radius;
11787
11867
  const strokeWidth = schCircle.stroke_width ?? 0.02;
11788
11868
  const transformedStrokeWidth = Math.abs(transform.a) * strokeWidth;
@@ -11812,13 +11892,13 @@ function createSvgObjectsFromSchematicCircle({
11812
11892
  }
11813
11893
 
11814
11894
  // lib/sch/svg-object-fns/create-svg-objects-from-sch-rect.ts
11815
- import { applyToPoint as applyToPoint68 } from "transformation-matrix";
11895
+ import { applyToPoint as applyToPoint69 } from "transformation-matrix";
11816
11896
  function createSvgObjectsFromSchematicRect({
11817
11897
  schRect,
11818
11898
  transform,
11819
11899
  colorMap: colorMap2
11820
11900
  }) {
11821
- const center = applyToPoint68(transform, schRect.center);
11901
+ const center = applyToPoint69(transform, schRect.center);
11822
11902
  const transformedWidth = Math.abs(transform.a) * schRect.width;
11823
11903
  const transformedHeight = Math.abs(transform.d) * schRect.height;
11824
11904
  const strokeWidth = schRect.stroke_width ?? 0.02;
@@ -11854,13 +11934,13 @@ function createSvgObjectsFromSchematicRect({
11854
11934
  }
11855
11935
 
11856
11936
  // lib/sch/svg-object-fns/create-svg-objects-from-sch-arc.ts
11857
- import { applyToPoint as applyToPoint69 } from "transformation-matrix";
11937
+ import { applyToPoint as applyToPoint70 } from "transformation-matrix";
11858
11938
  function createSvgObjectsFromSchematicArc({
11859
11939
  schArc,
11860
11940
  transform,
11861
11941
  colorMap: colorMap2
11862
11942
  }) {
11863
- const center = applyToPoint69(transform, schArc.center);
11943
+ const center = applyToPoint70(transform, schArc.center);
11864
11944
  const transformedRadius = Math.abs(transform.a) * schArc.radius;
11865
11945
  const strokeWidth = schArc.stroke_width ?? 0.02;
11866
11946
  const transformedStrokeWidth = Math.abs(transform.a) * strokeWidth;
@@ -12980,18 +13060,18 @@ function formatNumber2(value) {
12980
13060
  import { distance as distance3 } from "circuit-json";
12981
13061
  import { stringify as stringify7 } from "svgson";
12982
13062
  import {
12983
- applyToPoint as applyToPoint72,
13063
+ applyToPoint as applyToPoint73,
12984
13064
  compose as compose15,
12985
13065
  scale as scale9,
12986
13066
  translate as translate15
12987
13067
  } from "transformation-matrix";
12988
13068
 
12989
13069
  // lib/pcb/svg-object-fns/convert-circuit-json-to-solder-paste-mask.ts
12990
- import { applyToPoint as applyToPoint71 } from "transformation-matrix";
13070
+ import { applyToPoint as applyToPoint72 } from "transformation-matrix";
12991
13071
  function createSvgObjectsFromSolderPaste(solderPaste, ctx) {
12992
13072
  const { transform, layer: layerFilter } = ctx;
12993
13073
  if (layerFilter && solderPaste.layer !== layerFilter) return [];
12994
- const [x, y] = applyToPoint71(transform, [solderPaste.x, solderPaste.y]);
13074
+ const [x, y] = applyToPoint72(transform, [solderPaste.x, solderPaste.y]);
12995
13075
  if (solderPaste.shape === "rect" || solderPaste.shape === "rotated_rect") {
12996
13076
  const width = solderPaste.width * Math.abs(transform.a);
12997
13077
  const height = solderPaste.height * Math.abs(transform.d);
@@ -13217,8 +13297,8 @@ function createSvgObjects4({ elm, ctx }) {
13217
13297
  }
13218
13298
  }
13219
13299
  function createSvgObjectFromPcbBoundary2(transform, minX, minY, maxX, maxY) {
13220
- const [x1, y1] = applyToPoint72(transform, [minX, minY]);
13221
- const [x2, y2] = applyToPoint72(transform, [maxX, maxY]);
13300
+ const [x1, y1] = applyToPoint73(transform, [minX, minY]);
13301
+ const [x2, y2] = applyToPoint73(transform, [maxX, maxY]);
13222
13302
  const width = Math.abs(x2 - x1);
13223
13303
  const height = Math.abs(y2 - y1);
13224
13304
  const x = Math.min(x1, x2);