Added the possibility to set the maximum length of the detour

This commit is contained in:
Lukáš Hejl 2020-10-16 02:25:45 +02:00
parent c16aad7e0b
commit c828a5d6e9
6 changed files with 22 additions and 2 deletions

View file

@ -597,6 +597,12 @@ namespace Slic3r {
result.points.front() = start;
result.points.back() = end;
Line travel(start, end);
double max_detour_length scale_(gcodegen.config().avoid_crossing_perimeters_max_detour);
if ((max_detour_length > 0) && ((result.length() - travel.length()) > max_detour_length)) {
result = Polyline({start, end});
}
if (use_external)
result.translate(-scaled_origin);
return result;