@tscircuit/capacity-autorouter 0.0.558 → 0.0.560

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
@@ -1,7 +1,7 @@
1
1
  import { RectDiffPipeline } from '@tscircuit/rectdiff';
2
2
  import { ConnectivityMap } from 'circuit-json-to-connectivity-map';
3
3
  import * as graphics_debug from 'graphics-debug';
4
- import { GraphicsObject, Rect, Circle, Line, Point as Point$7 } from 'graphics-debug';
4
+ import { GraphicsObject, Rect, Circle, Line, Point as Point$5 } from 'graphics-debug';
5
5
  import { BaseSolver as BaseSolver$1, BasePipelineSolver, PipelineStep as PipelineStep$a } from '@tscircuit/solver-utils';
6
6
  import { HighDensitySolverA03, NodeWithPortPoints as NodeWithPortPoints$1 } from '@tscircuit/high-density-a01';
7
7
  import Flatbush from 'flatbush';
@@ -258,6 +258,8 @@ type PortPoint = {
258
258
  x: number;
259
259
  y: number;
260
260
  z: number;
261
+ prevPortPointId?: string;
262
+ nextPortPointId?: string;
261
263
  };
262
264
  type NodeWithPortPoints = {
263
265
  capacityMeshNodeId: string;
@@ -441,6 +443,8 @@ interface InputPortPoint {
441
443
  x: number;
442
444
  y: number;
443
445
  z: number;
446
+ prevPortPointId?: string;
447
+ nextPortPointId?: string;
444
448
  /** The node IDs that this port point connects (on the shared edge) */
445
449
  connectionNodeIds: [CapacityMeshNodeId, CapacityMeshNodeId];
446
450
  /** XY distance to the centermost port on this Z level (centermost port has distance 0) */
@@ -1336,16 +1340,17 @@ declare class SingleLayerNoDifferentRootIntersectionsIntraNodeSolver extends Bas
1336
1340
  visualize(): GraphicsObject;
1337
1341
  }
1338
1342
 
1339
- type Point$6 = {
1340
- x: number;
1341
- y: number;
1342
- z?: number;
1343
- };
1344
1343
  type Route$3 = {
1345
- A: Point$6;
1346
- B: Point$6;
1344
+ A: PortPoint;
1345
+ B: PortPoint;
1347
1346
  connectionName: string;
1348
1347
  };
1348
+ type NodeBounds = {
1349
+ minX: number;
1350
+ maxX: number;
1351
+ minY: number;
1352
+ maxY: number;
1353
+ };
1349
1354
  declare class SingleTransitionIntraNodeSolver extends BaseSolver {
1350
1355
  getSolverName(): string;
1351
1356
  nodeWithPortPoints: NodeWithPortPoints;
@@ -1354,34 +1359,39 @@ declare class SingleTransitionIntraNodeSolver extends BaseSolver {
1354
1359
  traceThickness: number;
1355
1360
  obstacleMargin: number;
1356
1361
  solvedRoutes: HighDensityIntraNodeRoute$1[];
1357
- bounds: {
1358
- minX: number;
1359
- maxX: number;
1360
- minY: number;
1361
- maxY: number;
1362
- };
1362
+ bounds: NodeBounds;
1363
1363
  constructor(params: {
1364
1364
  nodeWithPortPoints: NodeWithPortPoints;
1365
1365
  viaDiameter?: number;
1366
1366
  traceThickness?: number;
1367
1367
  obstacleMargin?: number;
1368
1368
  });
1369
+ /**
1370
+ * Groups node port points into explicit route tasks.
1371
+ *
1372
+ * @returns One route record per discovered port-point pair.
1373
+ */
1369
1374
  private extractRoutesFromNode;
1375
+ /**
1376
+ * Computes the rectangular routing bounds of the current node.
1377
+ *
1378
+ * @returns Axis-aligned node bounds in board coordinates.
1379
+ */
1370
1380
  private calculateBounds;
1381
+ /**
1382
+ * Builds the solved route for a single via transition.
1383
+ *
1384
+ * @param params - Route endpoints, via location, and connection metadata.
1385
+ * @returns A solved high-density route containing a single via.
1386
+ */
1371
1387
  private createTransitionRoute;
1372
1388
  _step(): void;
1373
1389
  visualize(): GraphicsObject;
1374
1390
  }
1375
1391
 
1376
- type Point$5 = {
1377
- x: number;
1378
- y: number;
1379
- z?: number;
1380
- rootConnectionName?: string;
1381
- };
1382
1392
  type Route$2 = {
1383
- A: Point$5;
1384
- B: Point$5;
1393
+ A: PortPoint;
1394
+ B: PortPoint;
1385
1395
  connectionName: string;
1386
1396
  rootConnectionName?: string;
1387
1397
  };
@@ -1411,7 +1421,18 @@ declare class SingleTransitionThroughObstacleIntraNodeSolver extends BaseSolver
1411
1421
  connMap?: ConnectivityMap;
1412
1422
  layerCount?: number;
1413
1423
  }): boolean;
1424
+ /**
1425
+ * Builds explicit route tasks from linked port-point pairs in the node.
1426
+ *
1427
+ * @returns Route tasks ready for obstacle validation.
1428
+ */
1414
1429
  private extractRoutesFromNode;
1430
+ /**
1431
+ * Finds a same-net multilayer obstacle that contains both route endpoints.
1432
+ *
1433
+ * @param route - Route to validate.
1434
+ * @returns Matching obstacle, or `null` when none exists.
1435
+ */
1415
1436
  private getContainingThroughObstacle;
1416
1437
  _step(): void;
1417
1438
  visualize(): GraphicsObject;
@@ -5320,7 +5341,7 @@ declare class PolyHypergraphPortPointPathingSolver extends BaseSolver {
5320
5341
  convexRegions: ConvexRegionsComputeResult;
5321
5342
  serializedGraph: SerializedPolyHyperGraph;
5322
5343
  loaded: PolyHyperGraphLoadResult;
5323
- polySolver: PolyHyperGraphSolver;
5344
+ polySolver: PolyHyperGraphSolver & BaseSolver;
5324
5345
  inputNodeWithPortPoints: InputNodeWithPortPoints[];
5325
5346
  nodesWithPortPoints: PolyNodeWithPortPoints[];
5326
5347
  reservedRegionCount: number;
@@ -6493,7 +6514,7 @@ declare const convertSrjToGraphicsObject: (srj: SimpleRouteJson) => {
6493
6514
  rects: Rect[];
6494
6515
  circles: Circle[];
6495
6516
  lines: Line[];
6496
- points: Point$7[];
6517
+ points: Point$5[];
6497
6518
  };
6498
6519
 
6499
6520
  type RerouteRectRegion = {