17
0
mirror of https://github.com/MaSzyna-EU07/maszyna.git synced 2026-11-02 05:49:13 +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

@@ -3181,9 +3181,11 @@ std::optional<trace_stretch> fit_arcs(design const &Single, std::vector<glm::dve
else
curve.arcs.push_back({radius, 0.0, share});
}
// arcs meeting with no transitions between them: the points of a curve clicked by hand ask for the radius to change
// quicker than the transitions of the norms let it
// the radii found with the arcs meeting directly, which follows the points easily, then with the transitions of the norms
// between the arcs, fitted again from there
fit_compound(shaped, 0, Points, false);
recommend_between(shaped.vertices.front(), Single.speed, Single.norms);
fit_compound(shaped, 0, Points, true);
// none of an arc too short to be one: a kink the points made
auto const fitted{compute(shaped)};
auto const kinked{std::any_of(fitted.elements.begin(), fitted.elements.end(), [](element const &Element) {