17
0
mirror of https://github.com/MaSzyna-EU07/maszyna.git synced 2026-11-06 09:18:36 +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

@@ -9,6 +9,7 @@ http://mozilla.org/MPL/2.0/.
#pragma once
#include <algorithm>
#include <array>
#include <vector>
#include <glm/glm.hpp>
@@ -49,6 +50,8 @@ double constexpr blade_gap { 0.0005 };
double constexpr blade_lowered { 0.050 };
double constexpr blade_spacing { 0.5 };
double constexpr blade_runon_margin { 0.2 }; // how far short of the end of the plain track a blade running on into it ends
double constexpr wing_low { 1.5 }; // how far before the throat the wing rails are of the low section of the blades, raised on their timbers as the blades
double constexpr wing_forged { 0.5 }; // how long the end of a wing rail forged to the plain rail is, going down to it
// where the inner rails of the two paths of a switch cross, found from their gauge lines behind the blades
struct switch_frog {
@@ -175,6 +178,36 @@ inline knots::line part_offsets( rail_cut const *Before, rail_cut const *After )
knots::sort( result );
return result;
}
// how far the foot of a part of a rail between two cuts is raised, Rise along a wing rail of the low section: from wing_low before the throat on,
// down to the plain rail past it along its forged end; the rail whole along Stock, the stock rail of a blade there
inline knots::line part_rises( rail_cut const *Before, rail_cut const *After, double const Rise, glm::dvec2 const &Stock ) {
knots::line result;
auto const going { Before != nullptr && Before->startkind == rail_end::point };
auto const coming { After != nullptr && After->endkind == rail_end::point };
if( Rise <= 0.0 || ( false == going && false == coming ) ) {
return result;
}
auto const lowto { going ? Before->startanchor + wing_low : 0.0 };
auto const lowfrom { coming ? After->endanchor - wing_low : 0.0 };
auto const through { going && coming && lowto + 2.0 * wing_forged >= lowfrom };
auto const stock { Stock.y > Stock.x };
// the share of the rise: whole along the low section, none along the stock rail, between along the forged ends
auto const share = [&]( double const At ) {
auto const low { through ? 1.0 : std::max(
going ? std::clamp( ( lowto + wing_forged - At ) / wing_forged, 0.0, 1.0 ) : 0.0,
coming ? std::clamp( ( At - lowfrom + wing_forged ) / wing_forged, 0.0, 1.0 ) : 0.0 ) };
auto const whole { stock ? std::clamp( std::max( Stock.x - At, At - Stock.y ) / wing_forged, 0.0, 1.0 ) : 1.0 };
return std::min( low, whole ); };
std::array<double, 8> places { lowto, lowto + wing_forged, lowfrom - wing_forged, lowfrom, Stock.x - wing_forged, Stock.x, Stock.y, Stock.y + wing_forged };
std::sort( places.begin(), places.end() );
for( auto const at : places ) {
if( result.empty() || at > result.back().x + 1e-6 ) {
result.emplace_back( at, Rise * share( at ) );
}
}
return result;
}
struct rail_tread {
double from { 0.0 };
double to { 0.0 };