Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 12 additions & 2 deletions src/LayerPlan.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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<coord_t>("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;
Expand Down Expand Up @@ -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,
Expand All @@ -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);
}

Expand Down
Loading