small perimeter threshold

This commit is contained in:
SoftFever 2022-10-24 22:35:40 +08:00
parent 397e0f0a29
commit dd77599dea
12 changed files with 33 additions and 10 deletions

View file

@ -1030,6 +1030,12 @@ msgstr "自动Brim"
msgid "Outer wall speed"
msgstr "外墙速度"
msgid "Small perimeters"
msgstr "微小部位"
msgid "Small perimeters threshold"
msgstr "微小部位周长阈值"
msgid "Plate"
msgstr "盘"

Binary file not shown.

View file

@ -3324,7 +3324,7 @@ std::string GCode::extrude_loop(ExtrusionLoop loop, std::string description, dou
// BBS: remove small small_perimeter_speed config, and will absolutely
// remove related code if no other issue in the coming release.
// apply the small perimeter speed
if (is_perimeter(paths.front().role()) && loop.length() <= SMALL_PERIMETER_LENGTH && speed == -1)
if (is_perimeter(paths.front().role()) && loop.length() <= SMALL_PERIMETER_LENGTH(m_config.small_perimeter_threshold.value) && speed == -1)
speed = m_config.small_perimeter_speed.get_abs_value(m_config.outer_wall_speed);
// extrude along the path

View file

@ -2786,7 +2786,7 @@ double Model::findMaxSpeed(const ModelObject* object) {
if (objectKey == "outer_wall_speed")
externalPerimeterSpeedObj = object->config.opt_float(objectKey);
if (objectKey == "small_perimeter_speed")
smallPerimeterSpeedObj = object->config.opt_float(objectKey);
smallPerimeterSpeedObj = object->config.get_abs_value(objectKey);
}
objMaxSpeed = std::max(perimeterSpeedObj, std::max(externalPerimeterSpeedObj, std::max(infillSpeedObj, std::max(solidInfillSpeedObj, std::max(topSolidInfillSpeedObj, std::max(supportSpeedObj, std::max(smallPerimeterSpeedObj, objMaxSpeed)))))));
if (objMaxSpeed <= 0) objMaxSpeed = 250.;

View file

@ -695,7 +695,7 @@ static std::vector<std::string> s_Preset_print_options {
#ifdef HAS_PRESSURE_EQUALIZER
"max_volumetric_extrusion_rate_slope_positive", "max_volumetric_extrusion_rate_slope_negative",
#endif /* HAS_PRESSURE_EQUALIZER */
"inner_wall_speed", "outer_wall_speed", "small_perimeter_speed", "sparse_infill_speed", "internal_solid_infill_speed",
"inner_wall_speed", "outer_wall_speed", "small_perimeter_speed", "small_perimeter_threshold", "sparse_infill_speed", "internal_solid_infill_speed",
"top_surface_speed", "support_speed", "support_object_xy_distance", "support_interface_speed",
"bridge_speed", "bridge_angle", "gap_infill_speed", "travel_speed", "travel_speed_z", "initial_layer_speed",
"outer_wall_acceleration", "inner_wall_acceleration", "initial_layer_acceleration", "top_surface_acceleration", "default_acceleration", "travel_acceleration", "skirt_loops", "skirt_distance", "skirt_height", "draft_shield",

View file

@ -980,7 +980,16 @@ void PrintConfigDef::init_fff_params()
def->ratio_over = "outer_wall_speed";
def->min = 0;
def->mode = comAdvanced;
def->set_default_value(new ConfigOptionFloatOrPercent(15, false));
def->set_default_value(new ConfigOptionFloatOrPercent(100, true));
def = this->add("small_perimeter_threshold", coFloat);
def->label = L("Small perimeters threshold");
def->category = L("Speed");
def->tooltip = L("This sets the threshold for small perimeter length. Default threshold is 6.5mm");
def->sidetext = L("mm");
def->min = 0;
def->mode = comAdvanced;
def->set_default_value(new ConfigOptionFloat(6.5));
def = this->add("wall_infill_order", coEnum);
def->label = L("Order of inner wall/outer wall/infil");
@ -3755,7 +3764,6 @@ void PrintConfigDef::handle_legacy(t_config_option_key &opt_key, std::string &va
opt_key == "top_surface_speed" ||
opt_key == "support_interface_speed" ||
opt_key == "outer_wall_speed" ||
opt_key == "small_perimeter_speed" ||
opt_key == "support_object_xy_distance") && value.find("%") != std::string::npos) {
//BBS: this is old profile in which value is expressed as percentage.
//But now these key-value must be absolute value.

View file

@ -672,6 +672,7 @@ PRINT_CONFIG_CLASS_DEFINE(
((ConfigOptionFloat, outer_wall_line_width))
((ConfigOptionFloat, outer_wall_speed))
((ConfigOptionFloatOrPercent, small_perimeter_speed))
((ConfigOptionFloat, small_perimeter_threshold))
((ConfigOptionFloat, infill_direction))
((ConfigOptionPercent, sparse_infill_density))
((ConfigOptionEnum<InfillPattern>, sparse_infill_pattern))
@ -1281,7 +1282,12 @@ public:
const ConfigOption* option(const t_config_option_key &opt_key) const { return m_data.option(opt_key); }
int opt_int(const t_config_option_key &opt_key) const { return m_data.opt_int(opt_key); }
int extruder() const { return opt_int("extruder"); }
double opt_float(const t_config_option_key &opt_key) const { return m_data.opt_float(opt_key); }
double opt_float(const t_config_option_key &opt_key) const {
return m_data.opt_float(opt_key);
}
double get_abs_value(const t_config_option_key &opt_key) const {
return m_data.get_abs_value(opt_key);
}
std::string opt_serialize(const t_config_option_key &opt_key) const { return m_data.opt_serialize(opt_key); }
// Return an optional timestamp of this object.

View file

@ -657,6 +657,7 @@ bool PrintObject::invalidate_state_by_config_options(
// BBS: brim generation depends on printing speed
|| opt_key == "outer_wall_speed"
|| opt_key == "small_perimeter_speed"
|| opt_key == "small_perimeter_threshold"
|| opt_key == "sparse_infill_speed"
|| opt_key == "inner_wall_speed"
|| opt_key == "support_speed"
@ -832,6 +833,7 @@ bool PrintObject::invalidate_state_by_config_options(
|| opt_key == "bridge_speed"
|| opt_key == "outer_wall_speed"
|| opt_key == "small_perimeter_speed"
|| opt_key == "small_perimeter_threshold"
|| opt_key == "sparse_infill_speed"
|| opt_key == "inner_wall_speed"
|| opt_key == "internal_solid_infill_speed"

View file

@ -66,7 +66,7 @@ static constexpr double SPARSE_INFILL_RESOLUTION = 0.04;
static constexpr double SUPPORT_RESOLUTION = 0.05;
#define SCALED_SUPPORT_RESOLUTION (SUPPORT_RESOLUTION / SCALING_FACTOR)
// Maximum perimeter length for the loop to apply the small perimeter speed.
#define SMALL_PERIMETER_LENGTH ((6.5 / SCALING_FACTOR) * 2 * PI)
#define SMALL_PERIMETER_LENGTH(LENGTH) (((LENGTH) / SCALING_FACTOR) * 2 * PI)
static constexpr double INSET_OVERLAP_TOLERANCE = 0.4;
// 3mm ring around the top / bottom / bridging areas.
//FIXME This is quite a lot.

View file

@ -451,7 +451,7 @@ void ConfigManipulation::toggle_print_fff_options(DynamicPrintConfig *config, co
bool have_perimeters = config->opt_int("wall_loops") > 0;
for (auto el : { "detect_thin_wall", "detect_overhang_wall",
"seam_position", "wall_infill_order", "outer_wall_line_width",
"inner_wall_speed", "outer_wall_speed", "small_perimeter_speed" })
"inner_wall_speed", "outer_wall_speed", "small_perimeter_speed", "small_perimeter_threshold" })
toggle_field(el, have_perimeters);
bool have_infill = config->option<ConfigOptionPercent>("sparse_infill_density")->value > 0;

View file

@ -1823,6 +1823,7 @@ void TabPrint::build()
optgroup->append_single_option_line("outer_wall_speed");
optgroup->append_single_option_line("inner_wall_speed");
optgroup->append_single_option_line("small_perimeter_speed");
optgroup->append_single_option_line("small_perimeter_threshold");
optgroup->append_single_option_line("sparse_infill_speed");
optgroup->append_single_option_line("internal_solid_infill_speed");
optgroup->append_single_option_line("top_surface_speed");

View file

@ -11,4 +11,4 @@ if(NOT DEFINED BBL_INTERNAL_TESTING)
set(BBL_INTERNAL_TESTING "1")
endif()
set(SLIC3R_VERSION "01.03.00.12")
set(SoftFever_VERSION "1.3.2-beta")
set(SoftFever_VERSION "1.3.2 beta2")