@tscircuit/schematic-trace-solver 0.0.50 → 0.0.52
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 +120 -3
- package/dist/index.js +1149 -51
- package/lib/solvers/SchematicTracePipelineSolver/SchematicTracePipelineSolver.ts +30 -0
- package/lib/solvers/TraceAnchoredNetLabelOverlapSolver/TraceAnchoredNetLabelOverlapSolver.ts +331 -0
- package/lib/solvers/TraceAnchoredNetLabelOverlapSolver/candidates.ts +429 -0
- package/lib/solvers/TraceAnchoredNetLabelOverlapSolver/geometry.ts +250 -0
- package/lib/solvers/TraceAnchoredNetLabelOverlapSolver/types.ts +47 -0
- package/lib/solvers/TraceAnchoredNetLabelOverlapSolver/visualize.ts +125 -0
- package/lib/solvers/VccNetLabelCornerPlacementSolver/VccNetLabelCornerPlacementSolver.ts +268 -0
- package/lib/solvers/VccNetLabelCornerPlacementSolver/geometry.ts +59 -0
- package/lib/solvers/VccNetLabelCornerPlacementSolver/types.ts +37 -0
- package/lib/solvers/VccNetLabelCornerPlacementSolver/visualize.ts +114 -0
- package/package.json +1 -1
- package/tests/examples/__snapshots__/example12.snap.svg +2 -2
- package/tests/examples/__snapshots__/example14.snap.svg +68 -68
- package/tests/examples/__snapshots__/example17.snap.svg +2 -2
- package/tests/examples/__snapshots__/example30.snap.svg +59 -59
- package/tests/examples/__snapshots__/example31.snap.svg +12 -12
package/dist/index.d.ts
CHANGED
|
@@ -642,10 +642,10 @@ type CandidateLabel = {
|
|
|
642
642
|
width: number;
|
|
643
643
|
height: number;
|
|
644
644
|
};
|
|
645
|
-
type CandidateStatus = "valid" | "chip-collision" | "trace-collision" | "netlabel-collision";
|
|
645
|
+
type CandidateStatus$1 = "valid" | "chip-collision" | "trace-collision" | "netlabel-collision";
|
|
646
646
|
type CandidatePhase = "rotate" | "shift";
|
|
647
647
|
type EvaluatedCandidate = CandidateLabel & {
|
|
648
|
-
status: CandidateStatus;
|
|
648
|
+
status: CandidateStatus$1;
|
|
649
649
|
selected: boolean;
|
|
650
650
|
phase: CandidatePhase;
|
|
651
651
|
distance?: number;
|
|
@@ -706,6 +706,121 @@ declare class AvailableNetOrientationSolver extends BaseSolver {
|
|
|
706
706
|
visualize(): GraphicsObject;
|
|
707
707
|
}
|
|
708
708
|
|
|
709
|
+
interface VccNetLabelCornerPlacementSolverParams {
|
|
710
|
+
inputProblem: InputProblem;
|
|
711
|
+
traces: SolvedTracePath[];
|
|
712
|
+
netLabelPlacements: NetLabelPlacement[];
|
|
713
|
+
}
|
|
714
|
+
type TraceCornerCandidate = {
|
|
715
|
+
anchorPoint: Point;
|
|
716
|
+
traceId: string;
|
|
717
|
+
distance: number;
|
|
718
|
+
};
|
|
719
|
+
type CornerCandidateStatus = "valid" | "chip-collision" | "trace-collision" | "netlabel-collision";
|
|
720
|
+
type EvaluatedCornerCandidate = TraceCornerCandidate & {
|
|
721
|
+
center: Point;
|
|
722
|
+
width: number;
|
|
723
|
+
height: number;
|
|
724
|
+
status: CornerCandidateStatus;
|
|
725
|
+
selected: boolean;
|
|
726
|
+
};
|
|
727
|
+
|
|
728
|
+
declare class VccNetLabelCornerPlacementSolver extends BaseSolver {
|
|
729
|
+
inputProblem: InputProblem;
|
|
730
|
+
traces: SolvedTracePath[];
|
|
731
|
+
netLabelPlacements: NetLabelPlacement[];
|
|
732
|
+
outputNetLabelPlacements: NetLabelPlacement[];
|
|
733
|
+
queuedLabelIndices: number[];
|
|
734
|
+
currentLabelIndex: number | null;
|
|
735
|
+
currentLabel: NetLabelPlacement | null;
|
|
736
|
+
currentCandidateResults: EvaluatedCornerCandidate[];
|
|
737
|
+
private queuedCornerCandidates;
|
|
738
|
+
private shouldAdvanceToNextLabel;
|
|
739
|
+
private traceMap;
|
|
740
|
+
constructor(params: VccNetLabelCornerPlacementSolverParams);
|
|
741
|
+
getConstructorParams(): ConstructorParameters<typeof VccNetLabelCornerPlacementSolver>[0];
|
|
742
|
+
_step(): void;
|
|
743
|
+
getOutput(): {
|
|
744
|
+
netLabelPlacements: NetLabelPlacement[];
|
|
745
|
+
};
|
|
746
|
+
private getProcessableLabelIndices;
|
|
747
|
+
private prepareNextLabel;
|
|
748
|
+
private advanceToNextLabel;
|
|
749
|
+
private clearCurrentLabel;
|
|
750
|
+
private finish;
|
|
751
|
+
private evaluateCornerCandidate;
|
|
752
|
+
private getCandidateStatus;
|
|
753
|
+
private applyCandidate;
|
|
754
|
+
private shouldProcessLabel;
|
|
755
|
+
private intersectsAnyChip;
|
|
756
|
+
private intersectsAnyOtherNetLabel;
|
|
757
|
+
private getCornerCandidatesForLabel;
|
|
758
|
+
private getTraceLinesForLabel;
|
|
759
|
+
private isTraceForLabel;
|
|
760
|
+
visualize(): GraphicsObject;
|
|
761
|
+
}
|
|
762
|
+
|
|
763
|
+
interface TraceAnchoredNetLabelOverlapSolverParams {
|
|
764
|
+
inputProblem: InputProblem;
|
|
765
|
+
traces: SolvedTracePath[];
|
|
766
|
+
netLabelPlacements: NetLabelPlacement[];
|
|
767
|
+
}
|
|
768
|
+
type LabelOverlap = {
|
|
769
|
+
firstLabelIndex: number;
|
|
770
|
+
secondLabelIndex: number;
|
|
771
|
+
};
|
|
772
|
+
type CandidateStatus = "valid" | "chip-collision" | "trace-collision" | "netlabel-collision";
|
|
773
|
+
type LabelCandidate = {
|
|
774
|
+
anchorPoint: Point;
|
|
775
|
+
center: Point;
|
|
776
|
+
width: number;
|
|
777
|
+
height: number;
|
|
778
|
+
orientation: FacingDirection;
|
|
779
|
+
traceId: string;
|
|
780
|
+
pathDistance: number;
|
|
781
|
+
distanceFromOriginal: number;
|
|
782
|
+
status: CandidateStatus;
|
|
783
|
+
selected: boolean;
|
|
784
|
+
};
|
|
785
|
+
|
|
786
|
+
declare class TraceAnchoredNetLabelOverlapSolver extends BaseSolver {
|
|
787
|
+
inputProblem: InputProblem;
|
|
788
|
+
traces: SolvedTracePath[];
|
|
789
|
+
netLabelPlacements: NetLabelPlacement[];
|
|
790
|
+
outputNetLabelPlacements: NetLabelPlacement[];
|
|
791
|
+
currentOverlap: LabelOverlap | null;
|
|
792
|
+
currentCandidateResults: LabelCandidate[];
|
|
793
|
+
private activeSearch;
|
|
794
|
+
private skippedOverlapKeys;
|
|
795
|
+
constructor(params: TraceAnchoredNetLabelOverlapSolverParams);
|
|
796
|
+
getConstructorParams(): ConstructorParameters<typeof TraceAnchoredNetLabelOverlapSolver>[0];
|
|
797
|
+
_step(): void;
|
|
798
|
+
getOutput(): {
|
|
799
|
+
netLabelPlacements: NetLabelPlacement[];
|
|
800
|
+
};
|
|
801
|
+
private findNextOverlap;
|
|
802
|
+
private isLabelEligible;
|
|
803
|
+
private labelsOverlap;
|
|
804
|
+
private startNextOverlapSearch;
|
|
805
|
+
private getMoveLabelIndices;
|
|
806
|
+
private getNextSearchWithCandidates;
|
|
807
|
+
private activateNextLabelSearch;
|
|
808
|
+
private skipSearch;
|
|
809
|
+
private evaluateNextCandidate;
|
|
810
|
+
private getCandidatesForLabel;
|
|
811
|
+
private getCandidateStatus;
|
|
812
|
+
private applyCandidate;
|
|
813
|
+
private intersectsAnyChip;
|
|
814
|
+
private intersectsAnyOtherLabel;
|
|
815
|
+
private getTraceLocationsForLabel;
|
|
816
|
+
private isTraceAssociatedWithLabel;
|
|
817
|
+
private getOverlapKey;
|
|
818
|
+
private finish;
|
|
819
|
+
private setActiveSearch;
|
|
820
|
+
private clearActiveSearch;
|
|
821
|
+
visualize(): GraphicsObject;
|
|
822
|
+
}
|
|
823
|
+
|
|
709
824
|
/**
|
|
710
825
|
* Pipeline solver that runs a series of solvers to find the best schematic layout.
|
|
711
826
|
* Coordinates the entire layout process from chip partitioning through final packing.
|
|
@@ -733,12 +848,14 @@ declare class SchematicTracePipelineSolver extends BaseSolver {
|
|
|
733
848
|
traceCleanupSolver?: TraceCleanupSolver;
|
|
734
849
|
example28Solver?: Example28Solver;
|
|
735
850
|
availableNetOrientationSolver?: AvailableNetOrientationSolver;
|
|
851
|
+
vccNetLabelCornerPlacementSolver?: VccNetLabelCornerPlacementSolver;
|
|
852
|
+
traceAnchoredNetLabelOverlapSolver?: TraceAnchoredNetLabelOverlapSolver;
|
|
736
853
|
startTimeOfPhase: Record<string, number>;
|
|
737
854
|
endTimeOfPhase: Record<string, number>;
|
|
738
855
|
timeSpentOnPhase: Record<string, number>;
|
|
739
856
|
firstIterationOfPhase: Record<string, number>;
|
|
740
857
|
inputProblem: InputProblem;
|
|
741
|
-
pipelineDef: (PipelineStep<typeof MspConnectionPairSolver> | PipelineStep<typeof SchematicTraceLinesSolver> | PipelineStep<typeof LongDistancePairSolver> | PipelineStep<typeof TraceOverlapShiftSolver> | PipelineStep<typeof NetLabelPlacementSolver> | PipelineStep<typeof TraceLabelOverlapAvoidanceSolver> | PipelineStep<typeof TraceCleanupSolver> | PipelineStep<typeof Example28Solver> | PipelineStep<typeof AvailableNetOrientationSolver>)[];
|
|
858
|
+
pipelineDef: (PipelineStep<typeof MspConnectionPairSolver> | PipelineStep<typeof SchematicTraceLinesSolver> | PipelineStep<typeof LongDistancePairSolver> | PipelineStep<typeof TraceOverlapShiftSolver> | PipelineStep<typeof NetLabelPlacementSolver> | PipelineStep<typeof TraceLabelOverlapAvoidanceSolver> | PipelineStep<typeof TraceCleanupSolver> | PipelineStep<typeof Example28Solver> | PipelineStep<typeof AvailableNetOrientationSolver> | PipelineStep<typeof VccNetLabelCornerPlacementSolver> | PipelineStep<typeof TraceAnchoredNetLabelOverlapSolver>)[];
|
|
742
859
|
constructor(inputProblem: InputProblem);
|
|
743
860
|
getConstructorParams(): ConstructorParameters<typeof SchematicTracePipelineSolver>[0];
|
|
744
861
|
currentPipelineStepIndex: number;
|