From 8a405d5a1c4344562b2d0cfb28c268c0c5be4edc Mon Sep 17 00:00:00 2001 From: bubnikv Date: Tue, 14 May 2019 12:35:19 +0200 Subject: [PATCH] Changed the wizard to generate explicit extrusion widths for the custom profile (not the zeros). Changed the default values for filament_diameter and nozzle_diameter. --- src/libslic3r/PrintConfig.cpp | 4 ++-- src/slic3r/GUI/ConfigWizard.cpp | 16 ++++++++++++++++ 2 files changed, 18 insertions(+), 2 deletions(-) diff --git a/src/libslic3r/PrintConfig.cpp b/src/libslic3r/PrintConfig.cpp index 453a16943..845b5ed46 100644 --- a/src/libslic3r/PrintConfig.cpp +++ b/src/libslic3r/PrintConfig.cpp @@ -680,7 +680,7 @@ void PrintConfigDef::init_fff_params() "and do multiple measurements along the filament, then compute the average."); def->sidetext = L("mm"); def->min = 0; - def->set_default_value(new ConfigOptionFloats { 3. }); + def->set_default_value(new ConfigOptionFloats { 1.75 }); def = this->add("filament_density", coFloats); def->label = L("Density"); @@ -1286,7 +1286,7 @@ void PrintConfigDef::init_fff_params() def->label = L("Nozzle diameter"); def->tooltip = L("This is the diameter of your extruder nozzle (for example: 0.5, 0.35 etc.)"); def->sidetext = L("mm"); - def->set_default_value(new ConfigOptionFloats { 0.5 }); + def->set_default_value(new ConfigOptionFloats { 0.4 }); def = this->add("host_type", coEnum); def->label = L("Host Type"); diff --git a/src/slic3r/GUI/ConfigWizard.cpp b/src/slic3r/GUI/ConfigWizard.cpp index 2b1638aa1..aacbfdc52 100644 --- a/src/slic3r/GUI/ConfigWizard.cpp +++ b/src/slic3r/GUI/ConfigWizard.cpp @@ -590,6 +590,22 @@ void PageDiameters::apply_custom_config(DynamicPrintConfig &config) config.set_key_value("nozzle_diameter", opt_nozzle); auto *opt_filam = new ConfigOptionFloats(1, spin_filam->GetValue()); config.set_key_value("filament_diameter", opt_filam); + + auto set_extrusion_width = [&config, opt_nozzle](const char *key, double dmr) { + char buf[64]; + sprintf(buf, "%.2lf", dmr * opt_nozzle->values.front() / 0.4); + config.set_key_value(key, new ConfigOptionFloatOrPercent(atof(buf), false)); + }; + + set_extrusion_width("support_material_extrusion_width", 0.35); + set_extrusion_width("top_infill_extrusion_width", 0.40); + set_extrusion_width("first_layer_extrusion_width", 0.42); + + set_extrusion_width("extrusion_width", 0.45); + set_extrusion_width("perimeter_extrusion_width", 0.45); + set_extrusion_width("external_perimeter_extrusion_width", 0.45); + set_extrusion_width("infill_extrusion_width", 0.45); + set_extrusion_width("solid_infill_extrusion_width", 0.45); } PageTemperatures::PageTemperatures(ConfigWizard *parent)