@tscircuit/capacity-autorouter 0.0.139 → 0.0.141

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/README.md CHANGED
@@ -68,6 +68,7 @@ interface Obstacle {
68
68
  width: number
69
69
  height: number
70
70
  connectedTo: string[] // TraceIds
71
+ offBoardConnectsTo?: string[] // TraceIds connected off-board
71
72
  }
72
73
 
73
74
  interface SimpleRouteConnection {
package/dist/index.d.ts CHANGED
@@ -33,6 +33,7 @@ interface Obstacle {
33
33
  height: number;
34
34
  connectedTo: TraceId[];
35
35
  netIsAssignable?: boolean;
36
+ offBoardConnectsTo?: TraceId[];
36
37
  }
37
38
  interface SimpleRouteConnection {
38
39
  name: string;
@@ -2179,13 +2180,15 @@ interface CapacityMeshNodeSolverOptions {
2179
2180
  * aren't allowed, but there may be assignable vias on the PCB as obstacles.
2180
2181
  *
2181
2182
  * Behavior:
2182
- * - Outside obstacles, multi-layer nodes are *always* Z-split into single-layer nodes.
2183
- * - Inside an "assignable" obstacle (obstacle.netIsAssignable === true), we keep
2184
- * exactly *one* multi-layer node (capacity ~ 1 via region), i.e. we do not Z-split it.
2185
- * Further nodes completely inside the same assignable obstacle will be Z-split (one per layer).
2183
+ * - Outside assignable obstacles, multi-layer nodes are *always* Z-split into single-layer nodes.
2184
+ * - During mesh subdivision, nodes overlapping with "assignable" obstacles
2185
+ * (obstacle.netIsAssignable === true) are NOT filtered, allowing normal subdivision.
2186
+ * - After the main mesh subdivision is complete:
2187
+ * 1. All nodes overlapping with assignable obstacles are removed
2188
+ * 2. Each assignable obstacle is replaced with a single multi-layer node spanning all layers
2186
2189
  * - Single-layer nodes that are larger than MAX_SIZE_FOR_SINGLE_LAYER_NODES are XY-subdivided.
2187
- * - IMPORTANT: the single multi-layer node inside an assignable obstacle is **traversable**,
2188
- * so we mark `_containsObstacle = false` and `_completelyInsideObstacle = false` on it.
2190
+ * - IMPORTANT: the multi-layer nodes created from assignable obstacles are **traversable**,
2191
+ * so we mark `_containsObstacle = false` and `_completelyInsideObstacle = false` on them.
2189
2192
  */
2190
2193
  declare class CapacityMeshNodeSolver_OnlyTraverseLayersInAssignableObstacles extends CapacityMeshNodeSolver2_NodeUnderObstacle {
2191
2194
  srj: SimpleRouteJson;
@@ -2194,15 +2197,17 @@ declare class CapacityMeshNodeSolver_OnlyTraverseLayersInAssignableObstacles ext
2194
2197
  constructor(srj: SimpleRouteJson, opts?: CapacityMeshNodeSolverOptions);
2195
2198
  private isObstacleAssignable;
2196
2199
  private getOverlappingAssignableObstacles;
2197
- private isNodeCompletelyInsideSpecificObstacle;
2198
- private getAssignableContainer;
2199
2200
  shouldNodeBeXYSubdivided(node: CapacityMeshNode): boolean;
2200
2201
  /**
2201
- * Multi-layer nodes are filtered unless they are completely inside an
2202
- * assignable obstacle (the single allowed via region per obstacle).
2203
- * Single-layer nodes use the standard relaxed single-layer filtering.
2202
+ * Filter nodes for obstacles, but skip filtering for assignable obstacles.
2203
+ * Assignable obstacles will be handled separately at the end.
2204
2204
  */
2205
2205
  shouldFilterNodeForObstacle(node: CapacityMeshNode): boolean;
2206
+ /**
2207
+ * Remove nodes inside assignable obstacles and replace with single multi-layer nodes.
2208
+ * The new node's bounds are extended to cover all removed nodes' XY space.
2209
+ */
2210
+ private insertAssignableObstaclesAsNodes;
2206
2211
  _step(): void;
2207
2212
  }
2208
2213