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

fix(sleepers): no rail left lying on a timber without a fastening: the stock rails on a plate as wide as their foot between the brace and the slide plate, the stock rails back to back, as the wing rails of the slips with the blades outside of the diamond, on one plate under both; three rails or more close beside one another under fastenings of two rails in turn; a plate lying over the fastening of the rail beside cut short at its edge, as on one plate with it, a rail with its check rail on the fastening of the rail beside in such a plate, not left out; selftests checkseats and the bare rails in fastencheck

This commit is contained in:
maj00r
2026-10-23 18:25:00 +02:00
parent 62f8932f15
commit fa62a61389
4 changed files with 369 additions and 20 deletions

View File

@@ -27,9 +27,10 @@ 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 scale { 1.f }; // along its x, a plate or a slide plate narrowed where it'd lie over the fastenings of rails close beside, a plate stretched under two
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
bool both { false }; // the fastening of two rails close beside each other, neither with a check rail of its own seated
// 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 ); }
@@ -42,6 +43,8 @@ public:
explicit fastened_rails( TTrack &Track );
// the fastenings of the rails on the timber, of the parts the model has
std::vector<fastening> on( beam const &Beam, beam_model const &Model ) const;
// where the rails on the timber lie over none of the fastenings
std::vector<glm::dvec2> bare( beam const &Beam, beam_model const &Model, std::vector<fastening> const &Fastenings ) const;
private:
// what a rail is where it lies on a timber
@@ -77,8 +80,10 @@ private:
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
// the rails lying on the timber, in the order along it, one where several lie on one another, but the blades
std::vector<hit> rails_on( beam const &Beam ) const;
// the fastenings of rails close by fitted to the room between them: narrowed across, a plate cut short at the fastening of the
// rail beside it or left out, the plates of two rails lying over each other made one
static void fit( std::vector<fastening> &Fastenings, beam const &Beam, beam_model const &Model );
std::vector<rail> m_rails;
@@ -90,6 +95,7 @@ struct fastening_row {
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
std::vector<glm::dvec2> bares; // where rails lie on a timber over no fastening
double worst { 0.0 };
glm::dvec3 worstat { 0.0 };
std::string worstparts;
@@ -104,4 +110,19 @@ struct fastening_row {
// those of all the tracks laying timbers with fastenings
std::vector<fastening_row> check_fastenings();
// a check rail of a track with timbers under it and no fastening seating it there, along some of its length
struct check_rail_gap {
std::string track;
int path { 0 };
int side { 1 };
double from { 0.0 }; // the check rail, along the path
double to { 0.0 };
std::size_t timbers { 0 }; // with the fastenings, under it
double bare { 0.0 }; // of those, with no seat under it
std::size_t unsupported { 0 }; // of those, with no fastening under it at all
glm::dvec2 at { 0.0 }; // where the first of those crosses it
};
// those of all the tracks with fastenings in the model of their timbers
std::vector<check_rail_gap> check_rail_seats();
} // namespace track_sleepers