17
0
mirror of https://github.com/MaSzyna-EU07/maszyna.git synced 2026-11-01 01:09:04 +01:00

fix(editor): the plan warns of the curved track adjoining a curve only where the curvature jumps there: a curve going on from the diverging track of a switch at its radius (R 300 after R 301 in wsd) no longer has it. The side the adjoining track turns to is taken with its radius into the chain and the design, and the curvature the design meets it with, signed by its turn, compared with it, within 5%; a design kept without the side is taken for turning its way. Unit test: R 300 from the very start after R 301 turning the same way gives no warning, turning the other way or starting with a straight does

This commit is contained in:
maj00r
2026-10-25 11:14:49 +01:00
parent bbb3e9e61e
commit 29b9b93353
6 changed files with 85 additions and 6 deletions

View File

@@ -94,6 +94,10 @@ struct design
double end_grade{0.0};
double start_radius{0.0};
double end_radius{0.0};
// the side the adjoining track turns to at the start and at the end, going from the one to the other: 1 left, -1 right, 0 not
// known; a design going on at the curvature of the adjoining track doesn't change it abruptly
int start_turn{0};
int end_turn{0};
// length of the straight beyond the start and the end, which the curves can take over
double start_reserve{0.0};
double end_reserve{0.0};