@tscircuit/core 0.0.1859 → 0.0.1861

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 +59 -33
  2. package/package.json +1 -1
package/dist/index.js CHANGED
@@ -3327,6 +3327,26 @@ var getObstaclesFromCircuitJson = (circuitJson, connMap) => {
3327
3327
  height: element.outer_diameter,
3328
3328
  connectedTo: withNetId([element.pcb_plated_hole_id])
3329
3329
  });
3330
+ } else if (element.shape === "pill_hole_with_rect_pad" || element.shape === "rotated_pill_hole_with_rect_pad") {
3331
+ const rotatedRect = {
3332
+ center: { x: element.x, y: element.y },
3333
+ width: element.rect_pad_width,
3334
+ height: element.rect_pad_height,
3335
+ rotation: element.shape === "rotated_pill_hole_with_rect_pad" ? element.rect_ccw_rotation : 0
3336
+ };
3337
+ const axisAlignedRect = getAxisAlignedRectFromRotatedRect(rotatedRect);
3338
+ const rect = axisAlignedRect ?? rotatedRect;
3339
+ obstacles.push({
3340
+ circuitJsonMetadata: pcbPlatedHoleCircuitJsonMetadata,
3341
+ componentId: pcbComponentId,
3342
+ type: "rect",
3343
+ layers: everyLayer,
3344
+ center: rect.center,
3345
+ width: rect.width,
3346
+ height: rect.height,
3347
+ ccwRotationDegrees: axisAlignedRect ? void 0 : rotatedRect.rotation,
3348
+ connectedTo: withNetId([element.pcb_plated_hole_id])
3349
+ });
3330
3350
  } else if (element.shape === "circular_hole_with_rect_pad") {
3331
3351
  obstacles.push({
3332
3352
  circuitJsonMetadata: pcbPlatedHoleCircuitJsonMetadata,
@@ -51411,7 +51431,7 @@ function Group_getRoutingPhasePlans(group) {
51411
51431
  var package_default = {
51412
51432
  name: "@tscircuit/core",
51413
51433
  type: "module",
51414
- version: "0.0.1858",
51434
+ version: "0.0.1860",
51415
51435
  types: "dist/index.d.ts",
51416
51436
  main: "dist/index.js",
51417
51437
  module: "dist/index.js",
@@ -51852,7 +51872,7 @@ function Group_syncFanoutExitsWithGlobalConnections({
51852
51872
  }
51853
51873
  const outputConnection = outputConnectionByName.get(inputConnection.name);
51854
51874
  if (!outputConnection) continue;
51855
- const globalConnection = baseConnections.find((connection) => {
51875
+ const globalConnections = baseConnections.filter((connection) => {
51856
51876
  if (connection.routingPcbGroupId === routingPcbGroupId) return false;
51857
51877
  const sharesSourceTrace = connection.source_trace_id === inputConnection.source_trace_id;
51858
51878
  const sharesPointId = connection.pointsToConnect.some(
@@ -51867,14 +51887,14 @@ function Group_syncFanoutExitsWithGlobalConnections({
51867
51887
  )
51868
51888
  );
51869
51889
  });
51870
- if (!globalConnection) continue;
51871
- const previousGlobalPointIndex = globalConnection.pointsToConnect.findIndex(
51872
- (globalPoint) => inputConnection.pointsToConnect.some(
51873
- (inputPoint) => srjPointsReferToSameEndpoint(globalPoint, inputPoint)
51890
+ const globalPointMatches = globalConnections.flatMap(
51891
+ (globalConnection) => globalConnection.pointsToConnect.flatMap(
51892
+ (previousPoint, pointIndex) => inputConnection.pointsToConnect.some(
51893
+ (inputPoint) => srjPointsReferToSameEndpoint(previousPoint, inputPoint)
51894
+ ) ? [{ globalConnection, pointIndex, previousPoint }] : []
51874
51895
  )
51875
51896
  );
51876
- if (previousGlobalPointIndex < 0) continue;
51877
- const previousPoint = globalConnection.pointsToConnect[previousGlobalPointIndex];
51897
+ if (globalPointMatches.length === 0) continue;
51878
51898
  const changedPointIndex = outputConnection.pointsToConnect.findIndex(
51879
51899
  (outputPoint, pointIndex) => {
51880
51900
  const inputPoint = inputConnection.pointsToConnect[pointIndex];
@@ -51883,32 +51903,38 @@ function Group_syncFanoutExitsWithGlobalConnections({
51883
51903
  );
51884
51904
  if (changedPointIndex < 0) continue;
51885
51905
  const fanoutExitPoint = outputConnection.pointsToConnect[changedPointIndex];
51886
- const {
51887
- layers: _previousLayers,
51888
- terminalVia: _previousTerminalVia,
51889
- ...previousPointWithoutLayerOverrides
51890
- } = previousPoint;
51891
- const synchronizedGlobalPoint = {
51892
- ...previousPointWithoutLayerOverrides,
51893
- x: fanoutExitPoint.x,
51894
- y: fanoutExitPoint.y,
51895
- layer: fanoutExitPoint.layer,
51896
- ...fanoutExitPoint.layers ? { layers: [...fanoutExitPoint.layers] } : {},
51897
- ...fanoutExitPoint.terminalVia ? { terminalVia: { ...fanoutExitPoint.terminalVia } } : {}
51898
- };
51899
- globalConnection.pointsToConnect[previousGlobalPointIndex] = synchronizedGlobalPoint;
51900
- if (previousPoint.pointId) {
51901
- breakoutPointIdByConnectionName.set(
51902
- inputConnection.name,
51903
- previousPoint.pointId
51904
- );
51906
+ for (const {
51907
+ globalConnection,
51908
+ pointIndex,
51909
+ previousPoint
51910
+ } of globalPointMatches) {
51911
+ const {
51912
+ layers: _previousLayers,
51913
+ terminalVia: _previousTerminalVia,
51914
+ ...previousPointWithoutLayerOverrides
51915
+ } = previousPoint;
51916
+ const synchronizedGlobalPoint = {
51917
+ ...previousPointWithoutLayerOverrides,
51918
+ x: fanoutExitPoint.x,
51919
+ y: fanoutExitPoint.y,
51920
+ layer: fanoutExitPoint.layer,
51921
+ ...fanoutExitPoint.layers ? { layers: [...fanoutExitPoint.layers] } : {},
51922
+ ...fanoutExitPoint.terminalVia ? { terminalVia: { ...fanoutExitPoint.terminalVia } } : {}
51923
+ };
51924
+ globalConnection.pointsToConnect[pointIndex] = synchronizedGlobalPoint;
51925
+ if (previousPoint.pointId) {
51926
+ breakoutPointIdByConnectionName.set(
51927
+ inputConnection.name,
51928
+ previousPoint.pointId
51929
+ );
51930
+ }
51931
+ synchronizedBreakoutPoints.push({
51932
+ sourceTraceId: inputConnection.source_trace_id,
51933
+ routingPcbGroupId,
51934
+ previousPoint,
51935
+ fanoutExitPoint
51936
+ });
51905
51937
  }
51906
- synchronizedBreakoutPoints.push({
51907
- sourceTraceId: inputConnection.source_trace_id,
51908
- routingPcbGroupId,
51909
- previousPoint,
51910
- fanoutExitPoint
51911
- });
51912
51938
  }
51913
51939
  const newFanoutSourceKeepouts = fanoutOutputSimpleRouteJson.obstacles.filter(
51914
51940
  (obstacle) => obstacle.isFanoutSourceKeepout === true && obstacle.componentId !== void 0
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@tscircuit/core",
3
3
  "type": "module",
4
- "version": "0.0.1859",
4
+ "version": "0.0.1861",
5
5
  "types": "dist/index.d.ts",
6
6
  "main": "dist/index.js",
7
7
  "module": "dist/index.js",