mirror of
https://github.com/MaSzyna-EU07/maszyna.git
synced 2026-11-01 03:29:03 +01:00
fix(editor): a compound curve is fitted with the transition curves of the norms between its arcs from the first step, not found without them and given them after: from several starts, the problem having more than one bottom, each count of arcs from the curve fitted with one less, its longest arc cut in two, and from the curvature the points show, the fewest arcs taken which keep within 0.3 m of the points, or within 0.1 m of the closest; and the transitions fitted no longer than half as long again as the norms ask for, 30 m at least, a fit started below that
This commit is contained in:
@@ -246,8 +246,15 @@ TEST_CASE("alignment: a compound curve traced is followed closely") {
|
||||
auto const fit{alignment::fit_trace_stretch(stretch_base(truth, points), points, 0, true)};
|
||||
|
||||
REQUIRE(fit.valid);
|
||||
CHECK(fit.rms < 0.05);
|
||||
CHECK(fit.worst < 0.15);
|
||||
REQUIRE(fit.vertices.size() == 1);
|
||||
// the transition between the arcs the one of the norms, 45 m, not the 60 m of the line traced
|
||||
auto const &curve{fit.vertices.front()};
|
||||
REQUIRE(curve.compound);
|
||||
REQUIRE(curve.arcs.size() == 1);
|
||||
CHECK(curve.radius == doctest::Approx(1200.0).epsilon(0.05));
|
||||
CHECK(curve.arcs.front().radius == doctest::Approx(700.0).epsilon(0.05));
|
||||
CHECK(fit.rms < 0.1);
|
||||
CHECK(fit.worst < 0.2);
|
||||
}
|
||||
|
||||
TEST_CASE("alignment: bends clicked close along a curve make one compound curve, not curves with short straights between them") {
|
||||
|
||||
Reference in New Issue
Block a user