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

feat(track): at a crossing at a wide angle the tread of the other track is laid where its wheels roll over the mitred corners: the part of a guard rail under the running rail of the other track becomes a running surface in the shared tread material instead of matte, and running rails of different materials share the tread over the rolled band of the other track instead of over a square span; wide_tread draws the edges of the band from the crossing itself, since the gauge lines meet in one point at right angles, and a tread gives its own fade, widened for bands lying across the rail; treaded keeps the matte parts of a guard rail matte, lay_treads splits guard rails at their treads, and a piece of no triangles is not inserted

This commit is contained in:
maj00r
2026-10-14 11:25:34 +02:00
parent f03c6b8ebc
commit ae4e828ed2
3 changed files with 87 additions and 27 deletions

View File

@@ -101,6 +101,16 @@ struct rail_cut {
struct rail_plan {
std::vector<rail_cut> cuts;
};
struct rail_tread {
double from { 0.0 };
double to { 0.0 };
material_handle material { 0 };
int anchor { 0 };
knots::line edge;
knots::line gauge;
bool below { false };
double fade { tread_fade };
};
// guard rails of a crossing at a wide angle: the rail profile laid inside the running rail across the flangeway, broken like the rails
struct guard_rail {
double from { 0.0 };
@@ -111,6 +121,7 @@ struct guard_rail {
glm::dvec2 frommiter { 0.0 };
glm::dvec2 tomiter { 0.0 };
bool through { true };
std::vector<rail_tread> treads;
};
struct rail_band {
double at { 0.0 };
@@ -129,15 +140,6 @@ struct rail_fill {
double lift { 0.0 };
bool web { false };
};
struct rail_tread {
double from { 0.0 };
double to { 0.0 };
material_handle material { 0 };
int anchor { 0 };
knots::line edge;
knots::line gauge;
bool below { false };
};
struct rail_layout {
rail_plan plans[ 2 ][ 2 ]; // path, right side
std::vector<rail_band> bands[ 2 ][ 2 ];