fix: skip single_equation_pass during drag to prevent stale constraints #37
Reference in New Issue
Block a user
Delete Branch "fix/planar-drag-prepass"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Problem
Planar distance=0 constraints weren't holding during interactive drag operations.
Root Cause
single_equation_passinpre_drag()analytically solves variables from upstream constraints (e.g. Coincident fixesbracket/tz = 0) and bakes their values asConst()nodes into downstream residual expressions. It also callsparams.fix()on those variables, removing them from the free list.During drag, the cached residuals use these stale constants even though part positions have changed via
set_value(). The fixed variables aren't in Newton's free list, so they can't be corrected. Downstream constraints (like Planar) that had upstream values baked in silently stop being enforced.Fix
Skip
single_equation_passin thepre_drag()path. Onlysubstitution_pass(which replaces genuinely grounded/immutable parameters) is safe to cache across drag steps. Newton-Raphson converges in 1-2 iterations from a nearby initial guess anyway, so the prepass optimization is unnecessary for drag performance.The static
solve()path continues to usesingle_equation_passas before.Testing
tests/test_drag.py