diff options
author | supermerill <merill@free.fr> | 2022-03-31 12:03:29 +0300 |
---|---|---|
committer | supermerill <merill@free.fr> | 2022-04-01 00:48:01 +0300 |
commit | f554e802fa826ed4d0574b0a08d4c45f728d290a (patch) | |
tree | baedcbf22760d2ec6072b4e35df6c620b3afd6dc /src | |
parent | c7285758f68a1a0276bb9e9a503f144191e58b25 (diff) |
skirt and brim speed & acceleration
supermerill/SuperSlicer#1789
Diffstat (limited to 'src')
-rw-r--r-- | src/libslic3r/GCode.cpp | 38 | ||||
-rw-r--r-- | src/libslic3r/Preset.cpp | 2 | ||||
-rw-r--r-- | src/libslic3r/PrintConfig.cpp | 31 | ||||
-rw-r--r-- | src/libslic3r/PrintConfig.hpp | 2 | ||||
-rw-r--r-- | src/slic3r/GUI/ConfigManipulation.cpp | 4 |
5 files changed, 63 insertions, 14 deletions
diff --git a/src/libslic3r/GCode.cpp b/src/libslic3r/GCode.cpp index a79f632a2..12c227ac5 100644 --- a/src/libslic3r/GCode.cpp +++ b/src/libslic3r/GCode.cpp @@ -943,10 +943,8 @@ namespace DoExport { excluded.insert(erMixed); excluded.insert(erNone); excluded.insert(erWipeTower); - if (config->option("perimeter_speed") != nullptr && config->get_computed_value("perimeter_speed") != 0) { + if (config->option("perimeter_speed") != nullptr && config->get_computed_value("perimeter_speed") != 0) excluded.insert(erPerimeter); - excluded.insert(erSkirt); - } if (config->option("external_perimeter_speed") != nullptr && config->get_computed_value("external_perimeter_speed") != 0) excluded.insert(erExternalPerimeter); if (config->option("overhangs_speed") != nullptr && config->get_computed_value("overhangs_speed") != 0) @@ -969,6 +967,8 @@ namespace DoExport { excluded.insert(erSupportMaterial); if (config->option("support_material_interface_speed") != nullptr && config->get_computed_value("support_material_interface_speed") != 0) excluded.insert(erSupportMaterialInterface); + if (config->option("brim_speed") != nullptr && config->get_computed_value("brim_speed") != 0) + excluded.insert(erSkirt); } virtual void use(const ExtrusionPath& path) override { if (excluded.find(path.role()) == excluded.end()) @@ -2982,8 +2982,7 @@ GCode::LayerResult GCode::process_layer( path.height = layer_skirt_flow.height(); path.mm3_per_mm = mm3_per_mm; } - //FIXME using the support_material_speed of the 1st object printed. - gcode += this->extrude_loop(loop, "", m_config.support_material_speed.value); + gcode += this->extrude_loop(loop, ""); } m_avoid_crossing_perimeters.use_external_mp(false); // Allow a straight travel move to the first object point if this is the first layer (but don't in next layers). @@ -3000,7 +2999,7 @@ GCode::LayerResult GCode::process_layer( for (const ExtrusionEntity* brim_entity : print.brim().entities()) { //if first layer, ask for a bigger lift for travel to each brim, to be on the safe side set_extra_lift(m_last_layer_z, layer.id(), print.config(), m_writer, extruder_id); - gcode += this->extrude_entity(*brim_entity, "Brim", m_config.support_material_speed.value); + gcode += this->extrude_entity(*brim_entity, "Brim"); } m_brim_done = true; m_avoid_crossing_perimeters.use_external_mp(false); @@ -3019,10 +3018,10 @@ GCode::LayerResult GCode::process_layer( if (this->m_layer != nullptr && (this->m_layer->id() < m_config.skirt_height || print.has_infinite_skirt() )) { if(first_layer && print.skirt_first_layer()) for (const ExtrusionEntity* ee : print_object->skirt_first_layer()->entities()) - gcode += this->extrude_entity(*ee, "", m_config.support_material_speed.value); + gcode += this->extrude_entity(*ee, ""); else for (const ExtrusionEntity *ee : print_object->skirt().entities()) - gcode += this->extrude_entity(*ee, "", m_config.support_material_speed.value); + gcode += this->extrude_entity(*ee, ""); } } //extrude object-only brim @@ -3034,7 +3033,7 @@ GCode::LayerResult GCode::process_layer( if (this->m_layer != nullptr && this->m_layer->id() == 0) { m_avoid_crossing_perimeters.use_external_mp(true); for (const ExtrusionEntity *ee : print_object->brim().entities()) - gcode += this->extrude_entity(*ee, "brim", m_config.support_material_speed.value); + gcode += this->extrude_entity(*ee, "brim"); m_avoid_crossing_perimeters.use_external_mp(false); m_avoid_crossing_perimeters.disable_once(); } @@ -4197,8 +4196,8 @@ std::string GCode::extrude_support(const ExtrusionEntityCollection &support_fill std::string gcode; if (! support_fills.entities().empty()) { - const double support_speed = m_config.support_material_speed.value; - const double support_interface_speed = m_config.support_material_interface_speed.get_abs_value(support_speed); + const double support_speed = m_config.get_computed_value("support_material_speed"); + const double support_interface_speed = m_config.get_computed_value("support_material_interface_speed"); for (const ExtrusionEntity *ee : support_fills.entities()) { ExtrusionRole role = ee->role(); assert(role == erSupportMaterial || role == erSupportMaterialInterface || role == erMixed); @@ -4466,6 +4465,12 @@ double_t GCode::_compute_speed_mm_per_sec(const ExtrusionPath& path, double spee speed = m_config.get_computed_value("travel_speed"); } else if (path.role() == erMilling) { speed = m_config.get_computed_value("milling_speed"); + } else if (path.role() == erSupportMaterial) { + speed = m_config.get_computed_value("support_material_speed"); + } else if (path.role() == erSupportMaterialInterface) { + speed = m_config.get_computed_value("support_material_interface_speed"); + } else if (path.role() == erSkirt) { + speed = m_config.get_computed_value("brim_speed"); } else { throw Slic3r::InvalidArgument("Invalid speed"); } @@ -4622,7 +4627,6 @@ std::string GCode::_before_extrude(const ExtrusionPath &path, const std::string } goto topSolidInfill; case erSupportMaterial: - case erSkirt: case erWipeTower: supportMaterial: if (m_config.support_material_acceleration.value > 0) { @@ -4640,6 +4644,16 @@ std::string GCode::_before_extrude(const ExtrusionPath &path, const std::string } } goto supportMaterial; + case erSkirt: + //skirtBrim: + if (m_config.brim_acceleration.value > 0) { + double brim_acceleration = m_config.get_computed_value("brim_acceleration"); + if (brim_acceleration > 0) { + acceleration = brim_acceleration; + break; + } + } + goto supportMaterial; case erBridgeInfill: bridgeInfill: if (m_config.bridge_acceleration.value > 0) { diff --git a/src/libslic3r/Preset.cpp b/src/libslic3r/Preset.cpp index c2f380dd9..5bfa74985 100644 --- a/src/libslic3r/Preset.cpp +++ b/src/libslic3r/Preset.cpp @@ -510,6 +510,7 @@ static std::vector<std::string> s_Preset_print_options { "default_speed", "bridge_speed", "bridge_speed_internal", + "brim_speed", "external_perimeter_speed", "first_layer_speed", "first_layer_min_speed", @@ -540,6 +541,7 @@ static std::vector<std::string> s_Preset_print_options { // acceleration "bridge_acceleration", "bridge_internal_acceleration", + "brim_acceleration", "default_acceleration", "external_perimeter_acceleration", "first_layer_acceleration", diff --git a/src/libslic3r/PrintConfig.cpp b/src/libslic3r/PrintConfig.cpp index b62a3714a..bde2beb52 100644 --- a/src/libslic3r/PrintConfig.cpp +++ b/src/libslic3r/PrintConfig.cpp @@ -862,7 +862,21 @@ void PrintConfigDef::init_fff_params() def->min = 0; def->max = 180; def->mode = comAdvancedE | comSuSi; - def->set_default_value(new ConfigOptionFloat(125)); + def->set_default_value(new ConfigOptionFloat(125)); + + def = this->add("brim_acceleration", coFloatOrPercent); + def->label = L("Brim & Skirt"); + def->full_label = L("Brim & Skirt acceleration"); + def->category = OptionCategory::speed; + def->tooltip = L("This is the acceleration your printer will use for brim and skirt. " + "\nCan be a % of the support acceleration" + "\nSet zero to use support acceleration."); + def->sidetext = L("mm/s² or %"); + def->ratio_over = "support_material_acceleration"; + def->min = 0; + def->max_literal = { -200, false }; + def->mode = comAdvancedE | comSuSi; + def->set_default_value(new ConfigOptionFloatOrPercent(0, false)); def = this->add("brim_ears_detection_length", coFloat); def->label = L("Detection radius"); @@ -900,6 +914,19 @@ void PrintConfigDef::init_fff_params() def->set_default_value(new ConfigOptionFloat(0)); def->aliases = { "brim_offset" }; // from superslicer 2.3 + def = this->add("brim_speed", coFloatOrPercent); + def->label = L("Brim & Skirt"); + def->full_label = L("Brim & Skirt speed"); + def->category = OptionCategory::speed; + def->tooltip = L("This separate setting will affect the speed of brim and skirt. " + "\nIf expressed as percentage (for example: 80%) it will be calculated over the Support speed setting." + "\nSet zero to use autospeed for this feature."); + def->sidetext = L("mm/s or %"); + def->ratio_over = "support_material_speed"; + def->min = 0; + def->mode = comExpert | comSuSi; + def->set_default_value(new ConfigOptionFloatOrPercent(50, true)); + #if 0 def = this->add("brim_type", coEnum); def->label = L("Brim type"); @@ -6969,11 +6996,13 @@ std::unordered_set<std::string> prusa_export_to_remove_keys = { "bridge_speed_internal", "bridge_type", "bridged_infill_margin", +"brim_acceleration", "brim_ears_detection_length", "brim_ears_max_angle", "brim_ears_pattern", "brim_ears", "brim_inside_holes", +"brim_speed", "brim_width_interior", "chamber_temperature", "complete_objects_one_brim", diff --git a/src/libslic3r/PrintConfig.hpp b/src/libslic3r/PrintConfig.hpp index b507e813e..d500818eb 100644 --- a/src/libslic3r/PrintConfig.hpp +++ b/src/libslic3r/PrintConfig.hpp @@ -774,6 +774,7 @@ PRINT_CONFIG_CLASS_DEFINE( ((ConfigOptionFloatOrPercent, bridged_infill_margin)) ((ConfigOptionFloatOrPercent, bridge_speed)) ((ConfigOptionFloatOrPercent, bridge_speed_internal)) + ((ConfigOptionFloatOrPercent, brim_speed)) ((ConfigOptionFloat, curve_smoothing_precision)) ((ConfigOptionFloat, curve_smoothing_cutoff_dist)) ((ConfigOptionFloat, curve_smoothing_angle_convex)) @@ -1083,6 +1084,7 @@ PRINT_CONFIG_CLASS_DERIVED_DEFINE( ((ConfigOptionFloatOrPercent, bridge_internal_acceleration)) ((ConfigOptionInts, bridge_fan_speed)) ((ConfigOptionInts, bridge_internal_fan_speed)) + ((ConfigOptionFloatOrPercent, brim_acceleration)) ((ConfigOptionInts, chamber_temperature)) ((ConfigOptionBool, complete_objects)) ((ConfigOptionBool, complete_objects_one_skirt)) diff --git a/src/slic3r/GUI/ConfigManipulation.cpp b/src/slic3r/GUI/ConfigManipulation.cpp index 0a72cc4dd..90182f00c 100644 --- a/src/slic3r/GUI/ConfigManipulation.cpp +++ b/src/slic3r/GUI/ConfigManipulation.cpp @@ -453,7 +453,8 @@ void ConfigManipulation::toggle_print_fff_options(DynamicPrintConfig* config) toggle_field("perimeter_extrusion_spacing", have_perimeters || have_brim); toggle_field("skirt_extrusion_width", have_skirt); toggle_field("support_material_extruder", have_support_material || have_skirt); - toggle_field("support_material_speed", have_support_material || have_brim || have_skirt); + toggle_field("support_material_speed", have_support_material); + toggle_field("brim_speed", have_brim || have_skirt); toggle_field("raft_contact_distance", have_raft && !have_support_soluble); for (auto el : { "raft_expansion", "first_layer_acceleration_over_raft", "first_layer_speed_over_raft" }) @@ -515,6 +516,7 @@ void ConfigManipulation::toggle_print_fff_options(DynamicPrintConfig* config) toggle_field("ironing_acceleration", have_default_acceleration && has_ironing); toggle_field("support_material_acceleration", have_default_acceleration && (have_support_material || have_brim || have_skirt)); toggle_field("support_material_interface_acceleration", have_default_acceleration && have_support_material && have_support_interface); + toggle_field("brim_acceleration", have_default_acceleration && have_support_material && (have_brim || have_skirt)); for (auto el : { "bridge_acceleration", "bridge_internal_acceleration", "overhangs_acceleration", "gap_fill_acceleration", "travel_acceleration", "travel_deceleration_use_target", "first_layer_acceleration" }) toggle_field(el, have_default_acceleration); |