17
0
mirror of https://github.com/MaSzyna-EU07/maszyna.git synced 2026-10-30 23:40:29 +01:00

feat(editor): the whole-scenery grade fit keeps the tracks a station shares at one height, lets the switches lie on the vertical curves the regulation allows, runs straight through the double slips and leaves the bridges out of the faults

A switch may lie on a concave vertical curve, and on a convex one no sharper than 2000 m (Dz.U. 2026 poz. 1225 § 58 ust. 16): the fit bends over the switches and their shared timbers where the ground does, a curve on a switch is a warning, and only a sharper convex one an error. A sharp crest of a hump keeps its curve off the switch zones. The zone of a crossing reaches only as far as the path crossed has rails, so the middle of a double slip keeps to itself.

A line runs through a switch along its main path, and through the quarters of a double slip straight on, so the long lines go through the slips and the connections between them are fitted after. Rails of the lines fitted already nearer than a sleeper is long are taken at their height, as both lie on the same timbers. A short line between two lines whose end grades can't be joined within the norms keeps only the heights of its ends, and the grade breaks at the joints. The norms speed of a line is the one most of its length is laid for, so a few tracks set much faster don't stiffen the curves of all of it.

The fault finder leaves out the places over the terrain model on a bridge or a viaduct, the ground falling away under them by the abutments. A formation modifier may be open at its start or end.
This commit is contained in:
maj00r
2026-10-22 01:48:04 +02:00
parent 9fedbaf6a8
commit f361bc406b
11 changed files with 1020 additions and 186 deletions

View File

@@ -115,19 +115,47 @@ struct recognition
// grade line of existing track, from its elevations and grades sampled along the chainage
line recognize(std::vector<double> const &Chainages, std::vector<double> const &Elevations, std::vector<double> const &Grades, recognition const &Options);
// the hump of a marshalling yard: a crest with the fan of the switches of the sorting tracks past it, the ground falling away from
// it both ways, one of them more steeply than a line or a station is laid, and the grade changing across it more sharply than
// any vertical curve of the norms bends. Nothing else has all of it
struct hump
{
double from{0.0};
double crest{0.0};
double to{0.0};
double height{0.0}; // m, of the crest over the lower of its feet
};
// the humps of the ground; the samples which tell the height more closely than Tolerance, the rail tops beside, don't count
std::vector<hump> humps(std::vector<double> const &Chainages, std::vector<double> const &Ground, context const &Context, double const Tolerance, std::vector<double> const &Tolerances = {});
struct ground_fit
{
double tolerance{1.0}; // m, the ground this near the line agrees with it; farther, the line doesn't lie on it there
double grade_max{0.0}; // per mille, the steepest grade the line may take; 0: the limit of the line
// the ground parting from the line longer than this, by less than the height and nowhere steeper than the steepest, is no
// structure: no bridge or viaduct with the banks and the walls under it, no hill over a tunnel, but a hump, a rise, a
// hollow. The line follows it, as closely as the tolerance. 0: the line goes past whatever it parts from
double follow_length{0.0}; // m
double follow_height{0.0}; // m
double follow_steepest{0.0}; // per mille
double follow_tolerance{0.0}; // m, 0: the tolerance
// on the humps the line follows the ground all along, as closely as the follow tolerance, and its vertical curves are as sharp
// as the ground bends, down to the hump radius. Nowhere else is a curve sharper than the norms require
std::vector<hump> humps;
double hump_radius{0.0}; // m, 0: the required one
// heights the line keeps between before it lies on the ground, as where the tracks off a switch of it lead into another line:
// they can't climb more than their length lets them
// they can't climb more than their length lets them. A yielding one, told over tracks which still bend, gives way to the
// curves of the norms, if to no ground
struct bound
{
double chainage{0.0};
double low{0.0};
double high{0.0};
bool yielding{false};
};
std::vector<bound> bounds;
// the joined ends keep the grade of the adjoining track; false: their height only, the grade breaks at the joint
bool hold_grades{true};
};
// grade line which lies on the ground where it agrees, within the limits of Settings, with the fewest and least changes of
// grade; where the ground parts from it, at a bridge, a viaduct, a cutting wall, the line goes on past it. Chainages ascend,
@@ -145,6 +173,9 @@ struct departure
double depth{0.0}; // m, the ground against the line where they part the most
};
std::vector<departure> departures(line const &Line, std::vector<double> const &Chainages, std::vector<double> const &Ground, double const Tolerance);
// stretches a track goes over on a bridge or a viaduct the ground doesn't have: the ground under the heights of the track by over
// Depth, with a bank about them steeper than Steepest (per mille), as it falls by the abutments into what the bridge spans
std::vector<departure> bridged(std::vector<double> const &Chainages, std::vector<double> const &Heights, std::vector<double> const &Ground, double const Depth, double const Steepest);
// chainages where the paths have to end so that each of them carries a single grade or a single curve
std::vector<double> breaks(line const &Line);