17
0
mirror of https://github.com/MaSzyna-EU07/maszyna.git synced 2026-10-17 12:09:19 +02:00

feat(track): the guard rails of a crossing at a wide angle reach a metre past the rails of the other track instead of 0.3 m and open their flangeway over 0.6 m at the ends, the way the guard arms of the corners of a diamond run out on real crossings, the reach and the flare are the constants guard_reach and guard_flare shared by the plan and the layer

This commit is contained in:
maj00r
2026-10-14 10:53:28 +02:00
parent 701d82d1bd
commit f27ed682c0
3 changed files with 5 additions and 3 deletions

View File

@@ -563,7 +563,7 @@ void TTrack::rail_layer::lay_guards() {
auto const outside { Miter.x + Miter.y * ( top + m_guardoffset ) };
return Latest ? std::max( inside, outside ) : std::min( inside, outside ); };
for( auto const &guard : ours( m_layout.guards ) ) {
auto const offsets { flared( guard.from, guard.to, std::min( 0.3, 0.25 * ( guard.to - guard.from ) ), m_guardoffset, guard.flarefrom ? 0.02 : 0.0, guard.flareto ? 0.02 : 0.0 ) };
auto const offsets { flared( guard.from, guard.to, std::min( guard_flare, 0.25 * ( guard.to - guard.from ) ), m_guardoffset, guard.flarefrom ? 0.02 : 0.0, guard.flareto ? 0.02 : 0.0 ) };
auto cuts { guard.plan.cuts };
sort_cuts( cuts );
auto start { guard.from };

View File

@@ -28,6 +28,8 @@ double constexpr rolled_band { wheel_width - ( 1.435 - back_to_back ) / 2.0 };
double constexpr nose_tip { 0.012 };
double constexpr middle_angle { 0.35 };
double constexpr wide_angle { 0.785 };
double constexpr guard_reach { 1.0 };
double constexpr guard_flare { 0.6 };
// where the inner rails of the two paths of a switch cross, found from their gauge lines behind the blades
struct switch_frog {

View File

@@ -150,7 +150,7 @@ std::vector<glm::dvec2> glue_line( std::vector<glm::dvec2> const &Outline, doubl
track_rails::rail_fill guard_fill( track_rails::guard_rail const &Guard, track_rails::rail_size const &Size ) {
auto const offset { Size.web - ( flangeway + Size.head ) };
auto const flare { std::min( 0.3, 0.25 * ( Guard.to - Guard.from ) ) };
auto const flare { std::min( guard_flare, 0.25 * ( Guard.to - Guard.from ) ) };
track_rails::rail_fill fill;
fill.web = true;
fill.from = Guard.from;
@@ -448,7 +448,7 @@ void TTrack::rail_planner::cross_wide( rail_crossing const &Crossing, rail_size
if( through ) {
add_tread( Crossing.path, Crossing.side, shared_span( Crossing, Other ), *Crossing.track, Crossing.otherpath );
}
auto const reach { ( flangeway + m_size.head + 0.3 ) / std::abs( Crossing.into ) };
auto const reach { ( flangeway + m_size.head + guard_reach ) / std::abs( Crossing.into ) };
track_rails::guard_rail guard { Crossing.at - reach, Crossing.at + reach };
guard.through = through;
wide( guard.plan, Crossing, { -Other.head, through ? flangeway : flangeway + Other.head, m_guardoffset, m_guardoffset + m_size.head, glue_line( Other.field, 0.0 ), through ? knots::line {} : glue_line( Other.gauge, flangeway + Other.head ) } );