Files
make-cad/test
NiJingzhe 5d5e69343b fix(translator): accept clearly separated geo-selector matches
The FreeCAD runtime rejected any geo match scoring above an absolute
1e-2, but the score is a sum of 10x-scaled relative-error terms and a
rebuild in FreeCAD's OCC differs from the recorded OCP geometry in the
4th-6th significant digit — the CORRECT candidate lands at ~0.01-0.5
while wrong candidates score >= ~1. The absolute threshold was
calibrated for same-kernel replay and rejected correct cross-kernel
matches (observed: best 0.0516 vs runner-up 2.12, a 40x separation,
rejected).

Accept the best candidate when best <= 0.5 AND second >= 10*best + 0.5
in addition to the unchanged near-exact path. Rejection semantics are
preserved: absent targets (best >= 1) and ambiguous twins (second close
to best) still raise.

Unit tests cover all five cases: near-exact accept, kernel-drift
accept (both orderings), similar-runner-up reject, absent-target
reject, single-candidate accept.
2026-08-31 23:18:29 +08:00
..