@tscircuit/schematic-trace-solver 0.0.163 → 0.0.164
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 +8 -4
- package/lib/solvers/SchematicTraceLinesSolver/SchematicTraceSingleLineSolver2/SchematicTraceSingleLineSolver2.ts +15 -4
- package/package.json +1 -1
- package/tests/bug-reports/bug-report-20260730T061837Z/__snapshots__/bug-report-20260730T061837Z.snap.svg +166 -166
- package/tests/repros/__snapshots__/board-1273-trace-overlap-cycle.snap.svg +26 -26
- package/tests/repros/__snapshots__/repro-pmp11282-endpoint-trace-through-component-text.snap.svg +76 -0
- package/tests/repros/__snapshots__/repro-pmp11282-isolated-dcdc.snap.svg +131 -113
- package/tests/repros/__snapshots__/repro-tida010076-page02.snap.svg +1681 -1690
- package/tests/repros/repro-pmp11282-endpoint-trace-through-component-text.test.ts +82 -0
- package/tests/repros/repro-pmp11282-isolated-dcdc.test.ts +5 -5
package/dist/index.js
CHANGED
|
@@ -1507,13 +1507,17 @@ var SchematicTraceSingleLineSolver2 = class extends BaseSolver {
|
|
|
1507
1507
|
excludeRectsForSegment: (segIndex2) => {
|
|
1508
1508
|
const lastSegIndex2 = path.length - 2;
|
|
1509
1509
|
const excludedRects = /* @__PURE__ */ new Set();
|
|
1510
|
-
|
|
1510
|
+
const segmentStart = path[segIndex2];
|
|
1511
|
+
const segmentEnd = path[segIndex2 + 1];
|
|
1512
|
+
const oppositeTerminalPin = segIndex2 === 0 ? PB : segIndex2 === lastSegIndex2 ? PA : null;
|
|
1513
|
+
if (oppositeTerminalPin) {
|
|
1511
1514
|
for (const textObstacle of this.textObstacles) {
|
|
1512
|
-
|
|
1515
|
+
const textBounds = getTextBoxBounds(textObstacle.textBox);
|
|
1516
|
+
if (textObstacle.textBox.chipId !== oppositeTerminalPin.chipId || !segmentIntersectsRect(segmentStart, segmentEnd, textBounds)) {
|
|
1517
|
+
excludedRects.add(textObstacle);
|
|
1518
|
+
}
|
|
1513
1519
|
}
|
|
1514
1520
|
}
|
|
1515
|
-
const segmentStart = path[segIndex2];
|
|
1516
|
-
const segmentEnd = path[segIndex2 + 1];
|
|
1517
1521
|
const endpointEpsilon = 1e-9;
|
|
1518
1522
|
const segmentTouchesPin = (pin) => [segmentStart, segmentEnd].some(
|
|
1519
1523
|
(point) => Math.abs(point.x - pin.x) <= endpointEpsilon && Math.abs(point.y - pin.y) <= endpointEpsilon
|
|
@@ -325,15 +325,26 @@ export class SchematicTraceSingleLineSolver2 extends BaseSolver {
|
|
|
325
325
|
excludeRectsForSegment: (segIndex) => {
|
|
326
326
|
const lastSegIndex = path.length - 2
|
|
327
327
|
const excludedRects = new Set<ObstacleRect>()
|
|
328
|
+
const segmentStart = path[segIndex]!
|
|
329
|
+
const segmentEnd = path[segIndex + 1]!
|
|
328
330
|
|
|
329
|
-
|
|
331
|
+
const oppositeTerminalPin =
|
|
332
|
+
segIndex === 0 ? PB : segIndex === lastSegIndex ? PA : null
|
|
333
|
+
if (oppositeTerminalPin) {
|
|
330
334
|
for (const textObstacle of this.textObstacles) {
|
|
331
|
-
|
|
335
|
+
// Preserve the existing terminal-segment clearance exception, but
|
|
336
|
+
// do not let a segment that wraps around the opposite endpoint cut
|
|
337
|
+
// through that component's actual text.
|
|
338
|
+
const textBounds = getTextBoxBounds(textObstacle.textBox)
|
|
339
|
+
if (
|
|
340
|
+
textObstacle.textBox.chipId !== oppositeTerminalPin.chipId ||
|
|
341
|
+
!segmentIntersectsRect(segmentStart, segmentEnd, textBounds)
|
|
342
|
+
) {
|
|
343
|
+
excludedRects.add(textObstacle)
|
|
344
|
+
}
|
|
332
345
|
}
|
|
333
346
|
}
|
|
334
347
|
|
|
335
|
-
const segmentStart = path[segIndex]!
|
|
336
|
-
const segmentEnd = path[segIndex + 1]!
|
|
337
348
|
const endpointEpsilon = 1e-9
|
|
338
349
|
const segmentTouchesPin = (pin: MspConnectionPair["pins"][number]) =>
|
|
339
350
|
[segmentStart, segmentEnd].some(
|