diff --git a/resources/calibration/filament_pressure/0.3mf b/resources/calibration/filament_pressure/0.3mf new file mode 100644 index 00000000000..f18107e0e82 Binary files /dev/null and b/resources/calibration/filament_pressure/0.3mf differ diff --git a/resources/calibration/filament_pressure/1.3mf b/resources/calibration/filament_pressure/1.3mf new file mode 100644 index 00000000000..dd8f331777c Binary files /dev/null and b/resources/calibration/filament_pressure/1.3mf differ diff --git a/resources/calibration/filament_pressure/2.3mf b/resources/calibration/filament_pressure/2.3mf new file mode 100644 index 00000000000..fdeb8bbdd07 Binary files /dev/null and b/resources/calibration/filament_pressure/2.3mf differ diff --git a/resources/calibration/filament_pressure/3.3mf b/resources/calibration/filament_pressure/3.3mf new file mode 100644 index 00000000000..04c28fa5af9 Binary files /dev/null and b/resources/calibration/filament_pressure/3.3mf differ diff --git a/resources/calibration/filament_pressure/4.3mf b/resources/calibration/filament_pressure/4.3mf new file mode 100644 index 00000000000..e124482d021 Binary files /dev/null and b/resources/calibration/filament_pressure/4.3mf differ diff --git a/resources/calibration/filament_pressure/5.3mf b/resources/calibration/filament_pressure/5.3mf new file mode 100644 index 00000000000..37135fa6860 Binary files /dev/null and b/resources/calibration/filament_pressure/5.3mf differ diff --git a/resources/calibration/filament_pressure/6.3mf b/resources/calibration/filament_pressure/6.3mf new file mode 100644 index 00000000000..aae82ae2b94 Binary files /dev/null and b/resources/calibration/filament_pressure/6.3mf differ diff --git a/resources/calibration/filament_pressure/7.3mf b/resources/calibration/filament_pressure/7.3mf new file mode 100644 index 00000000000..f21d6fb2593 Binary files /dev/null and b/resources/calibration/filament_pressure/7.3mf differ diff --git a/resources/calibration/filament_pressure/8.3mf b/resources/calibration/filament_pressure/8.3mf new file mode 100644 index 00000000000..8804502d5dc Binary files /dev/null and b/resources/calibration/filament_pressure/8.3mf differ diff --git a/resources/calibration/filament_pressure/9.3mf b/resources/calibration/filament_pressure/9.3mf new file mode 100644 index 00000000000..58fe1bbf199 Binary files /dev/null and b/resources/calibration/filament_pressure/9.3mf differ diff --git a/resources/calibration/filament_pressure/base_plate.3mf b/resources/calibration/filament_pressure/base_plate.3mf new file mode 100644 index 00000000000..4815007b066 Binary files /dev/null and b/resources/calibration/filament_pressure/base_plate.3mf differ diff --git a/resources/calibration/filament_pressure/filament_pressure.html b/resources/calibration/filament_pressure/filament_pressure.html new file mode 100644 index 00000000000..019e9cee723 --- /dev/null +++ b/resources/calibration/filament_pressure/filament_pressure.html @@ -0,0 +1,41 @@ + + + + + Pressure Advance Calibration + + + + + + + + + + + +
+

Pressure/Linear Advance

+
+ + +
Needs:Bed Leveling and Layer Squish to be perfect
+
+
+ +

this test is still in development, beta should work "ok" for now though.
your current print settings will need to be saved before clicking "generate" since it uses the saved values to create the model

+

note: this test will auto pull all your currently loaded config parameters and generate a model for you to print!
for to help with firmware speed/processing limitations it's reccomended to have most extrusion roles similar set to speeds.

+ +

How to tune your printer for Pressure/Linear Advance

+

todo add detaisl here

+

Advice

+

Before doing this test, it's preferable to tune everything else first!
i would reccomended setting XXXX to the same speeds, XXX to a slow speed, and everything else you can send it with.

+

note: having large variance with ER speeds can reduce print quality/dimensional accuracy this is effect is mainly caused by the inner perimeter getting pulled closer to the external perimeter as it cools down, since each perimeter would be at different temperatues.

+

TODO add things about PA and setting first layer correctly
add notes about fan speed and disabling fan speed for this test, or do i have check box in GUI that would auto change relavent UI tab?

+ +

Notes

+

TODO: add cred for andrew ellis testing method

