fix ironing post-process-> on all solid surface

This commit is contained in:
supermerill 2020-12-06 02:21:52 +01:00
parent b4e4b09a03
commit 787b121025

View File

@ -503,6 +503,7 @@ void Layer::make_ironing()
double height; double height;
double speed; double speed;
double angle; double angle;
IroningType type;
bool operator<(const IroningParams &rhs) const { bool operator<(const IroningParams &rhs) const {
if (this->extruder < rhs.extruder) if (this->extruder < rhs.extruder)
@ -535,7 +536,8 @@ void Layer::make_ironing()
bool operator==(const IroningParams &rhs) const { bool operator==(const IroningParams &rhs) const {
return this->extruder == rhs.extruder && this->just_infill == rhs.just_infill && return this->extruder == rhs.extruder && this->just_infill == rhs.just_infill &&
this->line_spacing == rhs.line_spacing && this->height == rhs.height && this->speed == rhs.speed && this->line_spacing == rhs.line_spacing && this->height == rhs.height && this->speed == rhs.speed &&
this->angle == rhs.angle; this->angle == rhs.angle &&
this->type == rhs.type;
} }
LayerRegion *layerm = nullptr; LayerRegion *layerm = nullptr;
@ -577,6 +579,7 @@ void Layer::make_ironing()
} }
} }
if (ironing_params.extruder != -1) { if (ironing_params.extruder != -1) {
ironing_params.type = config.ironing_type;
ironing_params.just_infill = false; ironing_params.just_infill = false;
ironing_params.line_spacing = config.ironing_spacing; ironing_params.line_spacing = config.ironing_spacing;
ironing_params.height = default_layer_height * 0.01 * config.ironing_flowrate; ironing_params.height = default_layer_height * 0.01 * config.ironing_flowrate;
@ -611,14 +614,25 @@ void Layer::make_ironing()
// Just infill. // Just infill.
} else { } else {
// Infill and perimeter. // Infill and perimeter.
// Merge top surfaces with the same ironing parameters. if (ironing_params.type == IroningType::AllSolid) {
Polygons polys; // Merge top surfaces with the same ironing parameters.
for (size_t k = i; k < j; ++ k) Polygons polys;
for (const Surface &surface : by_extruder[k].layerm->slices().surfaces) for (size_t k = i; k < j; ++k)
if (surface.has_pos_top()) for (const Surface& surface : by_extruder[k].layerm->slices().surfaces)
polygons_append(polys, surface.expolygon); if (surface.has_fill_solid())
// Trim the top surfaces with half the nozzle diameter. polygons_append(polys, surface.expolygon);
ironing_areas = intersection_ex(polys, offset(this->lslices, - float(scale_(0.5 * nozzle_dmr)))); // Trim the top surfaces with half the nozzle diameter.
ironing_areas = intersection_ex(polys, offset(this->lslices, -float(scale_(0.5 * nozzle_dmr))));
} else {
// Merge top surfaces with the same ironing parameters.
Polygons polys;
for (size_t k = i; k < j; ++k)
for (const Surface& surface : by_extruder[k].layerm->slices().surfaces)
if (surface.has_pos_top())
polygons_append(polys, surface.expolygon);
// Trim the top surfaces with half the nozzle diameter.
ironing_areas = intersection_ex(polys, offset(this->lslices, -float(scale_(0.5 * nozzle_dmr))));
}
} }
// Create the filler object. // Create the filler object.