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