Make new overhang slowdonw(PrusaSlicer's slowdown) default again.

And tweak it
This commit is contained in:
SoftFever 2023-08-22 18:33:43 +08:00
parent 44a013a5a7
commit 95762fabee
5 changed files with 10 additions and 36 deletions

View file

@ -23,6 +23,8 @@
#include <cstdlib> #include <cstdlib>
#include <chrono> #include <chrono>
#include <math.h> #include <math.h>
#include <stdlib.h>
#include <string>
#include <utility> #include <utility>
#include <string_view> #include <string_view>
@ -4354,6 +4356,7 @@ std::string GCode::_extrude(const ExtrusionPath &path, std::string description,
for (size_t i = 1; i < new_points.size(); i++) { for (size_t i = 1; i < new_points.size(); i++) {
const ProcessedPoint &processed_point = new_points[i]; const ProcessedPoint &processed_point = new_points[i];
const ProcessedPoint &pre_processed_point = new_points[i-1];
Vec2d p = this->point_to_gcode_quantized(processed_point.p); Vec2d p = this->point_to_gcode_quantized(processed_point.p);
if (m_enable_cooling_markers) { if (m_enable_cooling_markers) {
if (enable_overhang_bridge_fan) { if (enable_overhang_bridge_fan) {
@ -4387,7 +4390,7 @@ std::string GCode::_extrude(const ExtrusionPath &path, std::string description,
} }
const double line_length = (p - prev).norm(); const double line_length = (p - prev).norm();
double new_speed = std::max((float)EXTRUDER_CONFIG(slow_down_min_speed), processed_point.speed) * 60.0; double new_speed = std::max((float)EXTRUDER_CONFIG(slow_down_min_speed), pre_processed_point.speed) * 60.0;
if (last_set_speed != new_speed) { if (last_set_speed != new_speed) {
gcode += m_writer.set_speed(new_speed, "", comment); gcode += m_writer.set_speed(new_speed, "", comment);
last_set_speed = new_speed; last_set_speed = new_speed;

View file

@ -1,6 +1,8 @@
#ifndef slic3r_ExtrusionProcessor_hpp_ #ifndef slic3r_ExtrusionProcessor_hpp_
#define slic3r_ExtrusionProcessor_hpp_ #define slic3r_ExtrusionProcessor_hpp_
// This algorithm is copied from PrusaSlicer, original author is Pavel Mikus(pavel.mikus.mail@seznam.cz)
#include "../AABBTreeLines.hpp" #include "../AABBTreeLines.hpp"
//#include "../SupportSpotsGenerator.hpp" //#include "../SupportSpotsGenerator.hpp"
#include "../libslic3r.h" #include "../libslic3r.h"
@ -68,7 +70,7 @@ public:
class CurvatureEstimator class CurvatureEstimator
{ {
static const size_t sliders_count = 3; static const size_t sliders_count = 3;
SlidingWindowCurvatureAccumulator sliders[sliders_count] = {{1.0},{4.0}, {10.0}}; SlidingWindowCurvatureAccumulator sliders[sliders_count] = {{3.0},{9.0}, {16.0}};
public: public:
void add_point(float distance, float angle) void add_point(float distance, float angle)

View file

@ -609,7 +609,7 @@ static ExtrusionEntityCollection traverse_extrusions(const PerimeterGenerator& p
extrusion_paths_append(temp_paths, clip_extrusion(extrusion_path, lower_slices_paths, ClipperLib_Z::ctIntersection), role, extrusion_paths_append(temp_paths, clip_extrusion(extrusion_path, lower_slices_paths, ClipperLib_Z::ctIntersection), role,
is_external ? perimeter_generator.ext_perimeter_flow : perimeter_generator.perimeter_flow); is_external ? perimeter_generator.ext_perimeter_flow : perimeter_generator.perimeter_flow);
if (perimeter_generator.config->enable_overhang_speed && perimeter_generator.config->fuzzy_skin == FuzzySkinType::None) { if (perimeter_generator.config->overhang_speed_classic && perimeter_generator.config->enable_overhang_speed && perimeter_generator.config->fuzzy_skin == FuzzySkinType::None) {
Flow flow = is_external ? perimeter_generator.ext_perimeter_flow : perimeter_generator.perimeter_flow; Flow flow = is_external ? perimeter_generator.ext_perimeter_flow : perimeter_generator.perimeter_flow;
std::map<double, std::vector<Polygons>> clipper_serise; std::map<double, std::vector<Polygons>> clipper_serise;

View file

@ -783,7 +783,7 @@ void PrintConfigDef::init_fff_params()
def->category = L("Speed"); def->category = L("Speed");
def->tooltip = L("Enable this option to use classic mode"); def->tooltip = L("Enable this option to use classic mode");
def->mode = comAdvanced; def->mode = comAdvanced;
def->set_default_value(new ConfigOptionBool{ true }); def->set_default_value(new ConfigOptionBool{ false });
def = this->add("enable_overhang_speed", coBool); def = this->add("enable_overhang_speed", coBool);
def->label = L("Slow down for overhang"); def->label = L("Slow down for overhang");
@ -4607,7 +4607,7 @@ void PrintConfigDef::handle_legacy(t_config_option_key &opt_key, std::string &va
"remove_freq_sweep", "remove_bed_leveling", "remove_extrusion_calibration", "remove_freq_sweep", "remove_bed_leveling", "remove_extrusion_calibration",
"support_transition_line_width", "support_transition_speed", "bed_temperature", "bed_temperature_initial_layer", "support_transition_line_width", "support_transition_speed", "bed_temperature", "bed_temperature_initial_layer",
"can_switch_nozzle_type", "can_add_auxiliary_fan", "extra_flush_volume", "spaghetti_detector", "adaptive_layer_height", "can_switch_nozzle_type", "can_add_auxiliary_fan", "extra_flush_volume", "spaghetti_detector", "adaptive_layer_height",
"z_hop_type", "z_lift_type"/*, "overhang_speed_classic"*/ "z_hop_type", "z_lift_type"
}; };
if (ignore.find(opt_key) != ignore.end()) { if (ignore.find(opt_key) != ignore.end()) {

View file

@ -321,37 +321,6 @@ void ConfigManipulation::update_print_fff_config(DynamicPrintConfig* config, con
is_msg_dlg_already_exist = false; is_msg_dlg_already_exist = false;
} }
//BBS
/*
if (config->opt_enum<PerimeterGeneratorType>("wall_generator") == PerimeterGeneratorType::Arachne &&
config->opt_bool("overhang_speed_classic"))
{
wxString msg_text = _(L("Arachne engine doesn't work with classic overhang speed mode.\n")) + "\n";
if (is_global_config)
msg_text += "\n" + _(L("Turn off classic mode automatically? \n"
"Yes - Enable arachne with classic mode off\n"
"No - Give up using arachne this time"));
MessageDialog dialog(m_msg_dlg_parent, msg_text, "",
wxICON_WARNING | (is_global_config ? wxYES | wxNO : wxOK));
DynamicPrintConfig new_conf = *config;
is_msg_dlg_already_exist = true;
auto answer = dialog.ShowModal();
bool enable_overhang_slow_down_legacy = false;
if (!is_global_config || answer == wxID_YES) {
new_conf.set_key_value("overhang_speed_classic", new ConfigOptionBool(false));
enable_overhang_slow_down_legacy = true;
}
else {
new_conf.set_key_value("wall_generator", new ConfigOptionEnum<PerimeterGeneratorType>(PerimeterGeneratorType::Classic));
}
apply(config, &new_conf);
if (cb_value_change) {
if (!enable_overhang_slow_down_legacy)
cb_value_change("overhang_speed_classic", false);
}
is_msg_dlg_already_exist = false;
}
*/
// BBS // BBS
int filament_cnt = wxGetApp().preset_bundle->filament_presets.size(); int filament_cnt = wxGetApp().preset_bundle->filament_presets.size();
#if 0 #if 0