@tscircuit/core 0.0.2153 → 0.0.2154

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (2) hide show
  1. package/dist/index.js +22 -20
  2. package/package.json +1 -1
package/dist/index.js CHANGED
@@ -119162,7 +119162,7 @@ var RoutingPhasePreparationError = class extends Error {
119162
119162
  var package_default = {
119163
119163
  name: "@tscircuit/core",
119164
119164
  type: "module",
119165
- version: "0.0.2152",
119165
+ version: "0.0.2153",
119166
119166
  types: "dist/index.d.ts",
119167
119167
  main: "dist/index.js",
119168
119168
  module: "dist/index.js",
@@ -119929,6 +119929,7 @@ function getAccumulatedPcbTracesWithStageOutputReplacements({
119929
119929
  // lib/components/primitive-components/Group/get-source-trace-id-for-routed-trace.ts
119930
119930
  import { distance as distance18, pointToSegmentDistance as pointToSegmentDistance4 } from "@tscircuit/math-utils";
119931
119931
  import { ConnectivityMap as ConnectivityMap6 } from "circuit-json-to-connectivity-map";
119932
+ import { applyToPoint as applyToPoint39, rotateDEG as rotateDEG4 } from "transformation-matrix";
119932
119933
  var POINT_EPSILON3 = 1e-6;
119933
119934
  function isPointOnWireSegment({
119934
119935
  point: point6,
@@ -119946,7 +119947,8 @@ function isPointInSmtPad({
119946
119947
  traceWidth = 0
119947
119948
  }) {
119948
119949
  if (pad.shape === "rect" || pad.shape === "rotated_rect") {
119949
- return Math.abs(point6.x - pad.x) <= pad.width / 2 + traceWidth / 2 && Math.abs(point6.y - pad.y) <= pad.height / 2 + traceWidth / 2;
119950
+ const unrotatedPoint = pad.shape === "rotated_rect" ? applyToPoint39(rotateDEG4(-pad.ccw_rotation, pad.x, pad.y), point6) : point6;
119951
+ return Math.abs(unrotatedPoint.x - pad.x) <= pad.width / 2 + traceWidth / 2 && Math.abs(unrotatedPoint.y - pad.y) <= pad.height / 2 + traceWidth / 2;
119950
119952
  }
119951
119953
  if (pad.shape === "circle") {
119952
119954
  return distance18(point6, pad) <= pad.radius + traceWidth / 2;
@@ -122571,7 +122573,7 @@ import { symbols as symbols7 } from "schematic-symbols";
122571
122573
  import { ledProps, resolveManufacturerPartNumber as resolveManufacturerPartNumber9 } from "@tscircuit/props";
122572
122574
 
122573
122575
  // lib/components/normal-components/Led_addPolarityFabricationSymbol.ts
122574
- import { applyToPoint as applyToPoint39, compose as compose17, rotate as rotate7, translate as translate17 } from "transformation-matrix";
122576
+ import { applyToPoint as applyToPoint40, compose as compose17, rotate as rotate7, translate as translate17 } from "transformation-matrix";
122575
122577
  var generatedNotes = /* @__PURE__ */ new WeakMap();
122576
122578
  var getPolarity2 = (port) => {
122577
122579
  const hints = [port.name, ...port.port_hints ?? []].map(
@@ -122616,7 +122618,7 @@ var Led_addPolarityFabricationSymbol = (led) => {
122616
122618
  translate17((a2.x + k2.x) / 2, (a2.y + k2.y) / 2),
122617
122619
  rotate7(angle)
122618
122620
  );
122619
- const point6 = (x2, y2) => applyToPoint39(frame, { x: x2, y: y2 });
122621
+ const point6 = (x2, y2) => applyToPoint40(frame, { x: x2, y: y2 });
122620
122622
  const common = {
122621
122623
  pcb_component_id: pcb.pcb_component_id,
122622
122624
  subcircuit_id: led.getSubcircuit()?.subcircuit_id ?? void 0,
@@ -127891,10 +127893,10 @@ var AutoroutingPhase = class extends PrimitiveComponent2 {
127891
127893
 
127892
127894
  // lib/components/primitive-components/FabricationNoteDimension.ts
127893
127895
  import { fabricationNoteDimensionProps } from "@tscircuit/props";
127894
- import { applyToPoint as applyToPoint41 } from "transformation-matrix";
127896
+ import { applyToPoint as applyToPoint42 } from "transformation-matrix";
127895
127897
 
127896
127898
  // lib/utils/pcb/resolve-pcb-dimension-offset-direction.ts
127897
- import { applyToPoint as applyToPoint40 } from "transformation-matrix";
127899
+ import { applyToPoint as applyToPoint41 } from "transformation-matrix";
127898
127900
  var resolvePcbDimensionOffsetDirection = ({
127899
127901
  from,
127900
127902
  offset,
@@ -127903,7 +127905,7 @@ var resolvePcbDimensionOffsetDirection = ({
127903
127905
  transform
127904
127906
  }) => {
127905
127907
  if (offsetDirection) {
127906
- return applyToPoint40({ ...transform, e: 0, f: 0 }, offsetDirection);
127908
+ return applyToPoint41({ ...transform, e: 0, f: 0 }, offsetDirection);
127907
127909
  }
127908
127910
  const dx2 = to.x - from.x;
127909
127911
  const dy2 = to.y - from.y;
@@ -127931,13 +127933,13 @@ var FabricationNoteDimension = class extends PrimitiveComponent2 {
127931
127933
  this.renderError(
127932
127934
  `FabricationNoteDimension could not find selector "${input}"`
127933
127935
  );
127934
- return applyToPoint41(transform, { x: 0, y: 0 });
127936
+ return applyToPoint42(transform, { x: 0, y: 0 });
127935
127937
  }
127936
127938
  return target._getGlobalPcbPositionBeforeLayout();
127937
127939
  }
127938
127940
  const numericX = typeof input.x === "string" ? parseFloat(input.x) : input.x;
127939
127941
  const numericY = typeof input.y === "string" ? parseFloat(input.y) : input.y;
127940
- return applyToPoint41(transform, { x: numericX, y: numericY });
127942
+ return applyToPoint42(transform, { x: numericX, y: numericY });
127941
127943
  }
127942
127944
  doInitialPcbPrimitiveRender() {
127943
127945
  if (this.root?.pcbDisabled) return;
@@ -128041,7 +128043,7 @@ var FabricationNoteDimension = class extends PrimitiveComponent2 {
128041
128043
 
128042
128044
  // lib/components/primitive-components/PcbNoteDimension.ts
128043
128045
  import { pcbNoteDimensionProps } from "@tscircuit/props";
128044
- import { applyToPoint as applyToPoint42 } from "transformation-matrix";
128046
+ import { applyToPoint as applyToPoint43 } from "transformation-matrix";
128045
128047
  var PcbNoteDimension = class extends PrimitiveComponent2 {
128046
128048
  pcb_note_dimension_id = null;
128047
128049
  isPcbPrimitive = true;
@@ -128058,7 +128060,7 @@ var PcbNoteDimension = class extends PrimitiveComponent2 {
128058
128060
  );
128059
128061
  if (!target) {
128060
128062
  this.renderError(`PcbNoteDimension could not find selector "${input}"`);
128061
- return applyToPoint42(transform, { x: 0, y: 0 });
128063
+ return applyToPoint43(transform, { x: 0, y: 0 });
128062
128064
  }
128063
128065
  const targetPcbComponentId = target.pcb_component_id;
128064
128066
  const root = this.root;
@@ -128075,7 +128077,7 @@ var PcbNoteDimension = class extends PrimitiveComponent2 {
128075
128077
  }
128076
128078
  const numericX = typeof input.x === "string" ? parseFloat(input.x) : input.x;
128077
128079
  const numericY = typeof input.y === "string" ? parseFloat(input.y) : input.y;
128078
- return applyToPoint42(transform, { x: numericX, y: numericY });
128080
+ return applyToPoint43(transform, { x: numericX, y: numericY });
128079
128081
  }
128080
128082
  doInitialPcbPrimitiveRender() {
128081
128083
  if (this.root?.pcbDisabled) return;
@@ -130853,7 +130855,7 @@ import {
130853
130855
  getTransformedSvgPathRoutes,
130854
130856
  loadImageSource
130855
130857
  } from "@tscircuit/image-utils";
130856
- import { applyToPoint as applyToPoint43 } from "transformation-matrix";
130858
+ import { applyToPoint as applyToPoint44 } from "transformation-matrix";
130857
130859
  var SilkscreenGraphic = class extends PrimitiveComponent2 {
130858
130860
  pcb_silkscreen_graphic_id = null;
130859
130861
  pcb_silkscreen_graphic_ids = [];
@@ -130955,7 +130957,7 @@ var SilkscreenGraphic = class extends PrimitiveComponent2 {
130955
130957
  { x: halfWidth, y: -halfHeight },
130956
130958
  { x: -halfWidth, y: -halfHeight }
130957
130959
  ]).map(
130958
- (point6) => applyToPoint43(transform, point6)
130960
+ (point6) => applyToPoint44(transform, point6)
130959
130961
  )
130960
130962
  },
130961
130963
  inner_rings: []
@@ -134608,7 +134610,7 @@ var SpiceModel = class extends PrimitiveComponent2 {
134608
134610
 
134609
134611
  // lib/components/primitive-components/PcbBend.ts
134610
134612
  import { pcbBendProps } from "@tscircuit/props";
134611
- import { applyToPoint as applyToPoint44 } from "transformation-matrix";
134613
+ import { applyToPoint as applyToPoint45 } from "transformation-matrix";
134612
134614
 
134613
134615
  // lib/components/primitive-components/getPcbFlexBoardTransform.ts
134614
134616
  import { compose as compose20, translate as translate20 } from "transformation-matrix";
@@ -134642,8 +134644,8 @@ var PcbBend = class extends PrimitiveComponent2 {
134642
134644
  pcb_group_id: this.getGroup()?.pcb_group_id ?? void 0,
134643
134645
  subcircuit_id: this.getSubcircuit().subcircuit_id ?? void 0,
134644
134646
  name: props.name,
134645
- start: applyToPoint44(transform, { x: props.x1, y: props.y1 }),
134646
- end: applyToPoint44(transform, { x: props.x2, y: props.y2 }),
134647
+ start: applyToPoint45(transform, { x: props.x1, y: props.y1 }),
134648
+ end: applyToPoint45(transform, { x: props.x2, y: props.y2 }),
134647
134649
  bend_angle: props.bendAngle,
134648
134650
  bend_radius: props.bendRadius,
134649
134651
  bend_side: props.bendSide
@@ -134679,7 +134681,7 @@ var PcbBend = class extends PrimitiveComponent2 {
134679
134681
 
134680
134682
  // lib/components/primitive-components/PcbStiffener.ts
134681
134683
  import { pcbStiffenerProps } from "@tscircuit/props";
134682
- import { applyToPoint as applyToPoint45, decomposeTSR as decomposeTSR12 } from "transformation-matrix";
134684
+ import { applyToPoint as applyToPoint46, decomposeTSR as decomposeTSR12 } from "transformation-matrix";
134683
134685
  var PcbStiffener = class extends PrimitiveComponent2 {
134684
134686
  pcb_stiffener_id = null;
134685
134687
  get config() {
@@ -134702,14 +134704,14 @@ var PcbStiffener = class extends PrimitiveComponent2 {
134702
134704
  };
134703
134705
  const geometry = props.shape === "rect" ? {
134704
134706
  shape: "rect",
134705
- center: applyToPoint45(transform, { x: 0, y: 0 }),
134707
+ center: applyToPoint46(transform, { x: 0, y: 0 }),
134706
134708
  rotation: decomposeTSR12(transform).rotation.angle * 180 / Math.PI,
134707
134709
  width: props.width,
134708
134710
  height: props.height
134709
134711
  } : {
134710
134712
  shape: "polygon",
134711
134713
  outline: props.outline.map(
134712
- (point6) => applyToPoint45(transform, point6)
134714
+ (point6) => applyToPoint46(transform, point6)
134713
134715
  )
134714
134716
  };
134715
134717
  this.pcb_stiffener_id = db2.pcb_stiffener.insert({
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@tscircuit/core",
3
3
  "type": "module",
4
- "version": "0.0.2153",
4
+ "version": "0.0.2154",
5
5
  "types": "dist/index.d.ts",
6
6
  "main": "dist/index.js",
7
7
  "module": "dist/index.js",