@tscircuit/capacity-autorouter 0.0.259 → 0.0.261
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 +234 -170
- 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,10 +2,11 @@ import * as graphics_debug from 'graphics-debug';
|
|
|
2
2
|
import { GraphicsObject, Rect, Circle, Line, Point as Point$5 } from 'graphics-debug';
|
|
3
3
|
import { ConnectivityMap } from 'circuit-json-to-connectivity-map';
|
|
4
4
|
import { RectDiffPipeline } from '@tscircuit/rectdiff';
|
|
5
|
+
import { BaseSolver as BaseSolver$1 } from '@tscircuit/solver-utils';
|
|
6
|
+
import { Polygon } from '@tscircuit/math-utils';
|
|
5
7
|
import { JumperGraphSolver, JRegion, JPort } from '@tscircuit/hypergraph';
|
|
6
8
|
import { CurvyTraceSolver } from '@tscircuit/curvy-trace-solver';
|
|
7
9
|
import { ConnectivityMap as ConnectivityMap$1 } from 'connectivity-map';
|
|
8
|
-
import { Polygon } from '@tscircuit/math-utils';
|
|
9
10
|
|
|
10
11
|
type TraceId = string;
|
|
11
12
|
type NetId = string;
|
|
@@ -2042,6 +2043,52 @@ declare class MultiSectionPortPointOptimizer extends BaseSolver {
|
|
|
2042
2043
|
visualize(): GraphicsObject;
|
|
2043
2044
|
}
|
|
2044
2045
|
|
|
2046
|
+
type Side = "left" | "right" | "top" | "bottom";
|
|
2047
|
+
type Bounds = {
|
|
2048
|
+
minX: number;
|
|
2049
|
+
maxX: number;
|
|
2050
|
+
minY: number;
|
|
2051
|
+
maxY: number;
|
|
2052
|
+
};
|
|
2053
|
+
interface NodeAndSide {
|
|
2054
|
+
nodeId: string;
|
|
2055
|
+
side: Side;
|
|
2056
|
+
}
|
|
2057
|
+
type PortPointWithSide = PortPoint & {
|
|
2058
|
+
side: Side;
|
|
2059
|
+
ownerNodeId: string;
|
|
2060
|
+
};
|
|
2061
|
+
|
|
2062
|
+
interface UniformPortDistributionSolverInput {
|
|
2063
|
+
nodeWithPortPoints: NodeWithPortPoints[];
|
|
2064
|
+
inputNodesWithPortPoints: InputNodeWithPortPoints[];
|
|
2065
|
+
obstacles: Obstacle[];
|
|
2066
|
+
}
|
|
2067
|
+
/**
|
|
2068
|
+
* Redistributes port points uniformly along the sides of nodes to optimize
|
|
2069
|
+
* routing density and prevent congestion.
|
|
2070
|
+
*
|
|
2071
|
+
* This solver:
|
|
2072
|
+
* 1. Classifies which side of a node each port point belongs to.
|
|
2073
|
+
* 2. Determines the "owner" node for port points shared between nodes.
|
|
2074
|
+
* 3. Evenly spaces port points along their assigned side.
|
|
2075
|
+
*/
|
|
2076
|
+
declare class UniformPortDistributionSolver extends BaseSolver$1 {
|
|
2077
|
+
private input;
|
|
2078
|
+
mapOfNodeIdToLengthOfEachSide: Map<string, Record<Side, number>>;
|
|
2079
|
+
sidesToProcess: NodeAndSide[];
|
|
2080
|
+
mapOfNodeIdToBounds: Map<string, Bounds>;
|
|
2081
|
+
mapOfNodeAndSideToPortPoints: Map<string, PortPointWithSide[]>;
|
|
2082
|
+
currentSideBeingProcessed: NodeAndSide | null;
|
|
2083
|
+
redistributedNodes: NodeWithPortPoints[];
|
|
2084
|
+
private getNodeAndSideKey;
|
|
2085
|
+
constructor(input: UniformPortDistributionSolverInput);
|
|
2086
|
+
step(): void;
|
|
2087
|
+
rebuildNodes(): void;
|
|
2088
|
+
getOutput: () => NodeWithPortPoints[];
|
|
2089
|
+
visualize(): GraphicsObject;
|
|
2090
|
+
}
|
|
2091
|
+
|
|
2045
2092
|
interface CapacityMeshSolverOptions$4 {
|
|
2046
2093
|
capacityDepth?: number;
|
|
2047
2094
|
targetMinCapacity?: number;
|
|
@@ -2071,6 +2118,7 @@ declare class AutoroutingPipelineSolver2_PortPointPathing extends BaseSolver {
|
|
|
2071
2118
|
availableSegmentPointSolver?: AvailableSegmentPointSolver;
|
|
2072
2119
|
portPointPathingSolver?: HyperPortPointPathingSolver;
|
|
2073
2120
|
multiSectionPortPointOptimizer?: MultiSectionPortPointOptimizer;
|
|
2121
|
+
uniformPortDistributionSolver?: UniformPortDistributionSolver;
|
|
2074
2122
|
viaDiameter: number;
|
|
2075
2123
|
minTraceWidth: number;
|
|
2076
2124
|
effort: number;
|
|
@@ -2082,8 +2130,9 @@ declare class AutoroutingPipelineSolver2_PortPointPathing extends BaseSolver {
|
|
|
2082
2130
|
srjWithPointPairs?: SimpleRouteJson;
|
|
2083
2131
|
capacityNodes: CapacityMeshNode[] | null;
|
|
2084
2132
|
capacityEdges: CapacityMeshEdge[] | null;
|
|
2133
|
+
inputNodeWithPortPoints: InputNodeWithPortPoints[];
|
|
2085
2134
|
cacheProvider: CacheProvider | null;
|
|
2086
|
-
pipelineDef: (PipelineStep$4<typeof NetToPointPairsSolver2_OffBoardConnection> | PipelineStep$4<typeof RectDiffPipeline> | PipelineStep$4<typeof CapacityMeshEdgeSolver2_NodeTreeOptimization> | PipelineStep$4<typeof AvailableSegmentPointSolver> | PipelineStep$4<typeof HyperPortPointPathingSolver> | PipelineStep$4<typeof MultiSectionPortPointOptimizer> | PipelineStep$4<typeof HighDensitySolver> | PipelineStep$4<typeof MultipleHighDensityRouteStitchSolver> | PipelineStep$4<typeof TraceSimplificationSolver>)[];
|
|
2135
|
+
pipelineDef: (PipelineStep$4<typeof NetToPointPairsSolver2_OffBoardConnection> | PipelineStep$4<typeof RectDiffPipeline> | PipelineStep$4<typeof CapacityMeshEdgeSolver2_NodeTreeOptimization> | PipelineStep$4<typeof AvailableSegmentPointSolver> | PipelineStep$4<typeof HyperPortPointPathingSolver> | PipelineStep$4<typeof MultiSectionPortPointOptimizer> | PipelineStep$4<typeof UniformPortDistributionSolver> | PipelineStep$4<typeof HighDensitySolver> | PipelineStep$4<typeof MultipleHighDensityRouteStitchSolver> | PipelineStep$4<typeof TraceSimplificationSolver>)[];
|
|
2087
2136
|
constructor(srj: SimpleRouteJson, opts?: CapacityMeshSolverOptions$4);
|
|
2088
2137
|
getConstructorParams(): readonly [SimpleRouteJson, CapacityMeshSolverOptions$4];
|
|
2089
2138
|
currentPipelineStepIndex: number;
|
|
@@ -2112,6 +2161,168 @@ declare class AutoroutingPipelineSolver2_PortPointPathing extends BaseSolver {
|
|
|
2112
2161
|
declare const CapacityMeshSolver: typeof AutoroutingPipelineSolver2_PortPointPathing;
|
|
2113
2162
|
type CapacityMeshSolver = AutoroutingPipelineSolver2_PortPointPathing;
|
|
2114
2163
|
|
|
2164
|
+
/**
|
|
2165
|
+
* ObstacleTree wraps different spatial index implementations:
|
|
2166
|
+
* - 'native': original spatial-hash grid
|
|
2167
|
+
* - 'rbush': dynamic R-tree via rbush
|
|
2168
|
+
* - 'flatbush': static index via flatbush
|
|
2169
|
+
*/
|
|
2170
|
+
declare class ObstacleSpatialHashIndex {
|
|
2171
|
+
private idx;
|
|
2172
|
+
private storage;
|
|
2173
|
+
constructor(implementation?: "native" | "rbush" | "flatbush", obstacles?: Obstacle[]);
|
|
2174
|
+
insert(o: Obstacle): void;
|
|
2175
|
+
search(bbox: {
|
|
2176
|
+
minX: number;
|
|
2177
|
+
minY: number;
|
|
2178
|
+
maxX: number;
|
|
2179
|
+
maxY: number;
|
|
2180
|
+
}): Obstacle[];
|
|
2181
|
+
searchArea(centerX: number, centerY: number, width: number, height: number): Obstacle[];
|
|
2182
|
+
}
|
|
2183
|
+
|
|
2184
|
+
interface Target$1 {
|
|
2185
|
+
x: number;
|
|
2186
|
+
y: number;
|
|
2187
|
+
bounds: {
|
|
2188
|
+
minX: number;
|
|
2189
|
+
minY: number;
|
|
2190
|
+
maxX: number;
|
|
2191
|
+
maxY: number;
|
|
2192
|
+
};
|
|
2193
|
+
connectionName: string;
|
|
2194
|
+
availableZ: number[];
|
|
2195
|
+
}
|
|
2196
|
+
type BucketCoordinate$1 = `${number}x${number}`;
|
|
2197
|
+
declare class TargetTree {
|
|
2198
|
+
targets: Target$1[];
|
|
2199
|
+
buckets: Map<BucketCoordinate$1, [Target$1, number][]>;
|
|
2200
|
+
CELL_SIZE: number;
|
|
2201
|
+
constructor(targets: Target$1[]);
|
|
2202
|
+
getBucketKey(x: number, y: number): BucketCoordinate$1;
|
|
2203
|
+
getTargetsInArea(centerX: number, centerY: number, width: number, height: number): Target$1[];
|
|
2204
|
+
}
|
|
2205
|
+
|
|
2206
|
+
interface CapacityMeshNodeSolverOptions$2 {
|
|
2207
|
+
capacityDepth?: number;
|
|
2208
|
+
}
|
|
2209
|
+
interface Target {
|
|
2210
|
+
x: number;
|
|
2211
|
+
y: number;
|
|
2212
|
+
bounds: {
|
|
2213
|
+
minX: number;
|
|
2214
|
+
minY: number;
|
|
2215
|
+
maxX: number;
|
|
2216
|
+
maxY: number;
|
|
2217
|
+
};
|
|
2218
|
+
connectionName: string;
|
|
2219
|
+
availableZ: number[];
|
|
2220
|
+
}
|
|
2221
|
+
declare class CapacityMeshNodeSolver extends BaseSolver {
|
|
2222
|
+
srj: SimpleRouteJson;
|
|
2223
|
+
opts: CapacityMeshNodeSolverOptions$2;
|
|
2224
|
+
unfinishedNodes: CapacityMeshNode[];
|
|
2225
|
+
finishedNodes: CapacityMeshNode[];
|
|
2226
|
+
nodeToXYOverlappingObstaclesMap: Map<CapacityMeshNodeId, Obstacle[]>;
|
|
2227
|
+
layerCount: number;
|
|
2228
|
+
protected outlinePolygon?: Polygon;
|
|
2229
|
+
MAX_DEPTH: number;
|
|
2230
|
+
targets: Target[];
|
|
2231
|
+
targetTree: TargetTree;
|
|
2232
|
+
obstacleTree: ObstacleSpatialHashIndex;
|
|
2233
|
+
constructor(srj: SimpleRouteJson, opts?: CapacityMeshNodeSolverOptions$2);
|
|
2234
|
+
computeTargets(): Target[];
|
|
2235
|
+
protected getNodeBounds(node: CapacityMeshNode): {
|
|
2236
|
+
minX: number;
|
|
2237
|
+
maxX: number;
|
|
2238
|
+
minY: number;
|
|
2239
|
+
maxY: number;
|
|
2240
|
+
};
|
|
2241
|
+
protected getNodeRect(node: CapacityMeshNode): {
|
|
2242
|
+
center: {
|
|
2243
|
+
x: number;
|
|
2244
|
+
y: number;
|
|
2245
|
+
};
|
|
2246
|
+
width: number;
|
|
2247
|
+
height: number;
|
|
2248
|
+
};
|
|
2249
|
+
_nextNodeCounter: number;
|
|
2250
|
+
getNextNodeId(): string;
|
|
2251
|
+
getCapacityFromDepth(depth: number): number;
|
|
2252
|
+
getTargetIfNodeContainsTarget(node: CapacityMeshNode): Target | null;
|
|
2253
|
+
getXYOverlappingObstacles(node: CapacityMeshNode): Obstacle[];
|
|
2254
|
+
getXYZOverlappingObstacles(node: CapacityMeshNode): Obstacle[];
|
|
2255
|
+
/**
|
|
2256
|
+
* Checks if the given mesh node overlaps with any obstacle.
|
|
2257
|
+
* We treat both obstacles and nodes as axis‐aligned rectangles.
|
|
2258
|
+
*/
|
|
2259
|
+
doesNodeOverlapObstacle(node: CapacityMeshNode): boolean;
|
|
2260
|
+
/**
|
|
2261
|
+
* Checks if the entire node is contained within any obstacle.
|
|
2262
|
+
*/
|
|
2263
|
+
isNodeCompletelyInsideObstacle(node: CapacityMeshNode): boolean;
|
|
2264
|
+
getChildNodes(parent: CapacityMeshNode): CapacityMeshNode[];
|
|
2265
|
+
shouldNodeBeXYSubdivided(node: CapacityMeshNode): boolean;
|
|
2266
|
+
_step(): void;
|
|
2267
|
+
/**
|
|
2268
|
+
* Creates a GraphicsObject to visualize the mesh, its nodes, obstacles, and connection points.
|
|
2269
|
+
*
|
|
2270
|
+
* - Mesh nodes are rendered as rectangles.
|
|
2271
|
+
* - Nodes that have an obstacle intersection are outlined in red.
|
|
2272
|
+
* - Other nodes are outlined in green.
|
|
2273
|
+
* - Lines are drawn from a node to its parent.
|
|
2274
|
+
* - Obstacles are drawn as semi-transparent red rectangles.
|
|
2275
|
+
* - Points for each connection’s pointsToConnect are drawn in a unique color.
|
|
2276
|
+
*/
|
|
2277
|
+
visualize(): GraphicsObject;
|
|
2278
|
+
}
|
|
2279
|
+
|
|
2280
|
+
interface CapacityMeshNodeSolverOptions$1 {
|
|
2281
|
+
capacityDepth?: number;
|
|
2282
|
+
}
|
|
2283
|
+
declare class CapacityMeshNodeSolver2_NodeUnderObstacle extends CapacityMeshNodeSolver {
|
|
2284
|
+
srj: SimpleRouteJson;
|
|
2285
|
+
opts: CapacityMeshNodeSolverOptions$1;
|
|
2286
|
+
VIA_DIAMETER: number;
|
|
2287
|
+
OBSTACLE_MARGIN: number;
|
|
2288
|
+
/**
|
|
2289
|
+
* The threshold for the percentage of a single-layer node that must be
|
|
2290
|
+
* covered by obstacles to be considered "under an obstacle"
|
|
2291
|
+
*/
|
|
2292
|
+
OVERLAP_THRESHOLD_FOR_SINGLE_LAYER_NODES: number;
|
|
2293
|
+
constructor(srj: SimpleRouteJson, opts?: CapacityMeshNodeSolverOptions$1);
|
|
2294
|
+
isNodeCompletelyOutsideBounds(node: CapacityMeshNode): boolean;
|
|
2295
|
+
isNodePartiallyOutsideBounds(node: CapacityMeshNode): boolean;
|
|
2296
|
+
/**
|
|
2297
|
+
* Calculate the percentage of node area covered by obstacles
|
|
2298
|
+
*/
|
|
2299
|
+
getObstacleCoveragePercentage(node: CapacityMeshNode): number;
|
|
2300
|
+
/**
|
|
2301
|
+
* Check if a single-layer node should be filtered due to obstacle coverage
|
|
2302
|
+
*/
|
|
2303
|
+
shouldFilterSingleLayerNodeForObstacle(node: CapacityMeshNode): boolean;
|
|
2304
|
+
/**
|
|
2305
|
+
* Check if a node should be filtered due to obstacles.
|
|
2306
|
+
* Single-layer nodes: filtered only if >20% covered
|
|
2307
|
+
* Multi-layer nodes: filtered if any overlap
|
|
2308
|
+
*/
|
|
2309
|
+
shouldFilterNodeForObstacle(node: CapacityMeshNode): boolean;
|
|
2310
|
+
createChildNodeAtPosition(parent: CapacityMeshNode, opts: {
|
|
2311
|
+
center: {
|
|
2312
|
+
x: number;
|
|
2313
|
+
y: number;
|
|
2314
|
+
};
|
|
2315
|
+
width: number;
|
|
2316
|
+
height: number;
|
|
2317
|
+
availableZ: number[];
|
|
2318
|
+
_depth?: number;
|
|
2319
|
+
}): CapacityMeshNode;
|
|
2320
|
+
getZSubdivisionChildNodes(node: CapacityMeshNode): CapacityMeshNode[];
|
|
2321
|
+
getChildNodes(parent: CapacityMeshNode): CapacityMeshNode[];
|
|
2322
|
+
shouldNodeBeXYSubdivided(node: CapacityMeshNode): boolean;
|
|
2323
|
+
_step(): void;
|
|
2324
|
+
}
|
|
2325
|
+
|
|
2115
2326
|
interface NodePortSegment {
|
|
2116
2327
|
capacityMeshNodeId: string;
|
|
2117
2328
|
nodePortSegmentId?: string;
|
|
@@ -2901,6 +3112,21 @@ declare class CapacityPathingMultiSectionSolver extends BaseSolver {
|
|
|
2901
3112
|
visualize(): graphics_debug.GraphicsObject;
|
|
2902
3113
|
}
|
|
2903
3114
|
|
|
3115
|
+
/**
|
|
3116
|
+
* A simplified version of MultipleHighDensityRouteStitchSolver that doesn't handle
|
|
3117
|
+
* off-board routing cases. It always uses the connection's pointsToConnect directly
|
|
3118
|
+
* instead of analyzing possible endpoints from route islands.
|
|
3119
|
+
*/
|
|
3120
|
+
declare class NoOffBoardMultipleHighDensityRouteStitchSolver extends MultipleHighDensityRouteStitchSolver {
|
|
3121
|
+
constructor(params: {
|
|
3122
|
+
connections: SimpleRouteConnection[];
|
|
3123
|
+
hdRoutes: any[];
|
|
3124
|
+
colorMap?: Record<string, string>;
|
|
3125
|
+
layerCount: number;
|
|
3126
|
+
defaultViaDiameter?: number;
|
|
3127
|
+
});
|
|
3128
|
+
}
|
|
3129
|
+
|
|
2904
3130
|
interface CapacityMeshSolverOptions$3 {
|
|
2905
3131
|
capacityDepth?: number;
|
|
2906
3132
|
targetMinCapacity?: number;
|
|
@@ -2916,7 +3142,7 @@ declare class AutoroutingPipeline1_OriginalUnravel extends BaseSolver {
|
|
|
2916
3142
|
srj: SimpleRouteJson;
|
|
2917
3143
|
opts: CapacityMeshSolverOptions$3;
|
|
2918
3144
|
netToPointPairsSolver?: NetToPointPairsSolver;
|
|
2919
|
-
nodeSolver?:
|
|
3145
|
+
nodeSolver?: CapacityMeshNodeSolver;
|
|
2920
3146
|
nodeTargetMerger?: CapacityNodeTargetMerger;
|
|
2921
3147
|
edgeSolver?: CapacityMeshEdgeSolver;
|
|
2922
3148
|
initialPathingSolver?: CapacityPathingGreedySolver;
|
|
@@ -2927,7 +3153,7 @@ declare class AutoroutingPipeline1_OriginalUnravel extends BaseSolver {
|
|
|
2927
3153
|
unravelMultiSectionSolver?: UnravelMultiSectionSolver;
|
|
2928
3154
|
segmentToPointOptimizer?: CapacitySegmentPointOptimizer;
|
|
2929
3155
|
highDensityRouteSolver?: HighDensitySolver;
|
|
2930
|
-
highDensityStitchSolver?:
|
|
3156
|
+
highDensityStitchSolver?: NoOffBoardMultipleHighDensityRouteStitchSolver;
|
|
2931
3157
|
singleLayerNodeMerger?: SingleLayerNodeMergerSolver;
|
|
2932
3158
|
strawSolver?: StrawSolver;
|
|
2933
3159
|
deadEndSolver?: DeadEndSolver;
|
|
@@ -2943,7 +3169,7 @@ declare class AutoroutingPipeline1_OriginalUnravel extends BaseSolver {
|
|
|
2943
3169
|
capacityNodes: CapacityMeshNode[] | null;
|
|
2944
3170
|
capacityEdges: CapacityMeshEdge[] | null;
|
|
2945
3171
|
cacheProvider: CacheProvider | null;
|
|
2946
|
-
pipelineDef: (PipelineStep$3<typeof NetToPointPairsSolver2_OffBoardConnection> | PipelineStep$3<typeof
|
|
3172
|
+
pipelineDef: (PipelineStep$3<typeof NetToPointPairsSolver2_OffBoardConnection> | PipelineStep$3<typeof CapacityMeshNodeSolver2_NodeUnderObstacle> | PipelineStep$3<typeof SingleLayerNodeMergerSolver> | PipelineStep$3<typeof StrawSolver> | PipelineStep$3<typeof CapacityMeshEdgeSolver2_NodeTreeOptimization> | PipelineStep$3<typeof DeadEndSolver> | PipelineStep$3<typeof CapacityPathingGreedySolver> | PipelineStep$3<typeof CapacityPathingMultiSectionSolver> | PipelineStep$3<typeof CapacityEdgeToPortSegmentSolver> | PipelineStep$3<typeof CapacitySegmentToPointSolver> | PipelineStep$3<typeof UnravelMultiSectionSolver> | PipelineStep$3<typeof HighDensitySolver> | PipelineStep$3<typeof NoOffBoardMultipleHighDensityRouteStitchSolver> | PipelineStep$3<typeof TraceSimplificationSolver>)[];
|
|
2947
3173
|
constructor(srj: SimpleRouteJson, opts?: CapacityMeshSolverOptions$3);
|
|
2948
3174
|
getConstructorParams(): readonly [SimpleRouteJson, CapacityMeshSolverOptions$3];
|
|
2949
3175
|
currentPipelineStepIndex: number;
|
|
@@ -3353,26 +3579,6 @@ declare class JumperHighDensitySolver extends BaseSolver {
|
|
|
3353
3579
|
visualize(): GraphicsObject;
|
|
3354
3580
|
}
|
|
3355
3581
|
|
|
3356
|
-
/**
|
|
3357
|
-
* ObstacleTree wraps different spatial index implementations:
|
|
3358
|
-
* - 'native': original spatial-hash grid
|
|
3359
|
-
* - 'rbush': dynamic R-tree via rbush
|
|
3360
|
-
* - 'flatbush': static index via flatbush
|
|
3361
|
-
*/
|
|
3362
|
-
declare class ObstacleSpatialHashIndex {
|
|
3363
|
-
private idx;
|
|
3364
|
-
private storage;
|
|
3365
|
-
constructor(implementation?: "native" | "rbush" | "flatbush", obstacles?: Obstacle[]);
|
|
3366
|
-
insert(o: Obstacle): void;
|
|
3367
|
-
search(bbox: {
|
|
3368
|
-
minX: number;
|
|
3369
|
-
minY: number;
|
|
3370
|
-
maxX: number;
|
|
3371
|
-
maxY: number;
|
|
3372
|
-
}): Obstacle[];
|
|
3373
|
-
searchArea(centerX: number, centerY: number, width: number, height: number): Obstacle[];
|
|
3374
|
-
}
|
|
3375
|
-
|
|
3376
3582
|
interface Point$1 {
|
|
3377
3583
|
x: number;
|
|
3378
3584
|
y: number;
|
|
@@ -3744,13 +3950,13 @@ declare class PortPointOffboardPathFragmentSolver extends BaseSolver {
|
|
|
3744
3950
|
visualize(): GraphicsObject;
|
|
3745
3951
|
}
|
|
3746
3952
|
|
|
3747
|
-
type BucketCoordinate
|
|
3953
|
+
type BucketCoordinate = `${number}x${number}`;
|
|
3748
3954
|
declare class CapacityNodeTree {
|
|
3749
3955
|
nodes: CapacityMeshNode[];
|
|
3750
|
-
buckets: Map<BucketCoordinate
|
|
3956
|
+
buckets: Map<BucketCoordinate, CapacityMeshNode[]>;
|
|
3751
3957
|
CELL_SIZE: number;
|
|
3752
3958
|
constructor(nodes: CapacityMeshNode[]);
|
|
3753
|
-
getBucketKey(x: number, y: number): BucketCoordinate
|
|
3959
|
+
getBucketKey(x: number, y: number): BucketCoordinate;
|
|
3754
3960
|
getNodesInArea(centerX: number, centerY: number, width: number, height: number): CapacityMeshNode[];
|
|
3755
3961
|
}
|
|
3756
3962
|
|
|
@@ -4131,148 +4337,6 @@ declare function getGlobalLocalStorageCache(): LocalStorageCache;
|
|
|
4131
4337
|
declare function getGlobalInMemoryCache(): InMemoryCache;
|
|
4132
4338
|
declare function setupGlobalCaches(): void;
|
|
4133
4339
|
|
|
4134
|
-
interface Target$1 {
|
|
4135
|
-
x: number;
|
|
4136
|
-
y: number;
|
|
4137
|
-
bounds: {
|
|
4138
|
-
minX: number;
|
|
4139
|
-
minY: number;
|
|
4140
|
-
maxX: number;
|
|
4141
|
-
maxY: number;
|
|
4142
|
-
};
|
|
4143
|
-
connectionName: string;
|
|
4144
|
-
availableZ: number[];
|
|
4145
|
-
}
|
|
4146
|
-
type BucketCoordinate = `${number}x${number}`;
|
|
4147
|
-
declare class TargetTree {
|
|
4148
|
-
targets: Target$1[];
|
|
4149
|
-
buckets: Map<BucketCoordinate, [Target$1, number][]>;
|
|
4150
|
-
CELL_SIZE: number;
|
|
4151
|
-
constructor(targets: Target$1[]);
|
|
4152
|
-
getBucketKey(x: number, y: number): BucketCoordinate;
|
|
4153
|
-
getTargetsInArea(centerX: number, centerY: number, width: number, height: number): Target$1[];
|
|
4154
|
-
}
|
|
4155
|
-
|
|
4156
|
-
interface CapacityMeshNodeSolverOptions$2 {
|
|
4157
|
-
capacityDepth?: number;
|
|
4158
|
-
}
|
|
4159
|
-
interface Target {
|
|
4160
|
-
x: number;
|
|
4161
|
-
y: number;
|
|
4162
|
-
bounds: {
|
|
4163
|
-
minX: number;
|
|
4164
|
-
minY: number;
|
|
4165
|
-
maxX: number;
|
|
4166
|
-
maxY: number;
|
|
4167
|
-
};
|
|
4168
|
-
connectionName: string;
|
|
4169
|
-
availableZ: number[];
|
|
4170
|
-
}
|
|
4171
|
-
declare class CapacityMeshNodeSolver extends BaseSolver {
|
|
4172
|
-
srj: SimpleRouteJson;
|
|
4173
|
-
opts: CapacityMeshNodeSolverOptions$2;
|
|
4174
|
-
unfinishedNodes: CapacityMeshNode[];
|
|
4175
|
-
finishedNodes: CapacityMeshNode[];
|
|
4176
|
-
nodeToXYOverlappingObstaclesMap: Map<CapacityMeshNodeId, Obstacle[]>;
|
|
4177
|
-
layerCount: number;
|
|
4178
|
-
protected outlinePolygon?: Polygon;
|
|
4179
|
-
MAX_DEPTH: number;
|
|
4180
|
-
targets: Target[];
|
|
4181
|
-
targetTree: TargetTree;
|
|
4182
|
-
obstacleTree: ObstacleSpatialHashIndex;
|
|
4183
|
-
constructor(srj: SimpleRouteJson, opts?: CapacityMeshNodeSolverOptions$2);
|
|
4184
|
-
computeTargets(): Target[];
|
|
4185
|
-
protected getNodeBounds(node: CapacityMeshNode): {
|
|
4186
|
-
minX: number;
|
|
4187
|
-
maxX: number;
|
|
4188
|
-
minY: number;
|
|
4189
|
-
maxY: number;
|
|
4190
|
-
};
|
|
4191
|
-
protected getNodeRect(node: CapacityMeshNode): {
|
|
4192
|
-
center: {
|
|
4193
|
-
x: number;
|
|
4194
|
-
y: number;
|
|
4195
|
-
};
|
|
4196
|
-
width: number;
|
|
4197
|
-
height: number;
|
|
4198
|
-
};
|
|
4199
|
-
_nextNodeCounter: number;
|
|
4200
|
-
getNextNodeId(): string;
|
|
4201
|
-
getCapacityFromDepth(depth: number): number;
|
|
4202
|
-
getTargetIfNodeContainsTarget(node: CapacityMeshNode): Target | null;
|
|
4203
|
-
getXYOverlappingObstacles(node: CapacityMeshNode): Obstacle[];
|
|
4204
|
-
getXYZOverlappingObstacles(node: CapacityMeshNode): Obstacle[];
|
|
4205
|
-
/**
|
|
4206
|
-
* Checks if the given mesh node overlaps with any obstacle.
|
|
4207
|
-
* We treat both obstacles and nodes as axis‐aligned rectangles.
|
|
4208
|
-
*/
|
|
4209
|
-
doesNodeOverlapObstacle(node: CapacityMeshNode): boolean;
|
|
4210
|
-
/**
|
|
4211
|
-
* Checks if the entire node is contained within any obstacle.
|
|
4212
|
-
*/
|
|
4213
|
-
isNodeCompletelyInsideObstacle(node: CapacityMeshNode): boolean;
|
|
4214
|
-
getChildNodes(parent: CapacityMeshNode): CapacityMeshNode[];
|
|
4215
|
-
shouldNodeBeXYSubdivided(node: CapacityMeshNode): boolean;
|
|
4216
|
-
_step(): void;
|
|
4217
|
-
/**
|
|
4218
|
-
* Creates a GraphicsObject to visualize the mesh, its nodes, obstacles, and connection points.
|
|
4219
|
-
*
|
|
4220
|
-
* - Mesh nodes are rendered as rectangles.
|
|
4221
|
-
* - Nodes that have an obstacle intersection are outlined in red.
|
|
4222
|
-
* - Other nodes are outlined in green.
|
|
4223
|
-
* - Lines are drawn from a node to its parent.
|
|
4224
|
-
* - Obstacles are drawn as semi-transparent red rectangles.
|
|
4225
|
-
* - Points for each connection’s pointsToConnect are drawn in a unique color.
|
|
4226
|
-
*/
|
|
4227
|
-
visualize(): GraphicsObject;
|
|
4228
|
-
}
|
|
4229
|
-
|
|
4230
|
-
interface CapacityMeshNodeSolverOptions$1 {
|
|
4231
|
-
capacityDepth?: number;
|
|
4232
|
-
}
|
|
4233
|
-
declare class CapacityMeshNodeSolver2_NodeUnderObstacle extends CapacityMeshNodeSolver {
|
|
4234
|
-
srj: SimpleRouteJson;
|
|
4235
|
-
opts: CapacityMeshNodeSolverOptions$1;
|
|
4236
|
-
VIA_DIAMETER: number;
|
|
4237
|
-
OBSTACLE_MARGIN: number;
|
|
4238
|
-
/**
|
|
4239
|
-
* The threshold for the percentage of a single-layer node that must be
|
|
4240
|
-
* covered by obstacles to be considered "under an obstacle"
|
|
4241
|
-
*/
|
|
4242
|
-
OVERLAP_THRESHOLD_FOR_SINGLE_LAYER_NODES: number;
|
|
4243
|
-
constructor(srj: SimpleRouteJson, opts?: CapacityMeshNodeSolverOptions$1);
|
|
4244
|
-
isNodeCompletelyOutsideBounds(node: CapacityMeshNode): boolean;
|
|
4245
|
-
isNodePartiallyOutsideBounds(node: CapacityMeshNode): boolean;
|
|
4246
|
-
/**
|
|
4247
|
-
* Calculate the percentage of node area covered by obstacles
|
|
4248
|
-
*/
|
|
4249
|
-
getObstacleCoveragePercentage(node: CapacityMeshNode): number;
|
|
4250
|
-
/**
|
|
4251
|
-
* Check if a single-layer node should be filtered due to obstacle coverage
|
|
4252
|
-
*/
|
|
4253
|
-
shouldFilterSingleLayerNodeForObstacle(node: CapacityMeshNode): boolean;
|
|
4254
|
-
/**
|
|
4255
|
-
* Check if a node should be filtered due to obstacles.
|
|
4256
|
-
* Single-layer nodes: filtered only if >20% covered
|
|
4257
|
-
* Multi-layer nodes: filtered if any overlap
|
|
4258
|
-
*/
|
|
4259
|
-
shouldFilterNodeForObstacle(node: CapacityMeshNode): boolean;
|
|
4260
|
-
createChildNodeAtPosition(parent: CapacityMeshNode, opts: {
|
|
4261
|
-
center: {
|
|
4262
|
-
x: number;
|
|
4263
|
-
y: number;
|
|
4264
|
-
};
|
|
4265
|
-
width: number;
|
|
4266
|
-
height: number;
|
|
4267
|
-
availableZ: number[];
|
|
4268
|
-
_depth?: number;
|
|
4269
|
-
}): CapacityMeshNode;
|
|
4270
|
-
getZSubdivisionChildNodes(node: CapacityMeshNode): CapacityMeshNode[];
|
|
4271
|
-
getChildNodes(parent: CapacityMeshNode): CapacityMeshNode[];
|
|
4272
|
-
shouldNodeBeXYSubdivided(node: CapacityMeshNode): boolean;
|
|
4273
|
-
_step(): void;
|
|
4274
|
-
}
|
|
4275
|
-
|
|
4276
4340
|
interface CapacityMeshNodeSolverOptions {
|
|
4277
4341
|
capacityDepth?: number;
|
|
4278
4342
|
}
|