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

feat(sleepers): the fastenings fitted on the switches crossing and the double ones: the chair of the model split into its brace and its slide plate, the slide plate from the edge of the foot of the stock rail on, not under it; the plates and the slide plates narrowed where the rails lie close, the fastening of two rails centred between them, a rail lying on the fastening of the rail beside it left without one of its own, the brace dropped where the rail beside comes too close; selftest fastencheck

This commit is contained in:
maj00r
2026-10-23 17:25:02 +02:00
parent 5aedbcdc1b
commit b512460fdf
7 changed files with 335 additions and 20 deletions

View File

@@ -9,6 +9,8 @@ http://mozilla.org/MPL/2.0/.
#pragma once
#include <array>
#include <string>
#include <vector>
#include <glm/glm.hpp>
@@ -25,6 +27,12 @@ struct fastening {
int part { part_plate };
glm::dvec3 point { 0.0 }; // under the middle of the rail, on the top of the timber
glm::dvec2 across { 1.0, 0.0 }; // unit vector in plan square to the rail, the way the +x of the part goes
float scale { 1.f }; // along its x, a plate or a slide plate narrowed where it'd lie over the fastenings of rails close beside
float pivot { 0.f }; // the x of the part kept in place as it's narrowed
float shift { 0.f }; // along its x, how far the pivot is moved
// where an x of the part lands along its across, at the scale
double placed( double const X, double const Scale ) const {
return pivot + shift + Scale * ( X - pivot ); }
};
// the rails of the tracks around a track, which lie on its timbers
@@ -54,6 +62,7 @@ private:
std::vector<double> distances;
glm::dvec2 low { 0.0 };
glm::dvec2 high { 0.0 };
double foot { 0.0 }; // from the middle of the rail to the edge of its foot toward the middle of the path
// the stretches along the path the rail is a blade, a stock rail with a chair, checked along
glm::dvec2 blade { -1.0 };
glm::dvec2 stock { -1.0 };
@@ -65,9 +74,34 @@ private:
double at { 0.0 }; // along the timber, from its from end
role kind { role::plain };
glm::dvec2 inward { 1.0, 0.0 };
double foot { 0.0 };
};
// the fastenings of rails close by fitted to the room between them: narrowed across, and a rail lying on the fastening of the
// rail beside it left without one of its own
static void fit( std::vector<fastening> &Fastenings, beam const &Beam, beam_model const &Model );
std::vector<rail> m_rails;
};
// the fastenings of a track with them in the model of its timbers, as laid on the timbers laid with it
struct fastening_row {
std::string track;
std::size_t beams { 0 };
std::array<std::size_t, part_count> parts {};
std::size_t overlaps { 0 }; // fastenings lying over one another on a timber, along it
double worst { 0.0 };
glm::dvec3 worstat { 0.0 };
std::string worstparts;
struct overlap {
int parts[ 2 ];
double apart; // of the rails the two lie under
double over;
glm::dvec3 at;
};
std::vector<overlap> cases;
};
// those of all the tracks laying timbers with fastenings
std::vector<fastening_row> check_fastenings();
} // namespace track_sleepers