17
0
mirror of https://github.com/MaSzyna-EU07/maszyna.git synced 2026-10-31 23:59:03 +01:00

fix(editor): a compound curve of more than three radii, made of bends clicked close along a curve or traced, has the transition curves of the norms between its arcs too: its radii found with the arcs meeting directly, then fitted again with the transitions between them; in abc the curve keeps within 0.12 m of the points clicked with them

This commit is contained in:
maj00r
2026-10-24 22:40:28 +02:00
parent 133ba9cb45
commit f94ddb293f
2 changed files with 11 additions and 2 deletions

View File

@@ -286,5 +286,12 @@ TEST_CASE("alignment: bends clicked close along a curve make one compound curve,
// the straight before the curve and the one after it
CHECK(straights <= 2);
CHECK(line.curves.size() <= 2);
// the arcs of a compound curve meet through transition curves, the curvature not jumping from one radius to another
for (std::size_t i = 0; i + 1 < line.elements.size(); ++i) {
auto const &a{line.elements[i]};
auto const &b{line.elements[i + 1]};
if (a.kind == alignment::element_kind::spiral && b.kind == alignment::element_kind::spiral && a.vertex == b.vertex)
CHECK(a.curvature_end == doctest::Approx(b.curvature_start).epsilon(1e-6));
}
CHECK(design.vertices.size() < 12);
}