@tscircuit/capacity-autorouter 0.0.297 → 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
 
@@ -4423,6 +4431,65 @@ declare class HgPortPointPathingSolver extends HyperGraphSolver<HgRegion, HgPort
4423
4431
  visualize(): GraphicsObject;
4424
4432
  }
4425
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
+
4426
4493
  interface CapacityMeshSolverOptions$1 {
4427
4494
  capacityDepth?: number;
4428
4495
  targetMinCapacity?: number;
@@ -4454,6 +4521,7 @@ declare class AutoroutingPipelineSolver3_HgPortPointPathing extends BaseSolver {
4454
4521
  multiSectionPortPointOptimizer?: MultiSectionPortPointOptimizer;
4455
4522
  uniformPortDistributionSolver?: UniformPortDistributionSolver;
4456
4523
  traceWidthSolver?: TraceWidthSolver;
4524
+ necessaryCrampedPortPointSolver?: MultiTargetNecessaryCrampedPortPointSolver;
4457
4525
  viaDiameter: number;
4458
4526
  minTraceWidth: number;
4459
4527
  effort: number;
@@ -4467,7 +4535,7 @@ declare class AutoroutingPipelineSolver3_HgPortPointPathing extends BaseSolver {
4467
4535
  capacityEdges: CapacityMeshEdge[] | null;
4468
4536
  inputNodeWithPortPoints: InputNodeWithPortPoints[];
4469
4537
  cacheProvider: CacheProvider | null;
4470
- 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>)[];
4471
4539
  constructor(srj: SimpleRouteJson, opts?: CapacityMeshSolverOptions$1);
4472
4540
  getConstructorParams(): readonly [SimpleRouteJson, CapacityMeshSolverOptions$1];
4473
4541
  currentPipelineStepIndex: number;