@tscircuit/capacity-autorouter 0.0.193 → 0.0.195

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
@@ -2,6 +2,7 @@ import * as graphics_debug from 'graphics-debug';
2
2
  import { GraphicsObject, Rect, Circle, Line, Point as Point$3 } from 'graphics-debug';
3
3
  import { ConnectivityMap } from 'circuit-json-to-connectivity-map';
4
4
  import { RectDiffPipeline } from '@tscircuit/rectdiff';
5
+ import { ConnectivityMap as ConnectivityMap$1 } from 'connectivity-map';
5
6
  import { Polygon } from '@tscircuit/math-utils';
6
7
 
7
8
  type TraceId = string;
@@ -949,7 +950,7 @@ declare class NetToPointPairsSolver2_OffBoardConnection extends NetToPointPairsS
949
950
  _step(): void;
950
951
  }
951
952
 
952
- type Phase = "via_removal" | "via_merging" | "path_simplification";
953
+ type Phase$1 = "via_removal" | "via_merging" | "path_simplification";
953
954
  /**
954
955
  * TraceSimplificationSolver consolidates trace optimization by iteratively applying
955
956
  * via removal, via merging, and path simplification phases. It reduces redundant vias
@@ -967,8 +968,8 @@ declare class TraceSimplificationSolver extends BaseSolver {
967
968
  hdRoutes: HighDensityRoute$1[];
968
969
  simplificationPipelineLoops: number;
969
970
  MAX_SIMPLIFICATION_PIPELINE_LOOPS: number;
970
- PHASE_ORDER: Phase[];
971
- currentPhase: Phase;
971
+ PHASE_ORDER: Phase$1[];
972
+ currentPhase: Phase$1;
972
973
  /** Callback to extract results from the active sub-solver */
973
974
  extractResult: ((solver: BaseSolver) => HighDensityRoute$1[]) | null;
974
975
  /** Returns the simplified routes. This is the primary output of the solver. */
@@ -1631,12 +1632,12 @@ declare class MultiSectionPortPointOptimizer extends BaseSolver {
1631
1632
  visualize(): GraphicsObject;
1632
1633
  }
1633
1634
 
