@tscircuit/capacity-autorouter 0.0.12 → 0.0.13

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.d.ts CHANGED
@@ -650,6 +650,9 @@ declare class CapacityPathingSolver4_FlexibleNegativeCapacity extends CapacityPa
650
650
  computeH(prevCandidate: Candidate, node: CapacityMeshNode, endGoal: CapacityMeshNode): number;
651
651
  }
652
652
 
653
+ /**
654
+ * Merge targets that are close to each other into a single target
655
+ */
653
656
  declare class CapacityNodeTargetMerger extends BaseSolver {
654
657
  nodes: CapacityMeshNode[];
655
658
  connMap: ConnectivityMap;
package/dist/index.js CHANGED
@@ -4204,7 +4204,7 @@ var NetToPointPairsSolver = class extends BaseSolver {
4204
4204
  super();
4205
4205
  this.ogSrj = ogSrj;
4206
4206
  this.colorMap = colorMap;
4207
- this.unprocessedConnections = ogSrj.connections;
4207
+ this.unprocessedConnections = [...ogSrj.connections];
4208
4208
  this.newConnections = [];
4209
4209
  }
4210
4210
  unprocessedConnections;
@@ -4962,19 +4962,16 @@ var CapacityMeshSolver = class extends BaseSolver {
4962
4962
  const hdRoutes = this.highDensityStitchSolver.mergedHdRoutes.filter(
4963
4963
  (r) => r.connectionName === connection.name
4964
4964
  );
4965
- if (hdRoutes.length > 1) {
4966
- throw new Error("Multiple hdRoutes found for connection");
4965
+ for (let i = 0; i < hdRoutes.length; i++) {
4966
+ const hdRoute = hdRoutes[i];
4967
+ const simplifiedPcbTrace = {
4968
+ type: "pcb_trace",
4969
+ pcb_trace_id: `${connection.name}_${i}`,
4970
+ connection_name: this.getOriginalConnectionName(connection.name),
4971
+ route: convertHdRouteToSimplifiedRoute(hdRoute, this.srj.layerCount)
4972
+ };
4973
+ traces.push(simplifiedPcbTrace);
4967
4974
  }
4968
- const simplifiedPcbTrace = {
4969
- type: "pcb_trace",
4970
- pcb_trace_id: connection.name,
4971
- connection_name: this.getOriginalConnectionName(connection.name),
4972
- route: convertHdRouteToSimplifiedRoute(
4973
- hdRoutes[0],
4974
- this.srj.layerCount
4975
- )
4976
- };
4977
- traces.push(simplifiedPcbTrace);
4978
4975
  }
4979
4976
  return traces;
4980
4977
  }