diff options
author | supermerill <merill@free.fr> | 2022-02-21 01:34:40 +0300 |
---|---|---|
committer | supermerill <merill@free.fr> | 2022-02-21 14:39:59 +0300 |
commit | 9cfc5d2f7d8f4849b501df332f0fdabba8654d71 (patch) | |
tree | 9bc599f0024b8faffcd3366937faf6c2e9372a1e /src/libslic3r | |
parent | dd468a5f4671b97b9eb3246cb3473239ee54197d (diff) |
Small Simple reorg & more scripted widget
- move Simple print settings to 2 tabs
- add seam position shortcut for corners & nearest (scripted widget, Simple & Advanced)
- add Wall thickness scripted widget
- fix scripted widgets bugs.
Diffstat (limited to 'src/libslic3r')
-rw-r--r-- | src/libslic3r/Config.cpp | 10 | ||||
-rw-r--r-- | src/libslic3r/PrintConfig.cpp | 9 | ||||
-rw-r--r-- | src/libslic3r/PrintConfig.hpp | 7 |
3 files changed, 18 insertions, 8 deletions
diff --git a/src/libslic3r/Config.cpp b/src/libslic3r/Config.cpp index 72afd3ec7..af0fd7c76 100644 --- a/src/libslic3r/Config.cpp +++ b/src/libslic3r/Config.cpp @@ -722,6 +722,8 @@ const ConfigOptionDef* ConfigBase::get_option_def(const t_config_option_key& opt if (def == nullptr) throw NoDefinitionException(opt_key); const ConfigOptionDef* opt_def = def->get(opt_key); + if(opt_def == nullptr && parent != nullptr) + opt_def = parent->get_option_def(opt_key); return opt_def; } @@ -747,7 +749,7 @@ double ConfigBase::get_computed_value(const t_config_option_key &opt_key, int ex if (raw_opt->type() == coFloatOrPercent) { auto cofop = static_cast<const ConfigOptionFloatOrPercent*>(raw_opt); if (cofop->value == 0 && boost::ends_with(opt_key, "_extrusion_width")) { - return get_computed_value("extrusion_width"); + return this->get_computed_value("extrusion_width"); } if (!cofop->percent) return cofop->value; @@ -756,7 +758,7 @@ double ConfigBase::get_computed_value(const t_config_option_key &opt_key, int ex if (raw_opt->type() == coPercent) { cast_opt = static_cast<const ConfigOptionPercent*>(raw_opt); } - const ConfigOptionDef* opt_def = get_option_def(opt_key); + const ConfigOptionDef* opt_def = this->get_option_def(opt_key); if (opt_def == nullptr) // maybe a placeholder? return cast_opt->get_abs_value(1); //if over no other key, it's most probably a simple % @@ -801,7 +803,7 @@ double ConfigBase::get_computed_value(const t_config_option_key &opt_key, int ex if (!opt_fl_per->values[idx].percent) return opt_fl_per->values[idx].value; - const ConfigOptionDef* opt_def = get_option_def(opt_key); + const ConfigOptionDef* opt_def = this->get_option_def(opt_key); if (opt_def == nullptr) // maybe a placeholder? return opt_fl_per->get_abs_value(extruder_id, 1); if (opt_def->ratio_over.empty()) @@ -813,7 +815,7 @@ double ConfigBase::get_computed_value(const t_config_option_key &opt_key, int ex } if (raw_opt->type() == coPercents) { const ConfigOptionPercents* opt_per = static_cast<const ConfigOptionPercents*>(raw_opt); - const ConfigOptionDef* opt_def = get_option_def(opt_key); + const ConfigOptionDef* opt_def = this->get_option_def(opt_key); if (opt_def == nullptr) // maybe a placeholder? return opt_per->get_abs_value(extruder_id, 1); if (opt_def->ratio_over.empty()) diff --git a/src/libslic3r/PrintConfig.cpp b/src/libslic3r/PrintConfig.cpp index 08d3a0c71..ca23d7715 100644 --- a/src/libslic3r/PrintConfig.cpp +++ b/src/libslic3r/PrintConfig.cpp @@ -989,7 +989,7 @@ void PrintConfigDef::init_fff_params() "each object before moving onto next one (and starting it from its bottom layer). " "This feature is useful to avoid the risk of ruined prints. " "Slic3r should warn and prevent you from extruder collisions, but beware."); - def->mode = comAdvancedE | comPrusa; + def->mode = comSimpleAE | comPrusa; def->set_default_value(new ConfigOptionBool(false)); def = this->add("complete_objects_one_skirt", coBool); @@ -1197,7 +1197,7 @@ void PrintConfigDef::init_fff_params() def->sidetext = L("mm"); def->aliases = { "multiply_distance" }; def->min = 0; - def->mode = comSimpleAE | comPrusa; + def->mode = comExpert | comPrusa | comSuSi; def->set_default_value(new ConfigOptionFloat(6)); def = this->add("end_gcode", coString); @@ -4210,7 +4210,8 @@ void PrintConfigDef::init_fff_params() def->label = L("Seam position"); def->category = OptionCategory::perimeter; def->tooltip = L("Position of perimeters' starting points." - "\n "); + "\nCost-based option let you choose the angel and travel cost. A high angle cost will place the seam where it can be hidden by a corner" + ", the travel cost place the seam near the last position (often at the end of the previous infill)."); def->enum_keys_map = &ConfigOptionEnum<SeamPosition>::get_enum_values(); def->enum_values.push_back("cost"); def->enum_values.push_back("random"); @@ -5848,7 +5849,7 @@ void PrintConfigDef::init_milling_params() def->category = OptionCategory::milling; def->tooltip = L("If activated, at the end of each layer, the printer will switch to a milling head and mill the external perimeters." "\nYou should set the 'Milling extra XY size' to a value high enough to have enough plastic to mill. Also, be sure that your piece is firmly glued to the bed."); - def->mode = comSimpleAE | comSuSi; + def->mode = comAdvancedE | comSuSi; def->set_default_value(new ConfigOptionBool(false)); def = this->add("milling_extra_size", coFloatOrPercent); diff --git a/src/libslic3r/PrintConfig.hpp b/src/libslic3r/PrintConfig.hpp index ea66fe45b..e141e8a2f 100644 --- a/src/libslic3r/PrintConfig.hpp +++ b/src/libslic3r/PrintConfig.hpp @@ -672,9 +672,11 @@ PRINT_CONFIG_CLASS_DEFINE( ((ConfigOptionPercent, external_perimeter_cut_corners)) ((ConfigOptionBool, exact_last_layer_height)) ((ConfigOptionFloatOrPercent, extrusion_width)) + ((ConfigOptionFloatOrPercent, extrusion_spacing)) ((ConfigOptionFloatOrPercent, first_layer_acceleration_over_raft)) ((ConfigOptionFloatOrPercent, first_layer_height)) ((ConfigOptionFloatOrPercent, first_layer_extrusion_width)) + ((ConfigOptionFloatOrPercent, first_layer_extrusion_spacing)) ((ConfigOptionFloat, first_layer_size_compensation)) /* elefant_foot_compensation */ ((ConfigOptionInt, first_layer_size_compensation_layers)) ((ConfigOptionFloatOrPercent, first_layer_speed_over_raft)) @@ -764,6 +766,7 @@ PRINT_CONFIG_CLASS_DEFINE( ((ConfigOptionBool, enforce_full_fill_volume)) ((ConfigOptionFloatOrPercent, external_infill_margin)) ((ConfigOptionFloatOrPercent, external_perimeter_extrusion_width)) + ((ConfigOptionFloatOrPercent, external_perimeter_extrusion_spacing)) ((ConfigOptionPercent, external_perimeter_overlap)) ((ConfigOptionFloatOrPercent, external_perimeter_speed)) ((ConfigOptionBool, external_perimeters_first)) @@ -798,6 +801,7 @@ PRINT_CONFIG_CLASS_DEFINE( ((ConfigOptionBool, hole_to_polyhole_twisted)) ((ConfigOptionInt, infill_extruder)) ((ConfigOptionFloatOrPercent, infill_extrusion_width)) + ((ConfigOptionFloatOrPercent, infill_extrusion_spacing)) ((ConfigOptionInt, infill_every_layers)) ((ConfigOptionFloatOrPercent, infill_overlap)) ((ConfigOptionFloatOrPercent, infill_speed)) @@ -831,6 +835,7 @@ PRINT_CONFIG_CLASS_DEFINE( ((ConfigOptionBool, perimeter_round_corners)) ((ConfigOptionInt, perimeter_extruder)) ((ConfigOptionFloatOrPercent, perimeter_extrusion_width)) + ((ConfigOptionFloatOrPercent, perimeter_extrusion_spacing)) ((ConfigOptionBool, perimeter_loop)) ((ConfigOptionEnum<SeamPosition>, perimeter_loop_seam)) ((ConfigOptionPercent, perimeter_overlap)) @@ -847,6 +852,7 @@ PRINT_CONFIG_CLASS_DEFINE( ((ConfigOptionFloat, solid_infill_below_area)) ((ConfigOptionInt, solid_infill_extruder)) ((ConfigOptionFloatOrPercent, solid_infill_extrusion_width)) + ((ConfigOptionFloatOrPercent, solid_infill_extrusion_spacing)) ((ConfigOptionInt, solid_infill_every_layers)) ((ConfigOptionFloatOrPercent, solid_infill_speed)) ((ConfigOptionPercent, solid_infill_overlap)) @@ -860,6 +866,7 @@ PRINT_CONFIG_CLASS_DEFINE( ((ConfigOptionFloatOrPercent, thin_walls_speed)) ((ConfigOptionEnum<InfillPattern>, top_fill_pattern)) ((ConfigOptionFloatOrPercent, top_infill_extrusion_width)) + ((ConfigOptionFloatOrPercent, top_infill_extrusion_spacing)) ((ConfigOptionInt, top_solid_layers)) ((ConfigOptionFloat, top_solid_min_thickness)) ((ConfigOptionFloatOrPercent, top_solid_infill_speed)) |