Skip to content

Commit 35be5d9

Browse files
committed
Don't chop up lines stradling roofing/normal areas too much.
This may result in zits in areas that are _just_ on the border between meeting the requirements for top surfaces and normal areas -- of which there may be a lot on certain combinations of curved models and settings. part of CURA-12774
1 parent 7fc615e commit 35be5d9

File tree

1 file changed

+11
-1
lines changed

1 file changed

+11
-1
lines changed

src/LayerPlan.cpp

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1087,13 +1087,17 @@ void LayerPlan::addWallLine(
10871087
return vSize2(a.front() - p0) < vSize2(b.front() - p0);
10881088
});
10891089

1090+
auto pt0 = p0.toPoint2LL();
1091+
Point2LL& last_placed = pt0;
1092+
10901093
// add intersected line segments, alternating between roofing and default_config
10911094
for (const auto& line_poly : skin_line_segments)
10921095
{
10931096
// This is only relevant for the very fist iteration of the loop
10941097
// if the start of the line segment is not at minimum distance from p0
1095-
if (vSize2(line_poly.front() - p0) > min_line_len * min_line_len)
1098+
if (vSize2(line_poly.front() - last_placed) > min_line_len * min_line_len)
10961099
{
1100+
last_placed = line_poly.front();
10971101
addExtrusionMove(
10981102
line_poly.front(),
10991103
default_config,
@@ -1106,6 +1110,12 @@ void LayerPlan::addWallLine(
11061110
travel_to_z);
11071111
}
11081112

1113+
if (vSize2(line_poly.back() - last_placed) < min_line_len * min_line_len)
1114+
{
1115+
continue;
1116+
}
1117+
last_placed = line_poly.back();
1118+
11091119
addExtrusionMove(line_poly.back(), config, SpaceFillType::Polygons, flow, width_factor, spiralize, 1.0_r, GCodePathConfig::FAN_SPEED_DEFAULT, travel_to_z);
11101120
}
11111121

0 commit comments

Comments
 (0)