@tscircuit/capacity-autorouter 0.0.31 → 0.0.33
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/LICENSE +21 -0
- package/dist/index.d.ts +83 -1
- package/dist/index.js +702 -9
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/LICENSE
CHANGED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2025 tscircuit
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
package/dist/index.d.ts
CHANGED
|
@@ -216,6 +216,7 @@ declare class CapacityMeshNodeSolver2_NodeUnderObstacle extends CapacityMeshNode
|
|
|
216
216
|
srj: SimpleRouteJson;
|
|
217
217
|
opts: CapacityMeshNodeSolverOptions;
|
|
218
218
|
VIA_DIAMETER: number;
|
|
219
|
+
OBSTACLE_MARGIN: number;
|
|
219
220
|
constructor(srj: SimpleRouteJson, opts?: CapacityMeshNodeSolverOptions);
|
|
220
221
|
isNodeCompletelyOutsideBounds(node: CapacityMeshNode): boolean;
|
|
221
222
|
isNodePartiallyOutsideBounds(node: CapacityMeshNode): boolean;
|
|
@@ -644,7 +645,83 @@ declare class HyperParameterSupervisorSolver<T extends BaseSolver> extends BaseS
|
|
|
644
645
|
visualize(): GraphicsObject;
|
|
645
646
|
}
|
|
646
647
|
|
|
647
|
-
|
|
648
|
+
type Point$1 = {
|
|
649
|
+
x: number;
|
|
650
|
+
y: number;
|
|
651
|
+
z?: number;
|
|
652
|
+
};
|
|
653
|
+
type Route = {
|
|
654
|
+
startPort: Point$1;
|
|
655
|
+
endPort: Point$1;
|
|
656
|
+
connectionName: string;
|
|
657
|
+
};
|
|
658
|
+
declare class TwoCrossingRoutesHighDensitySolver extends BaseSolver {
|
|
659
|
+
nodeWithPortPoints: NodeWithPortPoints;
|
|
660
|
+
routes: Route[];
|
|
661
|
+
viaDiameter: number;
|
|
662
|
+
traceThickness: number;
|
|
663
|
+
obstacleMargin: number;
|
|
664
|
+
layerCount: number;
|
|
665
|
+
debugViaPositions: {
|
|
666
|
+
via1: Point$1;
|
|
667
|
+
via2: Point$1;
|
|
668
|
+
}[];
|
|
669
|
+
solvedRoutes: HighDensityIntraNodeRoute[];
|
|
670
|
+
bounds: {
|
|
671
|
+
minX: number;
|
|
672
|
+
maxX: number;
|
|
673
|
+
minY: number;
|
|
674
|
+
maxY: number;
|
|
675
|
+
};
|
|
676
|
+
constructor(params: {
|
|
677
|
+
nodeWithPortPoints: NodeWithPortPoints;
|
|
678
|
+
viaDiameter?: number;
|
|
679
|
+
traceThickness?: number;
|
|
680
|
+
obstacleMargin?: number;
|
|
681
|
+
layerCount?: number;
|
|
682
|
+
});
|
|
683
|
+
/**
|
|
684
|
+
* Extract routes that need to be connected from the node data
|
|
685
|
+
*/
|
|
686
|
+
private extractRoutesFromNode;
|
|
687
|
+
/**
|
|
688
|
+
* Calculate the bounding box of the node
|
|
689
|
+
*/
|
|
690
|
+
private calculateBounds;
|
|
691
|
+
/**
|
|
692
|
+
* Check if two routes are crossing
|
|
693
|
+
*/
|
|
694
|
+
private doRoutesCross;
|
|
695
|
+
private calculateViaPositions;
|
|
696
|
+
/**
|
|
697
|
+
* Create a route with properly placed vias
|
|
698
|
+
*/
|
|
699
|
+
private createRoute;
|
|
700
|
+
/**
|
|
701
|
+
* Try to solve with routeA going over and routeB staying on layer 0
|
|
702
|
+
*/
|
|
703
|
+
private trySolveAOverB;
|
|
704
|
+
private optimizeViaPositions;
|
|
705
|
+
/**
|
|
706
|
+
* Calculate the orthogonal route points for the second route
|
|
707
|
+
*/
|
|
708
|
+
private calculateConservativeOrthogonalRoutePoints;
|
|
709
|
+
private calculateShortestOrthogonalRoutePoints;
|
|
710
|
+
/**
|
|
711
|
+
* Main step method that attempts to solve the two crossing routes
|
|
712
|
+
*/
|
|
713
|
+
_step(): void;
|
|
714
|
+
/**
|
|
715
|
+
* Visualization for debugging
|
|
716
|
+
*/
|
|
717
|
+
visualize(): GraphicsObject;
|
|
718
|
+
/**
|
|
719
|
+
* Get the solved routes
|
|
720
|
+
*/
|
|
721
|
+
getSolvedRoutes(): HighDensityIntraNodeRoute[];
|
|
722
|
+
}
|
|
723
|
+
|
|
724
|
+
declare class HyperSingleIntraNodeSolver extends HyperParameterSupervisorSolver<IntraNodeRouteSolver | TwoCrossingRoutesHighDensitySolver> {
|
|
648
725
|
constructorParams: ConstructorParameters<typeof IntraNodeRouteSolver>[0];
|
|
649
726
|
solvedRoutes: HighDensityIntraNodeRoute[];
|
|
650
727
|
nodeWithPortPoints: NodeWithPortPoints;
|
|
@@ -686,6 +763,11 @@ declare class HyperSingleIntraNodeSolver extends HyperParameterSupervisorSolver<
|
|
|
686
763
|
CELL_SIZE_FACTOR: number;
|
|
687
764
|
VIA_PENALTY_FACTOR_2: number;
|
|
688
765
|
}[];
|
|
766
|
+
} | {
|
|
767
|
+
name: string;
|
|
768
|
+
possibleValues: {
|
|
769
|
+
CLOSED_FORM_TWO_TRACE_SAME_LAYER: boolean;
|
|
770
|
+
}[];
|
|
689
771
|
})[];
|
|
690
772
|
computeG(solver: IntraNodeRouteSolver): number;
|
|
691
773
|
computeH(solver: IntraNodeRouteSolver): number;
|