17
0
mirror of https://github.com/MaSzyna-EU07/maszyna.git synced 2026-10-29 15:07:29 +01:00

feat(editor): a switch path can be a chain of pieces: the attributes pieces1 and pieces2 keep the parts of each path after the classic bezier, which stays as the approximation older versions read and log the attributes as unknown; the simulation drives, draws and maps a path along its pieces by distance, pieces that don't join the ends of the path are reported and the bezier used; the catalogue Rz switches get the diverging path as the arc of their radius and the straight after it, moving, rotating and mirroring a switch carry the pieces, reshaping a path by hand drops them; self-test commands switchpieces and switchbreak

This commit is contained in:
maj00r
2026-10-12 18:32:23 +02:00
parent 46d41549c9
commit ea341af27a
8 changed files with 329 additions and 60 deletions

View File

@@ -965,10 +965,7 @@ save_result node_layers::save(std::vector<std::string> const &Rootstatements, st
auto const path_text = [](TTrack &Path, glm::dvec3 const &Offset) {
auto const paths{Path.m_paths};
for (auto &path : Path.m_paths)
{
path.points[segment_data::point::start] -= Offset;
path.points[segment_data::point::end] -= Offset;
}
path.translate(-Offset);
std::string text;
Path.export_as_text(text);
Path.m_paths = paths;