77 type ViaTile ,
88 ViaGraphSolver ,
99 createConvexViaGraphFromXYConnections ,
10- viaTile as defaultViaTile ,
1110} from "@tscircuit/hypergraph"
1211import { ConnectivityMap } from "circuit-json-to-connectivity-map"
1312import type {
@@ -33,7 +32,6 @@ export interface FixedTopologyHighDensityIntraNodeSolverParams {
3332 nodeWithPortPoints : NodeWithPortPoints
3433 colorMap ?: Record < string , string >
3534 traceWidth ?: number
36- viaDiameter ?: number
3735 connMap ?: ConnectivityMap
3836 effort ?: number
3937}
@@ -53,8 +51,6 @@ export class FixedTopologyHighDensityIntraNodeSolver extends BaseSolver {
5351 nodeWithPortPoints : NodeWithPortPoints
5452 colorMap : Record < string , string >
5553 traceWidth : number
56- viaDiameter : number
57- viaTile : ViaTile
5854 connMap ?: ConnectivityMap
5955
6056 rootConnectionNameByConnectionId : Map < string , string | undefined > = new Map ( )
@@ -70,8 +66,6 @@ export class FixedTopologyHighDensityIntraNodeSolver extends BaseSolver {
7066 this . nodeWithPortPoints = params . nodeWithPortPoints
7167 this . colorMap = params . colorMap ?? { }
7268 this . traceWidth = params . traceWidth ?? 0.15
73- this . viaTile = defaultViaTile
74- this . viaDiameter = this . _resolveViaDiameter ( params . viaDiameter )
7569 this . connMap = params . connMap
7670 this . MAX_ITERATIONS = P99_MAX_ITERATIONS * ( params . effort ?? 1 )
7771
@@ -92,17 +86,6 @@ export class FixedTopologyHighDensityIntraNodeSolver extends BaseSolver {
9286 return 0.3
9387 }
9488
95- private _resolveViaDiameter ( requestedViaDiameter ?: number ) : number {
96- const viaTileDiameter = this . _getViaTileDiameter ( this . viaTile )
97- if (
98- requestedViaDiameter !== undefined &&
99- Math . abs ( requestedViaDiameter - viaTileDiameter ) <= 1e-6
100- ) {
101- return requestedViaDiameter
102- }
103- return viaTileDiameter
104- }
105-
10689 private _initializeGraph ( ) : ViaGraphSolver | null {
10790 // Build connections from port points
10891 const connectionMap = new Map <
@@ -140,10 +123,7 @@ export class FixedTopologyHighDensityIntraNodeSolver extends BaseSolver {
140123 }
141124 if ( inputConnections . length === 0 ) return null
142125
143- const convexGraph = createConvexViaGraphFromXYConnections (
144- inputConnections ,
145- this . viaTile ,
146- )
126+ const convexGraph = createConvexViaGraphFromXYConnections ( inputConnections )
147127 this . tiledViasByNet = convexGraph . viaTile . viasByNet ?? { }
148128
149129 return new ViaGraphSolver ( {
@@ -418,6 +398,9 @@ export class FixedTopologyHighDensityIntraNodeSolver extends BaseSolver {
418398 private _processResults ( viaGraphSolver : ViaGraphSolver ) {
419399 this . solvedRoutes = [ ]
420400 const viaTile = viaGraphSolver . viaTile
401+ const fallbackViaDiameter = viaTile
402+ ? this . _getViaTileDiameter ( viaTile )
403+ : 0.3
421404 const viasByPosition : Map <
422405 string ,
423406 {
@@ -571,7 +554,7 @@ export class FixedTopologyHighDensityIntraNodeSolver extends BaseSolver {
571554 ? Math . max (
572555 ...routeViaRegions . map ( ( viaRegion ) => viaRegion . diameter ) ,
573556 )
574- : this . viaDiameter ,
557+ : fallbackViaDiameter ,
575558 route : routePoints ,
576559 vias : routeVias ,
577560 viaRegions : routeViaRegions ,
0 commit comments