1634
- interface CapacityMeshSolverOptions$2 {
1635
+ interface CapacityMeshSolverOptions$3 {
1635
1636
  capacityDepth?: number;
1636
1637
  targetMinCapacity?: number;
1637
1638
  cacheProvider?: CacheProvider | null;
1638
1639
  }
1639
- type PipelineStep$2<T extends new (...args: any[]) => BaseSolver> = {
1640
+ type PipelineStep$3<T extends new (...args: any[]) => BaseSolver> = {
1640
1641
  solverName: string;
1641
1642
  solverClass: T;
1642
1643
  getConstructorParams: (instance: AutoroutingPipelineSolver2_PortPointPathing) => ConstructorParameters<T>;
@@ -1644,7 +1645,7 @@ type PipelineStep$2<T extends new (...args: any[]) => BaseSolver> = {
1644
1645
  };
1645
1646
  declare class AutoroutingPipelineSolver2_PortPointPathing extends BaseSolver {
1646
1647
  srj: SimpleRouteJson;
1647
- opts: CapacityMeshSolverOptions$2;
1648
+ opts: CapacityMeshSolverOptions$3;
1648
1649
  netToPointPairsSolver?: NetToPointPairsSolver;
1649
1650
  nodeSolver?: RectDiffPipeline;
1650
1651
  nodeTargetMerger?: CapacityNodeTargetMerger;
@@ -1670,8 +1671,9 @@ declare class AutoroutingPipelineSolver2_PortPointPathing extends BaseSolver {
1670
1671
  capacityNodes: CapacityMeshNode[] | null;
1671
1672
  capacityEdges: CapacityMeshEdge[] | null;
1672
1673
  cacheProvider: CacheProvider | null;
1673
- pipelineDef: (PipelineStep$2<typeof NetToPointPairsSolver2_OffBoardConnection> | PipelineStep$2<typeof RectDiffPipeline> | PipelineStep$2<typeof CapacityMeshEdgeSolver2_NodeTreeOptimization> | PipelineStep$2<typeof AvailableSegmentPointSolver> | PipelineStep$2<typeof HyperPortPointPathingSolver> | PipelineStep$2<typeof MultiSectionPortPointOptimizer> | PipelineStep$2<typeof HighDensitySolver> | PipelineStep$2<typeof MultipleHighDensityRouteStitchSolver> | PipelineStep$2<typeof TraceSimplificationSolver>)[];
1674
- constructor(srj: SimpleRouteJson, opts?: CapacityMeshSolverOptions$2);
1674
+ pipelineDef: (PipelineStep$3<typeof NetToPointPairsSolver2_OffBoardConnection> | PipelineStep$3<typeof RectDiffPipeline> | PipelineStep$3<typeof CapacityMeshEdgeSolver2_NodeTreeOptimization> | PipelineStep$3<typeof AvailableSegmentPointSolver> | PipelineStep$3<typeof HyperPortPointPathingSolver> | PipelineStep$3<typeof MultiSectionPortPointOptimizer> | PipelineStep$3<typeof HighDensitySolver> | PipelineStep$3<typeof MultipleHighDensityRouteStitchSolver> | PipelineStep$3<typeof TraceSimplificationSolver>)[];
1675
+ constructor(srj: SimpleRouteJson, opts?: CapacityMeshSolverOptions$3);
1676
+ getConstructorParams(): readonly [SimpleRouteJson, CapacityMeshSolverOptions$3];
1675
1677
  currentPipelineStepIndex: number;
1676
1678
  _step(): void;
1677
1679
  solveUntilPhase(phase: string): void;
@@ -2487,12 +2489,12 @@ declare class CapacityPathingMultiSectionSolver extends BaseSolver {
2487
2489
  visualize(): graphics_debug.GraphicsObject;
2488
2490
  }
2489
2491
 
2490
- interface CapacityMeshSolverOptions$1 {
2492
+ interface CapacityMeshSolverOptions$2 {
2491
2493
  capacityDepth?: number;
2492
2494
  targetMinCapacity?: number;
2493
2495
  cacheProvider?: CacheProvider | null;
2494
2496
  }
2495
- type PipelineStep$1<T extends new (...args: any[]) => BaseSolver> = {
2497
+ type PipelineStep$2<T extends new (...args: any[]) => BaseSolver> = {
2496
2498
  solverName: string;
2497
2499
  solverClass: T;
2498
2500
  getConstructorParams: (instance: AutoroutingPipeline1_OriginalUnravel) => ConstructorParameters<T>;
@@ -2500,7 +2502,7 @@ type PipelineStep$1<T extends new (...args: any[]) => BaseSolver> = {
2500
2502
  };
2501
2503
  declare class AutoroutingPipeline1_OriginalUnravel extends BaseSolver {
2502
2504
  srj: SimpleRouteJson;
2503
- opts: CapacityMeshSolverOptions$1;
2505
+ opts: CapacityMeshSolverOptions$2;
2504
2506
  netToPointPairsSolver?: NetToPointPairsSolver;
2505
2507
  nodeSolver?: RectDiffPipeline;
2506
2508
  nodeTargetMerger?: CapacityNodeTargetMerger;
@@ -2529,8 +2531,443 @@ declare class AutoroutingPipeline1_OriginalUnravel extends BaseSolver {
2529
2531
  capacityNodes: CapacityMeshNode[] | null;
2530
2532
  capacityEdges: CapacityMeshEdge[] | null;
2531
2533
  cacheProvider: CacheProvider | null;
2532
- pipelineDef: (PipelineStep$1<typeof NetToPointPairsSolver2_OffBoardConnection> | PipelineStep$1<typeof RectDiffPipeline> | PipelineStep$1<typeof StrawSolver> | PipelineStep$1<typeof CapacityMeshEdgeSolver2_NodeTreeOptimization> | PipelineStep$1<typeof DeadEndSolver> | PipelineStep$1<typeof CapacityPathingGreedySolver> | PipelineStep$1<typeof CapacityPathingMultiSectionSolver> | PipelineStep$1<typeof CapacityEdgeToPortSegmentSolver> | PipelineStep$1<typeof CapacitySegmentToPointSolver> | PipelineStep$1<typeof UnravelMultiSectionSolver> | PipelineStep$1<typeof HighDensitySolver> | PipelineStep$1<typeof MultipleHighDensityRouteStitchSolver> | PipelineStep$1<typeof TraceSimplificationSolver>)[];
2534
+ pipelineDef: (PipelineStep$2<typeof NetToPointPairsSolver2_OffBoardConnection> | PipelineStep$2<typeof RectDiffPipeline> | PipelineStep$2<typeof StrawSolver> | PipelineStep$2<typeof CapacityMeshEdgeSolver2_NodeTreeOptimization> | PipelineStep$2<typeof DeadEndSolver> | PipelineStep$2<typeof CapacityPathingGreedySolver> | PipelineStep$2<typeof CapacityPathingMultiSectionSolver> | PipelineStep$2<typeof CapacityEdgeToPortSegmentSolver> | PipelineStep$2<typeof CapacitySegmentToPointSolver> | PipelineStep$2<typeof UnravelMultiSectionSolver> | PipelineStep$2<typeof HighDensitySolver> | PipelineStep$2<typeof MultipleHighDensityRouteStitchSolver> | PipelineStep$2<typeof TraceSimplificationSolver>)[];
2535
+ constructor(srj: SimpleRouteJson, opts?: CapacityMeshSolverOptions$2);
2536
+ getConstructorParams(): readonly [SimpleRouteJson, CapacityMeshSolverOptions$2];
2537
+ currentPipelineStepIndex: number;
2538
+ _step(): void;
2539
+ solveUntilPhase(phase: string): void;
2540
+ getCurrentPhase(): string;
2541
+ visualize(): GraphicsObject;
2542
+ /**
2543
+ * A lightweight version of the visualize method that can be used to stream
2544
+ * progress
2545
+ *
2546
+ * We return the most relevant graphic for the stage:
2547
+ * 1. netToPointPairs output
2548
+ * 2. Capacity Planning Output
2549
+ * 3. High Density Route Solver Output, max 200 lines
2550
+ */
2551
+ preview(): GraphicsObject;
2552
+ _getOutputHdRoutes(): HighDensityRoute$1[];
2553
+ /**
2554
+ * Returns the SimpleRouteJson with routes converted to SimplifiedPcbTraces
2555
+ */
2556
+ getOutputSimplifiedPcbTraces(): SimplifiedPcbTraces;
2557
+ getOutputSimpleRouteJson(): SimpleRouteJson;
2558
+ }
2559
+
2560
+ interface MovablePoint {
2561
+ x: number;
2562
+ y: number;
2563
+ z: number;
2564
+ rootConnectionName?: string;
2565
+ connectionName: string;
2566
+ forceX?: number;
2567
+ forceY?: number;
2568
+ }
2569
+ interface RouteInProgress {
2570
+ connectionName: string;
2571
+ rootConnectionName?: string;
2572
+ startPoint: {
2573
+ x: number;
2574
+ y: number;
2575
+ z: number;
2576
+ };
2577
+ endPoint: {
2578
+ x: number;
2579
+ y: number;
2580
+ z: number;
2581
+ };
2582
+ movablePoints: MovablePoint[];
2583
+ }
2584
+ /**
2585
+ * A simplified high density solver that directly connects port points
2586
+ * within each node without considering intersections or vias.
2587
+ *
2588
+ * This solver creates 3-segment lines (4 points) for each connection and uses
2589
+ * a force-directed approach to push movable points away from borders and
2590
+ * other movable points with different rootConnectionName.
2591
+ *
2592
+ * Only solves intra-node routing - connecting port points within a single node.
2593
+ */
2594
+ declare class SimpleHighDensitySolver extends BaseSolver {
2595
+ unsolvedNodes: NodeWithPortPoints[];
2596
+ allNodes: NodeWithPortPoints[];
2597
+ routes: HighDensityIntraNodeRoute$1[];
2598
+ colorMap: Record<string, string>;
2599
+ traceWidth: number;
2600
+ viaDiameter: number;
2601
+ numMovablePoints: number;
2602
+ currentNode: NodeWithPortPoints | null;
2603
+ currentNodeStep: number;
2604
+ routesInProgress: RouteInProgress[];
2605
+ pushMargin: number;
2606
+ currentNodeBounds: {
2607
+ minX: number;
2608
+ maxX: number;
2609
+ minY: number;
2610
+ maxY: number;
2611
+ } | null;
2612
+ constructor({ nodePortPoints, colorMap, traceWidth, viaDiameter, pushMargin, numMovablePoints, }: {
2613
+ nodePortPoints: NodeWithPortPoints[];
2614
+ colorMap?: Record<string, string>;
2615
+ traceWidth?: number;
2616
+ viaDiameter?: number;
2617
+ numMovablePoints?: number;
2618
+ pushMargin?: number;
2619
+ });
2620
+ _step(): void;
2621
+ _initializeRoutesForCurrentNode(): void;
2622
+ _runForceDirectedStep(): void;
2623
+ _finalizeRoutesForCurrentNode(): void;
2624
+ _getNodeBounds(node: NodeWithPortPoints): {
2625
+ minX: number;
2626
+ maxX: number;
2627
+ minY: number;
2628
+ maxY: number;
2629
+ };
2630
+ visualize(): GraphicsObject;
2631
+ }
2632
+
2633
+ /**
2634
+ * ObstacleTree wraps different spatial index implementations:
2635
+ * - 'native': original spatial-hash grid
2636
+ * - 'rbush': dynamic R-tree via rbush
2637
+ * - 'flatbush': static index via flatbush
2638
+ */
2639
+ declare class ObstacleSpatialHashIndex {
2640
+ private idx;
2641
+ private storage;
2642
+ constructor(implementation?: "native" | "rbush" | "flatbush", obstacles?: Obstacle[]);
2643
+ insert(o: Obstacle): void;
2644
+ search(bbox: {
2645
+ minX: number;
2646
+ minY: number;
2647
+ maxX: number;
2648
+ maxY: number;
2649
+ }): Obstacle[];
2650
+ searchArea(centerX: number, centerY: number, width: number, height: number): Obstacle[];
2651
+ }
2652
+
2653
+ interface Point$1 {
2654
+ x: number;
2655
+ y: number;
2656
+ z: number;
2657
+ }
2658
+ type Point2D$2 = {
2659
+ x: number;
2660
+ y: number;
2661
+ };
2662
+ type HighDensityIntraNodeRoute = {
2663
+ connectionName: string;
2664
+ rootConnectionName?: string;
2665
+ traceThickness: number;
2666
+ viaDiameter: number;
2667
+ route: Array<{
2668
+ x: number;
2669
+ y: number;
2670
+ z: number;
2671
+ }>;
2672
+ vias: Array<{
2673
+ x: number;
2674
+ y: number;
2675
+ }>;
2676
+ };
2677
+ type HighDensityRoute = HighDensityIntraNodeRoute;
2678
+ declare class HighDensityRouteSpatialIndex {
2679
+ private segmentBuckets;
2680
+ private viaBuckets;
2681
+ private routes;
2682
+ private CELL_SIZE;
2683
+ constructor(routes: HighDensityRoute[], cellSize?: number);
2684
+ /**
2685
+ * Finds routes that potentially conflict with a given line segment within a margin.
2686
+ * Checks both segments and vias.
2687
+ * @param segmentStart Start point of the query segment.
2688
+ * @param segmentEnd End point of the query segment.
2689
+ * @param margin The minimum required clearance distance from the query segment's centerline.
2690
+ * @returns An array of conflicting routes and their minimum distance to the segment.
2691
+ */
2692
+ getConflictingRoutesForSegment(segmentStart: Point$1, // Keep Point for original Z data if needed elsewhere
2693
+ segmentEnd: Point$1, margin: number): Array<{
2694
+ conflictingRoute: HighDensityRoute;
2695
+ distance: number;
2696
+ }>;
2697
+ /**
2698
+ * Finds routes that pass near a given point within a margin.
2699
+ * Checks both segments and vias.
2700
+ * @param point The query point {x, y}. Z is ignored.
2701
+ * @param margin The minimum required clearance distance from the query point.
2702
+ * @returns An array of conflicting routes and their minimum distance to the point.
2703
+ */
2704
+ getConflictingRoutesNearPoint(point: Point2D$2, margin: number): Array<{
2705
+ conflictingRoute: HighDensityRoute;
2706
+ distance: number;
2707
+ }>;
2708
+ }
2709
+
2710
+ interface Point2D$1 {
2711
+ x: number;
2712
+ y: number;
2713
+ }
2714
+ interface Segment {
2715
+ start: Point2D$1;
2716
+ end: Point2D$1;
2717
+ }
2718
+
2719
+ interface Point2D {
2720
+ x: number;
2721
+ y: number;
2722
+ }
2723
+ interface Point3D extends Point2D {
2724
+ z: number;
2725
+ }
2726
+ interface TraceKeepoutSolverInput {
2727
+ hdRoutes: HighDensityRoute$1[];
2728
+ obstacles: Obstacle[];
2729
+ connMap: ConnectivityMap;
2730
+ colorMap: Record<string, string>;
2731
+ keepoutRadiusSchedule?: number[];
2732
+ smoothDistance?: number;
2733
+ }
2734
+ /**
2735
+ * TraceKeepoutSolver adjusts traces to maintain keepout distance from obstacles
2736
+ * and non-connected traces. It works by walking along each trace with a cursor,
2737
+ * detecting obstacles within a keepout radius, and pushing the draw position
2738
+ * orthogonally to avoid them.
2739
+ *
2740
+ * The solver processes traces through multiple passes with decreasing keepout
2741
+ * radii as defined by KEEPOUT_RADIUS_SCHEDULE.
2742
+ */
2743
+ declare class TraceKeepoutSolver extends BaseSolver {
2744
+ private input;
2745
+ originalHdRoutes: HighDensityRoute$1[];
2746
+ hdRoutes: HighDensityRoute$1[];
2747
+ redrawnHdRoutes: HighDensityRoute$1[];
2748
+ smoothDistance: number;
2749
+ KEEPOUT_RADIUS_SCHEDULE: number[];
2750
+ currentScheduleIndex: number;
2751
+ currentKeepoutRadius: number;
2752
+ unprocessedRoutes: HighDensityRoute$1[];
2753
+ smoothedCursorRoutes: HighDensityRoute$1[];
2754
+ processedRoutes: HighDensityRoute$1[];
2755
+ currentTrace: HighDensityRoute$1 | null;
2756
+ cursorPosition: Point3D | null;
2757
+ lastCursorPosition: Point3D | null;
2758
+ drawPosition: Point2D | null;
2759
+ currentTraceSegmentIndex: number;
2760
+ currentTraceSegmentT: number;
2761
+ recordedDrawPositions: Point3D[];
2762
+ lastCollidingSegments: Segment[];
2763
+ obstacleSHI: ObstacleSpatialHashIndex;
2764
+ hdRouteSHI: HighDensityRouteSpatialIndex;
2765
+ constructor(input: TraceKeepoutSolverInput);
2766
+ _step(): void;
2767
+ /**
2768
+ * Steps the cursor forward by CURSOR_STEP_DISTANCE along the trace
2769
+ * Returns false if we've reached the end of the trace
2770
+ */
2771
+ private stepCursorForward;
2772
+ /**
2773
+ * Gets all colliding segments (obstacle edges and trace outlines) within the keepout radius
2774
+ */
2775
+ private getCollidingSegments;
2776
+ positionHasCollision(position: {
2777
+ x: number;
2778
+ y: number;
2779
+ z: number;
2780
+ }, margin?: number): boolean;
2781
+ /**
2782
+ * Finalizes the current trace with the recorded draw positions
2783
+ */
2784
+ private finalizeCurrentTrace;
2785
+ /**
2786
+ * Simplifies the route by removing collinear points
2787
+ */
2788
+ private simplifyRoute;
2789
+ visualize(): GraphicsObject;
2790
+ /** Returns the redrawn routes. This is the primary output of the solver. */
2791
+ getRedrawnHdRoutes(): HighDensityRoute$1[];
2792
+ }
2793
+
2794
+ interface OffboardPortPoint {
2795
+ portPointId: string;
2796
+ x: number;
2797
+ y: number;
2798
+ /** The obstacle this port point is at the center of */
2799
+ obstacleIndex: number;
2800
+ /** The offBoardConnectsTo ids this port point is associated with */
2801
+ offBoardConnectionIds: OffBoardConnectionId[];
2802
+ /** Available Z layers for this port point based on obstacle layers */
2803
+ availableZ: number[];
2804
+ }
2805
+ interface OffboardPathFragment {
2806
+ pathFragmentId: string;
2807
+ /** The shared offBoardConnectsTo id that connects these port points */
2808
+ offBoardConnectionId: OffBoardConnectionId;
2809
+ /** The two port points connected by this path fragment */
2810
+ portPointIds: [string, string];
2811
+ /** Endpoints of this edge */
2812
+ start: {
2813
+ x: number;
2814
+ y: number;
2815
+ };
2816
+ end: {
2817
+ x: number;
2818
+ y: number;
2819
+ };
2820
+ }
2821
+ type Phase = "finding_obstacles" | "creating_fragments" | "done";
2822
+ interface PendingFragment {
2823
+ offBoardId: OffBoardConnectionId;
2824
+ pp1: OffboardPortPoint;
2825
+ pp2: OffboardPortPoint;
2826
+ }
2827
+ /**
2828
+ * PortPointOffboardPathFragmentSolver finds obstacles with offBoardConnectsTo
2829
+ * defined and creates port points at their centers. It then creates path
2830
+ * fragments (edges) connecting port points that share the same offBoardConnectsTo
2831
+ * ids.
2832
+ *
2833
+ * This enables routing through off-board connections like flex cables or
2834
+ * external connectors.
2835
+ *
2836
+ * The solver iterates step-by-step:
2837
+ * 1. Phase "finding_obstacles": Process one obstacle per step, creating port points
2838
+ * 2. Phase "creating_fragments": Create one path fragment per step
2839
+ * 3. Phase "done": Solver complete
2840
+ */
2841
+ declare class PortPointOffboardPathFragmentSolver extends BaseSolver {
2842
+ srj: SimpleRouteJson;
2843
+ colorMap: Record<string, string>;
2844
+ /** Current phase of the solver */
2845
+ phase: Phase;
2846
+ /** Index of the current obstacle being processed */
2847
+ currentObstacleIndex: number;
2848
+ /** Obstacles that have offBoardConnectsTo defined */
2849
+ offboardObstacles: Array<{
2850
+ obstacle: Obstacle;
2851
+ index: number;
2852
+ }>;
2853
+ /** Port points created at obstacle centers */
2854
+ portPoints: OffboardPortPoint[];
2855
+ /** Map from portPointId to OffboardPortPoint */
2856
+ portPointMap: Map<string, OffboardPortPoint>;
2857
+ /** Path fragments connecting port points with shared offBoardConnectsTo */
2858
+ pathFragments: OffboardPathFragment[];
2859
+ /** Map from offBoardConnectionId to port points that share it */
2860
+ offBoardConnectionToPortPoints: Map<OffBoardConnectionId, OffboardPortPoint[]>;
2861
+ /** Pending path fragments to create (computed after obstacle phase) */
2862
+ pendingFragments: PendingFragment[];
2863
+ /** Index of current fragment being created */
2864
+ currentFragmentIndex: number;
2865
+ /** Last processed obstacle (for visualization) */
2866
+ lastProcessedObstacle: {
2867
+ obstacle: Obstacle;
2868
+ index: number;
2869
+ } | null;
2870
+ /** Last created port point (for visualization) */
2871
+ lastCreatedPortPoint: OffboardPortPoint | null;
2872
+ /** Last created path fragment (for visualization) */
2873
+ lastCreatedFragment: OffboardPathFragment | null;
2874
+ /** Color map for offBoardConnectionIds */
2875
+ offBoardColorMap: Record<string, string>;
2876
+ constructor({ srj, colorMap, }: {
2877
+ srj: SimpleRouteJson;
2878
+ colorMap?: Record<string, string>;
2879
+ });
2880
+ _step(): void;
2881
+ private stepFindingObstacles;
2882
+ private computePendingFragments;
2883
+ private stepCreatingFragments;
2884
+ private layerToZ;
2885
+ computeProgress(): number;
2886
+ visualize(): GraphicsObject;
2887
+ }
2888
+
2889
+ type BucketCoordinate$1 = `${number}x${number}`;
2890
+ declare class CapacityNodeTree {
2891
+ nodes: CapacityMeshNode[];
2892
+ buckets: Map<BucketCoordinate$1, CapacityMeshNode[]>;
2893
+ CELL_SIZE: number;
2894
+ constructor(nodes: CapacityMeshNode[]);
2895
+ getBucketKey(x: number, y: number): BucketCoordinate$1;
2896
+ getNodesInArea(centerX: number, centerY: number, width: number, height: number): CapacityMeshNode[];
2897
+ }
2898
+
2899
+ /**
2900
+ * This solver looks at every obstacle with off board connections (one per step),
2901
+ * then sets _offBoardConnectedCapacityMeshNodeIds on each capacity node that is
2902
+ * mutually connected via off board connections
2903
+ */
2904
+ declare class RelateNodesToOffBoardConnectionsSolver extends BaseSolver {
2905
+ input: {
2906
+ capacityMeshNodes: CapacityMeshNode[];
2907
+ srj: SimpleRouteJson;
2908
+ };
2909
+ unprocessedObstacles: Obstacle[];
2910
+ nodeTree: CapacityNodeTree;
2911
+ offBoardConnMap: ConnectivityMap$1;
2912
+ nodesInNet: Map<OffBoardConnectionId, CapacityMeshNode[]>;
2913
+ lastProcessedObstacle?: Obstacle;
2914
+ constructor(input: {
2915
+ capacityMeshNodes: CapacityMeshNode[];
2916
+ srj: SimpleRouteJson;
2917
+ });
2918
+ _step(): void;
2919
+ getOutput(): {
2920
+ capacityNodes: CapacityMeshNode[];
2921
+ };
2922
+ visualize(): GraphicsObject;
2923
+ }
2924
+
2925
+ interface CapacityMeshSolverOptions$1 {
2926
+ capacityDepth?: number;
2927
+ targetMinCapacity?: number;
2928
+ cacheProvider?: CacheProvider | null;
2929
+ }
2930
+ type PipelineStep$1<T extends new (...args: any[]) => BaseSolver> = {
2931
+ solverName: string;
2932
+ solverClass: T;
2933
+ getConstructorParams: (instance: AssignableAutoroutingPipeline2) => ConstructorParameters<T>;
2934
+ onSolved?: (instance: AssignableAutoroutingPipeline2) => void;
2935
+ };
2936
+ declare class AssignableAutoroutingPipeline2 extends BaseSolver {
2937
+ srj: SimpleRouteJson;
2938
+ opts: CapacityMeshSolverOptions$1;
2939
+ netToPointPairsSolver?: NetToPointPairsSolver;
2940
+ nodeSolver?: RectDiffPipeline;
2941
+ nodeTargetMerger?: CapacityNodeTargetMerger;
2942
+ edgeSolver?: CapacityMeshEdgeSolver;
2943
+ relateNodesToOffBoardConnections?: RelateNodesToOffBoardConnectionsSolver;
2944
+ colorMap: Record<string, string>;
2945
+ highDensityRouteSolver?: HighDensitySolver;
2946
+ simpleHighDensityRouteSolver?: SimpleHighDensitySolver;
2947
+ highDensityStitchSolver?: MultipleHighDensityRouteStitchSolver;
2948
+ singleLayerNodeMerger?: SingleLayerNodeMergerSolver;
2949
+ offboardPathFragmentSolver?: PortPointOffboardPathFragmentSolver;
2950
+ strawSolver?: StrawSolver;
2951
+ deadEndSolver?: DeadEndSolver;
2952
+ traceSimplificationSolver?: TraceSimplificationSolver;
2953
+ traceKeepoutSolver?: TraceKeepoutSolver;
2954
+ availableSegmentPointSolver?: AvailableSegmentPointSolver;
2955
+ portPointPathingSolver?: PortPointPathingSolver;
2956
+ multiSectionPortPointOptimizer?: MultiSectionPortPointOptimizer;
2957
+ viaDiameter: number;
2958
+ minTraceWidth: number;
2959
+ startTimeOfPhase: Record<string, number>;
2960
+ endTimeOfPhase: Record<string, number>;
2961
+ timeSpentOnPhase: Record<string, number>;
2962
+ activeSubSolver?: BaseSolver | null;
2963
+ connMap: ConnectivityMap;
2964
+ srjWithPointPairs?: SimpleRouteJson;
2965
+ capacityNodes: CapacityMeshNode[] | null;
2966
+ capacityEdges: CapacityMeshEdge[] | null;
2967
+ cacheProvider: CacheProvider | null;
2968
+ pipelineDef: (PipelineStep$1<typeof NetToPointPairsSolver> | PipelineStep$1<typeof RectDiffPipeline> | PipelineStep$1<typeof RelateNodesToOffBoardConnectionsSolver> | PipelineStep$1<typeof CapacityMeshEdgeSolver2_NodeTreeOptimization> | PipelineStep$1<typeof AvailableSegmentPointSolver> | PipelineStep$1<typeof HyperPortPointPathingSolver> | PipelineStep$1<typeof SimpleHighDensitySolver> | PipelineStep$1<typeof MultipleHighDensityRouteStitchSolver> | PipelineStep$1<typeof TraceSimplificationSolver> | PipelineStep$1<typeof TraceKeepoutSolver>)[];
2533
2969
  constructor(srj: SimpleRouteJson, opts?: CapacityMeshSolverOptions$1);
2970
+ getConstructorParams(): readonly [SimpleRouteJson, CapacityMeshSolverOptions$1];
2534
2971
  currentPipelineStepIndex: number;
2535
2972
  _step(): void;
2536
2973
  solveUntilPhase(phase: string): void;
@@ -2681,26 +3118,6 @@ declare function getGlobalLocalStorageCache(): LocalStorageCache;
2681
3118
  declare function getGlobalInMemoryCache(): InMemoryCache;
2682
3119
  declare function setupGlobalCaches(): void;
2683
3120
 
2684
- /**
2685
- * ObstacleTree wraps different spatial index implementations:
2686
- * - 'native': original spatial-hash grid
2687
- * - 'rbush': dynamic R-tree via rbush
2688
- * - 'flatbush': static index via flatbush
2689
- */
2690
- declare class ObstacleSpatialHashIndex {
2691
- private idx;
2692
- private storage;
2693
- constructor(implementation?: "native" | "rbush" | "flatbush", obstacles?: Obstacle[]);
2694
- insert(o: Obstacle): void;
2695
- search(bbox: {
2696
- minX: number;
2697
- minY: number;
2698
- maxX: number;
2699
- maxY: number;
2700
- }): Obstacle[];
2701
- searchArea(centerX: number, centerY: number, width: number, height: number): Obstacle[];
2702
- }
2703
-
2704
3121
  interface Target$1 {
2705
3122
  x: number;
2706
3123
  y: number;
@@ -2919,7 +3336,7 @@ declare class AssignableViaNodeMergerSolver extends BaseSolver {
2919
3336
  visualize(): GraphicsObject;
2920
3337
  }
2921
3338
 
2922
- interface Point$1 {
3339
+ interface Point {
2923
3340
  x: number;
2924
3341
  y: number;
2925
3342
  z: number;
@@ -2961,7 +3378,7 @@ declare class SingleSimplifiedPathSolver extends BaseSolver {
2961
3378
  }[] | undefined;
2962
3379
  };
2963
3380
  get simplifiedRoute(): HighDensityIntraNodeRoute$1;
2964
- isValidPath(pointsInRoute: Point$1[]): boolean;
3381
+ isValidPath(pointsInRoute: Point[]): boolean;
2965
3382
  _step(): void;
2966
3383
  getVisualsForNewRouteAndObstacles(): GraphicsObject & Pick<Required<GraphicsObject>, "points" | "lines" | "rects" | "circles">;
2967
3384
  }
@@ -2994,63 +3411,6 @@ declare class MultiSimplifiedPathSolver extends BaseSolver {
2994
3411
  visualize(): GraphicsObject;
2995
3412
  }
2996
3413
 
2997
- interface Point {
2998
- x: number;
2999
- y: number;
3000
- z: number;
3001
- }
3002
- type Point2D = {
3003
- x: number;
3004
- y: number;
3005
- };
3006
- type HighDensityIntraNodeRoute = {
3007
- connectionName: string;
3008
- rootConnectionName?: string;
3009
- traceThickness: number;
3010
- viaDiameter: number;
3011
- route: Array<{
3012
- x: number;
3013
- y: number;
3014
- z: number;
3015
- }>;
3016
- vias: Array<{
3017
- x: number;
3018
- y: number;
3019
- }>;
3020
- };
3021
- type HighDensityRoute = HighDensityIntraNodeRoute;
3022
- declare class HighDensityRouteSpatialIndex {
3023
- private segmentBuckets;
3024
- private viaBuckets;
3025
- private routes;
3026
- private CELL_SIZE;
3027
- constructor(routes: HighDensityRoute[], cellSize?: number);
3028
- /**
3029
- * Finds routes that potentially conflict with a given line segment within a margin.
3030
- * Checks both segments and vias.
3031
- * @param segmentStart Start point of the query segment.
3032
- * @param segmentEnd End point of the query segment.
3033
- * @param margin The minimum required clearance distance from the query segment's centerline.
3034
- * @returns An array of conflicting routes and their minimum distance to the segment.
3035
- */
3036
- getConflictingRoutesForSegment(segmentStart: Point, // Keep Point for original Z data if needed elsewhere
3037
- segmentEnd: Point, margin: number): Array<{
3038
- conflictingRoute: HighDensityRoute;
3039
- distance: number;
3040
- }>;
3041
- /**
3042
- * Finds routes that pass near a given point within a margin.
3043
- * Checks both segments and vias.
3044
- * @param point The query point {x, y}. Z is ignored.
3045
- * @param margin The minimum required clearance distance from the query point.
3046
- * @returns An array of conflicting routes and their minimum distance to the point.
3047
- */
3048
- getConflictingRoutesNearPoint(point: Point2D, margin: number): Array<{
3049
- conflictingRoute: HighDensityRoute;
3050
- distance: number;
3051
- }>;
3052
- }
3053
-
3054
3414
  interface RouteSection {
3055
3415
  startIndex: number;
3056
3416
  endIndex: number;
@@ -3353,6 +3713,7 @@ declare class AssignableAutoroutingPipeline1Solver extends BaseSolver {
3353
3713
  cacheProvider: CacheProvider | null;
3354
3714
  pipelineDef: (PipelineStep<typeof NetToPointPairsSolver> | PipelineStep<typeof CapacityMeshNodeSolver_OnlyTraverseLayersInAssignableObstacles> | PipelineStep<typeof AssignableViaNodeMergerSolver> | PipelineStep<typeof SingleLayerNodeMergerSolver_OnlyMergeTargets> | PipelineStep<typeof CapacityMeshEdgeSolver2_NodeTreeOptimization> | PipelineStep<typeof OffboardCapacityNodeSolver> | PipelineStep<typeof DeadEndSolver> | PipelineStep<typeof HyperAssignableViaCapacityPathingSolver> | PipelineStep<typeof OffboardPathFragmentSolver> | PipelineStep<typeof CapacityEdgeToPortSegmentSolver> | PipelineStep<typeof CapacitySegmentToPointSolver> | PipelineStep<typeof UnravelMultiSectionSolver> | PipelineStep<typeof HighDensitySolver> | PipelineStep<typeof MultipleHighDensityRouteStitchSolver> | PipelineStep<typeof UselessViaRemovalSolver> | PipelineStep<typeof MultiSimplifiedPathSolver>)[];
3355
3715
  constructor(srj: SimpleRouteJson, opts?: CapacityMeshSolverOptions);
3716
+ getConstructorParams(): readonly [SimpleRouteJson, CapacityMeshSolverOptions];
3356
3717
  currentPipelineStepIndex: number;
3357
3718
  _step(): void;
3358
3719
  solveUntilPhase(phase: string): void;
@@ -3383,4 +3744,4 @@ declare const convertSrjToGraphicsObject: (srj: SimpleRouteJson) => {
3383
3744
  points: Point$3[];
3384
3745
  };
3385
3746
 
3386
- export { AssignableAutoroutingPipeline1Solver, AutoroutingPipeline1_OriginalUnravel, AutoroutingPipelineSolver2_PortPointPathing as AutoroutingPipelineSolver, type AutoroutingPipelineSolverOptions, type CachableSolver, type CacheProvider, CapacityMeshSolver, InMemoryCache, LocalStorageCache, calculateOptimalCapacityDepth, convertSrjToGraphicsObject, getGlobalInMemoryCache, getGlobalLocalStorageCache, getTunedTotalCapacity1, setupGlobalCaches };
3747
+ export { AssignableAutoroutingPipeline1Solver, AssignableAutoroutingPipeline2, AutoroutingPipeline1_OriginalUnravel, AutoroutingPipelineSolver2_PortPointPathing as AutoroutingPipelineSolver, type AutoroutingPipelineSolverOptions, type CachableSolver, type CacheProvider, CapacityMeshSolver, InMemoryCache, LocalStorageCache, calculateOptimalCapacityDepth, convertSrjToGraphicsObject, getGlobalInMemoryCache, getGlobalLocalStorageCache, getTunedTotalCapacity1, setupGlobalCaches };