17
0
mirror of https://github.com/MaSzyna-EU07/maszyna.git synced 2026-10-19 07:19:18 +02:00
Files
maszyna/maj0sted/tests/test_editor.cpp
maj00r 4ae24114ba Editor: pin the whole branch rigidly to its frog, not just the leaving straight
Pinning previously rewrote only the branch's first (leaving) straight to start
at the frog and run along the frog heading. Any straight appended behind it
stayed where the user drew it, so its gap fit was solved against a leaving
straight that had jumped out from under it — the appended fragment could end up
~1.4 km from the frog.

Move the branch as one rigid body instead: the leaving straight fixes the
rotation+translation onto the frog, and every appended straight rides along
under the same motion, so the shapes and inter-fragment fits are preserved and
the branch still meets the switch tangentially by construction.

Add a test that draws an L-shaped branch far from the frog and checks the whole
centreline lands next to the frog after pinning.
2026-08-27 19:36:55 +02:00

9.6 KiB