Skip to content

Commit

Permalink
post-process ironing angle: now use fill_angle_cross, and can go into…
Browse files Browse the repository at this point in the history
… negative.

#4286
  • Loading branch information
supermerill committed May 29, 2024
1 parent 78e8ab7 commit 3e2f4cd
Show file tree
Hide file tree
Showing 4 changed files with 21 additions and 12 deletions.
21 changes: 13 additions & 8 deletions src/libslic3r/Fill/Fill.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -844,14 +844,18 @@ void Layer::make_ironing()
}
if (ironing_params.extruder != -1) {
//TODO just_infill is currently not used.
ironing_params.type = config.ironing_type;
ironing_params.just_infill = false;
ironing_params.type = config.ironing_type;
ironing_params.just_infill = false;
ironing_params.line_spacing = config.ironing_spacing;
ironing_params.height = default_layer_height * 0.01 * config.ironing_flowrate;
ironing_params.speed = config.ironing_speed;
ironing_params.angle = config.ironing_angle <0 ?
compute_fill_angle(config, layerm->layer()->id()) :
float(Geometry::deg2rad(config.ironing_angle.value));
ironing_params.height = default_layer_height * 0.01 * config.ironing_flowrate;
ironing_params.speed = config.ironing_speed;
if (config.ironing_angle.value >= 0) {
ironing_params.angle = float(Geometry::deg2rad(config.ironing_angle.value));
} else {
ironing_params.angle = compute_fill_angle(config, layerm->layer()->id());
if (config.ironing_angle.value < -1)
ironing_params.angle += float(Geometry::deg2rad(-config.ironing_angle.value));
}
ironing_params.layerm = layerm;
by_extruder.emplace_back(ironing_params);
}
Expand Down Expand Up @@ -933,7 +937,8 @@ void Layer::make_ironing()

// Create the filler object.
fill.init_spacing(ironing_params.line_spacing, fill_params);
fill.angle = float(ironing_params.angle + 0.25 * M_PI);
fill.can_angle_cross = region_config.fill_angle_cross.value;
fill.angle = float(ironing_params.angle);
fill.link_max_length = (coord_t)scale_(3. * fill.get_spacing());
double extrusion_height = ironing_params.height * fill.get_spacing() / nozzle_dmr;
//FIXME FLOW decide if it's good
Expand Down
1 change: 1 addition & 0 deletions src/libslic3r/Fill/FillBase.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -156,6 +156,7 @@ std::pair<float, Point> Fill::_infill_direction(const Surface *surface) const
// printf("Layer_ID undefined!\n");
}

//why?
out_angle += float(M_PI/2.);
return std::pair<float, Point>(out_angle, out_shift);
}
Expand Down
2 changes: 1 addition & 1 deletion src/libslic3r/Fill/FillSmooth.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ namespace Slic3r {
f2->init_spacing(this->get_spacing(), params);
f2->layer_id = this->layer_id;
f2->z = this->z;
f2->angle = anglePass[idx] + this->angle;
f2->angle = (this->can_angle_cross ? anglePass[idx] : 0) + this->angle;
// Maximum length of the perimeter segment linking two infill lines.
f2->link_max_length = this->link_max_length;
// Used by the concentric infill pattern to clip the loops to create extrusion paths.
Expand Down
9 changes: 6 additions & 3 deletions src/libslic3r/PrintConfig.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3339,11 +3339,14 @@ void PrintConfigDef::init_fff_params()
def = this->add("ironing_angle", coFloat);
def->label = L("Ironing angle");
def->category = OptionCategory::ironing;
def->tooltip = L("Ironing angle. if negative, it will use the fill angle.");
def->tooltip = L("Ironing post-process angle."
"\nIf positive, the ironing will use this angle."
"\nIf -1, it will use the fill angle."
"\nIf lower than -1, it will use the fill angle minus this angle.");
def->sidetext = L("°");
def->min = -1;
def->min = -360;
def->mode = comExpert | comSuSi;
def->set_default_value(new ConfigOptionFloat(-1));
def->set_default_value(new ConfigOptionFloat(-45));

def = this->add("ironing_type", coEnum);
def->label = L("Ironing Type");
Expand Down

0 comments on commit 3e2f4cd

Please sign in to comment.