mirror of
https://github.com/MaSzyna-EU07/maszyna.git
synced 2026-10-17 22:39:19 +02:00
A switch (rozjazd) is a relation on a through niweleta, not a niweleta - the through track is never split. It marks the theoretical point on the through centreline; two tangent lines cross there (the through heading and that heading turned by the crossing mark 1:n), and the internal diverging curve is fitted to round the corner between them, reusing the same GapFitter the gap fits go through. So the curve is free: a plain arc, or a łuk koszowy right inside the switch. The theoretical tangent lengths and the curve length follow from it and are read off, not set. The branch niweleta's leaving straight is now locked to the frog: it starts at the frog and runs along the frog heading every solve, only its length is the user's. That enforces tangency no matter what is drawn, and because the first straight is pinned tangent, any fit in the branch's first gap - including a basket - meets the switch tangentially by construction. solve_layout solves the niwelety and the switches together in two passes: solve, read each frog, pin the branches, solve again. Switches serialize as an ejuncs / ejunc section; older files without it still load. Typical Polish turnouts (rozjazdy zwyczajne) are offered as templates that set the crossing mark and radius together; the length each spans is computed from them (arc = R*atan(1/n)) and shown, so how long the switch is is known.
93 KiB
93 KiB