diff --git a/src/LayerPlan.cpp b/src/LayerPlan.cpp index dcaff54d00..d8568baf9b 100644 --- a/src/LayerPlan.cpp +++ b/src/LayerPlan.cpp @@ -925,7 +925,7 @@ void LayerPlan::addWallLine( double distance_to_bridge_start, const bool travel_to_z) { - constexpr coord_t min_line_len = 5; // we ignore lines less than 5um long + const coord_t min_line_len = settings.get("meshfix_maximum_resolution"); // all points will be on the line anyway, so there is no deviation to take into account constexpr double acceleration_segment_len = MM2INT(1); // accelerate using segments of this length constexpr double acceleration_factor = 0.75; // must be < 1, the larger the value, the slower the acceleration constexpr bool spiralize = false; @@ -1087,13 +1087,17 @@ void LayerPlan::addWallLine( return vSize2(a.front() - p0) < vSize2(b.front() - p0); }); + auto pt0 = p0.toPoint2LL(); + Point2LL& last_placed = pt0; + // add intersected line segments, alternating between roofing and default_config for (const auto& line_poly : skin_line_segments) { // This is only relevant for the very fist iteration of the loop // if the start of the line segment is not at minimum distance from p0 - if (vSize2(line_poly.front() - p0) > min_line_len * min_line_len) + if (vSize2(line_poly.front() - last_placed) > min_line_len * min_line_len) { + last_placed = line_poly.front(); addExtrusionMove( line_poly.front(), default_config, @@ -1106,6 +1110,12 @@ void LayerPlan::addWallLine( travel_to_z); } + if (vSize2(line_poly.back() - last_placed) < min_line_len * min_line_len) + { + continue; + } + last_placed = line_poly.back(); + addExtrusionMove(line_poly.back(), config, SpaceFillType::Polygons, flow, width_factor, spiralize, 1.0_r, GCodePathConfig::FAN_SPEED_DEFAULT, travel_to_z); }