mirror of
https://github.com/MaSzyna-EU07/maszyna.git
synced 2026-12-02 09:36:48 +01:00
feat(editor): the parallel tool beside a line of the model lays a line of the model, its arcs concentric
Continues E4b (editor-tracks-domain.md §8, "Odsuń tor równoległy"): with the editing on the model on, the parallel tool beside a track of a line of the model lays a new line of the model at the spacing, one create_line, checked by the norms. - editor/layout/layoutParallel: the line alongside a line, pure: the legs of the tangents offset, the vertices where the offset legs meet, the arcs concentric with the line's, the radius less on the inside of a curve and more on the outside, the transitions recomputed from the shift of the arc so the centre stays the line's; the cant and the class of the line, its grade breaks at the same share of the length. In a curve the spacing is widened by the widening of the gauge of both tracks on the sides facing each other (PLK tom II annex 1, gauge::curve_widening, under R 250 m), where the transitions of the curve can take it; where they can't, told so. The norms of the track geometry have no spacing of their own yet. - The tool tells the line laid, the spacing in each curve widened, what the norms warn of; refused, why, nothing changed. Self-test: expect modelspacing <line> <other> <m> <low> <high>. The case m_13_parallel (a line laid on the inside of the curve of a line of the model, 4.5 m on the straight and in the arc, one step). Tests: U: the line alongside a straight and alongside three curves on both sides, laid, the arcs concentric within 2 mm; alongside a curve of R 200 m the spacing widened by the gauges, the transitions longer on the inside and shorter on the outside; not widened where a curve has no transitions, told why. lang/editor_pl.po: the Polish of the new texts.
This commit is contained in:
@@ -1682,6 +1682,20 @@ editor_mode::selftest_result editor_mode::selftest_model(std::string const &comm
|
||||
expectation(marked.size() == wanted, "handlines", std::to_string(marked.size()) + lines, std::to_string(wanted));
|
||||
return selftest_result::handled;
|
||||
}
|
||||
if (what == "modelspacing")
|
||||
{
|
||||
// how far the other line runs from the point of the line at the chainage, within the bounds
|
||||
unsigned line{0}, other{0};
|
||||
double chainage{0.0}, low{0.0}, high{0.0};
|
||||
words >> line >> other >> chainage >> low >> high;
|
||||
auto const *one{model_network().find(static_cast<layout::line_id>(line))};
|
||||
auto const *two{model_network().find(static_cast<layout::line_id>(other))};
|
||||
auto got{std::numeric_limits<double>::quiet_NaN()};
|
||||
if (one != nullptr && two != nullptr && one->solved.valid() && two->solved.valid())
|
||||
layout::chainage_of(two->solved, one->solved.position(std::clamp(chainage, 0.0, one->solved.length)), &got);
|
||||
expectation(got >= low && got <= high, format("modelspacing %u %u %.1f", line, other, chainage), format("%.4f", got), format("%.4f .. %.4f", low, high));
|
||||
return selftest_result::handled;
|
||||
}
|
||||
if (what == "modelnodes")
|
||||
{
|
||||
// the nodes of the model: a line laid on from the free end of another one shares the node there
|
||||
|
||||
Reference in New Issue
Block a user