@tscircuit/capacity-autorouter 0.0.296 → 0.0.298

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 CHANGED
@@ -810,6 +810,11 @@ interface SegmentPortPoint {
810
810
  rootConnectionName?: string;
811
811
  /** XY distance to the centermost port on this Z level (centermost port has distance 0) */
812
812
  distToCentermostPortOnZ: number;
813
+ /**
814
+ * This is special port point that is created in narrow gaps, and only kept when otherwise reaching the obstacle is impossible
815
+ * ideally this port points should be discarded but we need them in some cases
816
+ */
817
+ cramped: boolean;
813
818
  }
814
819
  interface SharedEdgeSegment {
815
820
  edgeId: string;
@@ -854,12 +859,14 @@ declare class AvailableSegmentPointSolver extends BaseSolver {
854
859
  /** Map from segmentPortPointId to SegmentPortPoint */
855
860
  portPointMap: Map<string, SegmentPortPoint>;
856
861
  colorMap: Record<string, string>;
857
- constructor({ nodes, edges, traceWidth, obstacleMargin, colorMap, }: {
862
+ shouldReturnCrampedPortPoints: boolean;
863
+ constructor({ nodes, edges, traceWidth, obstacleMargin, colorMap, shouldReturnCrampedPortPoints, }: {
858
864
  nodes: CapacityMeshNode[];
859
865
  edges: CapacityMeshEdge[];
860
866
  traceWidth: number;
861
867
  obstacleMargin?: number;
862
868
  colorMap?: Record<string, string>;
869
+ shouldReturnCrampedPortPoints: boolean;
863
870
  });
864
871
  _step(): void;
865
872
  private computeAllSharedEdgeSegments;
@@ -891,6 +898,7 @@ declare class AvailableSegmentPointSolver extends BaseSolver {
891
898
  * Get the count of available port points on an edge
892
899
  */
893
900
  getAvailablePortCountForEdge(nodeId1: CapacityMeshNodeId, nodeId2: CapacityMeshNodeId): number;
901
+ getOutput(): SharedEdgeSegment[];
894
902
  visualize(): GraphicsObject;
895
903
  }
896
904
 
@@ -4358,6 +4366,7 @@ interface HgPortPointPathingSolverParams {
4358
4366
  MAX_RIPS: number;
4359
4367
  MIN_ALLOWED_BOARD_SCORE: number;
4360
4368
  };
4369
+ layerCount: number;
4361
4370
  }
4362
4371
  declare class HgPortPointPathingSolver extends HyperGraphSolver<HgRegion, HgPort> {
4363
4372
  inputNodes: InputNodeWithPortPoints[];
@@ -4386,7 +4395,8 @@ declare class HgPortPointPathingSolver extends HyperGraphSolver<HgRegion, HgPort
4386
4395
  randomRipFraction: number;
4387
4396
  maxRips: number;
4388
4397
  MIN_ALLOWED_BOARD_SCORE: number;
4389
- constructor({ inputGraph, inputConnections, connectionsWithResults, inputNodes, portPointMap, regionMemoryPfMap, rippingEnabled, weights, forceCenterFirst, }: HgPortPointPathingSolverParams);
4398
+ layerCount: number;
4399
+ constructor({ inputGraph, inputConnections, connectionsWithResults, inputNodes, portPointMap, regionMemoryPfMap, rippingEnabled, weights, forceCenterFirst, layerCount, }: HgPortPointPathingSolverParams);
4390
4400
  private clampPf;
4391
4401
  private pfToFailureCost;
4392
4402
  private recordRegionMemoryPf;
@@ -4421,6 +4431,65 @@ declare class HgPortPointPathingSolver extends HyperGraphSolver<HgRegion, HgPort
4421
4431
  visualize(): GraphicsObject;
4422
4432
  }
4423
4433
 
4434
+ type ExploredPortPoint = {
4435
+ port: SegmentPortPoint;
4436
+ depth: number;
4437
+ parent: ExploredPortPoint | null;
4438
+ countOfCrampedPortPointsInPath: number;
4439
+ };
4440
+
4441
+ type SingleTargetNecessaryCrampedPortPointSolverInput = {
4442
+ target: CapacityMeshNode;
4443
+ mapOfCapacityMeshNodeIdToSegmentPortPoints: Map<CapacityMeshNodeId, SegmentPortPoint[]>;
4444
+ mapOfCapacityMeshNodeIdToRef: Map<CapacityMeshNodeId, CapacityMeshNode>;
4445
+ depthLimit: number;
4446
+ shouldIgnoreCrampedPortPoints: boolean;
4447
+ };
4448
+ declare class SingleTargetNecessaryCrampedPortPointSolver extends BaseSolver$1 {
4449
+ private input;
4450
+ private queue;
4451
+ private resultExploredPortPoints;
4452
+ private currentExploredPortPoints;
4453
+ private visitedExploredPortPoints;
4454
+ constructor(input: SingleTargetNecessaryCrampedPortPointSolverInput);
4455
+ getSolverName(): string;
4456
+ _setup(): void;
4457
+ _step(): void;
4458
+ getOutput(): ExploredPortPoint[];
4459
+ visualize(): GraphicsObject;
4460
+ }
4461
+
4462
+ type MultiTargetNecessaryCrampedPortPointSolverInput = {
4463
+ sharedEdgeSegments: SharedEdgeSegment[];
4464
+ capacityMeshNodes: CapacityMeshNode[];
4465
+ simpleRouteJson: SimpleRouteJson;
4466
+ };
4467
+ /**
4468
+ * This solver filters out cramped port points that are not necessary.
4469
+ */
4470
+ declare class MultiTargetNecessaryCrampedPortPointSolver extends BaseSolver$1 {
4471
+ private input;
4472
+ private unprocessedTargets;
4473
+ private targetNode;
4474
+ private currentTarget;
4475
+ private crampedPortPointsToKeep;
4476
+ private candidatesAtDepth;
4477
+ private isRunningCrampedPass;
4478
+ activeSubSolver: SingleTargetNecessaryCrampedPortPointSolver | null;
4479
+ /**
4480
+ * NOTE: I do not like maps, add a capacityMeshNode ref inside SegmentPortPoints
4481
+ * in future so we do not need the capacityMeshNodeId
4482
+ */
4483
+ private nodeMap;
4484
+ private mapOfCapacityMeshNodeIdToSegmentPortPoints;
4485
+ constructor(input: MultiTargetNecessaryCrampedPortPointSolverInput);
4486
+ getSolverName(): string;
4487
+ _setup(): void;
4488
+ _step(): void;
4489
+ getOutput(): SharedEdgeSegment[];
4490
+ visualize(): GraphicsObject;
4491
+ }
4492
+
4424
4493
  interface CapacityMeshSolverOptions$1 {
4425
4494
  capacityDepth?: number;
4426
4495
  targetMinCapacity?: number;
@@ -4452,6 +4521,7 @@ declare class AutoroutingPipelineSolver3_HgPortPointPathing extends BaseSolver {
4452
4521
  multiSectionPortPointOptimizer?: MultiSectionPortPointOptimizer;
4453
4522
  uniformPortDistributionSolver?: UniformPortDistributionSolver;
4454
4523
  traceWidthSolver?: TraceWidthSolver;
4524
+ necessaryCrampedPortPointSolver?: MultiTargetNecessaryCrampedPortPointSolver;
4455
4525
  viaDiameter: number;
4456
4526
  minTraceWidth: number;
4457
4527
  effort: number;
@@ -4465,7 +4535,7 @@ declare class AutoroutingPipelineSolver3_HgPortPointPathing extends BaseSolver {
4465
4535
  capacityEdges: CapacityMeshEdge[] | null;
4466
4536
  inputNodeWithPortPoints: InputNodeWithPortPoints[];
4467
4537
  cacheProvider: CacheProvider | null;
4468
- pipelineDef: (PipelineStep$1<typeof NetToPointPairsSolver2_OffBoardConnection> | PipelineStep$1<typeof RectDiffPipeline> | PipelineStep$1<typeof CapacityMeshEdgeSolver2_NodeTreeOptimization> | PipelineStep$1<typeof AvailableSegmentPointSolver> | PipelineStep$1<typeof HgPortPointPathingSolver> | PipelineStep$1<typeof UniformPortDistributionSolver> | PipelineStep$1<typeof HighDensitySolver> | PipelineStep$1<typeof MultipleHighDensityRouteStitchSolver> | PipelineStep$1<typeof TraceSimplificationSolver> | PipelineStep$1<typeof TraceWidthSolver>)[];
4538
+ pipelineDef: (PipelineStep$1<typeof NetToPointPairsSolver2_OffBoardConnection> | PipelineStep$1<typeof RectDiffPipeline> | PipelineStep$1<typeof CapacityMeshEdgeSolver2_NodeTreeOptimization> | PipelineStep$1<typeof AvailableSegmentPointSolver> | PipelineStep$1<typeof MultiTargetNecessaryCrampedPortPointSolver> | PipelineStep$1<typeof HgPortPointPathingSolver> | PipelineStep$1<typeof UniformPortDistributionSolver> | PipelineStep$1<typeof HighDensitySolver> | PipelineStep$1<typeof MultipleHighDensityRouteStitchSolver> | PipelineStep$1<typeof TraceSimplificationSolver> | PipelineStep$1<typeof TraceWidthSolver>)[];
4469
4539
  constructor(srj: SimpleRouteJson, opts?: CapacityMeshSolverOptions$1);
4470
4540
  getConstructorParams(): readonly [SimpleRouteJson, CapacityMeshSolverOptions$1];
4471
4541
  currentPipelineStepIndex: number;