@tscircuit/schematic-trace-solver 0.0.181 → 0.0.182
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.js +7 -1
- package/lib/solvers/InlineNetLabelSolver/pushAnchoredNetLabelsAwayFromInlineLabels.ts +10 -0
- package/package.json +1 -1
- package/tests/bug-reports/bug-report-20260901T055358Z/__snapshots__/bug-report-20260901T055358Z.snap.svg +10 -10
- package/tests/repros/__snapshots__/repro-core-tb67s579ftg-inline-label-routing.snap.svg +181 -181
- package/tests/repros/__snapshots__/repro-mcp73831-charger-traces.snap.svg +10 -10
- package/tests/solvers/InlineNetLabelSolver/push-anchored-net-labels-away.test.ts +62 -0
package/dist/index.js
CHANGED
|
@@ -15048,7 +15048,13 @@ var pushAnchoredNetLabelsAwayFromInlineLabels = ({
|
|
|
15048
15048
|
label.anchorPoint,
|
|
15049
15049
|
movedLabel.anchorPoint
|
|
15050
15050
|
);
|
|
15051
|
-
const connectorObstructed =
|
|
15051
|
+
const connectorObstructed = outputTraces.some(
|
|
15052
|
+
(trace) => trace.globalConnNetId !== connector.globalConnNetId && findPerpendicularPathCrossings(
|
|
15053
|
+
connector.tracePath,
|
|
15054
|
+
trace.tracePath,
|
|
15055
|
+
{ includeTerminalSegments: true }
|
|
15056
|
+
).length > 0
|
|
15057
|
+
) || inlineBounds.some(
|
|
15052
15058
|
(bounds) => pathIntersectsBounds(connector.tracePath, bounds)
|
|
15053
15059
|
) || inputProblem.chips.some(
|
|
15054
15060
|
(chip) => !ownerChipIds.has(chip.chipId) && pathIntersectsBounds(connector.tracePath, {
|
|
@@ -5,6 +5,7 @@ import {
|
|
|
5
5
|
} from "lib/solvers/AvailableNetOrientationSolver/traces"
|
|
6
6
|
import type { NetLabelPlacement } from "lib/solvers/NetLabelPlacementSolver/NetLabelPlacementSolver"
|
|
7
7
|
import type { SolvedTracePath } from "lib/solvers/SchematicTraceLinesSolver/SchematicTraceLinesSolver"
|
|
8
|
+
import { findPerpendicularPathCrossings } from "lib/solvers/TraceCleanupSolver/sub-solver/findIntersectionsWithObstacles"
|
|
8
9
|
import type { InputProblem } from "lib/types/InputProblem"
|
|
9
10
|
import { dir, type FacingDirection } from "lib/utils/dir"
|
|
10
11
|
import { boundsOverlap, getTextBoxBounds } from "lib/utils/textBoxBounds"
|
|
@@ -481,6 +482,15 @@ export const pushAnchoredNetLabelsAwayFromInlineLabels = ({
|
|
|
481
482
|
movedLabel.anchorPoint,
|
|
482
483
|
)
|
|
483
484
|
const connectorObstructed =
|
|
485
|
+
outputTraces.some(
|
|
486
|
+
(trace) =>
|
|
487
|
+
trace.globalConnNetId !== connector.globalConnNetId &&
|
|
488
|
+
findPerpendicularPathCrossings(
|
|
489
|
+
connector.tracePath,
|
|
490
|
+
trace.tracePath,
|
|
491
|
+
{ includeTerminalSegments: true },
|
|
492
|
+
).length > 0,
|
|
493
|
+
) ||
|
|
484
494
|
inlineBounds.some((bounds) =>
|
|
485
495
|
pathIntersectsBounds(connector.tracePath, bounds),
|
|
486
496
|
) ||
|