A plain file like baltyk/mod/grass.scm was taken for a plant and never read,
which lost about a quarter of the plants on Baltyk, so overgrown tracks came
out better than they are. The grading is also split into steps.
The rules stay in TrackUneven.h with no dependence on the engine, as they can
be tested. Their use on the tracks moves out of Track.cpp to TrackUneven.cpp,
split into steps: the group of switches, the values of its paths, the meeting
of two ends. One set of helpers for the paths of a track takes the place of
the same conditions written out in several places, and the value at the ends
of a switch is worked out in one place. The clatter of an axle leaves the long
Update of a vehicle. The fields in the editor say themselves when they show.
No change in behaviour.
- A path of no length gave a joint with a vector across of NaN to the path
joined to it, on any scenery, with unevenness or not. It now has no
vector across, and so makes no joint.
- Axles no longer stray along the track. It moved vehicles against each
other, changing the distance their couplers go by.
- The bend under an axle goes straight on past the ends of a path: the
polynomial ran off on a short curved one, with a kick in the cab shake.
- A track left out of its rail run, where tracks are joined one way only,
no longer walks the whole run again on every call.
- The clatter of an axle goes by the outer axle on its side of the vehicle,
and not always by the same one, as the two can be on different tracks.
- A vertex works out the amounts once, and the foot of the ballast not at all.
Its numbers go by position, and the positions differ between a plain track
and a switch. A switch made in the style of a plain track wrote them in the
layout of the plain one, so they were read back as other values: the up and
down part as the value of the path p3-p4, and so on.
The values are now one struct with pure functions to read, write and resolve
them, which replaces eight fields and which the unit tests can reach.
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.
The phase of the rails was wrapped to the rail length of the track the
vehicle is on, while an axle can be on a track with longer rails. From
then on every frame looked like a joint crossed.
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.