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

feat(rails): the wing rails of the frogs of the low section of the blades, as Zu1-60, where the timbers have slide chairs: from 1.5 m before the throat to their ends the foot raised as much as the blades ride, the web shortened, the heads level with the rails beside, forged down to the plain rail along 0.5 m; a wing rail which is the stock rail of a blade too, as in the slips with the blades outside of the diamond, whole along its chairs; the fastening holding only rails raised as much moved up on a pad as wide as it, a raised rail on a fastening with others on a pad of its own

This commit is contained in:
maj00r
2026-10-23 20:21:13 +02:00
parent 153cdc550c
commit d3aef50257
10 changed files with 189 additions and 21 deletions

View File

@@ -10,6 +10,7 @@ http://mozilla.org/MPL/2.0/.
#include "stdafx.h"
#include "world/TrackRails.h"
#include "world/TrackSleepers.h"
#include "world/TrackBlend.h"
#include "rendering/renderer.h"
@@ -381,6 +382,7 @@ struct rail_piece {
bool walls { false };
float lift { 0.f };
float wallu { -1.f };
knots::line rises;
};
struct top_band {
@@ -605,6 +607,8 @@ private:
TSegment const &m_segment;
double const m_length;
double const m_guardoffset;
double const m_rise; // of the feet of the wing rails of the low section
glm::dvec2 const m_stock; // the stretch the rail is the stock rail of a blade along
std::size_t m_topfirst;
std::size_t m_toplast { 0 };
std::vector<material_handle> m_tints;
@@ -626,6 +630,8 @@ TTrack::rail_layer::rail_layer( TTrack &Track, rail_layout const &Layout, rail_d
m_segment { path_segment( Track, Path ) },
m_length { m_segment.GetLength() },
m_guardoffset { -( flangeway + Drawing.size.head ) },
m_rise { track_sleepers::wing_rise( Track ) },
m_stock { track_sleepers::stock_stretch( Track, Path, Side ) },
m_topfirst { Profile.size() } {
// the running surface on top of the head is split along the edge of the wheel treads, the part of it out of their reach goes matte; the rest of the profile and the end faces are laid whole
for( std::size_t j = 0; j < Profile.size(); ++j ) {
@@ -791,6 +797,7 @@ void TTrack::rail_layer::lay_cuts( gfx::vertex_array const &Shape, std::vector<r
// a piece carved between two cuts has the same lines at both
auto const own { i < Cuts.size() && false == ( i > 0 && Cuts[ i - 1 ].carved && Cuts[ i ].carved ) };
auto const pieceoffsets { part_offsets( i > 0 ? &Cuts[ i - 1 ] : nullptr, i < Cuts.size() ? &Cuts[ i ] : nullptr ) };
auto const piecerises { part_rises( i > 0 ? &Cuts[ i - 1 ] : nullptr, i < Cuts.size() ? &Cuts[ i ] : nullptr, Wheels ? m_rise : 0.0, m_stock ) };
// the limits of the head from both ends can overlap along a short piece, as the planed wing rail of one frog and the cut of the next: the tighter of them holds
auto const pieceextents { own ? knots::bound( extents, Cuts[ i ].endextents, true ) : extents };
auto const pieceinner { own ? knots::bound( inner, Cuts[ i ].endinner, false ) : inner };
@@ -838,7 +845,8 @@ void TTrack::rail_layer::lay_cuts( gfx::vertex_array const &Shape, std::vector<r
.capfrom = k == 1 && capstart,
.capto = k + 1 == splits.size() && capend,
.walls = false == Wheels,
.wallu = Wallu };
.wallu = Wallu,
.rises = piecerises };
if( Wheels && tread != nullptr && false == tread->edge.empty() && m_topfirst < m_toplast ) {
treaded( whole, *tread, ends );
}
@@ -1270,6 +1278,10 @@ loft_span TTrack::rail_layer::span( rail_piece const &Piece, piece_ends const &E
result.rampwidth = ( Piece.ramp.empty() ? 0.0 : Piece.fade );
result.walls = Piece.walls;
result.wallu = Piece.wallu;
result.rises = Piece.rises;
if( false == Piece.rises.empty() ) {
result.head = { m_drawing.size.neck, m_drawing.size.crest };
}
if( std::abs( Piece.from - Ends.from ) < 1e-6 ) {
result.fromend = Ends.fromend;
}