final release

This commit is contained in:
Finn Tews
2026-05-08 22:37:31 +02:00
parent feac4235b2
commit 708b527598
2 changed files with 13 additions and 12 deletions

View File

@@ -239,6 +239,13 @@ function attachEdgeTabsToNearestBusbars(busbars, geometries, positions, options)
} }
for (const best of selectedByBusbar) { for (const best of selectedByBusbar) {
// Skip if the anchor is too far horizontally from the tab centre — this
// means the busbar doesn't straddle the slot and the arm would require a
// hard 90° bend (e.g. a single-column vertical busbar next to a tab).
// Valid connections have an edge midpoint exactly at tab.x → deltaX ≈ 0.
// Invalid single-column case has deltaX ≈ ±pitch/2 > cellRadius.
if (Math.abs(best.deltaX) > cellRadius) continue;
const sameTabCandidates = conflictsByTab.get(best.tabKey) || []; const sameTabCandidates = conflictsByTab.get(best.tabKey) || [];
const leftCandidate = sameTabCandidates.find((candidate) => candidate.deltaX < -betweenBusbarThreshold); const leftCandidate = sameTabCandidates.find((candidate) => candidate.deltaX < -betweenBusbarThreshold);
const rightCandidate = sameTabCandidates.find((candidate) => candidate.deltaX > betweenBusbarThreshold); const rightCandidate = sameTabCandidates.find((candidate) => candidate.deltaX > betweenBusbarThreshold);

View File

@@ -309,18 +309,12 @@ function computeEdgeOverlapFeatures(cellIndices, positions, layoutType, overlapL
return { extraPads: [], extraSegments: [] }; return { extraPads: [], extraSegments: [] };
} }
// Skip overlap if it would create a hard 90° bend at every boundary cell. // Skip overlap if the busbar spans only one column (all cells share the same
// This happens when no boundary cell has any busbar neighbour in the same row // X-coordinate, rounded to 0.1 mm). A single-column busbar's internal edges
// (i.e. the busbar only spans one column and all its internal connections are // are all vertical, so a horizontal arm would be at 90° to every connection
// vertical). In that case the horizontal arm is perpendicular to every // and would visually overlap adjacent busbars.
// connection and would overlap adjacent busbars. const uniqueXCount = new Set(selected.map(e => Math.round(e.pos[0] * 10))).size;
const hasSameRowBusbarNeighbour = boundaryEntries.some((entry) => if (uniqueXCount < 2) {
selected.some((other) =>
other.index !== entry.index &&
Math.abs(other.pos[1] - entry.pos[1]) <= yTolerance
)
);
if (!hasSameRowBusbarNeighbour) {
return { extraPads: [], extraSegments: [] }; return { extraPads: [], extraSegments: [] };
} }