diff --git a/src/libslic3r/PrintConfig.cpp b/src/libslic3r/PrintConfig.cpp index 5b601f2b5..b77302b1d 100644 --- a/src/libslic3r/PrintConfig.cpp +++ b/src/libslic3r/PrintConfig.cpp @@ -2100,15 +2100,30 @@ void PrintConfigDef::init_fff_params() def->mode = comAdvanced; def->set_default_value(new ConfigOptionFloatOrPercent(15, false)); - def = this->add("curve_smoothing_angle", coFloat); - def->label = L("Min angle"); - def->full_label = L("Curve smoothing minimum angle"); + def = this->add("curve_smoothing_angle_convex", coFloat); + def->label = L("Min convex angle"); + def->full_label = L("Curve smoothing minimum angle (convex)"); def->category = L("Slicing"); - def->tooltip = L("Minimum angle at a vertex to enable smoothing" + def->tooltip = L("Minimum (convex) angle at a vertex to enable smoothing" " (trying to create a curve around the vertex). " "180 : nothing will be smooth, 0 : all angles will be smoothen."); def->sidetext = L("°"); - def->cli = "curve-smoothing-angle=f"; + def->aliases = { "curve_smoothing_angle" }; + def->cli = "curve-smoothing-angle-convex=f"; + def->min = 0; + def->max = 180; + def->mode = comAdvanced; + def->set_default_value(new ConfigOptionFloat(0)); + + def = this->add("curve_smoothing_angle_concave", coFloat); + def->label = L("Min concave angle"); + def->full_label = L("Curve smoothing minimum angle (concave)"); + def->category = L("Slicing"); + def->tooltip = L("Minimum (concave) angle at a vertex to enable smoothing" + " (trying to create a curve around the vertex). " + "180 : nothing will be smooth, 0 : all angles will be smoothen."); + def->sidetext = L("°"); + def->cli = "curve-smoothing-angle-concave=f"; def->min = 0; def->max = 180; def->mode = comAdvanced; @@ -2129,6 +2144,17 @@ void PrintConfigDef::init_fff_params() def->mode = comAdvanced; def->set_default_value(new ConfigOptionFloat(0)); + def = this->add("curve_smoothing_cutoff_dist", coFloat); + def->label = L("cutoff"); + def->full_label = L("Curve smoothing cutoff dist"); + def->category = L("Slicing"); + def->tooltip = L("Maximum distance between two points to allow adding new ones. Allow to avoid distording long strait areas. 0 to disable."); + def->sidetext = L("mm"); + def->min = 0; + def->cli = "curve-smoothing-cutoff-dist=f"; + def->mode = comAdvanced; + def->set_default_value(new ConfigOptionFloat(2)); + def = this->add("solid_infill_below_area", coFloat); def->label = L("Solid infill threshold area"); def->category = L("Infill"); diff --git a/src/libslic3r/PrintConfig.hpp b/src/libslic3r/PrintConfig.hpp index 68bd4af4c..9f407a1bd 100644 --- a/src/libslic3r/PrintConfig.hpp +++ b/src/libslic3r/PrintConfig.hpp @@ -558,7 +558,9 @@ public: ConfigOptionFloatOrPercent bridged_infill_margin; ConfigOptionFloat bridge_speed; ConfigOptionFloat curve_smoothing_precision; - ConfigOptionFloat curve_smoothing_angle; + ConfigOptionFloat curve_smoothing_cutoff_dist; + ConfigOptionFloat curve_smoothing_angle_convex; + ConfigOptionFloat curve_smoothing_angle_concave; ConfigOptionBool ensure_vertical_shell_thickness; ConfigOptionBool enforce_full_fill_volume; ConfigOptionFloatOrPercent external_infill_margin; @@ -619,7 +621,9 @@ protected: OPT_PTR(bridged_infill_margin); OPT_PTR(bridge_speed); OPT_PTR(curve_smoothing_precision); - OPT_PTR(curve_smoothing_angle); + OPT_PTR(curve_smoothing_cutoff_dist); + OPT_PTR(curve_smoothing_angle_convex); + OPT_PTR(curve_smoothing_angle_concave); OPT_PTR(ensure_vertical_shell_thickness); OPT_PTR(enforce_full_fill_volume); OPT_PTR(external_infill_margin); diff --git a/src/libslic3r/PrintObject.cpp b/src/libslic3r/PrintObject.cpp index d78bf8043..18ce2bb4f 100644 --- a/src/libslic3r/PrintObject.cpp +++ b/src/libslic3r/PrintObject.cpp @@ -2129,19 +2129,35 @@ void PrintObject::_offset_holes(double hole_delta, LayerRegion *layerm) { /// max angle: you ahve to be lwer than that to divide it. PI => all accepted /// min angle: don't smooth sharp angles! 0 => all accepted -Polygon _smooth_curve(Polygon &p, double max_angle, double min_angle, coord_t max_dist){ +/// cutoff_dist: maximum dist between two point to add new points +/// max dist : maximum distance between two pointsd, where we add new points +Polygon _smooth_curve(Polygon &p, double max_angle, double min_angle_convex, double min_angle_concave, coord_t cutoff_dist, coord_t max_dist){ if (p.size() < 4) return p; Polygon pout; //duplicate points to simplify the loop p.points.insert(p.points.end(), p.points.begin(), p.points.begin() + 3); for (size_t idx = 1; idx