mirror of
https://github.com/MaSzyna-EU07/maszyna.git
synced 2026-10-17 03:59:19 +02:00
fix(editor): platform edge by the points of a switch keeps the setback of the diverging path, the sample at the points counted with the line leading into the switch
This commit is contained in:
@@ -335,6 +335,21 @@ void editor_mode::selftest_step()
|
||||
}
|
||||
WriteLog("SELFTEST conecheck " + name + ":" + text);
|
||||
}
|
||||
else if (command == "frames")
|
||||
{
|
||||
std::string name;
|
||||
double from{0.0}, to{0.0}, step{0.1};
|
||||
words >> name >> from >> to >> step;
|
||||
auto *sweep{simulation::Sweeps.find(name)};
|
||||
if (sweep == nullptr)
|
||||
continue;
|
||||
auto const side{sweep->definition().lateral >= 0.0 ? 1 : 0};
|
||||
for (double station = from; station <= to + 1e-9; station += step)
|
||||
{
|
||||
auto const at{sweep->frame_at(station)};
|
||||
WriteLog(format("SELFTEST frame %s %.2f: %.3f %.3f %.3f widening %.4f cant %.4f setback %.4f", name.c_str(), station, at.position.x, at.position.y, at.position.z, at.widening[side], at.cant[side], sweep->setback(at)));
|
||||
}
|
||||
}
|
||||
else if (command == "fouling")
|
||||
{
|
||||
std::map<std::string, std::string> values;
|
||||
|
||||
@@ -611,7 +611,7 @@ void sweep_node::beside_switches(std::vector<sample> &Samples)
|
||||
if (heading > 0.0)
|
||||
{
|
||||
for (auto const &sample : Samples)
|
||||
if (sample.station >= s0 - outer_reach && sample.station < s0 - 1e-3)
|
||||
if (sample.station >= s0 - outer_reach && sample.station <= s0 + 1e-3)
|
||||
{
|
||||
station = sample.station;
|
||||
chain.push_back(sample);
|
||||
@@ -650,7 +650,7 @@ void sweep_node::beside_switches(std::vector<sample> &Samples)
|
||||
nearest = &point;
|
||||
}
|
||||
}
|
||||
if (nearest == nullptr || closest > sample_spacing)
|
||||
if (nearest == nullptr || closest > 1.5 * sample_spacing)
|
||||
continue;
|
||||
auto const offset{sign * glm::dot(glm::dvec3{nearest->position.x - here.position.x, 0.0, nearest->position.z - here.position.z}, glm::dvec3{-forward.z, 0.0, forward.x})};
|
||||
if (offset > 0.05)
|
||||
|
||||
Reference in New Issue
Block a user