mirror of
https://github.com/qelectrotech/qelectrotech-source-mirror.git
synced 2026-09-29 22:24:13 +02:00
abd5e8978a
generateConductorPath()'s cas "3"/"4" branches each insert a two-point bridge along one axis, at a coordinate on the other axis computed as the midpoint of depart/arrivee and then snapped to the routing grid by a loop that walks it strictly downward until it divides evenly. When depart and arrivee already agree on the axis the bridge would run along, no bridge is needed at all -- the midpoint starts on the correct, already-shared value. But the snap can still walk it off that value, or, when it happens to already sit on the grid, the two bridge points just duplicate depart and arrivee outright. Either way the conductor renders with an unnecessary out-and-back excursion or a small looping detour at a join that needed neither. Fix: skip the bridge in exactly that degenerate case, per branch, on the axis that branch actually bridges on. descendant and montant are not mirror images of each other in which axis each cas guards on -- each site says so. Verified against the report's own canonical reproduction (qet_bug_repro_resaved.qet from the linked gist): 1 self-retracing path -> 0. Full corpus of 24 shipped example projects (stored segments, as shipped, not regenerated): 74 -> 65 self-retracing conductor paths, zero regressions -- only two files changed, both improved. One disclosed trade-off, found while checking for regressions: in schema_unifilaire_voltaique2.qet, 8 terminal pairs closer together than twice the extension length (docked stubs already cross before any bridge is considered) go from an existing small rectangular-loop artifact to a straight out-and-back retrace covering the full gap -- same count of defective paths (8 -> 8), a different shape, still no connectivity change either way. Not chased further; a real fix for that narrower "crossed stubs" case is a separate piece of work. The shipped affuteuse_250h.qet's own 12 self-retracing paths (verified by stripping all 185 stored <segment> elements and forcing full regeneration) are unchanged by this fix -- they are a structurally different point-count signature (a 4-point back-and-forth reachable from cas "1"/"2", not the cas "3"/"4" grid-snap bridge this fixes), consistent with what the issue thread already flagged as a separate, undiagnosed mechanism. Refs #734 (own root-cause comment, 2026-08-13). Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>