mirror of
https://git.mirrors.martin98.com/https://github.com/slic3r/Slic3r.git
synced 2025-08-13 02:08:59 +08:00
Fix infill_overlap and endpoints_overlap not being linked and not considering both perimeter and infill extrusion width (thus causing potential overflows). #3289
This commit is contained in:
parent
2708eb0bad
commit
4a25b3e8be
@ -283,9 +283,6 @@ FillRectilinear::_fill_single_direction(ExPolygon expolygon,
|
||||
svg.Close();
|
||||
#endif
|
||||
|
||||
// Calculate the extension of the vertical endpoints according to the configured value.
|
||||
const coord_t extra_y = floor((double)min_spacing * this->endpoints_overlap + 0.5f);
|
||||
|
||||
// Store the number of polygons already existing in the output container.
|
||||
const size_t n_polylines_out_old = out->size();
|
||||
|
||||
@ -313,7 +310,7 @@ FillRectilinear::_fill_single_direction(ExPolygon expolygon,
|
||||
// Start our polyline.
|
||||
Polyline polyline;
|
||||
polyline.append(p);
|
||||
polyline.points.back().y -= extra_y;
|
||||
polyline.points.back().y -= this->endpoints_overlap;
|
||||
|
||||
while (true) {
|
||||
// Complete the vertical line by finding the corresponding upper or lower point.
|
||||
@ -331,7 +328,7 @@ FillRectilinear::_fill_single_direction(ExPolygon expolygon,
|
||||
IntersectionPoint b = it->second;
|
||||
assert(b.type != p.type);
|
||||
polyline.append(b);
|
||||
polyline.points.back().y += extra_y * (b.type == IntersectionPoint::ipTypeUpper ? 1 : -1);
|
||||
polyline.points.back().y += this->endpoints_overlap * (b.type == IntersectionPoint::ipTypeUpper ? 1 : -1);
|
||||
|
||||
// Remove the two endpoints of this vertical line from the grid.
|
||||
{
|
||||
@ -359,7 +356,7 @@ FillRectilinear::_fill_single_direction(ExPolygon expolygon,
|
||||
const size_t n = polyline.points.size();
|
||||
polyline.append(b.next);
|
||||
for (Points::iterator pit = polyline.points.begin()+n; pit != polyline.points.end(); ++pit)
|
||||
pit->y += extra_y * (b.type == IntersectionPoint::ipTypeUpper ? 1 : -1);
|
||||
pit->y += this->endpoints_overlap * (b.type == IntersectionPoint::ipTypeUpper ? 1 : -1);
|
||||
}
|
||||
|
||||
// Is the final point still available?
|
||||
|
@ -34,6 +34,7 @@ LayerRegion::make_fill()
|
||||
const Flow infill_flow = this->flow(frInfill);
|
||||
const Flow solid_infill_flow = this->flow(frSolidInfill);
|
||||
const Flow top_solid_infill_flow = this->flow(frTopSolidInfill);
|
||||
const coord_t perimeter_spacing = this->flow(frPerimeter).scaled_spacing();
|
||||
|
||||
SurfaceCollection surfaces;
|
||||
|
||||
@ -215,6 +216,8 @@ LayerRegion::make_fill()
|
||||
} else {
|
||||
f->spacing = flow.spacing();
|
||||
}
|
||||
f->endpoints_overlap = this->region()->config.get_abs_value("infill_overlap",
|
||||
(perimeter_spacing + scale_(f->spacing))/2);
|
||||
|
||||
f->layer_id = this->layer()->id();
|
||||
f->z = this->layer()->print_z;
|
||||
|
@ -298,10 +298,6 @@ PerimeterGenerator::process()
|
||||
inset += pspacing/2;
|
||||
}
|
||||
|
||||
// only apply infill overlap if we actually have one perimeter
|
||||
if (inset > 0)
|
||||
inset -= this->config->get_abs_value("infill_overlap", inset + ispacing/2);
|
||||
|
||||
{
|
||||
ExPolygons expp = union_ex(last);
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user