Skip to content

Commit

Permalink
Make new overhang slowdonw(PrusaSlicer's slowdown) default again.
Browse files Browse the repository at this point in the history
And tweak it
  • Loading branch information
SoftFever committed Aug 22, 2023
1 parent 44a013a commit 95762fa
Show file tree
Hide file tree
Showing 5 changed files with 10 additions and 36 deletions.
5 changes: 4 additions & 1 deletion src/libslic3r/GCode.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,8 @@
#include <cstdlib>
#include <chrono>
#include <math.h>
#include <stdlib.h>
#include <string>
#include <utility>
#include <string_view>

Expand Down Expand Up @@ -4354,6 +4356,7 @@ std::string GCode::_extrude(const ExtrusionPath &path, std::string description,

for (size_t i = 1; i < new_points.size(); 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);
if (m_enable_cooling_markers) {
if (enable_overhang_bridge_fan) {
Expand Down Expand Up @@ -4387,7 +4390,7 @@ std::string GCode::_extrude(const ExtrusionPath &path, std::string description,
}

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) {
gcode += m_writer.set_speed(new_speed, "", comment);
last_set_speed = new_speed;
Expand Down
4 changes: 3 additions & 1 deletion src/libslic3r/GCode/ExtrusionProcessor.hpp
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
#ifndef slic3r_ExtrusionProcessor_hpp_
#define slic3r_ExtrusionProcessor_hpp_

// This algorithm is copied from PrusaSlicer, original author is Pavel Mikus([email protected])

#include "../AABBTreeLines.hpp"
//#include "../SupportSpotsGenerator.hpp"
#include "../libslic3r.h"
Expand Down Expand Up @@ -68,7 +70,7 @@ class SlidingWindowCurvatureAccumulator
class CurvatureEstimator
{
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:
void add_point(float distance, float angle)
Expand Down
2 changes: 1 addition & 1 deletion src/libslic3r/PerimeterGenerator.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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,
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;
std::map<double, std::vector<Polygons>> clipper_serise;
Expand Down
4 changes: 2 additions & 2 deletions src/libslic3r/PrintConfig.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -783,7 +783,7 @@ void PrintConfigDef::init_fff_params()
def->category = L("Speed");
def->tooltip = L("Enable this option to use classic mode");
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->label = L("Slow down for overhang");
Expand Down Expand Up @@ -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",
"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",
"z_hop_type", "z_lift_type"/*, "overhang_speed_classic"*/
"z_hop_type", "z_lift_type"
};

if (ignore.find(opt_key) != ignore.end()) {
Expand Down
31 changes: 0 additions & 31 deletions src/slic3r/GUI/ConfigManipulation.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -321,37 +321,6 @@ void ConfigManipulation::update_print_fff_config(DynamicPrintConfig* config, con
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
int filament_cnt = wxGetApp().preset_bundle->filament_presets.size();
#if 0
Expand Down

0 comments on commit 95762fa

Please sign in to comment.