17
0
mirror of https://github.com/MaSzyna-EU07/maszyna.git synced 2026-11-05 22:59:10 +01:00

feat: GPL-1/GPL-2 structure gauges, widening run-in ahead of the curves

This commit is contained in:
maj00r
2026-10-04 01:40:25 +02:00
parent b0c363b586
commit cf8062ea96
3 changed files with 161 additions and 60 deletions

View File

@@ -9,10 +9,12 @@ http://mozilla.org/MPL/2.0/.
#pragma once
#include <array>
#include <string>
#include <vector>
// structure gauge (skrajnia budowli): the space along the track which has to stay clear of the objects
// structure gauge (skrajnia budowli) of the PKP PLK technical standards, volume II: the space along the track
// which has to stay clear of the objects
namespace gauge
{
@@ -29,25 +31,29 @@ struct profile
std::vector<point> outline;
};
// starting points of the outlines, approximations to verify against PN-69/K-02057
// GPL-1 and GPL-2 over the limit installation gauge below 1170 mm, with and without the pantograph gauge
std::vector<profile> default_profiles();
// outlines kept in the file, the defaults when there's none
std::vector<profile> load_profiles(std::string const &File);
void save_profiles(std::string const &File, std::vector<profile> const &Profiles);
// widening of both sides in a curve, from the radius (table 1 of the D1 annex 11), metres
double curve_widening(double Radius);
// widening of the inner side of a curve from the tilt of the vehicles on the cant, at the height above the rail top, metres
double cant_widening(double Cant, double Height);
// below this height the outline is the limit installation gauge, which leaves the room for the platforms
double constexpr lower_part{1.17};
// place of the gauge across the track
// widening of the sides of the gauge at a place of the track, metres; index 0 is the right side, 1 the left one
struct section
{
double radius{0.0}; // 0: straight
int inner{0}; // side of the curve centre, +1 left or -1 right, 0 on a straight
double cant{0.0}; // metres
std::array<double, 2> upper{}; // from the radius, above the lower part
std::array<double, 2> lower{}; // from the radius, in the lower part
std::array<double, 2> cant{}; // cant in metres, positive on the inner side of the curve and negative on the outer one
};
// half-width of the gauge at the height on the side (+1 left, -1 right), negative above or below the outline
// sections at the points of a route, from their chainage, curvature (1/m, positive turning left) and cant (m).
// The widening begins and ends ahead of the changes of the curvature and cant, as the vehicles enter a curve
std::vector<section> sections(std::vector<double> const &Chainage, std::vector<double> const &Curvature, std::vector<double> const &Cant);
// widening of the side (+1 left, -1 right) at the height
double widening(section const &Section, double Height, int Side);
// half-width of the gauge at the height on the side, negative above or below the outline
double half_width(profile const &Profile, section const &Section, double Height, int Side);
// depth of the point inside the gauge, metres, not positive outside of it. Lateral positive to the left
double intrusion(profile const &Profile, section const &Section, double Lateral, double Height);