mirror of
https://git.mirrors.martin98.com/https://github.com/slic3r/Slic3r.git
synced 2025-08-03 06:40:38 +08:00
Prevent variable-width logic from causing negative extrusion. #3220
This commit is contained in:
parent
546312a18d
commit
f352406c33
@ -492,16 +492,20 @@ PerimeterGenerator::_variable_width(const ThickPolylines &polylines, ExtrusionRo
|
|||||||
const double w = fmax(line.a_width, line.b_width);
|
const double w = fmax(line.a_width, line.b_width);
|
||||||
|
|
||||||
if (path.polyline.points.empty()) {
|
if (path.polyline.points.empty()) {
|
||||||
path.polyline.append(line.a);
|
|
||||||
path.polyline.append(line.b);
|
|
||||||
|
|
||||||
flow.width = unscale(w);
|
flow.width = unscale(w);
|
||||||
#ifdef SLIC3R_DEBUG
|
#ifdef SLIC3R_DEBUG
|
||||||
printf(" filling %f gap\n", flow.width);
|
printf(" filling %f gap\n", flow.width);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
// make sure we don't include too thin segments which
|
||||||
|
// may cause even slightly negative mm3_per_mm because of floating point math
|
||||||
path.mm3_per_mm = flow.mm3_per_mm();
|
path.mm3_per_mm = flow.mm3_per_mm();
|
||||||
|
if (path.mm3_per_mm < EPSILON) continue;
|
||||||
|
|
||||||
path.width = flow.width;
|
path.width = flow.width;
|
||||||
path.height = flow.height;
|
path.height = flow.height;
|
||||||
|
path.polyline.append(line.a);
|
||||||
|
path.polyline.append(line.b);
|
||||||
} else {
|
} else {
|
||||||
thickness_delta = fabs(scale_(flow.width) - w);
|
thickness_delta = fabs(scale_(flow.width) - w);
|
||||||
if (thickness_delta <= tolerance) {
|
if (thickness_delta <= tolerance) {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user