mirror of
https://git.mirrors.martin98.com/https://github.com/slic3r/Slic3r.git
synced 2025-08-13 18:45:57 +08:00
#101 add ratio /distribution for the smoothing flow in ironing (see tooltip)
This commit is contained in:
parent
26db1722ae
commit
86fbd247b7
@ -96,7 +96,7 @@ bridge_acceleration = 1000
|
||||
bridge_angle = 0
|
||||
bridge_flow_ratio = 80%
|
||||
over_bridge_flow_ratio = 120%
|
||||
fill_top_flow_ratio = 120%
|
||||
fill_top_flow_ratio = 100%
|
||||
bridge_speed = 20
|
||||
brim_width = 0
|
||||
clip_multipart_objects = 1
|
||||
|
@ -18,6 +18,7 @@ namespace Slic3r {
|
||||
return polylines_out;
|
||||
}
|
||||
|
||||
/// @idx: the index of the step (0 = first step, 1 = second step, ...) The first lay down the volume and the others smoothen the surface.
|
||||
void FillSmooth::perform_single_fill(const int idx, ExtrusionEntityCollection &eecroot, const Surface &srf_source,
|
||||
const FillParams ¶ms, const double volume){
|
||||
if (srf_source.expolygon.empty()) return;
|
||||
@ -26,14 +27,18 @@ namespace Slic3r {
|
||||
ExtrusionEntityCollection *eec = new ExtrusionEntityCollection();
|
||||
eec->no_sort = false;
|
||||
FillParams params_modifided = params;
|
||||
if (params.config != NULL && rolePass[idx] == ExtrusionRole::erTopSolidInfill) params_modifided.density /= (float)params.config->fill_smooth_width.get_abs_value(1);
|
||||
if (params.config != NULL && idx > 0) params_modifided.density /= (float)params.config->fill_smooth_width.get_abs_value(1);
|
||||
else if (params.config != NULL && idx == 0) params_modifided.density *= 1;
|
||||
else params_modifided.density *= (float)percentWidth[idx];
|
||||
// reduce flow for each increase in density
|
||||
params_modifided.flow_mult *= params.density;
|
||||
params_modifided.flow_mult /= params_modifided.density;
|
||||
// split the flow between steps
|
||||
params_modifided.flow_mult *= (float)percentFlow[idx];
|
||||
|
||||
if (params.config != NULL && idx > 0) params_modifided.flow_mult *= (float)params.config->fill_smooth_distribution.get_abs_value(1);
|
||||
else if (params.config != NULL && idx == 0) params_modifided.flow_mult *= (1.f - (float)params.config->fill_smooth_distribution.get_abs_value(1));
|
||||
else params_modifided.flow_mult *= (float)percentFlow[idx];
|
||||
|
||||
//choose if we are going to extrude with or without overlap
|
||||
if ((params.flow->bridge && idx == 0) || has_overlap[idx]){
|
||||
this->fill_expolygon(idx, *eec, srf_source, params_modifided, volume);
|
||||
}
|
||||
@ -86,11 +91,11 @@ namespace Slic3r {
|
||||
good_role = params.flow->bridge && idx == 0 ? erBridgeInfill : rolePass[idx];
|
||||
}
|
||||
// print
|
||||
float mult_flow = (params.fill_exactly && idx == 0 ? std::min(2., volume / extrudedVolume) : 1);
|
||||
float mult_flow = (params.fill_exactly /*&& idx == 0*/ ? std::min(2., volume / extrudedVolume) : 1);
|
||||
extrusion_entities_append_paths(
|
||||
eec.entities, std::move(polylines_layer),
|
||||
good_role,
|
||||
params.flow_mult * params.flow->mm3_per_mm() * mult_flow,
|
||||
params.flow->mm3_per_mm() * params.flow_mult * mult_flow,
|
||||
//min-reduced flow width for a better view (it's only a gui thing)
|
||||
(float)(params.flow->width * (params.flow_mult* mult_flow < 0.1 ? 0.1 : params.flow_mult * mult_flow)), (float)params.flow->height);
|
||||
}
|
||||
|
@ -44,7 +44,7 @@ protected:
|
||||
int nbPass=2;
|
||||
// this parameter is now erased by fill_smooth_width when available.
|
||||
double percentWidth[3];
|
||||
// this parameter is now modified by fill_top_flow_ratio when available.
|
||||
// this parameter is now modified by fill_smooth_distribution when available. (note that fill_top_flow_ratio can also increasse the params.flow_mult passed by fill.cpp)
|
||||
double percentFlow[3];
|
||||
//angle to add to base angle
|
||||
float anglePass[3];
|
||||
@ -76,7 +76,7 @@ public:
|
||||
rolePass[0] = erTopSolidInfill;//erSolidInfill
|
||||
rolePass[1] = erSolidInfill;
|
||||
rolePass[2] = erTopSolidInfill;
|
||||
percentWidth[0] = 1.4; //0.8
|
||||
percentWidth[0] = 1; //0.8
|
||||
percentWidth[1] = 1.5;
|
||||
percentWidth[2] = 2.8;
|
||||
percentFlow[0] = 1; //0.7
|
||||
|
@ -1164,11 +1164,21 @@ void PrintConfigDef::init_fff_params()
|
||||
def = this->add("fill_smooth_width", coFloatOrPercent);
|
||||
def->label = L("width");
|
||||
def->full_label = L("Ironing width");
|
||||
def->tooltip = L("This is the width of the ironing pass, in a % of the top width, should be no more than 50%.");
|
||||
def->tooltip = L("This is the width of the ironing pass, in a % of the top extrusion width, should not be more than 50%.");
|
||||
def->min = 0;
|
||||
def->mode = comExpert;
|
||||
def->set_default_value(new ConfigOptionFloatOrPercent(50, true));
|
||||
|
||||
def = this->add("fill_smooth_distribution", coFloatOrPercent);
|
||||
def->label = L("distribution");
|
||||
def->full_label = L("Ironing flow distribution");
|
||||
def->tooltip = L("This is the percentage of the flow that is used for the second ironing pass. Typical 0-20%. "
|
||||
"Should not be lower than 20%, unless you have your top extrusion width greatly superior to your nozzle width.");
|
||||
def->min = 0;
|
||||
def->max = 0.9;
|
||||
def->mode = comExpert;
|
||||
def->set_default_value(new ConfigOptionFloatOrPercent(10, true));
|
||||
|
||||
def = this->add("first_layer_acceleration", coFloat);
|
||||
def->label = L("First layer");
|
||||
def->full_label = L("First layer acceleration");
|
||||
|
@ -592,6 +592,7 @@ public:
|
||||
ConfigOptionPercent fill_density;
|
||||
ConfigOptionEnum<InfillPattern> fill_pattern;
|
||||
ConfigOptionFloatOrPercent fill_top_flow_ratio;
|
||||
ConfigOptionFloatOrPercent fill_smooth_distribution;
|
||||
ConfigOptionFloatOrPercent fill_smooth_width;
|
||||
ConfigOptionBool gap_fill;
|
||||
ConfigOptionFloatOrPercent gap_fill_min_area;
|
||||
@ -659,6 +660,7 @@ protected:
|
||||
OPT_PTR(fill_density);
|
||||
OPT_PTR(fill_pattern);
|
||||
OPT_PTR(fill_top_flow_ratio);
|
||||
OPT_PTR(fill_smooth_distribution);
|
||||
OPT_PTR(fill_smooth_width);
|
||||
OPT_PTR(gap_fill);
|
||||
OPT_PTR(gap_fill_min_area);
|
||||
|
@ -560,6 +560,7 @@ bool PrintObject::invalidate_state_by_config_options(const std::vector<t_config_
|
||||
|| opt_key == "fill_pattern"
|
||||
|| opt_key == "fill_top_flow_ratio"
|
||||
|| opt_key == "fill_smooth_width"
|
||||
|| opt_key == "fill_smooth_distribution"
|
||||
|| opt_key == "top_infill_extrusion_width"
|
||||
|| opt_key == "first_layer_extrusion_width") {
|
||||
steps.emplace_back(posInfill);
|
||||
|
@ -279,7 +279,7 @@ void ConfigManipulation::toggle_print_fff_options(DynamicPrintConfig* config)
|
||||
// gap fill can appear in infill
|
||||
//toggle_field("gap_fill_speed", have_perimeters && config->opt_bool("gap_fill"));
|
||||
|
||||
for (auto el : {"fill_smooth_width" })
|
||||
for (auto el : {"fill_smooth_width, fill_smooth_distribution" })
|
||||
toggle_field(el, config->opt_enum<InfillPattern>("top_fill_pattern") == InfillPattern::ipSmooth);
|
||||
|
||||
bool have_top_solid_infill = config->opt_int("top_solid_layers") > 0;
|
||||
|
@ -385,6 +385,7 @@ const std::vector<std::string>& Preset::print_options()
|
||||
, "fill_pattern"
|
||||
, "fill_top_flow_ratio"
|
||||
, "fill_smooth_width"
|
||||
, "fill_smooth_distribution"
|
||||
, "top_fill_pattern"
|
||||
, "bottom_fill_pattern"
|
||||
, "solid_fill_pattern",
|
||||
|
@ -1145,6 +1145,7 @@ void TabPrint::build()
|
||||
|
||||
optgroup = page->new_optgroup(_(L("Advanced Infill")));
|
||||
line.append_option(optgroup->get_option("fill_smooth_width"));
|
||||
line.append_option(optgroup->get_option("fill_smooth_distribution"));
|
||||
optgroup->append_line(line);
|
||||
|
||||
page = add_options_page(_(L("Skirt and brim")), "skirt+brim");
|
||||
|
Loading…
x
Reference in New Issue
Block a user