Usage:
python tools/track_uneven_grade.py scenery/lk357.scn --out graded
python tools/track_uneven_grade.py scenery/baltyk_skm1.scn --out graded --route -107,2300 -4120,2491
It follows the includes from a .scn, .scm or .inc, and takes the state of
each track from what the scenery shows: ballast and rail textures, grass
on the track, curves, speed and road crossings. The originals stay as they
are, copies of the files with tracks go to --out, and with no --out it
only reports. Values stay under what a pantograph can follow on those
tracks, by simulation, the rise of the wire itself not counted.
Tracks in .inc files taking parameters are skipped and rotate blocks not
applied, the report says so. See track_uneven_doc.md.
Usage, before endtrack, in mm, 0-100, separated by semicolons with no
spaces:
a plain track: uneven value;up;side;cross;dip
a switch: uneven p1-p2;p3-p4;up p1-p2;side p1-p2;up p3-p4;side p3-p4
uneven 18 the value alone
uneven 18;;;25;6 with its own cross level and dip at the joints
uneven 0;;30 sideways alone
uneven 14;35 a switch, 14 on the straight path, 35 on the diverging
What's left out takes the first number, the dip goes by the up and down
one, and a path p3-p4 with no numbers of its own takes those of p1-p2.
This replaces unevenup, unevenside, unevencross and jointdip. The fields
in the editor stay, track panel, section Ride and sound.
At the end they share, the paths of a switch keep to the lower value, and
each comes to its own value along the way. Joined switches take the lowest
of the same path, a path joined to another path the lower of the two, and
a plain track comes to the value of the path it meets. See
track_uneven_doc.md.
Ends less than 20 cm apart meet in the middle with a common vector
across, which closes the cracks from coordinates that don't match in the
data, on tracks with no unevenness as well. At such a joint a switch takes
the cant of the plain track, and alike ones meet halfway: the slips on
Baltyk had steps of 0.2 degrees. The physics goes by the same cant.
On such a track the sway drawn from the lateral acceleration, that is
from the curve radius, and the jolts drawn at random are off. Tracks
with no unevenness shake the cab as before. Hunting stays: it goes by the
vehicle and its speed, not by the track.
Fewer short waves: at uneven 18 the humps over 12.6 mm on the 10 m chord
go from 28 to 38 per km, with the peak still at 18 mm. Waves of 47-83 m
join them. They hardly count on that chord, the body rises and falls on
them.
The documentation tells how far unevenness goes before a pantograph
can't keep up. A wire rising fast enough trips the main breaker on a
straight track too: it does at tor0290 on Baltyk, over about 46 km/h.
Tracks laid towards each other settled to opposite sides: a step of cant
of twice the value at their joint, in the geometry and under the axles.
It's now a tilt of the plan, which reads the same from either track.
Usage, optional attributes of a track entry, before endtrack:
uneven <mm> peak deviation of a rail on a 10 m chord, 0-100; normal and switch
unevenup <mm> up and down alone, instead of uneven; normal and switch
unevenside <mm> sideways alone, instead of uneven; normal and switch
unevencross <mm> cross level alone, instead of uneven; normal only
jointdip <mm> depth of the dip at rail joints, every sound distance; normal only,
default 0.4 of the up and down component
Values of uneven follow PLK Id-14 appendix 1: 6 mm is the limit at 160 km/h, 10 at 120,
18 at 80, 35 at 40; half of it for a track in a good state. Example:
uneven 18
unevencross 25
jointdip 6
endtrack
The same fields are in the editor, track panel, section Ride and sound. See
track_uneven_doc.md.
The unevenness is a displacement field over the plan of the scenery, with no random
numbers: one place strays the same every time, and joined tracks, the paths of a switch,
sleepermodel and axles at one place move together. Tracks meet at a joint at the lower of
their values. Joined switches take the lowest of theirs, the tracks joined to them come to
it, and a track with none of a component keeps the switch to its design in it. The clatter
comes from the dipping joints. Curve radius and grade for the physics stay as designed.
Tracks with it get geometry every 2 m on straights: 4x the vertices on Baltyk with all
tracks flagged, 0.2 ms more per frame on td.scn.