+ + diff --git a/resources/calibration/filament_pressure/pa_border.3mf b/resources/calibration/filament_pressure/pa_border.3mf new file mode 100644 index 00000000000..baf63447955 Binary files /dev/null and b/resources/calibration/filament_pressure/pa_border.3mf differ diff --git a/resources/calibration/filament_pressure/point.3mf b/resources/calibration/filament_pressure/point.3mf new file mode 100644 index 00000000000..5a5e03157c1 Binary files /dev/null and b/resources/calibration/filament_pressure/point.3mf differ diff --git a/resources/calibration/filament_pressure/scaled_with_nozzle_size/90_bend_0.10.3mf b/resources/calibration/filament_pressure/scaled_with_nozzle_size/90_bend_0.10.3mf new file mode 100644 index 00000000000..a43b1d3d847 Binary files /dev/null and b/resources/calibration/filament_pressure/scaled_with_nozzle_size/90_bend_0.10.3mf differ diff --git a/resources/calibration/filament_pressure/scaled_with_nozzle_size/90_bend_0.20.3mf b/resources/calibration/filament_pressure/scaled_with_nozzle_size/90_bend_0.20.3mf new file mode 100644 index 00000000000..de11b883ae1 Binary files /dev/null and b/resources/calibration/filament_pressure/scaled_with_nozzle_size/90_bend_0.20.3mf differ diff --git a/resources/calibration/filament_pressure/scaled_with_nozzle_size/90_bend_0.30.3mf b/resources/calibration/filament_pressure/scaled_with_nozzle_size/90_bend_0.30.3mf new file mode 100644 index 00000000000..672eb5b527b Binary files /dev/null and b/resources/calibration/filament_pressure/scaled_with_nozzle_size/90_bend_0.30.3mf differ diff --git a/resources/calibration/filament_pressure/scaled_with_nozzle_size/90_bend_0.40.3mf b/resources/calibration/filament_pressure/scaled_with_nozzle_size/90_bend_0.40.3mf new file mode 100644 index 00000000000..70dd9d89365 Binary files /dev/null and b/resources/calibration/filament_pressure/scaled_with_nozzle_size/90_bend_0.40.3mf differ diff --git a/resources/calibration/filament_pressure/scaled_with_nozzle_size/90_bend_0.50.3mf b/resources/calibration/filament_pressure/scaled_with_nozzle_size/90_bend_0.50.3mf new file mode 100644 index 00000000000..7435b5bf9c9 Binary files /dev/null and b/resources/calibration/filament_pressure/scaled_with_nozzle_size/90_bend_0.50.3mf differ diff --git a/resources/calibration/filament_pressure/scaled_with_nozzle_size/90_bend_0.60.3mf b/resources/calibration/filament_pressure/scaled_with_nozzle_size/90_bend_0.60.3mf new file mode 100644 index 00000000000..d4414a24389 Binary files /dev/null and b/resources/calibration/filament_pressure/scaled_with_nozzle_size/90_bend_0.60.3mf differ diff --git a/resources/calibration/filament_pressure/scaled_with_nozzle_size/90_bend_0.70.3mf b/resources/calibration/filament_pressure/scaled_with_nozzle_size/90_bend_0.70.3mf new file mode 100644 index 00000000000..e3f3e98bab2 Binary files /dev/null and b/resources/calibration/filament_pressure/scaled_with_nozzle_size/90_bend_0.70.3mf differ diff --git a/resources/calibration/filament_pressure/scaled_with_nozzle_size/90_bend_0.80.3mf b/resources/calibration/filament_pressure/scaled_with_nozzle_size/90_bend_0.80.3mf new file mode 100644 index 00000000000..802393609dd Binary files /dev/null and b/resources/calibration/filament_pressure/scaled_with_nozzle_size/90_bend_0.80.3mf differ diff --git a/resources/calibration/filament_pressure/scaled_with_nozzle_size/90_bend_0.90.3mf b/resources/calibration/filament_pressure/scaled_with_nozzle_size/90_bend_0.90.3mf new file mode 100644 index 00000000000..c8915c80977 Binary files /dev/null and b/resources/calibration/filament_pressure/scaled_with_nozzle_size/90_bend_0.90.3mf differ diff --git a/resources/calibration/filament_pressure/scaled_with_nozzle_size/90_bend_1.00.3mf b/resources/calibration/filament_pressure/scaled_with_nozzle_size/90_bend_1.00.3mf new file mode 100644 index 00000000000..5832fc30c0d Binary files /dev/null and b/resources/calibration/filament_pressure/scaled_with_nozzle_size/90_bend_1.00.3mf differ diff --git a/resources/calibration/filament_pressure/scaled_with_nozzle_size/90_bend_1.10.3mf b/resources/calibration/filament_pressure/scaled_with_nozzle_size/90_bend_1.10.3mf new file mode 100644 index 00000000000..06f9975daba Binary files /dev/null and b/resources/calibration/filament_pressure/scaled_with_nozzle_size/90_bend_1.10.3mf differ diff --git a/resources/calibration/filament_pressure/scaled_with_nozzle_size/90_bend_1.20.3mf b/resources/calibration/filament_pressure/scaled_with_nozzle_size/90_bend_1.20.3mf new file mode 100644 index 00000000000..2ba7117cff7 Binary files /dev/null and b/resources/calibration/filament_pressure/scaled_with_nozzle_size/90_bend_1.20.3mf differ diff --git a/resources/calibration/filament_pressure/scaled_with_nozzle_size/90_bend_1.30.3mf b/resources/calibration/filament_pressure/scaled_with_nozzle_size/90_bend_1.30.3mf new file mode 100644 index 00000000000..31490cbc46d Binary files /dev/null and b/resources/calibration/filament_pressure/scaled_with_nozzle_size/90_bend_1.30.3mf differ diff --git a/resources/calibration/filament_pressure/scaled_with_nozzle_size/90_bend_1.40.3mf b/resources/calibration/filament_pressure/scaled_with_nozzle_size/90_bend_1.40.3mf new file mode 100644 index 00000000000..317d409fc19 Binary files /dev/null and b/resources/calibration/filament_pressure/scaled_with_nozzle_size/90_bend_1.40.3mf differ diff --git a/resources/calibration/filament_pressure/scaled_with_nozzle_size/90_bend_1.50.3mf b/resources/calibration/filament_pressure/scaled_with_nozzle_size/90_bend_1.50.3mf new file mode 100644 index 00000000000..6992e6a0a3a Binary files /dev/null and b/resources/calibration/filament_pressure/scaled_with_nozzle_size/90_bend_1.50.3mf differ diff --git a/resources/calibration/filament_pressure/scaled_with_nozzle_size/90_bend_1.60.3mf b/resources/calibration/filament_pressure/scaled_with_nozzle_size/90_bend_1.60.3mf new file mode 100644 index 00000000000..71c89d2145c Binary files /dev/null and b/resources/calibration/filament_pressure/scaled_with_nozzle_size/90_bend_1.60.3mf differ diff --git a/resources/calibration/filament_pressure/scaled_with_nozzle_size/90_bend_1.70.3mf b/resources/calibration/filament_pressure/scaled_with_nozzle_size/90_bend_1.70.3mf new file mode 100644 index 00000000000..1059221a40c Binary files /dev/null and b/resources/calibration/filament_pressure/scaled_with_nozzle_size/90_bend_1.70.3mf differ diff --git a/resources/calibration/filament_pressure/scaled_with_nozzle_size/90_bend_1.80.3mf b/resources/calibration/filament_pressure/scaled_with_nozzle_size/90_bend_1.80.3mf new file mode 100644 index 00000000000..6ce9f6fc688 Binary files /dev/null and b/resources/calibration/filament_pressure/scaled_with_nozzle_size/90_bend_1.80.3mf differ diff --git a/resources/calibration/filament_pressure/scaled_with_nozzle_size/90_bend_1.90.3mf b/resources/calibration/filament_pressure/scaled_with_nozzle_size/90_bend_1.90.3mf new file mode 100644 index 00000000000..cb2cef4769c Binary files /dev/null and b/resources/calibration/filament_pressure/scaled_with_nozzle_size/90_bend_1.90.3mf differ diff --git a/resources/calibration/filament_pressure/scaled_with_nozzle_size/90_bend_2.00.3mf b/resources/calibration/filament_pressure/scaled_with_nozzle_size/90_bend_2.00.3mf new file mode 100644 index 00000000000..31df1df8cc0 Binary files /dev/null and b/resources/calibration/filament_pressure/scaled_with_nozzle_size/90_bend_2.00.3mf differ diff --git a/resources/localization/list.txt b/resources/localization/list.txt index 8eb97365b74..39cb74d0df2 100644 --- a/resources/localization/list.txt +++ b/resources/localization/list.txt @@ -12,6 +12,7 @@ src/slic3r/GUI/CalibrationCubeDialog.cpp src/slic3r/GUI/CalibrationFlowDialog.cpp src/slic3r/GUI/CalibrationOverBridgeDialog.cpp src/slic3r/GUI/CalibrationRetractionDialog.cpp +src/slic3r/GUI/CalibrationPressureAdvDialog.cpp src/slic3r/GUI/CalibrationTempDialog.cpp src/slic3r/GUI/ConfigManipulation.cpp src/slic3r/GUI/ConfigSnapshotDialog.cpp diff --git a/resources/ui_layout/default/print.ui b/resources/ui_layout/default/print.ui index 039c1ddf88b..ea3a565f88d 100644 --- a/resources/ui_layout/default/print.ui +++ b/resources/ui_layout/default/print.ui @@ -214,11 +214,12 @@ group:sidetext_width$5:Infill angle line:Modifiers setting:label_width$6:width$5:label$increment:fill_angle_increment setting:width$5:fill_angle_cross + setting:width$5:fill_angle_follow_model vector_line:fill_angle_template # setting:fill_angle_template group:sidetext_width$5:Advanced setting:solid_infill_every_layers - line:Solid infill is area below + line:Solid infill if area below setting:label$From region:solid_infill_below_area setting:label$From the whole layer:solid_infill_below_layer_area end_line diff --git a/src/libslic3r/Fill/Fill.cpp b/src/libslic3r/Fill/Fill.cpp index 99f5d1ec925..98c82035867 100644 --- a/src/libslic3r/Fill/Fill.cpp +++ b/src/libslic3r/Fill/Fill.cpp @@ -57,6 +57,7 @@ struct SurfaceFillParams : FillParams RETURN_COMPARE_NON_EQUAL(can_angle_cross); RETURN_COMPARE_NON_EQUAL(density); RETURN_COMPARE_NON_EQUAL(monotonic); + RETURN_COMPARE_NON_EQUAL(max_sparse_infill_spacing); RETURN_COMPARE_NON_EQUAL_TYPED(unsigned, connection); RETURN_COMPARE_NON_EQUAL_TYPED(unsigned, dont_adjust); @@ -70,16 +71,22 @@ struct SurfaceFillParams : FillParams assert(this->config != nullptr); assert(rhs.config != nullptr); if (config != nullptr && rhs.config != nullptr) { + RETURN_COMPARE_NON_EQUAL(config->infill_acceleration); RETURN_COMPARE_NON_EQUAL(config->infill_speed); + RETURN_COMPARE_NON_EQUAL(config->solid_infill_acceleration); RETURN_COMPARE_NON_EQUAL(config->solid_infill_speed); + RETURN_COMPARE_NON_EQUAL(config->top_solid_infill_acceleration); RETURN_COMPARE_NON_EQUAL(config->top_solid_infill_speed); - RETURN_COMPARE_NON_EQUAL(config->ironing_speed); + RETURN_COMPARE_NON_EQUAL(config->default_acceleration); RETURN_COMPARE_NON_EQUAL(config->default_speed); + RETURN_COMPARE_NON_EQUAL(config->bridge_acceleration); RETURN_COMPARE_NON_EQUAL(config->bridge_speed); - RETURN_COMPARE_NON_EQUAL(config->bridge_speed_internal); + RETURN_COMPARE_NON_EQUAL(config->internal_bridge_acceleration); + RETURN_COMPARE_NON_EQUAL(config->internal_bridge_speed); + RETURN_COMPARE_NON_EQUAL(config->gap_fill_acceleration); RETURN_COMPARE_NON_EQUAL(config->gap_fill_speed); RETURN_COMPARE_NON_EQUAL(config->print_extrusion_multiplier); - RETURN_COMPARE_NON_EQUAL(max_sparse_infill_spacing); + RETURN_COMPARE_NON_EQUAL(config->region_gcode.value); } if (config == nullptr || rhs.config == nullptr || max_sparse_infill_spacing == 0) RETURN_COMPARE_NON_EQUAL(flow.width()); @@ -92,14 +99,23 @@ struct SurfaceFillParams : FillParams if ((config != nullptr) != (rhs.config != nullptr)) return false; if(config != nullptr && ( - config->infill_speed != rhs.config->infill_speed + config->infill_acceleration != rhs.config->infill_acceleration + || config->infill_speed != rhs.config->infill_speed + || config->solid_infill_acceleration != rhs.config->solid_infill_acceleration || config->solid_infill_speed != rhs.config->solid_infill_speed + || config->top_solid_infill_acceleration != rhs.config->top_solid_infill_acceleration || config->top_solid_infill_speed != rhs.config->top_solid_infill_speed - || config->ironing_speed != rhs.config->ironing_speed + || config->default_acceleration != rhs.config->default_acceleration || config->default_speed != rhs.config->default_speed + || config->bridge_acceleration != rhs.config->bridge_acceleration || config->bridge_speed != rhs.config->bridge_speed - || config->bridge_speed_internal != rhs.config->bridge_speed_internal - || config->gap_fill_speed != rhs.config->gap_fill_speed)) + || config->internal_bridge_acceleration != rhs.config->internal_bridge_acceleration + || config->internal_bridge_speed != rhs.config->internal_bridge_speed + || config->gap_fill_acceleration != rhs.config->gap_fill_acceleration + || config->gap_fill_speed != rhs.config->gap_fill_speed + || config->print_extrusion_multiplier != rhs.config->print_extrusion_multiplier + || config->region_gcode != rhs.config->region_gcode + )) return false; // then check params return this->extruder == rhs.extruder && @@ -542,6 +558,12 @@ void Layer::make_fills(FillAdaptive::Octree* adaptive_fill_octree, FillAdaptive: f->can_angle_cross = surface_fill.params.can_angle_cross; f->adapt_fill_octree = (surface_fill.params.pattern == ipSupportCubic) ? support_fill_octree : adaptive_fill_octree; + // add object angle if needed + double z_object_angle = this->m_object->trafo().rotation().eulerAngles(0,1,2).z(); + if (this->object()->config().fill_angle_follow_model.value) { + f->angle += z_object_angle; + } + if (surface_fill.params.pattern == ipLightning) dynamic_cast(f.get())->generator = lightning_generator; @@ -779,6 +801,7 @@ void Layer::make_ironing() double line_spacing; // Height of the extrusion, to calculate the extrusion flow from. double height; + double acceleration; double speed; double angle; IroningType type; @@ -800,6 +823,10 @@ void Layer::make_ironing() return true; if (this->height > rhs.height) return false; + if (this->acceleration < rhs.acceleration) + return true; + if (this->acceleration > rhs.acceleration) + return false; if (this->speed < rhs.speed) return true; if (this->speed > rhs.speed) @@ -811,11 +838,12 @@ void Layer::make_ironing() return false; } - bool operator==(const IroningParams &rhs) const { + bool operator==(const IroningParams &rhs) const + { return this->extruder == rhs.extruder && this->just_infill == rhs.just_infill && - this->line_spacing == rhs.line_spacing && this->height == rhs.height && this->speed == rhs.speed && - this->angle == rhs.angle && - this->type == rhs.type; + this->line_spacing == rhs.line_spacing && this->height == rhs.height && + this->acceleration == rhs.acceleration && this->speed == rhs.speed && + this->angle == rhs.angle && this->type == rhs.type; } LayerRegion *layerm = nullptr; @@ -862,6 +890,7 @@ void Layer::make_ironing() ironing_params.just_infill = false; ironing_params.line_spacing = config.ironing_spacing; ironing_params.height = default_layer_height * 0.01 * config.ironing_flowrate; + ironing_params.acceleration = config.ironing_acceleration; ironing_params.speed = config.ironing_speed; if (config.ironing_angle.value >= 0) { ironing_params.angle = float(Geometry::deg2rad(config.ironing_angle.value)); diff --git a/src/libslic3r/Format/BBConfig.cpp b/src/libslic3r/Format/BBConfig.cpp index ffb22ab40e2..78e81ae23a8 100644 --- a/src/libslic3r/Format/BBConfig.cpp +++ b/src/libslic3r/Format/BBConfig.cpp @@ -96,7 +96,7 @@ void init() //key_translation_map["bridge_angle"] = "bridge_angle"; key_translation_map["bridge_density"] = "bridge_overlap_min"; key_translation_map["bridge_no_support"] = "dont_support_bridges"; - key_translation_map["internal_bridge_speed"] = "bridge_speed_internal"; + //key_translation_map["internal_bridge_speed"] = "internal_bridge_speed"; //key_translation_map["brim_ears"] = "brim_ears"; //key_translation_map["brim_ears_detection_length"] = "brim_ears_detection_length"; //key_translation_map["brim_ears_max_angle"] = "brim_ears_max_angle"; diff --git a/src/libslic3r/GCode.cpp b/src/libslic3r/GCode.cpp index 332eece4fb3..a56dff4dc1b 100644 --- a/src/libslic3r/GCode.cpp +++ b/src/libslic3r/GCode.cpp @@ -919,6 +919,16 @@ namespace DoExport { break; } } + if (ret.size() < MAX_TAGS_COUNT) { + std::set per_object_gcodes; + for (const PrintObject *obj : print.objects()) + per_object_gcodes.insert(obj->config().object_gcode.value); + for (const std::string &gcode : per_object_gcodes) { + check(_(L("Per object G-code")), gcode); + if (ret.size() == MAX_TAGS_COUNT) + break; + } + } return ret; } @@ -1096,7 +1106,7 @@ namespace DoExport { excluded.insert(erTopSolidInfill); if (config->option("bridge_speed") != nullptr && config->get_computed_value("bridge_speed") != 0) excluded.insert(erBridgeInfill); - if (config->option("bridge_speed_internal") != nullptr && config->get_computed_value("bridge_speed_internal") != 0) + if (config->option("internal_bridge_speed") != nullptr && config->get_computed_value("internal_bridge_speed") != 0) excluded.insert(erInternalBridgeInfill); if (config->option("support_material_speed") != nullptr && config->get_computed_value("support_material_speed") != 0) excluded.insert(erSupportMaterial); @@ -1628,6 +1638,7 @@ void GCode::_do_export(Print& print_mod, GCodeOutputStream &file, ThumbnailsGene file.write("M486 T" + std::to_string(nb_items) + "\n"); } if (this->config().gcode_label_objects) { + file.write("; Total objects to print: " + std::to_string(nb_items) + "\n"); file.write_format( "; plater:{\"center\":[%f,%f,%f],\"boundingbox_center\":[%f,%f,%f],\"boundingbox_size\":[%f,%f,%f]}\n", global_bounding_box.center().x(), global_bounding_box.center().y(), 0., global_bounding_box.center().x(), global_bounding_box.center().y(), global_bounding_box.center().z(), @@ -3073,7 +3084,9 @@ LayerResult GCode::process_layer( assert(l.layer() == nullptr || layer_id == l.layer()->id()); } assert(layer_id < layer_count()); + assert(object_layer != nullptr || support_layer != nullptr); const Layer &layer = (object_layer != nullptr) ? *object_layer : *support_layer; + assert(layer_id == layer.id()); LayerResult result { {}, layer.id(), false, last_layer, false}; if (layer_tools.extruders.empty()) // Nothing to extrude. @@ -3532,8 +3545,9 @@ LayerResult GCode::process_layer( if (m_config.avoid_crossing_perimeters) m_avoid_crossing_perimeters.init_layer(*m_layer); //print object label to help the printer firmware know where it is (for removing the objects) + m_gcode_label_objects_start = ""; if (this->config().gcode_label_objects) { - m_gcode_label_objects_start = + m_gcode_label_objects_start += std::string("; printing object ") + instance_to_print.print_object.model_object()->name + " id:" + instance_id + " copy " + instance_copy + @@ -3566,6 +3580,14 @@ LayerResult GCode::process_layer( "\n"; } } + if (!instance_to_print.print_object.config().object_gcode.value.empty()) { + DynamicConfig config; + config.set_key_value("layer_num", new ConfigOptionInt(m_layer_index)); + config.set_key_value("layer_z", new ConfigOptionFloat(print_z)); + m_gcode_label_objects_start += this->placeholder_parser_process("object_gcode", + instance_to_print.print_object.config().object_gcode.value, m_writer.tool()->id(), &config) + + "\n"; + } // ask for a bigger lift for travel to object when moving to another object if (single_object_instance_idx == size_t(-1) && !first_object) set_extra_lift(m_last_layer_z, layer.id(), print.config(), m_writer, extruder_id); @@ -3646,7 +3668,7 @@ LayerResult GCode::process_layer( } } // Don't set m_gcode_label_objects_end if you don't had to write the m_gcode_label_objects_start. - if (m_gcode_label_objects_start != "") { + if (!m_gcode_label_objects_start.empty()) { m_gcode_label_objects_start = ""; } else if (this->config().gcode_label_objects) { m_gcode_label_objects_end = std::string("; stop printing object ") + instance_to_print.print_object.model_object()->name @@ -5353,6 +5375,41 @@ std::string GCode::extrude_path_3D(const ExtrusionPath3D &path, const std::strin return gcode; } +// Apply region-specific settings +void GCode::apply_region_config(std::string &gcode) { + // modify our fullprintconfig with it. (works as all items avaialable in the regionconfig are present in this config, ie: it write everything region-defined) + m_config.apply(m_region->config()); + // pass our region config to the gcode writer + m_writer.apply_print_region_config(m_region->config()); + // perimeter-only (but won't break anything if done also in infill & ironing): pass needed settings to seam placer. + m_seam_placer.external_perimeters_first = m_region->config().external_perimeters_first.value; + // temperature override from region + if (m_config.print_temperature > 0) { + if (m_layer != nullptr && m_layer->bottom_z() < EPSILON && m_config.print_first_layer_temperature.value > 0) { + gcode += m_writer.set_temperature(m_config.print_first_layer_temperature.value, false, m_writer.tool()->id()); + } else { + gcode += m_writer.set_temperature(m_config.print_temperature.value, false, m_writer.tool()->id()); + } + } else if (m_layer != nullptr && m_layer->bottom_z() < EPSILON && m_config.first_layer_temperature.get_at(m_writer.tool()->id()) > 0) { + gcode += m_writer.set_temperature(m_config.first_layer_temperature.get_at(m_writer.tool()->id()), false, + m_writer.tool()->id()); + } else if (m_config.temperature.get_at(m_writer.tool()->id()) > 0) { // don't set it if disabled + gcode += m_writer.set_temperature(m_config.temperature.get_at(m_writer.tool()->id()), false, + m_writer.tool()->id()); + } + // apply region_gcode + if (!m_region->config().region_gcode.value.empty()) { + DynamicConfig config; + config.set_key_value("layer_num", new ConfigOptionInt(m_layer_index)); + config.set_key_value("layer_z", new ConfigOptionFloat(m_layer == nullptr ? m_last_height : m_layer->print_z)); + m_gcode_label_objects_start += this->placeholder_parser_process("region_gcode", + m_region->config().region_gcode.value, + m_writer.tool()->id(), &config) + + "\n"; + } + +} + // Extrude perimeters: Decide where to put seams (hide or align seams). std::string GCode::extrude_perimeters(const Print &print, const std::vector &by_region) { @@ -5362,20 +5419,7 @@ std::string GCode::extrude_perimeters(const Print &print, const std::vectorconfig()); - m_writer.apply_print_region_config(m_region->config()); - m_seam_placer.external_perimeters_first = m_region->config().external_perimeters_first.value; - if (m_config.print_temperature > 0) - if (m_layer != nullptr && m_layer->bottom_z() < EPSILON && m_config.print_first_layer_temperature.value > 0) - gcode += m_writer.set_temperature(m_config.print_first_layer_temperature.value, false, m_writer.tool()->id()); - else - gcode += m_writer.set_temperature(m_config.print_temperature.value, false, m_writer.tool()->id()); - else if (m_layer != nullptr && m_layer->bottom_z() < EPSILON && m_config.first_layer_temperature.get_at(m_writer.tool()->id()) > 0) - gcode += m_writer.set_temperature(m_config.first_layer_temperature.get_at(m_writer.tool()->id()), false, m_writer.tool()->id()); - else if (m_config.temperature.get_at(m_writer.tool()->id()) > 0) { // don't set it if disabled - gcode += m_writer.set_temperature(m_config.temperature.get_at(m_writer.tool()->id()), false, - m_writer.tool()->id()); - } + apply_region_config(gcode); ExtrusionEntitiesPtr extrusions{region.perimeters}; chain_and_reorder_extrusion_entities(extrusions, &m_last_pos); for (const ExtrusionEntity *ee : extrusions) { @@ -5394,17 +5438,7 @@ std::string GCode::extrude_infill(const Print& print, const std::vectorconfig().infill_first == is_infill_first)) { - m_config.apply(m_region->config()); - m_writer.apply_print_region_config(m_region->config()); - if (m_config.print_temperature > 0) - if (m_layer != nullptr && m_layer->bottom_z() < EPSILON && m_config.print_first_layer_temperature.value > 0) - gcode += m_writer.set_temperature(m_config.print_first_layer_temperature.value, false, m_writer.tool()->id()); - else - gcode += m_writer.set_temperature(m_config.print_temperature.value, false, m_writer.tool()->id()); - else if (m_layer != nullptr && m_layer->bottom_z() < EPSILON && m_config.first_layer_temperature.get_at(m_writer.tool()->id()) > 0) - gcode += m_writer.set_temperature(m_config.first_layer_temperature.get_at(m_writer.tool()->id()), false, m_writer.tool()->id()); - else if (m_config.temperature.get_at(m_writer.tool()->id()) > 0) // don't set it if disabled - gcode += m_writer.set_temperature(m_config.temperature.get_at(m_writer.tool()->id()), false, m_writer.tool()->id()); + apply_region_config(gcode); ExtrusionEntitiesPtr extrusions{ region.infills }; chain_and_reorder_extrusion_entities(extrusions, &m_last_pos); for (const ExtrusionEntity* fill : extrusions) { @@ -5423,17 +5457,7 @@ std::string GCode::extrude_ironing(const Print& print, const std::vectorconfig()); - m_writer.apply_print_region_config(m_region->config()); - if (m_config.print_temperature > 0) - if (m_layer != nullptr && m_layer->bottom_z() < EPSILON && m_config.print_first_layer_temperature.value > 0) - gcode += m_writer.set_temperature(m_config.print_first_layer_temperature.value, false, m_writer.tool()->id()); - else - gcode += m_writer.set_temperature(m_config.print_temperature.value, false, m_writer.tool()->id()); - else if (m_layer != nullptr && m_layer->bottom_z() < EPSILON && m_config.first_layer_temperature.get_at(m_writer.tool()->id()) > 0) - gcode += m_writer.set_temperature(m_config.first_layer_temperature.get_at(m_writer.tool()->id()), false, m_writer.tool()->id()); - else if (m_config.temperature.get_at(m_writer.tool()->id()) > 0) - gcode += m_writer.set_temperature(m_config.temperature.get_at(m_writer.tool()->id()), false, m_writer.tool()->id()); + apply_region_config(gcode); ExtrusionEntitiesPtr extrusions{ region.ironings }; chain_and_reorder_extrusion_entities(extrusions, &m_last_pos); for (const ExtrusionEntity* fill : extrusions) { @@ -5803,8 +5827,8 @@ double_t GCode::_compute_speed_mm_per_sec(const ExtrusionPath &path, double spee speed = m_config.get_computed_value("bridge_speed"); if(comment) *comment = "bridge_speed"; } else if (path.role() == erInternalBridgeInfill) { - speed = m_config.get_computed_value("bridge_speed_internal"); - if(comment) *comment = "bridge_speed_internal"; + speed = m_config.get_computed_value("internal_bridge_speed"); + if(comment) *comment = "internal_bridge_speed"; } else if (path.role() == erOverhangPerimeter) { speed = m_config.get_computed_value("overhangs_speed"); if(comment) *comment = "overhangs_speed"; @@ -5882,8 +5906,8 @@ double_t GCode::_compute_speed_mm_per_sec(const ExtrusionPath &path, double spee speed = m_config.bridge_speed.get_abs_value(vol_speed); if(comment) *comment = std::string("bridge_speed ") + *comment; } else if (path.role() == erInternalBridgeInfill) { - speed = m_config.bridge_speed_internal.get_abs_value(vol_speed); - if(comment) *comment = std::string("bridge_speed_internal ") + *comment; + speed = m_config.internal_bridge_speed.get_abs_value(vol_speed); + if(comment) *comment = std::string("internal_bridge_speed ") + *comment; } else if (path.role() == erOverhangPerimeter) { speed = m_config.overhangs_speed.get_abs_value(vol_speed); if(comment) *comment = std::string("overhangs_speed ") + *comment; @@ -6126,10 +6150,10 @@ std::string GCode::_before_extrude(const ExtrusionPath &path, const std::string } break; case erInternalBridgeInfill: - if (m_config.bridge_internal_acceleration.value > 0) { - double bridge_internal_acceleration = m_config.get_computed_value("bridge_internal_acceleration"); - if (bridge_internal_acceleration > 0) { - acceleration = bridge_internal_acceleration; + if (m_config.internal_bridge_acceleration.value > 0) { + double internal_bridge_acceleration = m_config.get_computed_value("internal_bridge_acceleration"); + if (internal_bridge_acceleration > 0) { + acceleration = internal_bridge_acceleration; break; } } diff --git a/src/libslic3r/GCode.hpp b/src/libslic3r/GCode.hpp index 2ff9d345c58..2399a0cdd09 100644 --- a/src/libslic3r/GCode.hpp +++ b/src/libslic3r/GCode.hpp @@ -390,6 +390,7 @@ class GCode : ExtrusionVisitorConst { // For sequential print, the instance of the object to be printing has to be defined. const size_t single_object_instance_idx); + void apply_region_config(std::string &gcode); std::string extrude_perimeters(const Print &print, const std::vector &by_region); std::string extrude_infill(const Print& print, const std::vector& by_region, bool is_infill_first); std::string extrude_ironing(const Print& print, const std::vector& by_region); diff --git a/src/libslic3r/GCode/CoolingBuffer.cpp b/src/libslic3r/GCode/CoolingBuffer.cpp index f366d24d2ff..3d9d48e0893 100644 --- a/src/libslic3r/GCode/CoolingBuffer.cpp +++ b/src/libslic3r/GCode/CoolingBuffer.cpp @@ -902,7 +902,7 @@ std::string CoolingBuffer::apply_layer_cooldown( } //set the fan controls default_fan_speed[ExtrusionRole::erBridgeInfill] = EXTRUDER_CONFIG(bridge_fan_speed); - default_fan_speed[ExtrusionRole::erInternalBridgeInfill] = EXTRUDER_CONFIG(bridge_internal_fan_speed); + default_fan_speed[ExtrusionRole::erInternalBridgeInfill] = EXTRUDER_CONFIG(internal_bridge_fan_speed); default_fan_speed[ExtrusionRole::erTopSolidInfill] = EXTRUDER_CONFIG(top_fan_speed); default_fan_speed[ExtrusionRole::erIroning] = default_fan_speed[ExtrusionRole::erTopSolidInfill]; default_fan_speed[ExtrusionRole::erSupportMaterialInterface] = EXTRUDER_CONFIG(support_material_interface_fan_speed); @@ -984,7 +984,7 @@ std::string CoolingBuffer::apply_layer_cooldown( fan_speeds[ExtrusionRole::erBridgeInfill] = fan_speeds[0]; } - // if bridge_internal_fan is disabled, it takes the value of bridge_fan + // if internal_bridge_fan is disabled, it takes the value of bridge_fan if (!fan_control[ExtrusionRole::erInternalBridgeInfill] && fan_control[ExtrusionRole::erBridgeInfill]) { fan_control[ExtrusionRole::erInternalBridgeInfill] = true; fan_speeds[ExtrusionRole::erInternalBridgeInfill] = fan_speeds[ExtrusionRole::erBridgeInfill]; diff --git a/src/libslic3r/Layer.cpp b/src/libslic3r/Layer.cpp index 5e5eaec9b49..c406ed76e7d 100644 --- a/src/libslic3r/Layer.cpp +++ b/src/libslic3r/Layer.cpp @@ -171,6 +171,7 @@ void Layer::make_perimeters() /// if you don't do that, objects will share the same region, and the same settings. if (config.perimeter_extruder == other_config.perimeter_extruder && config.perimeters == other_config.perimeters + && config.external_perimeter_acceleration == other_config.external_perimeter_acceleration && config.external_perimeter_extrusion_width == other_config.external_perimeter_extrusion_width && config.external_perimeter_overlap == other_config.external_perimeter_overlap && config.external_perimeter_speed == other_config.external_perimeter_speed // it os mandatory? can't this be set at gcode.cpp? @@ -182,6 +183,7 @@ void Layer::make_perimeters() && config.extra_perimeters_overhangs == other_config.extra_perimeters_overhangs && config.gap_fill_enabled == other_config.gap_fill_enabled && ((config.gap_fill_speed == other_config.gap_fill_speed) || !config.gap_fill_enabled) + && config.gap_fill_acceleration == other_config.gap_fill_acceleration && config.gap_fill_last == other_config.gap_fill_last && config.gap_fill_flow_match_perimeter == other_config.gap_fill_flow_match_perimeter && config.gap_fill_extension == other_config.gap_fill_extension @@ -196,10 +198,12 @@ void Layer::make_perimeters() && (this->id() == 0 || config.only_one_perimeter_first_layer == other_config.only_one_perimeter_first_layer) && config.only_one_perimeter_top == other_config.only_one_perimeter_top && config.only_one_perimeter_top_other_algo == other_config.only_one_perimeter_top_other_algo + && config.overhangs_acceleration == other_config.overhangs_acceleration && config.overhangs_width_speed == other_config.overhangs_width_speed && config.overhangs_width == other_config.overhangs_width && config.overhangs_reverse == other_config.overhangs_reverse && config.overhangs_reverse_threshold == other_config.overhangs_reverse_threshold + && config.perimeter_acceleration == other_config.perimeter_acceleration && config.perimeter_extrusion_width == other_config.perimeter_extrusion_width && config.perimeter_loop == other_config.perimeter_loop && config.perimeter_loop_seam == other_config.perimeter_loop_seam @@ -211,13 +215,15 @@ void Layer::make_perimeters() && config.small_perimeter_min_length == other_config.small_perimeter_min_length && config.small_perimeter_max_length == other_config.small_perimeter_max_length && config.thin_walls == other_config.thin_walls + && config.thin_walls_acceleration == other_config.thin_walls_acceleration && config.thin_walls_min_width == other_config.thin_walls_min_width && config.thin_walls_overlap == other_config.thin_walls_overlap + && config.thin_walls_speed == other_config.thin_walls_speed && config.thin_perimeters == other_config.thin_perimeters && config.thin_perimeters_all == other_config.thin_perimeters_all - && config.thin_walls_speed == other_config.thin_walls_speed && config.infill_overlap == other_config.infill_overlap && config.perimeter_loop == other_config.perimeter_loop + && config.region_gcode == other_config.region_gcode && config.fuzzy_skin == other_config.fuzzy_skin && config.fuzzy_skin_thickness == other_config.fuzzy_skin_thickness diff --git a/src/libslic3r/Preset.cpp b/src/libslic3r/Preset.cpp index 78750f24bfc..668257eea6f 100644 --- a/src/libslic3r/Preset.cpp +++ b/src/libslic3r/Preset.cpp @@ -517,6 +517,7 @@ static std::vector s_Preset_print_options { "fill_aligned_z", "fill_angle", "fill_angle_cross", + "fill_angle_follow_model", "fill_angle_increment", "fill_angle_template", "bridge_angle", @@ -531,7 +532,7 @@ static std::vector s_Preset_print_options { // speeds "default_speed", "bridge_speed", - "bridge_speed_internal", + "internal_bridge_speed", "brim_speed", "external_perimeter_speed", "first_layer_speed", @@ -567,7 +568,6 @@ static std::vector s_Preset_print_options { "fuzzy_skin_thickness", // acceleration "bridge_acceleration", - "bridge_internal_acceleration", "brim_acceleration", "default_acceleration", "external_perimeter_acceleration", @@ -575,6 +575,7 @@ static std::vector s_Preset_print_options { "first_layer_acceleration_over_raft", "gap_fill_acceleration", "infill_acceleration", + "internal_bridge_acceleration", "ironing_acceleration", "overhangs_acceleration", "perimeter_acceleration", @@ -640,7 +641,9 @@ static std::vector s_Preset_print_options { "extruder_clearance_height", "gcode_comments", "gcode_label_objects", "output_filename_format", "post_process", "perimeter_extruder", "gcode_substitutions", "infill_extruder", "solid_infill_extruder", "support_material_extruder", "support_material_interface_extruder", - "ooze_prevention", "standby_temperature_delta", "interface_shells", + "ooze_prevention", "standby_temperature_delta", "interface_shells", + "object_gcode", + "region_gcode", // width & spacing "extrusion_spacing", "extrusion_width", @@ -767,10 +770,10 @@ static std::vector s_Preset_filament_options { "default_fan_speed", "max_fan_speed", "bridge_fan_speed", - "bridge_internal_fan_speed", "external_perimeter_fan_speed", "gap_fill_fan_speed", "infill_fan_speed", + "internal_bridge_fan_speed", "overhangs_fan_speed", "perimeter_fan_speed", "solid_infill_fan_speed", diff --git a/src/libslic3r/Print.cpp b/src/libslic3r/Print.cpp index 73921321f5d..cbf6f656965 100644 --- a/src/libslic3r/Print.cpp +++ b/src/libslic3r/Print.cpp @@ -61,27 +61,25 @@ bool Print::invalidate_state_by_config_options(const ConfigOptionResolver& /* ne if (opt_keys.empty()) return false; + // Cache the plenty of parameters, which influence the G-code generator only, // or they are only notes not influencing the generated G-code. static std::unordered_set steps_gcode = { + "allow_empty_layers", "avoid_crossing_perimeters", "avoid_crossing_perimeters_max_detour", "avoid_crossing_not_first_layer", - "avoid_crossing_top", "bed_shape", "bed_temperature", "before_layer_gcode", "between_objects_gcode", - "bridge_acceleration", - "bridge_internal_acceleration", "bridge_fan_speed", - "bridge_internal_fan_speed", - "brim_acceleration", "chamber_temperature", + "color_change_gcode", "colorprint_heights", "complete_objects_sort", - "cooling", - "default_acceleration", + "complete_objects_one_brim", + //"cooling", "default_fan_speed", "deretract_speed", "disable_fan_first_layers", @@ -89,8 +87,6 @@ bool Print::invalidate_state_by_config_options(const ConfigOptionResolver& /* ne "enforce_retract_first_layer", "end_gcode", "end_filament_gcode", - "external_perimeter_acceleration", - "external_perimeter_cut_corners", "external_perimeter_fan_speed", "extrusion_axis", "extruder_clearance_height", @@ -105,62 +101,59 @@ bool Print::invalidate_state_by_config_options(const ConfigOptionResolver& /* ne "fan_kickstart", "fan_speedup_overhangs", "fan_speedup_time", + "feature_gcode", "fan_percentage", "fan_printer_min_speed", "filament_colour", "filament_custom_variables", "filament_diameter", "filament_density", + "filament_load_time", "filament_notes", "filament_cost", "filament_spool_weight", - "first_layer_acceleration", - "first_layer_acceleration_over_raft", + "filament_unload_time", + "filament_wipe_advanced_pigment", "first_layer_bed_temperature", - "first_layer_flow_ratio", - "first_layer_speed", // ? delete y prusa here in 2.4 - "first_layer_speed_over_raft", - "first_layer_infill_speed", - "first_layer_min_speed", "full_fan_speed_layer", - "gap_fill_acceleration", "gap_fill_fan_speed", - "gap_fill_flow_match_perimeter", - "gap_fill_speed", "gcode_ascii", "gcode_comments", "gcode_filename_illegal_char", "gcode_label_objects", "gcode_precision_xyz", "gcode_precision_e", - "infill_acceleration", + "gcode_substitutions", "infill_fan_speed", - "ironing_acceleration", + "internal_bridge_fan_speed", "layer_gcode", + "lift_min", "max_fan_speed", "max_gcode_per_second", "max_print_height", "max_print_speed", + "max_speed_reduction", "max_volumetric_speed", "min_length", "min_print_speed", + "milling_diameter", "milling_toolchange_end_gcode", "milling_toolchange_start_gcode", - "milling_offset", - "milling_z_offset", - "milling_z_lift", "max_volumetric_extrusion_rate_slope_positive", "max_volumetric_extrusion_rate_slope_negative", "notes", "only_retract_when_crossing_perimeters", "output_filename_format", - "overhangs_acceleration", "overhangs_fan_speed", - "perimeter_acceleration", + "parallel_objects_step", + "pause_print_gcode", "post_process", - "gcode_substitutions", + "print_custom_variables", + "printer_custom_variables", "perimeter_fan_speed", "printer_notes", + "remaining_times", + "remaining_times_type", "retract_before_travel", "retract_before_wipe", "retract_layer_change", @@ -175,9 +168,9 @@ bool Print::invalidate_state_by_config_options(const ConfigOptionResolver& /* ne "retract_restart_extra", "retract_restart_extra_toolchange", "retract_speed", + "silent_mode", "single_extruder_multi_material_priming", "slowdown_below_layer_time", - "solid_infill_acceleration", "solid_infill_fan_speed", "support_material_acceleration", "support_material_fan_speed", @@ -187,8 +180,7 @@ bool Print::invalidate_state_by_config_options(const ConfigOptionResolver& /* ne "start_gcode", "start_gcode_manual", "start_filament_gcode", - "thin_walls_acceleration", - "thin_walls_speed", + "template_custom_gcode", "thumbnails", "thumbnails_color", "thumbnails_custom_color", @@ -203,17 +195,16 @@ bool Print::invalidate_state_by_config_options(const ConfigOptionResolver& /* ne "tool_name", "toolchange_gcode", "top_fan_speed", - "top_solid_infill_acceleration", "threads", - "travel_acceleration", - "travel_deceleration_use_target", - "travel_speed", - "travel_speed_z", "use_firmware_retraction", "use_relative_e_distances", "use_volumetric_e", "variable_layer_height", "wipe", + "wipe_advanced", + "wipe_advanced_algo", + "wipe_advanced_multiplier", + "wipe_advanced_nozzle_melted_volume", "wipe_extra_perimeter", "wipe_inside_depth", "wipe_inside_end", @@ -229,6 +220,9 @@ bool Print::invalidate_state_by_config_options(const ConfigOptionResolver& /* ne bool invalidated = false; for (const t_config_option_key &opt_key : opt_keys) { + //this one isn't even use in slicing, only for import. + if (opt_key == "init_z_rotate") + continue; if (steps_gcode.find(opt_key) != steps_gcode.end()) { // These options only affect G-code export or they are just notes without influence on the generated G-code, // so there is nothing to invalidate. @@ -241,10 +235,11 @@ bool Print::invalidate_state_by_config_options(const ConfigOptionResolver& /* ne || opt_key == "min_skirt_length" || opt_key == "ooze_prevention" || opt_key == "skirts" - || opt_key == "skirt_height" || opt_key == "skirt_brim" || opt_key == "skirt_distance" || opt_key == "skirt_distance_from_brim" + || opt_key == "skirt_extrusion_width" + || opt_key == "skirt_height" || opt_key == "wipe_tower_x" || opt_key == "wipe_tower_y" || opt_key == "wipe_tower_rotation_angle" @@ -253,12 +248,9 @@ bool Print::invalidate_state_by_config_options(const ConfigOptionResolver& /* ne } else if ( opt_key == "bridge_precision" || opt_key == "filament_shrink" - || opt_key == "first_layer_height" || opt_key == "nozzle_diameter" - || opt_key == "model_precision" || opt_key == "resolution" || opt_key == "resolution_internal" - || opt_key == "slice_closing_radius" // Spiral Vase forces different kind of slicing than the normal model: // In Spiral Vase mode, holes are closed and only the largest area contour is kept at each layer. // Therefore toggling the Spiral Vase on / off requires complete reslicing. @@ -268,14 +260,13 @@ bool Print::invalidate_state_by_config_options(const ConfigOptionResolver& /* ne } else if ( opt_key == "complete_objects" || opt_key == "filament_type" - || opt_key == "filament_soluble" - || opt_key == "first_layer_temperature" || opt_key == "filament_loading_speed" || opt_key == "filament_loading_speed_start" || opt_key == "filament_unloading_speed" || opt_key == "filament_unloading_speed_start" || opt_key == "filament_toolchange_delay" || opt_key == "filament_cooling_moves" + || opt_key == "filament_max_wipe_tower_speed" || opt_key == "filament_minimal_purge_on_wipe_tower" || opt_key == "filament_cooling_initial_speed" || opt_key == "filament_cooling_final_speed" @@ -293,9 +284,9 @@ bool Print::invalidate_state_by_config_options(const ConfigOptionResolver& /* ne || opt_key == "filament_toolchange_part_fan_speed" || opt_key == "filament_dip_insertion_speed" || opt_key == "filament_dip_extraction_speed" //skinnydip params end + || opt_key == "first_layer_temperature" || opt_key == "gcode_flavor" || opt_key == "high_current_on_filament_swap" - || opt_key == "infill_first" || opt_key == "single_extruder_multi_material" || opt_key == "temperature" || opt_key == "wipe_tower" @@ -303,8 +294,10 @@ bool Print::invalidate_state_by_config_options(const ConfigOptionResolver& /* ne || opt_key == "wipe_tower_brim_width" || opt_key == "wipe_tower_bridging" || opt_key == "wipe_tower_no_sparse_layers" + || opt_key == "wipe_tower_per_color_wipe" || opt_key == "wipe_tower_speed" || opt_key == "wipe_tower_wipe_starting_speed" + || opt_key == "wiping_volumes_extruders" || opt_key == "wiping_volumes_matrix" || opt_key == "parking_pos_retraction" || opt_key == "cooling_tube_retraction" @@ -312,7 +305,6 @@ bool Print::invalidate_state_by_config_options(const ConfigOptionResolver& /* ne || opt_key == "extra_loading_move" || opt_key == "travel_speed" || opt_key == "travel_speed_z" - || opt_key == "first_layer_speed" || opt_key == "z_offset") { steps.emplace_back(psWipeTower); steps.emplace_back(psSkirtBrim); @@ -323,8 +315,7 @@ bool Print::invalidate_state_by_config_options(const ConfigOptionResolver& /* ne //FIXME Killing supports on any change of "filament_soluble" is rough. We should check for each object whether that is necessary. osteps.emplace_back(posSupportMaterial); } else if ( - opt_key == "first_layer_extrusion_width" - || opt_key == "arc_fitting" + opt_key == "arc_fitting" || opt_key == "arc_fitting_tolerance" || opt_key == "min_layer_height" || opt_key == "max_layer_height" @@ -335,6 +326,8 @@ bool Print::invalidate_state_by_config_options(const ConfigOptionResolver& /* ne osteps.emplace_back(posSimplifyPath); osteps.emplace_back(posSupportMaterial); steps.emplace_back(psSkirtBrim); + } else if (opt_key == "seam_gap" || opt_key == "seam_gap_external") { + osteps.emplace_back(posInfill); } else if (opt_key == "posSlice") osteps.emplace_back(posSlice); diff --git a/src/libslic3r/Print.hpp b/src/libslic3r/Print.hpp index a353f0b8d0f..ba6e9fe0136 100644 --- a/src/libslic3r/Print.hpp +++ b/src/libslic3r/Print.hpp @@ -46,6 +46,7 @@ namespace FillLightning { using GeneratorPtr = std::unique_ptr; }; // namespace FillLightning + // Print step IDs for keeping track of the print state. // The Print steps are applied in this order. enum PrintStep { @@ -59,6 +60,7 @@ enum PrintStep { // should be refreshed. psSlicingFinished = psSkirtBrim, psGCodeExport, + //TODO: psGCodeLoader (for params that are only used for time display and such) psCount, }; diff --git a/src/libslic3r/PrintConfig.cpp b/src/libslic3r/PrintConfig.cpp index a9444b68fab..e0a16ddcaf6 100644 --- a/src/libslic3r/PrintConfig.cpp +++ b/src/libslic3r/PrintConfig.cpp @@ -712,20 +712,6 @@ void PrintConfigDef::init_fff_params() def->mode = comAdvancedE | comPrusa; def->set_default_value(new ConfigOptionFloatOrPercent(0,false)); - def = this->add("bridge_internal_acceleration", coFloatOrPercent); - def->label = L("Internal bridges "); - def->full_label = L("Internal bridges acceleration"); - def->category = OptionCategory::speed; - def->tooltip = L("This is the acceleration your printer will use for internal bridges. " - "\nCan be a % of the default acceleration" - "\nSet zero to use bridge acceleration for internal bridges."); - def->sidetext = L("mm/s² or %"); - def->ratio_over = "bridge_acceleration"; - def->min = 0; - def->max_literal = { -200, false }; - def->mode = comExpert | comSuSi; - def->set_default_value(new ConfigOptionFloatOrPercent(0,false)); - def = this->add("bridge_angle", coFloat); def->label = L("Bridging"); def->full_label = L("Bridging angle"); @@ -751,19 +737,6 @@ void PrintConfigDef::init_fff_params() def->is_vector_extruder = true; def->set_default_value(new ConfigOptionInts{ 100 }); - def = this->add("bridge_internal_fan_speed", coInts); - def->label = L("Infill bridges fan speed"); - def->category = OptionCategory::cooling; - def->tooltip = L("This fan speed is enforced during all infill bridges. It won't slow down the fan if it's currently running at a higher speed." - "\nSet to -1 to disable this override (Internal bridges will use Bridges fan speed)." - "\nCan be disabled by disable_fan_first_layers and increased by low layer time."); - def->sidetext = L("%"); - def->min = -1; - def->max = 100; - def->mode = comAdvancedE | comSuSi; - def->is_vector_extruder = true; - def->set_default_value(new ConfigOptionInts{ -1 }); - def = this->add("bridge_type", coEnum); def->label = L("Bridge flow baseline"); def->category = OptionCategory::width; @@ -865,17 +838,6 @@ void PrintConfigDef::init_fff_params() def->mode = comAdvancedE | comPrusa; def->set_default_value(new ConfigOptionFloatOrPercent(60, true)); - def = this->add("bridge_speed_internal", coFloatOrPercent); - def->label = L("Internal bridges"); - def->full_label = L("Internal bridge speed"); - def->category = OptionCategory::speed; - def->tooltip = L("Speed for printing the bridges that support the top layer.\nCan be a % of the bridge speed."); - def->sidetext = L("mm/s or %"); - def->ratio_over = "bridge_speed"; - def->min = 0; - def->mode = comExpert | comSuSi; - def->set_default_value(new ConfigOptionFloatOrPercent(150,true)); - def = this->add("brim_inside_holes", coBool); def->label = L("Brim inside holes"); def->category = OptionCategory::skirtBrim; @@ -2336,6 +2298,13 @@ void PrintConfigDef::init_fff_params() def->mode = comAdvancedE | comSuSi; def->set_default_value(new ConfigOptionBool(true)); + def = this->add("fill_angle_follow_model", coBool); + def->label = L("Rotate with object"); + def->category = OptionCategory::infill; + def->tooltip = L("If your object has a z-rotation, then the infill will also be rotated by this value."); + def->mode = comAdvancedE | comSuSi; + def->set_default_value(new ConfigOptionBool(false)); + def = this->add("fill_angle_increment", coFloat); def->label = L("Fill"); def->full_label = L("Fill angle increment"); @@ -2784,7 +2753,7 @@ void PrintConfigDef::init_fff_params() def = this->add("gap_fill_flow_match_perimeter", coPercent); def->label = L("Cap with perimeter flow"); def->full_label = L("Gapfill: cap speed with perimeter flow"); - def->category = OptionCategory::output; + def->category = OptionCategory::speed; def->tooltip = L("A percentage of the perimeter flow (mm3/s) is used as a limit for the gap fill flow, and so the gapfill may reduce its speed when the gap fill extrusions became too thick." " This allow you to use a high gapfill speed, to print the thin gapfill quickly and reduce the difference in flow rate for the gapfill." "\nSet zero to deactivate."); @@ -3306,6 +3275,47 @@ void PrintConfigDef::init_fff_params() def->mode = comExpert | comPrusa; def->set_default_value(new ConfigOptionBool(false)); + def = this->add("internal_bridge_acceleration", coFloatOrPercent); + def->label = L("Internal bridges "); + def->full_label = L("Internal bridges acceleration"); + def->category = OptionCategory::speed; + def->tooltip = L("This is the acceleration your printer will use for internal bridges. " + "\nCan be a % of the default acceleration" + "\nSet zero to use bridge acceleration for internal bridges."); + def->sidetext = L("mm/s² or %"); + def->ratio_over = "bridge_acceleration"; + def->min = 0; + def->max_literal = { -200, false }; + def->mode = comExpert | comSuSi; + def->set_default_value(new ConfigOptionFloatOrPercent(0,false)); + def->aliases = { "bridge_internal_acceleration" }; + + def = this->add("internal_bridge_fan_speed", coInts); + def->label = L("Infill bridges fan speed"); + def->category = OptionCategory::cooling; + def->tooltip = L("This fan speed is enforced during all infill bridges. It won't slow down the fan if it's currently running at a higher speed." + "\nSet to -1 to disable this override (Internal bridges will use Bridges fan speed)." + "\nCan be disabled by disable_fan_first_layers and increased by low layer time."); + def->sidetext = L("%"); + def->min = -1; + def->max = 100; + def->mode = comAdvancedE | comSuSi; + def->is_vector_extruder = true; + def->set_default_value(new ConfigOptionInts{ -1 }); + def->aliases = { "bridge_internal_fan_speed" }; + + def = this->add("internal_bridge_speed", coFloatOrPercent); + def->label = L("Internal bridges"); + def->full_label = L("Internal bridge speed"); + def->category = OptionCategory::speed; + def->tooltip = L("Speed for printing the bridges that support the top layer.\nCan be a % of the bridge speed."); + def->sidetext = L("mm/s or %"); + def->ratio_over = "bridge_speed"; + def->min = 0; + def->mode = comExpert | comSuSi; + def->set_default_value(new ConfigOptionFloatOrPercent(150,true)); + def->aliases = { "bridge_speed_internal" }; + def = this->add("mmu_segmented_region_max_width", coFloat); def->label = L("Maximum width of a segmented region"); def->tooltip = L("Maximum width of a segmented region. Zero disables this feature."); @@ -3325,7 +3335,7 @@ void PrintConfigDef::init_fff_params() def = this->add("ironing_acceleration", coFloatOrPercent); def->label = L("Ironing"); def->full_label = L("Ironing acceleration"); - def->category = OptionCategory::speed; + def->category = OptionCategory::ironing; def->tooltip = L("This is the acceleration your printer will use for ironing. " "\nCan be a % of the top solid infill acceleration" "\nSet zero to use top solid infill acceleration for ironing."); @@ -3923,6 +3933,18 @@ void PrintConfigDef::init_fff_params() def->mode = comAdvancedE | comSuSi; def->set_default_value(new ConfigOptionString{ "" }); + def = this->add("object_gcode", coString); + def->label = L("Per object G-code"); + def->category = OptionCategory::advanced; + def->tooltip = L("This code is inserted each layer, when the object began to print (just after the label if any)." + " It's main advantage is when you use it as a object modifer (right click on a model)." + "\nSpecial variables: 'layer_num','layer_z'"); + def->multiline = true; + def->full_width = true; + def->height = 10; + def->mode = comExpert | comSuSi; + def->set_default_value(new ConfigOptionString("")); + def = this->add("only_one_perimeter_first_layer", coBool); def->label = L("Only one perimeter on First layer"); def->category = OptionCategory::perimeter; @@ -4520,6 +4542,18 @@ void PrintConfigDef::init_fff_params() def->mode = comAdvancedE | comSuSi; def->set_default_value(new ConfigOptionFloatOrPercent(0, false)); + def = this->add("region_gcode", coString); + def->label = L("Per region G-code"); + def->category = OptionCategory::output; + def->tooltip = L("This code is inserted when a region is starting to print something (infill, perimeter, ironing)." + " It's main advantage is when you use it as a object modifer(right click on a model to add it there)" + "\nSpecial variables: 'layer_num','layer_z'"); + def->multiline = true; + def->full_width = true; + def->height = 10; + def->mode = comExpert | comSuSi; + def->set_default_value(new ConfigOptionString("")); + def = this->add("resolution", coFloat); def->label = L("Slice resolution"); def->category = OptionCategory::slicing; @@ -8226,12 +8260,9 @@ std::unordered_set prusa_export_to_remove_keys = { "avoid_crossing_not_first_layer", "avoid_crossing_top", "bridge_fill_pattern", -"bridge_internal_acceleration", -"bridge_internal_fan_speed", "bridge_precision", "bridge_overlap", "bridge_overlap_min", -"bridge_speed_internal", "bridge_type", "bridged_infill_margin", "brim_acceleration", @@ -8295,6 +8326,7 @@ std::unordered_set prusa_export_to_remove_keys = { "fill_aligned_z", "fill_angle_increment", "fill_angle_cross", +"fill_angle_follow_model", "fill_angle_template", "fill_smooth_distribution", "fill_smooth_width", @@ -8337,6 +8369,9 @@ std::unordered_set prusa_export_to_remove_keys = { "infill_extrusion_spacing", "infill_fan_speed", "init_z_rotate", +"internal_bridge_acceleration", +"internal_bridge_fan_speed", +"internal_bridge_speed", "ironing_acceleration", "ironing_angle", "lift_min", @@ -8358,6 +8393,7 @@ std::unordered_set prusa_export_to_remove_keys = { "min_width_top_surface", "model_precision", "no_perimeter_unsupported_algo", +"object_gcode", "only_one_perimeter_top_other_algo", "only_one_perimeter_top", "only_one_perimeter_first_layer", @@ -8393,6 +8429,7 @@ std::unordered_set prusa_export_to_remove_keys = { "printhost_client_cert_password", "raft_layer_height", "raft_interface_layer_height", +"region_gcode", "remaining_times_type", "resolution_internal", "retract_lift_first_layer", @@ -8423,7 +8460,6 @@ std::unordered_set prusa_export_to_remove_keys = { "solid_infill_overlap", "start_gcode_manual", "solid_infill_below_layer_area", -"solid_infill_below_thickness", "solid_infill_below_width", "support_material_angle_height", "support_material_acceleration", diff --git a/src/libslic3r/PrintConfig.hpp b/src/libslic3r/PrintConfig.hpp index f2eba2b63db..5cca571ff41 100644 --- a/src/libslic3r/PrintConfig.hpp +++ b/src/libslic3r/PrintConfig.hpp @@ -706,6 +706,7 @@ protected: \ PRINT_CONFIG_CLASS_DEFINE( PrintObjectConfig, + ((ConfigOptionFloatOrPercent, brim_acceleration)) ((ConfigOptionBool, brim_inside_holes)) ((ConfigOptionFloat, brim_width)) ((ConfigOptionFloat, brim_width_interior)) @@ -718,17 +719,23 @@ PRINT_CONFIG_CLASS_DEFINE( ((ConfigOptionFloatOrPercent, brim_speed)) //((ConfigOptionEnum, brim_type)) ((ConfigOptionBool, clip_multipart_objects)) + ((ConfigOptionString, object_gcode)) ((ConfigOptionBool, dont_support_bridges)) ((ConfigOptionPercent, external_perimeter_cut_corners)) //((ConfigOptionBool, exact_last_layer_height)) ((ConfigOptionFloatOrPercent, extrusion_width)) ((ConfigOptionFloatOrPercent, extrusion_spacing)) + ((ConfigOptionBool, fill_angle_follow_model)) + ((ConfigOptionFloatOrPercent, first_layer_acceleration)) ((ConfigOptionFloatOrPercent, first_layer_acceleration_over_raft)) ((ConfigOptionFloatOrPercent, first_layer_height)) ((ConfigOptionFloatOrPercent, first_layer_extrusion_width)) ((ConfigOptionFloatOrPercent, first_layer_extrusion_spacing)) + ((ConfigOptionFloatOrPercent, first_layer_infill_speed)) + ((ConfigOptionFloat, first_layer_min_speed)) ((ConfigOptionFloat, first_layer_size_compensation)) /* elefant_foot_compensation */ ((ConfigOptionInt, first_layer_size_compensation_layers)) + ((ConfigOptionFloatOrPercent, first_layer_speed)) ((ConfigOptionFloatOrPercent, first_layer_speed_over_raft)) ((ConfigOptionFloat, hole_size_compensation)) ((ConfigOptionFloat, hole_size_threshold)) @@ -815,6 +822,7 @@ PRINT_CONFIG_CLASS_DEFINE( PrintRegionConfig, ((ConfigOptionBool, avoid_crossing_top)) + ((ConfigOptionFloatOrPercent, bridge_acceleration)) ((ConfigOptionFloat, bridge_angle)) ((ConfigOptionEnum, bridge_fill_pattern)) ((ConfigOptionEnum, bridge_type)) @@ -827,15 +835,16 @@ PRINT_CONFIG_CLASS_DEFINE( ((ConfigOptionEnum, bottom_fill_pattern)) ((ConfigOptionFloatOrPercent, bridged_infill_margin)) ((ConfigOptionFloatOrPercent, bridge_speed)) - ((ConfigOptionFloatOrPercent, bridge_speed_internal)) ((ConfigOptionFloat, curve_smoothing_precision)) ((ConfigOptionFloat, curve_smoothing_cutoff_dist)) ((ConfigOptionFloat, curve_smoothing_angle_convex)) ((ConfigOptionFloat, curve_smoothing_angle_concave)) + ((ConfigOptionFloatOrPercent, default_acceleration)) ((ConfigOptionFloatOrPercent, default_speed)) ((ConfigOptionBool, ensure_vertical_shell_thickness)) ((ConfigOptionBool, enforce_full_fill_volume)) ((ConfigOptionFloatOrPercent, external_infill_margin)) + ((ConfigOptionFloatOrPercent, external_perimeter_acceleration)) ((ConfigOptionFloatOrPercent, external_perimeter_extrusion_width)) ((ConfigOptionFloatOrPercent, external_perimeter_extrusion_spacing)) ((ConfigOptionFloatOrPercent, external_perimeter_extrusion_change_odd_layers)) @@ -865,6 +874,7 @@ PRINT_CONFIG_CLASS_DEFINE( ((ConfigOptionPercent, fill_top_flow_ratio)) ((ConfigOptionPercent, fill_smooth_distribution)) ((ConfigOptionFloatOrPercent, fill_smooth_width)) + ((ConfigOptionFloatOrPercent, gap_fill_acceleration)) ((ConfigOptionBool, gap_fill_enabled)) ((ConfigOptionFloatOrPercent, gap_fill_extension)) ((ConfigOptionPercent, gap_fill_flow_match_perimeter)) @@ -880,6 +890,7 @@ PRINT_CONFIG_CLASS_DEFINE( ((ConfigOptionBool, hole_to_polyhole)) ((ConfigOptionFloatOrPercent, hole_to_polyhole_threshold)) ((ConfigOptionBool, hole_to_polyhole_twisted)) + ((ConfigOptionFloatOrPercent, infill_acceleration)) ((ConfigOptionInt, infill_extruder)) ((ConfigOptionFloatOrPercent, infill_extrusion_width)) ((ConfigOptionFloatOrPercent, infill_extrusion_spacing)) @@ -895,8 +906,11 @@ PRINT_CONFIG_CLASS_DEFINE( ((ConfigOptionBool, infill_dense)) ((ConfigOptionEnum, infill_dense_algo)) ((ConfigOptionBool, infill_first)) + ((ConfigOptionFloatOrPercent, internal_bridge_acceleration)) + ((ConfigOptionFloatOrPercent, internal_bridge_speed)) // Ironing options ((ConfigOptionBool, ironing)) + ((ConfigOptionFloatOrPercent, ironing_acceleration)) ((ConfigOptionFloat, ironing_angle)) ((ConfigOptionEnum, ironing_type)) ((ConfigOptionPercent, ironing_flowrate)) @@ -909,6 +923,7 @@ PRINT_CONFIG_CLASS_DEFINE( ((ConfigOptionFloat, milling_speed)) ((ConfigOptionFloatOrPercent, min_width_top_surface)) // Detect bridging perimeters + ((ConfigOptionFloatOrPercent, overhangs_acceleration)) ((ConfigOptionFloatOrPercent, overhangs_max_slope)) ((ConfigOptionFloat, overhangs_bridge_threshold)) ((ConfigOptionInt, overhangs_bridge_upper_layers)) @@ -919,6 +934,7 @@ PRINT_CONFIG_CLASS_DEFINE( ((ConfigOptionBool, overhangs_reverse)) ((ConfigOptionFloatOrPercent, overhangs_reverse_threshold)) ((ConfigOptionEnum, no_perimeter_unsupported_algo)) + ((ConfigOptionFloatOrPercent, perimeter_acceleration)) ((ConfigOptionBool, perimeter_round_corners)) ((ConfigOptionInt, perimeter_extruder)) ((ConfigOptionFloatOrPercent, perimeter_extrusion_width)) @@ -935,10 +951,12 @@ PRINT_CONFIG_CLASS_DEFINE( ((ConfigOptionPercent, print_extrusion_multiplier)) ((ConfigOptionFloat, print_retract_length)) ((ConfigOptionFloat, print_retract_lift)) + ((ConfigOptionString, region_gcode)) ((ConfigOptionFloatOrPercent, small_perimeter_speed)) ((ConfigOptionFloatOrPercent, small_perimeter_min_length)) ((ConfigOptionFloatOrPercent, small_perimeter_max_length)) ((ConfigOptionEnum, solid_fill_pattern)) + ((ConfigOptionFloatOrPercent, solid_infill_acceleration)) ((ConfigOptionFloat, solid_infill_below_area)) ((ConfigOptionFloat, solid_infill_below_layer_area)) ((ConfigOptionFloatOrPercent, solid_infill_below_width)) @@ -955,6 +973,7 @@ PRINT_CONFIG_CLASS_DEFINE( ((ConfigOptionPercent, thin_perimeters)) ((ConfigOptionPercent, thin_perimeters_all)) ((ConfigOptionBool, thin_walls)) + ((ConfigOptionFloatOrPercent, thin_walls_acceleration)) ((ConfigOptionFloatOrPercent, thin_walls_min_width)) ((ConfigOptionFloatOrPercent, thin_walls_overlap)) ((ConfigOptionFloatOrPercent, thin_walls_speed)) @@ -963,10 +982,12 @@ PRINT_CONFIG_CLASS_DEFINE( ((ConfigOptionFloatOrPercent, top_infill_extrusion_spacing)) ((ConfigOptionInt, top_solid_layers)) ((ConfigOptionFloat, top_solid_min_thickness)) + ((ConfigOptionFloatOrPercent, top_solid_infill_acceleration)) ((ConfigOptionPercent, top_solid_infill_overlap)) ((ConfigOptionFloatOrPercent, top_solid_infill_speed)) + ((ConfigOptionFloatOrPercent, travel_acceleration)) + ((ConfigOptionBool, travel_deceleration_use_target)) ((ConfigOptionBool, wipe_into_infill)) - ) PRINT_CONFIG_CLASS_DEFINE( @@ -1171,12 +1192,8 @@ PRINT_CONFIG_CLASS_DERIVED_DEFINE( ((ConfigOptionFloatOrPercent, avoid_crossing_perimeters_max_detour)) ((ConfigOptionPoints, bed_shape)) ((ConfigOptionInts, bed_temperature)) - ((ConfigOptionFloatOrPercent, bridge_acceleration)) - ((ConfigOptionFloatOrPercent, bridge_internal_acceleration)) ((ConfigOptionInts, bridge_fan_speed)) - ((ConfigOptionInts, bridge_internal_fan_speed)) ((ConfigOptionFloatOrPercent, bridge_precision)) - ((ConfigOptionFloatOrPercent, brim_acceleration)) ((ConfigOptionInts, chamber_temperature)) ((ConfigOptionBool, complete_objects)) ((ConfigOptionFloat, parallel_objects_step)) @@ -1185,13 +1202,11 @@ PRINT_CONFIG_CLASS_DERIVED_DEFINE( ((ConfigOptionEnum, complete_objects_sort)) ((ConfigOptionFloats, colorprint_heights)) //((ConfigOptionBools, cooling)) - ((ConfigOptionFloatOrPercent, default_acceleration)) ((ConfigOptionInts, disable_fan_first_layers)) ((ConfigOptionInts, default_fan_speed)) ((ConfigOptionEnum, draft_shield)) ((ConfigOptionFloat, duplicate_distance)) ((ConfigOptionBool, enforce_retract_first_layer)) - ((ConfigOptionFloatOrPercent, external_perimeter_acceleration)) ((ConfigOptionInts, external_perimeter_fan_speed)) ((ConfigOptionFloat, extruder_clearance_height)) ((ConfigOptionFloat, extruder_clearance_radius)) @@ -1204,18 +1219,12 @@ PRINT_CONFIG_CLASS_DERIVED_DEFINE( ((ConfigOptionStrings, filament_notes)) ((ConfigOptionPercents, filament_max_overlap)) ((ConfigOptionPercents, filament_shrink)) - ((ConfigOptionFloatOrPercent, first_layer_acceleration)) ((ConfigOptionInts, first_layer_bed_temperature)) - ((ConfigOptionFloatOrPercent, first_layer_speed)) - ((ConfigOptionFloatOrPercent, first_layer_infill_speed)) - ((ConfigOptionFloat, first_layer_min_speed)) ((ConfigOptionInts, first_layer_temperature)) ((ConfigOptionInts, full_fan_speed_layer)) - ((ConfigOptionFloatOrPercent, gap_fill_acceleration)) ((ConfigOptionInts, gap_fill_fan_speed)) - ((ConfigOptionFloatOrPercent, infill_acceleration)) ((ConfigOptionInts, infill_fan_speed)) - ((ConfigOptionFloatOrPercent, ironing_acceleration)) + ((ConfigOptionInts, internal_bridge_fan_speed)) ((ConfigOptionFloat, lift_min)) ((ConfigOptionInts, max_fan_speed)) ((ConfigOptionFloatsOrPercents, max_layer_height)) @@ -1224,8 +1233,6 @@ PRINT_CONFIG_CLASS_DERIVED_DEFINE( ((ConfigOptionFloats, milling_diameter)) ((ConfigOptionStrings, milling_toolchange_end_gcode)) ((ConfigOptionStrings, milling_toolchange_start_gcode)) - //((ConfigOptionPoints, milling_offset)) - //((ConfigOptionFloats, milling_z_offset)) //((ConfigOptionInts, min_fan_speed)) // now fan_printer_min_speed ((ConfigOptionFloatsOrPercents, min_layer_height)) ((ConfigOptionFloats, min_print_speed)) @@ -1235,9 +1242,7 @@ PRINT_CONFIG_CLASS_DERIVED_DEFINE( ((ConfigOptionBool, only_retract_when_crossing_perimeters)) ((ConfigOptionBool, ooze_prevention)) ((ConfigOptionString, output_filename_format)) - ((ConfigOptionFloatOrPercent, overhangs_acceleration)) ((ConfigOptionInts, overhangs_fan_speed)) - ((ConfigOptionFloatOrPercent, perimeter_acceleration)) ((ConfigOptionInts, perimeter_fan_speed)) ((ConfigOptionStrings, post_process)) ((ConfigOptionString, print_custom_variables)) @@ -1259,7 +1264,6 @@ PRINT_CONFIG_CLASS_DERIVED_DEFINE( ((ConfigOptionInt, skirts)) ((ConfigOptionFloats, slowdown_below_layer_time)) ((ConfigOptionBool, spiral_vase)) - ((ConfigOptionFloatOrPercent, solid_infill_acceleration)) ((ConfigOptionInts, solid_infill_fan_speed)) ((ConfigOptionInt, standby_temperature_delta)) ((ConfigOptionFloatOrPercent, support_material_acceleration)) @@ -1267,7 +1271,6 @@ PRINT_CONFIG_CLASS_DERIVED_DEFINE( ((ConfigOptionFloatOrPercent, support_material_interface_acceleration)) ((ConfigOptionInts, support_material_interface_fan_speed)) ((ConfigOptionInts, temperature)) - ((ConfigOptionFloatOrPercent, thin_walls_acceleration)) ((ConfigOptionInt, threads)) ((ConfigOptionPoints, thumbnails)) ((ConfigOptionString, thumbnails_color)) @@ -1281,9 +1284,6 @@ PRINT_CONFIG_CLASS_DERIVED_DEFINE( ((ConfigOptionFloat, time_start_gcode)) ((ConfigOptionFloat, time_toolchange)) ((ConfigOptionInts, top_fan_speed)) - ((ConfigOptionFloatOrPercent, top_solid_infill_acceleration)) - ((ConfigOptionFloatOrPercent, travel_acceleration)) - ((ConfigOptionBool, travel_deceleration_use_target)) ((ConfigOptionBools, wipe)) ((ConfigOptionBool, wipe_tower)) ((ConfigOptionFloatOrPercent, wipe_tower_brim_width)) diff --git a/src/libslic3r/PrintObject.cpp b/src/libslic3r/PrintObject.cpp index aa2a7be1fdb..c029b894982 100644 --- a/src/libslic3r/PrintObject.cpp +++ b/src/libslic3r/PrintObject.cpp @@ -463,7 +463,6 @@ namespace Slic3r { { // prerequisites this->prepare_infill(); - m_print->set_status(35, L("Infilling layers")); m_print->set_status(0, L("Infilling layer %s / %s"), { std::to_string(0), std::to_string(m_layers.size()) }, PrintBase::SlicingStatus::SECONDARY_STATE); if (this->set_started(posInfill)) { @@ -707,7 +706,7 @@ FillLightning::GeneratorPtr PrintObject::prepare_lightning_infill_data() // Called by Print::apply(). // This method only accepts PrintObjectConfig and PrintRegionConfig option keys. -bool PrintObject::invalidate_state_by_config_options( + bool PrintObject::invalidate_state_by_config_options( const ConfigOptionResolver &old_config, const ConfigOptionResolver &new_config, const std::vector &opt_keys) { if (opt_keys.empty()) @@ -717,13 +716,13 @@ bool PrintObject::invalidate_state_by_config_options( bool invalidated = false; for (const t_config_option_key& opt_key : opt_keys) { if ( - opt_key == "gap_fill_enabled" - || opt_key == "gap_fill_extension" + opt_key == "gap_fill_extension" || opt_key == "gap_fill_last" || opt_key == "gap_fill_max_width" || opt_key == "gap_fill_min_area" || opt_key == "gap_fill_min_length" || opt_key == "gap_fill_min_width" + || opt_key == "min_width_top_surface" || opt_key == "only_one_perimeter_first_layer" || opt_key == "only_one_perimeter_top" || opt_key == "only_one_perimeter_top_other_algo" @@ -732,22 +731,21 @@ bool PrintObject::invalidate_state_by_config_options( || opt_key == "overhangs_reverse" || opt_key == "overhangs_reverse_threshold" || opt_key == "overhangs_speed_enforce" + || opt_key == "perimeter_bonding" || opt_key == "perimeter_extrusion_change_odd_layers" || opt_key == "perimeter_extrusion_spacing" || opt_key == "perimeter_extrusion_width" || opt_key == "perimeter_reverse" - || opt_key == "infill_overlap" + || opt_key == "perimeter_round_corners" || opt_key == "thin_perimeters" || opt_key == "thin_perimeters_all" - || opt_key == "thin_walls" + || opt_key == "thin_walls_merge" || opt_key == "thin_walls_min_width" || opt_key == "thin_walls_overlap" || opt_key == "external_perimeters_first" || opt_key == "external_perimeters_hole" || opt_key == "external_perimeters_nothole" || opt_key == "external_perimeter_extrusion_change_odd_layers" - || opt_key == "external_perimeter_extrusion_spacing" - || opt_key == "external_perimeter_extrusion_width" || opt_key == "external_perimeters_vase" || opt_key == "perimeter_loop" || opt_key == "perimeter_loop_seam") { @@ -774,34 +772,49 @@ bool PrintObject::invalidate_state_by_config_options( steps.emplace_back(posSlice); steps.emplace_back(posPerimeters); } else if ( - opt_key == "layer_height" - || opt_key == "first_layer_height" - || opt_key == "mmu_segmented_region_max_width" // || opt_key == "exact_last_layer_height" - || opt_key == "raft_contact_distance" - || opt_key == "raft_interface_layer_height" - || opt_key == "raft_layers" - || opt_key == "raft_layer_height" + opt_key == "bridge_type" || opt_key == "clip_multipart_objects" + || opt_key == "curve_smoothing_angle_concave" + || opt_key == "curve_smoothing_angle_convex" + || opt_key == "curve_smoothing_cutoff_dist" + || opt_key == "curve_smoothing_precision" + || opt_key == "dont_support_bridges" + || opt_key == "elephant_foot_min_width" //sla ? || opt_key == "first_layer_size_compensation" || opt_key == "first_layer_size_compensation_layers" - || opt_key == "elephant_foot_min_width" - || opt_key == "dont_support_bridges" + || opt_key == "first_layer_height" + || opt_key == "hole_size_compensation" + || opt_key == "hole_size_threshold" + || opt_key == "hole_to_polyhole" + || opt_key == "hole_to_polyhole_threshold" + || opt_key == "hole_to_polyhole_twisted" + || opt_key == "layer_height" + || opt_key == "min_bead_width" + || opt_key == "min_feature_size" + || opt_key == "mmu_segmented_region_max_width" + || opt_key == "model_precision" || opt_key == "overhangs_max_slope" || opt_key == "overhangs_bridge_threshold" || opt_key == "overhangs_bridge_upper_layers" + || opt_key == "raft_contact_distance" + || opt_key == "raft_interface_layer_height" + || opt_key == "raft_layers" + || opt_key == "raft_layer_height" + || opt_key == "perimeter_generator" || opt_key == "slice_closing_radius" || opt_key == "slicing_mode" || opt_key == "support_material_contact_distance_type" - || opt_key == "support_material_contact_distance_top" - || opt_key == "support_material_contact_distance_bottom" + || opt_key == "support_material_contact_distance" + || opt_key == "support_material_bottom_contact_distance" || opt_key == "support_material_interface_layer_height" || opt_key == "support_material_layer_height" - || opt_key == "xy_size_compensation" - || opt_key == "hole_size_compensation" - || opt_key == "hole_size_threshold" - || opt_key == "hole_to_polyhole" - || opt_key == "hole_to_polyhole_threshold") { + || opt_key == "wall_transition_length" + || opt_key == "wall_transition_filter_deviation" + || opt_key == "wall_transition_angle" + || opt_key == "wall_distribution_count" + || opt_key == "xy_inner_size_compensation" + || opt_key == "xy_size_compensation") { steps.emplace_back(posSlice); } else if (opt_key == "support_material") { steps.emplace_back(posSupportMaterial); @@ -823,17 +836,15 @@ bool PrintObject::invalidate_state_by_config_options( || opt_key == "support_material_enforce_layers" || opt_key == "support_material_extruder" || opt_key == "support_material_extrusion_width" - || opt_key == "support_material_bottom_contact_distance" || opt_key == "support_material_interface_layers" || opt_key == "support_material_bottom_interface_layers" || opt_key == "support_material_interface_angle" || opt_key == "support_material_interface_angle_increment" - || opt_key == "support_material_interface_pattern" || opt_key == "support_material_interface_contact_loops" || opt_key == "support_material_interface_extruder" + || opt_key == "support_material_interface_pattern" || opt_key == "support_material_interface_spacing" || opt_key == "support_material_pattern" - || opt_key == "support_material_interface_pattern" || opt_key == "support_material_style" || opt_key == "support_material_xy_spacing" || opt_key == "support_material_spacing" @@ -844,8 +855,7 @@ bool PrintObject::invalidate_state_by_config_options( steps.emplace_back(posSupportMaterial); } else if (opt_key == "bottom_solid_layers") { steps.emplace_back(posPrepareInfill); - if (m_print->config().spiral_vase - || opt_key == "z_step") { + if (m_print->config().spiral_vase) { // Changing the number of bottom layers when a spiral vase is enabled requires re-slicing the object again. // Otherwise, holes in the bottom layers could be filled, as is reported in GH #5528. steps.emplace_back(posSlice); @@ -861,9 +871,10 @@ bool PrintObject::invalidate_state_by_config_options( || opt_key == "infill_every_layers" || opt_key == "infill_dense" || opt_key == "infill_dense_algo" - || opt_key == "infill_not_connected" || opt_key == "infill_only_where_needed" + || opt_key == "ironing" || opt_key == "ironing_type" + || opt_key == "over_bridge_flow_ratio" || opt_key == "solid_infill_below_area" || opt_key == "solid_infill_below_layer_area" || opt_key == "solid_infill_below_width" @@ -874,14 +885,15 @@ bool PrintObject::invalidate_state_by_config_options( || opt_key == "top_solid_min_thickness") { steps.emplace_back(posPrepareInfill); } else if ( - opt_key == "top_fill_pattern" - || opt_key == "bottom_fill_pattern" + opt_key == "bottom_fill_pattern" || opt_key == "bridge_fill_pattern" - || opt_key == "solid_fill_pattern" + || opt_key == "bridge_overlap" + || opt_key == "bridge_overlap_min" || opt_key == "enforce_full_fill_volume" || opt_key == "fill_aligned_z" || opt_key == "fill_angle" || opt_key == "fill_angle_cross" + || opt_key == "fill_angle_follow_model" || opt_key == "fill_angle_increment" || opt_key == "fill_angle_template" || opt_key == "fill_top_flow_ratio" @@ -894,17 +906,20 @@ bool PrintObject::invalidate_state_by_config_options( || opt_key == "infill_connection_bridge" || opt_key == "infill_connection_solid" || opt_key == "infill_connection_top" - || opt_key == "seam_gap" - || opt_key == "seam_gap_external" + || opt_key == "ironing_angle" + || opt_key == "ironing_flowrate" + || opt_key == "ironing_spacing" + || opt_key == "solid_fill_pattern" + || opt_key == "top_fill_pattern" || opt_key == "top_infill_extrusion_spacing" || opt_key == "top_infill_extrusion_width" ) { steps.emplace_back(posInfill); - } else if (opt_key == "fill_pattern") { - steps.emplace_back(posInfill); + } else if (opt_key == "fill_pattern") { + steps.emplace_back(posInfill); - const auto *old_fill_pattern = old_config.option>(opt_key); - const auto *new_fill_pattern = new_config.option>(opt_key); - assert(old_fill_pattern && new_fill_pattern); + const auto *old_fill_pattern = old_config.option>(opt_key); + const auto *new_fill_pattern = new_config.option>(opt_key); + assert(old_fill_pattern && new_fill_pattern); // We need to recalculate infill surfaces when infill_only_where_needed is enabled, and we are switching from // the Lightning infill to another infill or vice versa. if (m_config.infill_only_where_needed && (new_fill_pattern->value == ipLightning || old_fill_pattern->value == ipLightning)) @@ -926,37 +941,35 @@ bool PrintObject::invalidate_state_by_config_options( || opt_key == "bridged_infill_margin" || opt_key == "extra_perimeters" || opt_key == "extra_perimeters_odd_layers" + || opt_key == "extra_perimeters_overhangs" || opt_key == "external_infill_margin" || opt_key == "external_perimeter_overlap" || opt_key == "gap_fill_overlap" + || opt_key == "infill_overlap" || opt_key == "no_perimeter_unsupported_algo" - || opt_key == "filament_max_overlap" || opt_key == "perimeters" || opt_key == "perimeters_hole" || opt_key == "perimeter_overlap" || opt_key == "solid_infill_extrusion_change_odd_layers" || opt_key == "solid_infill_extrusion_spacing" - || opt_key == "solid_infill_extrusion_width") { + || opt_key == "solid_infill_extrusion_width" + || opt_key == "solid_infill_overlap" + || opt_key == "top_solid_infill_overlap") { steps.emplace_back(posPerimeters); steps.emplace_back(posPrepareInfill); - } else if (opt_key == "solid_infill_extrusion_change_odd_layers" - || opt_key == "solid_infill_extrusion_spacing" - || opt_key == "solid_infill_extrusion_width") { - // This value is used for calculating perimeter - infill overlap, thus perimeters need to be recalculated. - steps.emplace_back(posPerimeters); - steps.emplace_back(posPrepareInfill); } else if ( - opt_key == "external_perimeter_extrusion_width" - || opt_key == "perimeter_extruder" - || opt_key == "fuzzy_skin" - || opt_key == "fuzzy_skin_thickness" - || opt_key == "fuzzy_skin_point_dist" - || opt_key == "overhangs" - || opt_key == "thin_walls" - || opt_key == "thick_bridges") { + opt_key == "external_perimeter_extrusion_width" + || opt_key == "external_perimeter_extrusion_spacing" + || opt_key == "perimeter_extruder" + || opt_key == "fuzzy_skin" + || opt_key == "fuzzy_skin_thickness" + || opt_key == "fuzzy_skin_point_dist" + || opt_key == "thin_walls") { steps.emplace_back(posPerimeters); steps.emplace_back(posSupportMaterial); } else if (opt_key == "bridge_flow_ratio" + || opt_key == "extrusion_spacing" + || opt_key == "extrusion_width" || opt_key == "first_layer_extrusion_spacing" || opt_key == "first_layer_extrusion_width") { //if (m_config.support_material_contact_distance > 0.) { @@ -966,28 +979,51 @@ bool PrintObject::invalidate_state_by_config_options( steps.emplace_back(posInfill); steps.emplace_back(posSupportMaterial); //} - } else if ( - opt_key == "perimeter_generator" - || opt_key == "wall_transition_length" - || opt_key == "wall_transition_filter_deviation" - || opt_key == "wall_transition_angle" - || opt_key == "wall_distribution_count" - || opt_key == "min_feature_size" - || opt_key == "min_bead_width") { - steps.emplace_back(posSlice); } else if ( opt_key == "avoid_crossing_top" + || opt_key == "bridge_acceleration" || opt_key == "bridge_speed" - || opt_key == "bridge_speed_internal" + || opt_key == "brim_acceleration" + || opt_key == "brim_speed" || opt_key == "external_perimeter_speed" - || opt_key == "external_perimeters_vase" + || opt_key == "default_acceleration" + || opt_key == "default_speed" + || opt_key == "external_perimeter_acceleration" + || opt_key == "external_perimeter_cut_corners" + || opt_key == "first_layer_acceleration" + || opt_key == "first_layer_acceleration_over_raft" + || opt_key == "first_layer_flow_ratio" + || opt_key == "first_layer_infill_speed" + || opt_key == "first_layer_min_speed" + || opt_key == "first_layer_speed" + || opt_key == "first_layer_speed_over_raft" + || opt_key == "gap_fill_acceleration" + || opt_key == "gap_fill_flow_match_perimeter" || opt_key == "gap_fill_speed" + || opt_key == "infill_acceleration" || opt_key == "infill_speed" + || opt_key == "internal_bridge_acceleration" + || opt_key == "internal_bridge_speed" + || opt_key == "ironing_acceleration" + || opt_key == "ironing_speed" + || opt_key == "milling_after_z" + || opt_key == "milling_extra_size" + || opt_key == "milling_post_process" + || opt_key == "milling_speed" + || opt_key == "object_gcode" + || opt_key == "overhangs_acceleration" || opt_key == "overhangs_speed" + || opt_key == "perimeter_acceleration" || opt_key == "perimeter_speed" + || opt_key == "print_extrusion_multiplier" + || opt_key == "print_first_layer_temperature" + || opt_key == "print_retract_length" + || opt_key == "print_retract_lift" + || opt_key == "print_temperature" + || opt_key == "region_gcode" || opt_key == "seam_position" - || opt_key == "seam_preferred_direction" - || opt_key == "seam_preferred_direction_jitter" + //|| opt_key == "seam_preferred_direction" + //|| opt_key == "seam_preferred_direction_jitter" || opt_key == "seam_angle_cost" || opt_key == "seam_notch_all" || opt_key == "seam_notch_angle" @@ -998,14 +1034,20 @@ bool PrintObject::invalidate_state_by_config_options( || opt_key == "small_perimeter_speed" || opt_key == "small_perimeter_min_length" || opt_key == "small_perimeter_max_length" + || opt_key == "solid_infill_acceleration" || opt_key == "solid_infill_speed" || opt_key == "support_material_interface_speed" || opt_key == "support_material_speed" + || opt_key == "thin_walls_acceleration" || opt_key == "thin_walls_speed" - || opt_key == "top_solid_infill_speed") { + || opt_key == "top_solid_infill_acceleration" + || opt_key == "top_solid_infill_speed" + || opt_key == "travel_acceleration" + || opt_key == "travel_deceleration_use_target") { invalidated |= m_print->invalidate_step(psGCodeExport); } else if ( - opt_key == "wipe_into_infill" + opt_key == "infill_first" + || opt_key == "wipe_into_infill" || opt_key == "wipe_into_objects") { invalidated |= m_print->invalidate_step(psWipeTower); invalidated |= m_print->invalidate_step(psGCodeExport); @@ -1016,7 +1058,8 @@ bool PrintObject::invalidate_state_by_config_options( || opt_key == "brim_ears_max_angle" || opt_key == "brim_ears_pattern" || opt_key == "brim_per_object" - || opt_key == "brim_separation") { + || opt_key == "brim_separation" + || opt_key == "brim_type") { invalidated |= m_print->invalidate_step(psSkirtBrim); // Brim is printed below supports, support invalidates brim and skirt. steps.emplace_back(posSupportMaterial); diff --git a/src/slic3r/CMakeLists.txt b/src/slic3r/CMakeLists.txt index 81241b45238..49bccb9d634 100644 --- a/src/slic3r/CMakeLists.txt +++ b/src/slic3r/CMakeLists.txt @@ -38,6 +38,8 @@ set(SLIC3R_GUI_SOURCES GUI/CalibrationTempDialog.hpp GUI/CalibrationRetractionDialog.cpp GUI/CalibrationRetractionDialog.hpp + GUI/CalibrationPressureAdvDialog.cpp + GUI/CalibrationPressureAdvDialog.hpp GUI/ConfigSnapshotDialog.cpp GUI/ConfigSnapshotDialog.hpp GUI/CreateMMUTiledCanvas.cpp diff --git a/src/slic3r/GUI/CalibrationPressureAdvDialog.cpp b/src/slic3r/GUI/CalibrationPressureAdvDialog.cpp new file mode 100644 index 00000000000..ef5de0b4e33 --- /dev/null +++ b/src/slic3r/GUI/CalibrationPressureAdvDialog.cpp @@ -0,0 +1,823 @@ +#include "CalibrationPressureAdvDialog.hpp" +#include "I18N.hpp" +#include "libslic3r/AppConfig.hpp" +#include "libslic3r/CustomGCode.hpp" +#include "libslic3r/Model.hpp" +#include "libslic3r/Printconfig.hpp" +#include "libslic3r/Utils.hpp" +#include "GLCanvas3D.hpp" +#include "GUI.hpp" +#include "GUI_ObjectList.hpp" +#include "Plater.hpp" +#include "Tab.hpp" +#include +#include +#include +#include "wxExtensions.hpp" +#include "Jobs/ArrangeJob.hpp" +#include + +#pragma optimize("", off) +#if ENABLE_SCROLLABLE +static wxSize get_screen_size(wxWindow* window) +{ + const auto idx = wxDisplay::GetFromWindow(window); + wxDisplay display(idx != wxNOT_FOUND ? idx : 0u); + return display.GetClientArea().GetSize(); +} +#endif // ENABLE_SCROLLABLE + +namespace Slic3r { +namespace GUI { + +void CalibrationPressureAdvDialog::create_buttons(wxStdDialogButtonSizer* buttons){ + + const DynamicPrintConfig* printer_config = this->gui_app->get_tab(Preset::TYPE_PRINTER)->get_config(); + GCodeFlavor flavor = printer_config->option>("gcode_flavor")->value; //there a better way to only load the flavor ? + + wxString choices_first_layerPA[] = { + "0.025", + "0.030", + "0.035", + "0.040", + "0.045", + "0.050" + }; + firstPa = new wxComboBox(this, wxID_ANY, wxString{ "0.040" }, wxDefaultPosition, wxDefaultSize, 6, choices_first_layerPA); + firstPa->SetToolTip(_L("Select the first layer PA value to be used for the first layer only.")); + firstPa->SetSelection(3);// starting at 0! + + + wxString choices_start_PA[] = { + "0.0", + "0.010", + "0.020", + "0.030", + "0.040", + "0.050" + }; + startPa = new wxComboBox(this, wxID_ANY, wxString{ "0.0" }, wxDefaultPosition, wxDefaultSize, 6, choices_start_PA); + startPa->SetToolTip(_L("Select the starting PA value to be used.")); + startPa->SetSelection(0); + + wxString choices_end_PA[] = { + "0.10", + "0.20", + "0.30", + "0.40", + "0.50", + "0.60", + "0.70", + "0.80", + "0.90", + "1.00" + }; + endPa = new wxComboBox(this, wxID_ANY, wxString{ "0.10" }, wxDefaultPosition, wxDefaultSize, 10, choices_end_PA); + endPa->SetToolTip(_L("Select the ending PA value to be used.")); + endPa->SetSelection(0); + + wxString choices_increment_PA[] = { + "0.0010",///1000 hits + "0.0025", + "0.0035", + "0.005", //200 hits + "0.006", + "0.007", + "0.01",//100 hits + "0.1"//10 hits + }; + paIncrement = new wxComboBox(this, wxID_ANY, wxString{ "0.0025" }, wxDefaultPosition, wxDefaultSize, 8, choices_increment_PA); + paIncrement->SetToolTip(_L("Select the PA increment amount.")); + paIncrement->SetSelection(1); + + wxString choices_extrusion_role[] = { + "InternalInfill", + "BridgeInfill", + "ExternalPerimeter", + "GapFill", + "InternalBridgeInfill", + "Ironing", + "OverhangPerimeter", + "Perimeter", + "SolidInfill", + "SupportMaterial", + "SupportMaterialInterface", + "ThinWall", + "TopSolidInfill", + "FirstLayer", + // "Verify"//if this selected, disable/hide other buttons? + // 'verify' this choice will require the user to manually add in the PA numbers with the GUI from their realworld tests. + // the code will then load a 90_bend for each ER role, and give each bend seperate ER speed/width/ect values + // when printed and user added in the PA numbers correctly. it should make it easy to spot what ER roles need adjusting. + //TODO: once the main pressure advance feature is added, this can pull that values and insert here to save the manual adding in the numbers. + // supermerill: i don't understand, so I deactivated the feature for now. + }; + erPa = new wxComboBox(this, wxID_ANY, wxString{ "InternalInfill" }, wxDefaultPosition, wxDefaultSize, 14, choices_extrusion_role); + erPa->SetToolTip(_L("Select the extrusion role you want to generate a calibration for")); + erPa->SetSelection(0); + + + wxString number_of_runs[] = {"1","2","3","4","5"}; + nbRuns = new wxComboBox(this, wxID_ANY, wxString{ "1" }, wxDefaultPosition, wxDefaultSize, 5, number_of_runs); + nbRuns->SetToolTip(_L("Select the number of tests to generate, max 2 is reccomended due to bed size limits")); + nbRuns->SetSelection(0); + + enableST = new wxCheckBox(this, wxID_ANY, _L(""), wxDefaultPosition, wxDefaultSize ); + enableST->SetToolTip(_L("generate smooth time values")); + enableST->SetValue(false); + + // TODO : add another row of boxes for the 2nd/3rd ect of tests to create, user adjust parameters of new row for the 2nd/3rd test + // this will allow multi plate PA tests to be run + + + std::string prefix = (gcfMarlinFirmware == flavor || gcfMarlinLegacy == flavor) ? " LA " : ((gcfKlipper == flavor || gcfRepRap == flavor) ? " PA " : "unsupported firmware type"); + + if (prefix != "unsupported firmware type"){ + wxBoxSizer* vertical =new wxBoxSizer(wxVERTICAL); + wxBoxSizer* hsizer_common =new wxBoxSizer(wxHORIZONTAL); + wxBoxSizer* hsizer_pa =new wxBoxSizer(wxHORIZONTAL); + wxBoxSizer* hsizer_speed =new wxBoxSizer(wxHORIZONTAL); + vertical->Add(hsizer_common); + vertical->Add(hsizer_pa); + vertical->Add(hsizer_speed); + + hsizer_common->Add(new wxStaticText(this, wxID_ANY, _L("Number of tests: "))); + hsizer_common->Add(nbRuns); + + hsizer_pa->Add(new wxStaticText(this, wxID_ANY, _L("First Layers" + prefix + "value: "))); + hsizer_pa->Add(firstPa); + hsizer_pa->AddSpacer(15); + hsizer_pa->Add(new wxStaticText(this, wxID_ANY, _L("Starting" + prefix + "value: "))); + hsizer_pa->Add(startPa); + hsizer_pa->AddSpacer(15); + hsizer_pa->Add(new wxStaticText(this, wxID_ANY, _L("Ending" + prefix + "value: "))); + hsizer_pa->Add(endPa); + hsizer_pa->AddSpacer(15); + hsizer_pa->Add(new wxStaticText(this, wxID_ANY, _L(prefix + "increments: "))); + hsizer_pa->Add(paIncrement); + + hsizer_speed->Add(new wxStaticText(this, wxID_ANY, _L("Extrusion role: "))); + hsizer_speed->Add(erPa); + if (gcfKlipper == flavor) { + hsizer_speed->AddSpacer(15); + hsizer_speed->Add(new wxStaticText(this, wxID_ANY, _L("Smooth time: "))); + hsizer_speed->Add(enableST); + } + hsizer_speed->AddSpacer(25); + + wxButton* bt = new wxButton(this, wxID_FILE1, _L("Generate")); + bt->Bind(wxEVT_BUTTON, &CalibrationPressureAdvDialog::create_geometry, this); + + vertical->Add(bt); + + buttons->Add(vertical); + } else { + buttons->Add(new wxStaticText(this, wxID_ANY, _L(prefix))); + } +} + +void CalibrationPressureAdvDialog::create_geometry(wxCommandEvent& event_args) { + /* + firstPa + startPa + endPa + paIncrement + erPa + enableST + */ + double first_pa, start_pa, end_pa, pa_increment = 0.01; + bool smooth_time = enableST->IsChecked(); + size_t nb_runs = nbRuns->GetSelection(); + nb_runs=nb_runs+1; + first_pa = firstPa->GetValue().ToDouble(&first_pa); + + if (!firstPa->GetValue().ToDouble(&first_pa)) { + first_pa = 0.025; + } + start_pa = startPa->GetValue().ToDouble(&start_pa); + if (!startPa->GetValue().ToDouble(&start_pa)) { + start_pa = 0.0; + } + end_pa = endPa->GetValue().ToDouble(&end_pa); + if (!endPa->GetValue().ToDouble(&end_pa)) { + end_pa = 1.0; + } + pa_increment = paIncrement->GetValue().ToDouble(&pa_increment); + if (!paIncrement->GetValue().ToDouble(&pa_increment)) { + pa_increment = 0.05; + } + + std::string extrusion_role = erPa->GetValue().ToStdString(); + std::string choice_extrusion_role[] = { + "InternalInfill", + "BridgeInfill", + "ExternalPerimeter", + "GapFill", + "InternalBridgeInfill", + "Ironing", + "OverhangPerimeter", + "Perimeter", + "SolidInfill", + "SupportMaterial", + "SupportMaterialInterface", + "ThinWall", + "TopSolidInfill", + "FirstLayer"//i've got added them all right? + }; + + std::unordered_map er_width_ToOptionKey = { + {"InternalInfill", "infill_extrusion_width"}, + //{"BridgeInfill", "placeholder"},//special calc required + {"ExternalPerimeter", "external_perimeter_extrusion_width"}, + //{"GapFill", "placeholder"},//special calc required + //{"InternalBridgeInfill", "placeholder"},//special calc required, TODO:find out where/how this is calculated + {"Ironing", "top_infill_extrusion_width"}, + {"OverhangPerimeter", "overhangs_width"}, + {"Perimeter", "perimeter_extrusion_width"}, + {"SolidInfill", "solid_infill_extrusion_width"}, + {"SupportMaterial", "support_material_extrusion_width"}, + {"SupportMaterialInterface", "support_material_extrusion_width"}, + {"ThinWall", "external_perimeter_extrusion_width"}, + {"TopSolidInfill", "top_infill_extrusion_width"}, + {"FirstLayer", "first_layer_extrusion_width"} + + }; + + std::unordered_map er_accel_ToOptionKey = { + {"InternalInfill", "infill_acceleration"}, + {"BridgeInfill", "bridge_acceleration"}, + {"ExternalPerimeter", "external_perimeter_acceleration"}, + {"GapFill", "gap_fill_acceleration"}, + {"InternalBridgeInfill", "bridge_internal_acceleration"}, + {"Ironing", "ironing_acceleration"}, + {"OverhangPerimeter", "overhangs_acceleration"}, + {"Perimeter", "perimeter_acceleration"}, + {"SolidInfill", "solid_infill_acceleration"}, + {"SupportMaterial", "support_material_acceleration"}, + {"SupportMaterialInterface", "support_material_interface_acceleration"}, + {"ThinWall", "top_solid_infill_acceleration"}, + {"TopSolidInfill", "top_solid_infill_acceleration"}, + {"FirstLayer", "first_layer_acceleration"} + }; + + std::unordered_map er_spacing_ToOptionKey = { + {"InternalInfill", "infill_extrusion_spacing"}, + //{"BridgeInfill", "placeholder"}, + {"ExternalPerimeter", "external_perimeter_extrusion_spacing"}, + //{"GapFill", "placeholder"},//special calc required for commented ones + //{"InternalBridgeInfill", "placeholder"}, + //{"Ironing", "ironing_spacing"}, TOFIX? TYPE: coFloat + {"Ironing", "top_infill_extrusion_spacing"}, + {"OverhangPerimeter", "external_perimeter_extrusion_spacing"}, + {"Perimeter", "perimeter_extrusion_spacing"}, + {"SolidInfill", "solid_infill_extrusion_spacing"}, + {"SupportMaterial", "external_perimeter_extrusion_spacing"}, //TOFIX? TYPE: coFloat + {"SupportMaterialInterface", "external_perimeter_extrusion_spacing"}, //TOFIX? TYPE: coFloat + {"ThinWall", "external_perimeter_extrusion_spacing"}, + {"TopSolidInfill", "top_infill_extrusion_spacing"}, + {"FirstLayer", "first_layer_extrusion_spacing"} + }; + + std::unordered_map er_speed_ToOptionKey = { + {"InternalInfill", "infill_speed"}, + {"BridgeInfill", "bridge_speed"}, + {"ExternalPerimeter", "external_perimeter_speed"}, + {"GapFill", "gap_fill_speed"}, + {"InternalBridgeInfill", "bridge_speed_internal"}, + {"Ironing", "ironing_speed"}, + {"OverhangPerimeter", "overhangs_speed"}, + {"Perimeter", "perimeter_speed"}, + {"SolidInfill", "solid_infill_speed"}, + {"SupportMaterial", "support_material_speed"}, + {"SupportMaterialInterface", "support_material_interface_speed"}, + {"ThinWall", "thin_walls_speed"}, + {"TopSolidInfill", "top_solid_infill_speed"}, + {"FirstLayer", "first_layer_speed"} + }; + +/* +struct ExtrusionSettings {// think a struct is better instead of all the maps ? + std::string extrusionWidth; + std::string acceleration; + std::string speed; +}; + + std::unordered_map extrusionRoleToOptionKey = { + {"InternalInfill", {"infill_extrusion_width", "infill_acceleration", "placeholder"}}, + //{"BridgeInfill", {"placeholder", "bridge_acceleration", "placeholder"}},//special calc required + {"ExternalPerimeter", {"external_perimeter_extrusion_width", "external_perimeter_acceleration"}}, + //{"GapFill", {"placeholder", "gap_fill_acceleration"}},//special calc required + //{"InternalBridgeInfill", {"placeholder", "bridge_internal_acceleration"}},//special calc required + {"Ironing", {"top_infill_extrusion_width", "ironing_acceleration"}}, + {"OverhangPerimeter", {"overhangs_width", "overhangs_acceleration"}}, + {"Perimeter", {"perimeter_extrusion_width", "perimeter_acceleration"}}, + {"SolidInfill", {"solid_infill_extrusion_width", "solid_infill_acceleration"}}, + {"SupportMaterial", {"support_material_extrusion_width", "support_material_acceleration"}}, + {"SupportMaterialInterface", {"support_material_extrusion_width", "support_material_interface_acceleration"}}, + {"ThinWall", {"external_perimeter_extrusion_width", "thin_walls_acceleration"}}, + {"TopSolidInfill", {"top_infill_extrusion_width", "top_solid_infill_acceleration"}} + };*/ + + int countincrements = 0; + int sizeofarray = static_cast((end_pa - start_pa) / pa_increment) + 2;//'+2' needed for odd/even numbers + std::vector pa_values(sizeofarray); + std::vector c_pa_values_c(sizeofarray); + + double incremented_pa_value = start_pa; + while (incremented_pa_value <= end_pa + pa_increment / 2) {//this makes a number to be used to load x number of 90 bend models for the PA test. + if (incremented_pa_value <= end_pa) { + double rounded_Pa = std::round(incremented_pa_value * 1000000.0) / 1000000.0; + pa_values[countincrements] = rounded_Pa;//store PA numbers in array to be used later. + c_pa_values_c[countincrements] = rounded_Pa; + countincrements++; + incremented_pa_value += pa_increment; + } + else { + pa_values[countincrements] = end_pa; + countincrements++;//failsafe if werid input numbers are provided that can't add the "ending pa" number to the array. + break; } + + }// is there a limit of how many models SS can load ? might be good to set a failsafe just so it won't load 10k+ models... + + bool has_to_arrange = false; + Plater* plat = this->main_frame->plater(); + Model& model = plat->model(); + if (!plat->new_project(L("Pressure calibration"))) + return; + + bool autocenter = gui_app->app_config->get("autocenter") == "1"; + if (autocenter) { + //disable auto-center for this calibration. + gui_app->app_config->set("autocenter", "0"); + } + + std::vector items; + for (size_t i = 0; i < nb_runs; i++){ + items.emplace_back((boost::filesystem::path(Slic3r::resources_dir()) / "calibration" / "filament_pressure" / "base_plate.3mf").string()); + } + std::vector objs_idx = plat->load_files(items, true, false, false, false); + assert(objs_idx.size() == nb_runs); + const DynamicPrintConfig* print_config = this->gui_app->get_tab(Preset::TYPE_FFF_PRINT)->get_config(); + const DynamicPrintConfig* filament_config = this->gui_app->get_tab(Preset::TYPE_FFF_FILAMENT)->get_config(); + const DynamicPrintConfig* printer_config = this->gui_app->get_tab(Preset::TYPE_PRINTER)->get_config(); + + // --- scale --- + //models is created for nozzles from 0.1-2mm walls should be nozzle_size*4 spaced, scale xy model by widths down is futher + const ConfigOptionFloats* nozzle_diameter_config = printer_config->option("nozzle_diameter"); + assert(nozzle_diameter_config->values.size() > 0); + double nozzle_diameter = nozzle_diameter_config->values[0];//get extruderID too? + double first_layer_height = print_config->get_abs_value("first_layer_height", nozzle_diameter); + double base_layer_height = print_config->get_computed_value("layer_height",0); + GCodeFlavor flavor = printer_config->option>("gcode_flavor")->value; + + double er_width = print_config->get_abs_value("solid_infill_extrusion_width", nozzle_diameter); + double er_accel = print_config->get_abs_value("solid_infill_acceleration", nozzle_diameter); + double er_speed = print_config->get_abs_value("solid_infill_speed", nozzle_diameter); + double er_spacing = print_config->get_abs_value("external_perimeter_extrusion_spacing",1.0); + + double default_er_width = print_config->get_abs_value("extrusion_width", nozzle_diameter); + double default_er_speed = print_config->get_abs_value("default_speed", nozzle_diameter); + double default_er_accel = print_config->get_abs_value("default_acceleration", nozzle_diameter); + double default_er_spacing = print_config->get_abs_value("extrusion_spacing", nozzle_diameter); + double spacing_ratio = print_config->get_abs_value("perimeter_overlap",1.0); + double spacing_ratio_external = print_config->get_abs_value("external_perimeter_overlap",1.0); + double filament_max_overlap = filament_config->get_computed_value("filament_max_overlap",0);//maybe check for extruderID ? + + if (extrusion_role == "Verify") { + countincrements = 13; + er_width = default_er_width; + er_spacing = default_er_spacing; + er_width = er_width * 100 / nozzle_diameter; + er_width = std::round(er_width * 100.0) / 100.0; // Change number to percentage and round + } + else{ + for (int i = 0; i < sizeof(choice_extrusion_role) / sizeof(choice_extrusion_role[0]); i++) { + + if (er_width_ToOptionKey.find(extrusion_role) != er_width_ToOptionKey.end()) { + + er_width = print_config->get_abs_value(er_width_ToOptionKey[extrusion_role].c_str(), nozzle_diameter);//look at maps at match speed/width ect to the selecter ER role + er_speed = print_config->get_abs_value(er_speed_ToOptionKey[extrusion_role].c_str(), nozzle_diameter);//need to load this here?? + er_accel = print_config->get_abs_value(er_accel_ToOptionKey[extrusion_role].c_str(), nozzle_diameter);//need to load this here?? + er_spacing = print_config->get_abs_value(er_spacing_ToOptionKey[extrusion_role].c_str(), nozzle_diameter); + + //potential BUG if any of the values are 0 everything else would fail, need to pull the default value too and assign that? + if(er_width == 0){er_width =default_er_width; } + if(er_speed == 0){er_speed =default_er_speed; } + if(er_accel == 0){er_accel =default_er_accel; } + if(er_spacing == 0){er_spacing = default_er_spacing; } + + er_width = er_width * 100 / nozzle_diameter; + er_width = std::round(er_width * 100.0) / 100.0; + } else { + er_width = print_config->get_abs_value("solid_infill_extrusion_width", nozzle_diameter); //used for gapfill_width/bridges selection. TODO: add the bits for this here since gapfill/bridges need special calculations + er_width = er_width * 100 / nozzle_diameter; + er_width = std::round(er_width * 100.0) / 100.0; // Change number to percentage and round + + } + + } + } + + + //-- magical scaling is done here :) + //the 90_bend models need to be scaled correctly so there is no 'gapfill' since gapfill will effect results. + double xyzScale = nozzle_diameter / 0.4; + double er_width_to_scale = magical_scaling(nozzle_diameter,er_width,filament_max_overlap,spacing_ratio,spacing_ratio_external,base_layer_height,er_spacing); + //-- magical scaling + std::vector < std::vector> pressure_tower; + + std::string nozzle_diameter_str = std::to_string(nozzle_diameter); + nozzle_diameter_str.erase(nozzle_diameter_str.find_last_not_of('0') + 2, std::string::npos); + + + if (nozzle_diameter_str.back() == '.') {//if nozzle_diameter_str broke fix it by adding '0' to end, prob not needed? + nozzle_diameter_str += '0'; + } + + /*size_t decimal_pos = nozzle_diameter_str.find('.'); + // maybe adjust for this ? + // some users might have 0.0x nozzle size. if that's the case then they should just need to create the file and it should load. ie; 90_bend_0.450.3mf + if (decimal_pos != std::string::npos) { + size_t non_zero_pos = nozzle_diameter_str.find_first_not_of('0', decimal_pos + 2); + nozzle_diameter_str.erase(non_zero_pos, std::string::npos); + }*/ + + std::string bend_90_nozzle_size_3mf = "90_bend_" + nozzle_diameter_str + ".3mf"; + + for (size_t id_item = 0; id_item < nb_runs; id_item++) { + + pressure_tower.emplace_back(); + + double initial_model_height = 0.2; + double initial_90_bend_x = 41.20;//fusion=41.200 mm + double initial_90_bend_y = 20.93;//fusion=20.930 mm + double initial_number_x = 2.06;//fusion=2.063 mm + double initial_number_y = 4.12;//fusion=4.125 mm + double initial_border_x = 1.6;//fusion= 1.6mm + double initial_point_xy = 0.69;//fusion = 0.687 mm + + double z_scaled_model_height = initial_model_height * (first_layer_height / initial_model_height); + double xy_scaled_90_bend_x = initial_90_bend_x * er_width_to_scale; + double xy_scaled_90_bend_y = initial_90_bend_y * er_width_to_scale; + double xy_scaled_x = initial_border_x * er_width_to_scale; + double xy_scaled_number_x = initial_number_x * xyzScale * er_width_to_scale; + double xy_scaled_number_y = initial_number_y * xyzScale * er_width_to_scale; + double xy_scaled_point_xy = initial_point_xy * xyzScale * er_width_to_scale; + + + double thickness_offset = nozzle_diameter * er_width_to_scale * 2; + double z_scale_90_bend = xyzScale * 1.8 / initial_model_height; + double z_scale_factor = 0.0; + double new_z_world_coords = first_layer_height / 2.0 -base_layer_height; + + if(base_layer_height <= first_layer_height){//normal conditions firstlayer is greater than base + z_scale_factor = first_layer_height / initial_model_height; + }else{ + z_scale_factor = first_layer_height + first_layer_height; + } + // BUG: output error if first layer height is lower than base layer height + // this can cause the numbers to not "show up" on the preview because the z scale is calculated wrong. + // ie; first_layer_height=0.1 and base_layer_height =0.20 + //BUG: if first/base layer height are both .02 numbers don't show up when sliced. doesn't happen with windows, it did for linux ? + + + + std::vector bend_90_positions; + std::vector number_positions; + + if (extrusion_role == "Verify") { + + int nb_bends = 0; + for (const std::string& role : choice_extrusion_role) {//dynamic add and scale each 90bend model per extrusion role. + + if (er_width_ToOptionKey.find(role) != er_width_ToOptionKey.end()) { + + er_width = std::round((print_config->get_abs_value(er_width_ToOptionKey[role].c_str(), nozzle_diameter) * 100 / nozzle_diameter) * 100.0) / 100.0; + er_spacing = print_config->get_abs_value(er_spacing_ToOptionKey[role].c_str(), nozzle_diameter); + er_width_to_scale = magical_scaling(nozzle_diameter, er_width, filament_max_overlap, spacing_ratio, spacing_ratio_external, base_layer_height, er_spacing); + thickness_offset = nozzle_diameter * er_width_to_scale * 2; + + add_part(model.objects[objs_idx[id_item]], + (boost::filesystem::path(Slic3r::resources_dir()) / "calibration" / "filament_pressure" / "scaled_with_nozzle_size" / bend_90_nozzle_size_3mf).string(), + Vec3d{ -0.8, (initial_90_bend_y/2) * nb_bends , xyzScale - base_layer_height }, Vec3d{ er_width_to_scale, er_width_to_scale, z_scale_90_bend }); + pressure_tower.back().push_back(model.objects[objs_idx[id_item]]); + + Eigen::Vector3d modelPosition(-0.8, (initial_90_bend_y/2) * nb_bends, xyzScale - base_layer_height ); + bend_90_positions.push_back(modelPosition); + nb_bends++; + } + else{ + er_width = std::round((default_er_width * 100 / nozzle_diameter) * 100.0) / 100.0; + er_spacing = default_er_spacing; + er_width_to_scale = magical_scaling(nozzle_diameter, er_width, filament_max_overlap, spacing_ratio, spacing_ratio_external, base_layer_height, er_spacing); + thickness_offset = nozzle_diameter * er_width_to_scale * 2; + + add_part(model.objects[objs_idx[id_item]], + (boost::filesystem::path(Slic3r::resources_dir()) / "calibration" / "filament_pressure" / "scaled_with_nozzle_size" / bend_90_nozzle_size_3mf).string(), + Vec3d{ -0.8, (initial_90_bend_y/2) * nb_bends , xyzScale - base_layer_height }, Vec3d{ er_width_to_scale, er_width_to_scale, z_scale_90_bend }); + pressure_tower.back().push_back(model.objects[objs_idx[id_item]]); + + Eigen::Vector3d modelPosition(-0.8, (initial_90_bend_y/2) * nb_bends, xyzScale - base_layer_height ); + bend_90_positions.push_back(modelPosition); + nb_bends++; + + } + + } + } + else{//not verify + for (int nb_bends = 0; nb_bends < countincrements; nb_bends++){ + //const double magical_transformation_y_pos = 10.47; + add_part(model.objects[objs_idx[id_item]], + (boost::filesystem::path(Slic3r::resources_dir()) / "calibration" / "filament_pressure" / "scaled_with_nozzle_size" / bend_90_nozzle_size_3mf).string(), + Vec3d{ -0.8, double(nb_bends) * (thickness_offset*2) *2 , xyzScale - base_layer_height }, Vec3d{ er_width_to_scale, er_width_to_scale, z_scale_90_bend }); + pressure_tower.back().push_back(model.objects[objs_idx[id_item]]); + + Eigen::Vector3d modelPosition(-0.8, (double(nb_bends) * (thickness_offset*2) *2) , xyzScale - base_layer_height ); + bend_90_positions.push_back(modelPosition); + } + } + + for (int nb_bends = 0; nb_bends < countincrements;nb_bends++){ + + if(nb_bends == 1 && extrusion_role != "Verify") {//only load once. this onyl determines when the borders get loaded, keeping at top of list makes it easier to scroll down to. it can't be '0' since it needs the numbers positions! + + const double extra_size_y = xy_scaled_90_bend_y / 4; + const double extra_size_x = xy_scaled_number_x; + + const double magical_transformation_x_pos = 20.6;//what is this, and how is this calculated ? >:( + const double magical_transformation_y_pos = 10.47;//load a model without moving its pos to find see what it is.the number doesn't seem to change regardless of layer heights/nozzle size + Eigen::Vector3d bend_pos_first = bend_90_positions[0]; + Eigen::Vector3d bend_pos_mid = bend_90_positions[countincrements/2]; + Eigen::Vector3d bend_pos_last = bend_90_positions[countincrements-1]; + + Eigen::Vector3d number_pos_first = number_positions[0]; + Eigen::Vector3d number_pos_mid = number_positions[3]; + Eigen::Vector3d number_pos_last = number_positions[6]; + double numbers_total_width = (number_pos_last.x() + (xy_scaled_number_x / 2)) - (number_pos_first.x() - (xy_scaled_number_x / 2)); + + double scaled_r_border_x_percentage = ((numbers_total_width + extra_size_x) / initial_border_x) * 100; + double scaled_r_border_x_mm = (scaled_r_border_x_percentage / 100) * initial_border_x; + double scaled_tb_border_x = scaled_r_border_x_mm + xy_scaled_90_bend_x; + double scaled_tb_border_x_percentage = ((scaled_tb_border_x /* + extra_size_x*/) / initial_border_x) * 100; + + + double total_height = (bend_pos_last.y() + (xy_scaled_90_bend_y / 2)) - (bend_pos_first.y() - (xy_scaled_90_bend_y / 2)); + double scaled_border_y_percentage = ((total_height + extra_size_y) / initial_90_bend_y) * 100; + double border_scaled_y = (initial_border_x*(xy_scaled_x * 1.5)) / initial_90_bend_y;//need to fix for larger nozzle sizes. + + + double right_border_pos_x = number_pos_mid.x(); + double top_border_x_pos = ((number_pos_last.x() + (xy_scaled_number_x / 2)) + (bend_pos_first.x() - (xy_scaled_90_bend_x / 2))) / 2; + double left_border_pos_x = bend_pos_first.x() - (xy_scaled_90_bend_x / 2); + + //---------- + add_part(model.objects[objs_idx[id_item]], + (boost::filesystem::path(Slic3r::resources_dir()) / "calibration" / "filament_pressure" / "pa_border.3mf").string(), + Vec3d{ left_border_pos_x + magical_transformation_x_pos, bend_pos_mid.y(), new_z_world_coords }, //need to fix to adjust for nozzle_diameter since it breaks bottom_solid_layers + /*scale*/Vec3d{ xy_scaled_x * 1.5, scaled_border_y_percentage*0.01, z_scale_factor }); // Left border + //---------- + add_part(model.objects[objs_idx[id_item]], (boost::filesystem::path(Slic3r::resources_dir()) / "calibration" / "filament_pressure" / "pa_border.3mf").string(), + Vec3d{ right_border_pos_x + magical_transformation_x_pos , bend_pos_mid.y(), new_z_world_coords }, + /*scale*/Vec3d{ scaled_r_border_x_percentage*0.01 , scaled_border_y_percentage*0.01 , z_scale_factor });// right border + + bool enable_top_bottom = true; + if(enable_top_bottom == true){//remove later + //---------- + add_part(model.objects[objs_idx[id_item]], (boost::filesystem::path(Slic3r::resources_dir()) / "calibration" / "filament_pressure" / "pa_border.3mf").string(), + Vec3d{ top_border_x_pos + magical_transformation_x_pos , bend_pos_first.y() - (xy_scaled_90_bend_y /1.8), new_z_world_coords }, //need to fix to adjust for nozzle_diameter since it breaks bottom_solid_layers + /*scale*/Vec3d{ scaled_tb_border_x_percentage*0.01, border_scaled_y, z_scale_factor });//bottom border + //---------- + add_part(model.objects[objs_idx[id_item]], (boost::filesystem::path(Slic3r::resources_dir()) / "calibration" / "filament_pressure" / "pa_border.3mf").string(), + Vec3d{ top_border_x_pos + magical_transformation_x_pos , bend_pos_last.y() + (xy_scaled_90_bend_y /1.8) , new_z_world_coords }, //need to fix to adjust for nozzle_diameter since it breaks bottom_solid_layers + /*scale*/Vec3d{ scaled_tb_border_x_percentage*0.01, border_scaled_y, z_scale_factor });//top border + } + + // position in printer coords are half of scaled size! + // scale model in percentage from original models xy values! + //---------- + } + //} + + if (extrusion_role != "Verify") {// possible to load the words for each ER role? + + if (nb_bends % 2 == 1) { // Skip generating every second number + continue; + } + + Eigen::Vector3d bend_90_pos = bend_90_positions[nb_bends]; + const double magical_transformation_y_pos = 10.47; + const double magical_transformation_num_x_pos = 1.03; + const double magical_transformation_num_y_pos = 2.06;// -2.03 + const double magical_transformation_z_pos = 0.12;//0.1 is the transformation value, but set slightly higher so numbers would be "inside" right border this might be dependant on z_scale_factor + + double bend_90_y = bend_90_pos.y() + magical_transformation_y_pos + (xy_scaled_90_bend_y/2); + double bend_90_x = bend_90_pos.x() + magical_transformation_num_x_pos; + double xpos_initial = bend_90_x + (xy_scaled_90_bend_x/2) - xy_scaled_number_x + nozzle_diameter; + double ypos_inital = bend_90_y /*+ (xy_scaled_number_y/2)*/; + double ypos_point = bend_90_y - (xy_scaled_number_y/2) - nozzle_diameter; + + double xpos = xpos_initial; + double ypos = ypos_inital; + + std::string pa_values_string = std::to_string(pa_values[nb_bends]); + std::string threemf =".3mf"; + + for (int j = 0; j < 7; ++j) {//not sure how the code will respond with a positive array list? ie ; 100.2 this moves decimal point thus breaking the code from loading model since "..3mf" not a real file + + std::string numered3mfpath = pa_values_string[j] + threemf; + + if (pa_values_string[j] == '.') { + + add_part(model.objects[objs_idx[id_item]], (boost::filesystem::path(Slic3r::resources_dir()) / "calibration" / "filament_pressure" / "point.3mf").string(), + Vec3d{ xpos + xy_scaled_number_x + nozzle_diameter , ypos_point, z_scaled_model_height - magical_transformation_z_pos }, Vec3d{ xyzScale * er_width_to_scale, xyzScale+(xyzScale/2), z_scale_factor }); + + Eigen::Vector3d modelPosition(xpos + xy_scaled_number_x + nozzle_diameter + magical_transformation_num_x_pos, ypos_point, z_scaled_model_height - magical_transformation_z_pos ); + number_positions.push_back(modelPosition); + xpos = xpos + xy_scaled_point_xy + (nozzle_diameter * 2 ); + } + else if (std::isdigit(pa_values_string[j])) { + + add_part(model.objects[objs_idx[id_item]], (boost::filesystem::path(Slic3r::resources_dir()) / "calibration" / "filament_pressure" / numered3mfpath).string(), + Vec3d{ xpos + xy_scaled_number_x + nozzle_diameter, ypos, z_scaled_model_height - magical_transformation_z_pos }, Vec3d{ xyzScale * er_width_to_scale, xyzScale * er_width_to_scale, z_scale_factor }); + + Eigen::Vector3d modelPosition(xpos + xy_scaled_number_x + nozzle_diameter + magical_transformation_num_x_pos, ypos, z_scaled_model_height - magical_transformation_z_pos ); + number_positions.push_back(modelPosition); + xpos = xpos + xy_scaled_number_x + nozzle_diameter; + } + } + } + } + } + + + /// --- translate --- + //bool autocenter = gui_app->app_config->get("autocenter") == "1"; + has_to_arrange = true; + /*if (!autocenter) { + const ConfigOptionPoints* bed_shape = printer_config->option("bed_shape"); + Vec2d bed_size = BoundingBoxf(bed_shape->values).size(); + Vec2d bed_min = BoundingBoxf(bed_shape->values).min; + model.objects[objs_idx[0]]->translate({ bed_min.x() + bed_size.x() / 2, bed_min.y() + bed_size.y() / 2, 5 * xyzScale - 5 }); + }*/ + + std::string set_advance_prefix =""; + if (gcfKlipper == flavor) { + if(smooth_time == false){ + set_advance_prefix = "SET_PRESSURE_ADVANCE ADVANCE="; + } + else{ + set_advance_prefix = "SET_PRESSURE_ADVANCE SMOOTH_TIME="; + } + } + else if (gcfMarlinFirmware == flavor) { + set_advance_prefix = "M900 K"; + } + else if(gcfRepRap == flavor){ + set_advance_prefix = "M572 S"; + } + + /// --- main config, modify object config when possible --- + DynamicPrintConfig new_print_config = *print_config; + DynamicPrintConfig new_printer_config = *printer_config; + new_print_config.set_key_value("complete_objects", new ConfigOptionBool(false)); //true is required for multi tests on single plate. + new_print_config.set_key_value("gap_fill_enabled", new ConfigOptionBool(true)); //should be false?, enabled for testing + new_print_config.set_key_value("top_solid_layers", new ConfigOptionInt(0)); + new_print_config.set_key_value("only_one_perimeter_top", new ConfigOptionBool(false)); + new_print_config.set_key_value("bottom_solid_layers", new ConfigOptionInt(1)); + new_print_config.set_key_value("fill_density", new ConfigOptionPercent(0)); + new_print_config.set_key_value("min_width_top_surface", new ConfigOptionFloatOrPercent(0.0,false)); + new_print_config.set_key_value("bottom_fill_pattern", new ConfigOptionEnum(ipMonotonicWGapFill)); + new_print_config.set_key_value("seam_position", new ConfigOptionEnum(spRear));//BUG: should be fixed in 2.7 merge/SS 2.5.59.7, when this is changed the "perimeters & shell" doesn't turn red indicating a change. + new_print_config.set_key_value("avoid_crossing_perimeters", new ConfigOptionBool(false)); + new_print_config.set_key_value("perimeter_overlap", new ConfigOptionPercent(100)); + new_print_config.set_key_value("external_perimeter_overlap", new ConfigOptionPercent(100)); + new_printer_config.set_key_value("before_layer_gcode", new ConfigOptionString(std::string("{if layer_num == 0} ") + set_advance_prefix + std::to_string(first_pa) + " {endif}")); + + for (size_t i = 0; i < nb_runs; i++) { + /* + gcfRepRap, + gcfSprinter, + gcfRepetier, + gcfTeacup, + gcfMakerWare, + gcfMarlinLegacy, + gcfMarlinFirmware, + gcfLerdge, + gcfKlipper, + gcfSailfish, + gcfMach3, + gcfMachinekit, + gcfSmoothie, + gcfNoExtrusion*/ + + size_t num_part = 0; + const int extra_vol = 1; + for (ModelObject* part : pressure_tower[i]) {//loop though each part/volume and assign the modifers + + std::string er_role =""; + if (extrusion_role == "Verify") { + er_role = choice_extrusion_role[num_part]; + if (er_width_ToOptionKey.find(er_role) != er_width_ToOptionKey.end()) { + + er_width = std::round((print_config->get_abs_value(er_width_ToOptionKey[er_role].c_str(), nozzle_diameter) * 100 / nozzle_diameter) * 100.0) / 100.0; + er_speed = print_config->get_abs_value(er_speed_ToOptionKey[er_role].c_str(), nozzle_diameter); + er_accel = print_config->get_abs_value(er_accel_ToOptionKey[er_role].c_str(), nozzle_diameter); + } + else{ + er_width = std::round((default_er_width * 100 / nozzle_diameter) * 100.0) / 100.0; + er_speed = default_er_speed; + er_accel = default_er_accel; + } + } + + + er_width = (er_width == 0) ? std::round((default_er_width * 100 / nozzle_diameter) * 100.0) / 100.0 : er_width; + er_speed = (er_speed == 0) ? default_er_speed : er_speed; + er_accel = (er_accel == 0) ? default_er_accel : er_accel; + + /// --- custom config --- // this is for forcing each model to have x print modifiers + + model.objects[objs_idx[i]]->volumes[num_part + extra_vol]->config.set_key_value("perimeter_extrusion_width", new ConfigOptionFloatOrPercent(er_width, true)); + model.objects[objs_idx[i]]->volumes[num_part + extra_vol]->config.set_key_value("external_perimeter_extrusion_width", new ConfigOptionFloatOrPercent(er_width, true));//TODO: check widths and ect breaks if any values are in mm/percentage + model.objects[objs_idx[i]]->volumes[num_part + extra_vol]->config.set_key_value("perimeter_speed", new ConfigOptionFloatOrPercent(er_speed, false)); + model.objects[objs_idx[i]]->volumes[num_part + extra_vol]->config.set_key_value("external_perimeter_speed", new ConfigOptionFloatOrPercent(er_speed, false)); + model.objects[objs_idx[i]]->volumes[num_part + extra_vol]->config.set_key_value("gap_fill_speed", new ConfigOptionFloatOrPercent(er_speed, false)); + model.objects[objs_idx[i]]->volumes[num_part + extra_vol]->config.set_key_value("perimeter_acceleration", new ConfigOptionFloatOrPercent(er_accel, false)); + model.objects[objs_idx[i]]->volumes[num_part + extra_vol]->config.set_key_value("external_perimeter_acceleration", new ConfigOptionFloatOrPercent(er_accel, false)); + model.objects[objs_idx[i]]->volumes[num_part + extra_vol]->config.set_key_value("gap_fill_acceleration", new ConfigOptionFloatOrPercent(er_accel, false)); + if (extrusion_role == "Verify") { + model.objects[objs_idx[i]]->volumes[num_part + extra_vol]->config.set_key_value("region_gcode", new ConfigOptionString(set_advance_prefix + " ; " + er_role ));//user manual type in values + } + else{//add '\n' in? answer: you can, not mandatory as it's verified. + model.objects[objs_idx[i]]->volumes[num_part + extra_vol]->config.set_key_value("region_gcode", new ConfigOptionString(set_advance_prefix + std::to_string(pa_values[num_part]) + " ; " + extrusion_role )); + } + num_part++; + } + } + + //update plater + this->gui_app->get_tab(Preset::TYPE_FFF_PRINT)->load_config(new_print_config); + plat->on_config_change(new_print_config); + this->gui_app->get_tab(Preset::TYPE_PRINTER)->load_config(new_printer_config); + plat->on_config_change(new_printer_config); + plat->changed_objects(objs_idx); + this->gui_app->get_tab(Preset::TYPE_FFF_PRINT)->update_dirty(); + this->gui_app->get_tab(Preset::TYPE_PRINTER)->update_dirty(); + plat->is_preview_shown(); + //update everything, easier to code. + ObjectList* obj = this->gui_app->obj_list(); + obj->update_after_undo_redo(); + + + // arrange if needed, after new settings, to take them into account + if (has_to_arrange) { + //update print config (done at reslice but we need it here) + if (plat->printer_technology() == ptFFF) + plat->fff_print().apply(plat->model(), *plat->config()); + std::shared_ptr fake_statusbar = std::make_shared(); + ArrangeJob arranger(std::dynamic_pointer_cast(fake_statusbar), plat); + arranger.prepare_all(); + arranger.process(); + arranger.finalize(); + } + + + if (extrusion_role != "Verify") {//don't auto slice so user can manual add PA values + //plat->reslice(); //forces a slice of plater. + } + + if (autocenter) { + //re-enable auto-center after this calibration. + gui_app->app_config->set("autocenter", "1"); + } +} + +double CalibrationPressureAdvDialog::magical_scaling(double nozzle_diameter, double er_width, double filament_max_overlap, double spacing_ratio, double spacing_ratio_external, double base_layer_height, double er_spacing ){ + + double xyzScale = nozzle_diameter / 0.4; + double er_width_decimal = er_width * nozzle_diameter / 100.0;//models are generated to be default width of x4 lines for the walls ie; 0.4mm nozzle is 1.6mm thick walls + double er_width_to_scale =1.0; + double overlap_ratio = 1; + if (filament_max_overlap) {overlap_ratio = filament_max_overlap;} + + spacing_ratio = std::min(overlap_ratio * 0.5f, spacing_ratio_external / 2.0); + double new_scale_spacing = er_width_decimal-base_layer_height*float(1. -0.25 *PI)* spacing_ratio; + double spacing_value = std::round((new_scale_spacing / nozzle_diameter) * 100); //spacing_value = Round((Spacing / Max Nozzle Diameter) * 100) + er_spacing = (std::round(spacing_value * 10000) / 10000) *0.01; + + + if (xyzScale > 4 ) { + er_width_to_scale = 1.0; + } + else{ + er_width_to_scale = er_spacing -(nozzle_diameter/2*0.01);//need to scale slightly under to help with models being correct TODO: test more configurations of nozzle sizes/layer heights + //if use has the 'wrong' min layer height for a nozzle size, the model will get filled with "gapfill" not a normal extrusion, need to test more for what variables 'break' it + } + + return er_width_to_scale; +} + +} // namespace GUI +} // namespace Slic3r +#pragma optimize("", on) \ No newline at end of file diff --git a/src/slic3r/GUI/CalibrationPressureAdvDialog.hpp b/src/slic3r/GUI/CalibrationPressureAdvDialog.hpp new file mode 100644 index 00000000000..4521e07daba --- /dev/null +++ b/src/slic3r/GUI/CalibrationPressureAdvDialog.hpp @@ -0,0 +1,37 @@ +#ifndef slic3r_GUI_CalibrationPressureAdvDialog_hpp_ +#define slic3r_GUI_CalibrationPressureAdvDialog_hpp_ + +#include "CalibrationAbstractDialog.hpp" +//pressure advance PressureAdv +namespace Slic3r { +namespace GUI { + +class CalibrationPressureAdvDialog : public CalibrationAbstractDialog +{ + +public: + CalibrationPressureAdvDialog(GUI_App* app, MainFrame* mainframe) : CalibrationAbstractDialog(app, mainframe, "Pressure calibration") + { create(boost::filesystem::path("calibration") / "filament_pressure", "filament_pressure.html", wxSize(1600, 600)); Centre(wxBOTH);} + virtual ~CalibrationPressureAdvDialog(){ } + +protected: + void create_buttons(wxStdDialogButtonSizer* sizer) override; + void create_geometry(wxCommandEvent& event_args); + double magical_scaling(double, double, double, double, double, double, double ); + + //i've set choice boxes for now just to save me typing numbers in when i want to test it :) + wxComboBox* firstPa; //first layer PA -user manual entry + wxComboBox* startPa; //starting PA value -user manual entry + //wxTextCtrl* firstPa; //edit to suit for manual data entry, + wxComboBox* endPa; //ending PA value -user manual entry + wxComboBox* paIncrement;//increment PA by this value -user manual entry~~ or have drop down box ? + wxComboBox* erPa; //extrusion role Pressure/Linear Advance -user choice select + wxComboBox* nbRuns; + wxCheckBox* enableST; // checkbox for "smooth_time" - klipper only feature? + +}; + +} // namespace GUI +} // namespace Slic3r + +#endif diff --git a/src/slic3r/GUI/ConfigManipulation.cpp b/src/slic3r/GUI/ConfigManipulation.cpp index cd9ee58b3f5..e5d7d5273ad 100644 --- a/src/slic3r/GUI/ConfigManipulation.cpp +++ b/src/slic3r/GUI/ConfigManipulation.cpp @@ -428,7 +428,7 @@ void ConfigManipulation::toggle_print_fff_options(DynamicPrintConfig* config) toggle_field("infill_first", (has_solid_infill || have_infill)); - for (auto el : {"fill_angle_cross","fill_angle_increment", "fill_angle_template", "fill_angle_cross", "bridge_angle", "infill_extrusion_width", + for (auto el : {"fill_angle_cross","fill_angle_follow_model","fill_angle_increment", "fill_angle_template", "bridge_angle", "infill_extrusion_width", "infill_extrusion_spacing", "infill_extrusion_change_odd_layers", "infill_speed" }) toggle_field(el, have_infill || has_solid_infill); @@ -579,7 +579,7 @@ void ConfigManipulation::toggle_print_fff_options(DynamicPrintConfig* config) 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_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" }) + for (auto el : { "bridge_acceleration", "internal_bridge_acceleration", "overhangs_acceleration", "gap_fill_acceleration", "travel_acceleration", "travel_deceleration_use_target", "first_layer_acceleration" }) toggle_field(el, have_default_acceleration); // for default speed, it needs at least a dependent field with a % diff --git a/src/slic3r/GUI/GUI_App.cpp b/src/slic3r/GUI/GUI_App.cpp index 3af8dd5bea2..66f6881c74a 100644 --- a/src/slic3r/GUI/GUI_App.cpp +++ b/src/slic3r/GUI/GUI_App.cpp @@ -66,6 +66,7 @@ #include "CalibrationOverBridgeDialog.hpp" #include "CalibrationTempDialog.hpp" #include "CalibrationRetractionDialog.hpp" +#include "CalibrationPressureAdvDialog.hpp" #include "ConfigSnapshotDialog.hpp" #include "CreateMMUTiledCanvas.hpp" #include "FreeCADDialog.hpp" @@ -1981,6 +1982,10 @@ void GUI_App::calibration_retraction_dialog() { change_calibration_dialog(nullptr, new CalibrationRetractionDialog(this, mainframe)); } +void GUI_App::calibration_pressureadv_dialog() +{ + change_calibration_dialog(nullptr, new CalibrationPressureAdvDialog(this, mainframe)); +} void GUI_App::freecad_script_dialog() { change_calibration_dialog(nullptr, new FreeCADDialog(this, mainframe)); diff --git a/src/slic3r/GUI/GUI_App.hpp b/src/slic3r/GUI/GUI_App.hpp index 3dc7f0c9081..25654af8e90 100644 --- a/src/slic3r/GUI/GUI_App.hpp +++ b/src/slic3r/GUI/GUI_App.hpp @@ -253,6 +253,7 @@ class GUI_App : public wxApp void over_bridge_dialog(); void calibration_cube_dialog(); void calibration_retraction_dialog(); + void calibration_pressureadv_dialog(); void freecad_script_dialog(); void tiled_canvas_dialog(); //void support_tuning(); //have to do multiple, in a submenu diff --git a/src/slic3r/GUI/GUI_Factories.cpp b/src/slic3r/GUI/GUI_Factories.cpp index 096e0bee1db..1c944dc7785 100644 --- a/src/slic3r/GUI/GUI_Factories.cpp +++ b/src/slic3r/GUI/GUI_Factories.cpp @@ -52,7 +52,7 @@ static bool is_improper_category(const Slic3r::OptionCategory& category, const i static SettingsFactory::Bundle FREQ_SETTINGS_BUNDLE_FFF = { { OptionCategory::perimeter , { "layer_height" , "perimeters", "top_solid_layers", "bottom_solid_layers" } }, - { OptionCategory::infill , { "fill_density", "fill_pattern" } }, + { OptionCategory::infill , { "fill_density", "fill_pattern", "fill_angle" } }, { OptionCategory::support , { "support_material", "support_material_auto", "support_material_threshold", "support_material_pattern", "support_material_interface_pattern", "support_material_buildplate_only", "support_material_spacing" } }, diff --git a/src/slic3r/GUI/MainFrame.cpp b/src/slic3r/GUI/MainFrame.cpp index 0307adeed63..b1deae00296 100644 --- a/src/slic3r/GUI/MainFrame.cpp +++ b/src/slic3r/GUI/MainFrame.cpp @@ -1960,6 +1960,8 @@ void MainFrame::init_menubar_as_editor() [this](wxCommandEvent&) { wxGetApp().filament_temperature_dialog(); }); append_menu_item(m_calibration_menu, wxID_ANY, _(L("Extruder retraction calibration")), _(L("Create a test print to help you to set your retraction length.")), [this](wxCommandEvent&) { wxGetApp().calibration_retraction_dialog(); }); + append_menu_item(m_calibration_menu, wxID_ANY, _(L("Pressure calibration")), _(L("Create a model for tuning Pressure Linear advance.")), + [this](wxCommandEvent&) { wxGetApp().calibration_pressureadv_dialog(); }); m_calibration_menu->AppendSeparator(); append_menu_item(m_calibration_menu, wxID_ANY, _(L("Bridge flow calibration")), _(L("Create a test print to help you to set your bridge flow ratio.")), [this](wxCommandEvent&) { wxGetApp().bridge_tuning_dialog(); }); diff --git a/src/slic3r/GUI/PresetHints.cpp b/src/slic3r/GUI/PresetHints.cpp index 305e7b642a5..2b2937bbf90 100644 --- a/src/slic3r/GUI/PresetHints.cpp +++ b/src/slic3r/GUI/PresetHints.cpp @@ -108,7 +108,7 @@ std::string PresetHints::cooling_description(const Preset &preset_fil, const Pre const int support_fan_speed = preset_fil.config.opt_int("support_material_fan_speed", 0) == 1 ? 0 : preset_fil.config.get_int("support_material_fan_speed"); const int supp_inter_fan_speed = preset_fil.config.opt_int("support_material_interface_fan_speed", 0) == 1 ? 0 : preset_fil.config.get_int("support_material_interface_fan_speed"); const int bridge_fan_speed = preset_fil.config.opt_int("bridge_fan_speed", 0) == 1 ? 0 : preset_fil.config.get_int("bridge_fan_speed"); - const int bridge_internal_fan_speed = preset_fil.config.opt_int("bridge_internal_fan_speed", 0) == 1 ? 0 : preset_fil.config.get_int("bridge_internal_fan_speed"); + const int internal_bridge_fan_speed = preset_fil.config.opt_int("internal_bridge_fan_speed", 0) == 1 ? 0 : preset_fil.config.get_int("internal_bridge_fan_speed"); const int overhangs_fan_speed = preset_fil.config.opt_int("overhangs_fan_speed", 0) == 1 ? 0 : preset_fil.config.get_int("overhangs_fan_speed"); const int gap_fill_fan_speed = preset_fil.config.opt_int("gap_fill_fan_speed", 0) == 1 ? 0 : preset_fil.config.get_int("gap_fill_fan_speed"); const int disable_fan_first_layers = preset_fil.config.opt_int("disable_fan_first_layers", 0); @@ -133,7 +133,7 @@ std::string PresetHints::cooling_description(const Preset &preset_fil, const Pre format_simple_fan_min_speed(out, min_fan_speed, default_fan_speed, _L("Solid surfaces"), solid_fan_speed); format_simple_fan_speed(out, min_fan_speed, default_fan_speed, _L("Top surfaces"), top_fan_speed); format_double_fan_min_speed(out, min_fan_speed, default_fan_speed, _L("Supports"), support_fan_speed, _L("Support interfaces"), supp_inter_fan_speed); - format_double_fan_speed(out, min_fan_speed, default_fan_speed, _L("Bridges"), bridge_fan_speed, _L("Internal bridges"), bridge_internal_fan_speed); + format_double_fan_speed(out, min_fan_speed, default_fan_speed, _L("Bridges"), bridge_fan_speed, _L("Internal bridges"), internal_bridge_fan_speed); format_simple_fan_min_speed(out, min_fan_speed, default_fan_speed, _L("Perimeter overhangs"), overhangs_fan_speed); format_simple_fan_min_speed(out, min_fan_speed, default_fan_speed, _L("Gap fills"), gap_fill_fan_speed); @@ -160,7 +160,7 @@ std::string PresetHints::cooling_description(const Preset &preset_fil, const Pre surface_list += ","; surface_list += _L("Bridges"); } - if (bridge_internal_fan_speed > 0) { + if (internal_bridge_fan_speed > 0) { surface_list += ","; surface_list += _L("Internal bridges"); } @@ -243,7 +243,7 @@ std::string PresetHints::cooling_description(const Preset &preset_fil, const Pre out += "\n\n" + _L("! 1 for the External perimeters fan speed is Deprecated, please set it to 0 to stop the fan!"); if (preset_fil.config.opt_int("bridge_fan_speed", 0) == 1) out += "\n\n" + _L("! 1 for the Bridge fan speed is Deprecated, please set it to 0 to stop the fan!"); - if (preset_fil.config.opt_int("bridge_internal_fan_speed", 0) == 1) + if (preset_fil.config.opt_int("internal_bridge_fan_speed", 0) == 1) out += "\n\n" + _L("! 1 for the Infill bridge fan speed is Deprecated, please set it to 0 to stop the fan!"); return out.ToStdString();