ENH: add small perimeter speed and threshold
The original param is added by Prusa. Thanks orca for adding threshold. 1. Re add small perimeter speed and threhold. github: #2221 Change-Id: I35b269b26f085d80f0edca28650bb21fc04898d7
This commit is contained in:
parent
0ece8534db
commit
bdaba79455
|
@ -3888,18 +3888,20 @@ std::string GCode::extrude_loop(ExtrusionLoop loop, std::string description, dou
|
|||
loop.clip_end(clip_length, &paths);
|
||||
if (paths.empty()) return "";
|
||||
|
||||
// BBS: remove small small_perimeter_speed config, and will absolutely
|
||||
// remove related code if no other issue in the coming release.
|
||||
double small_peri_speed=-1;
|
||||
// apply the small perimeter speed
|
||||
//if (is_perimeter(paths.front().role()) && loop.length() <= SMALL_PERIMETER_LENGTH && speed == -1)
|
||||
// speed = m_config.small_perimeter_speed.get_abs_value(m_config.inner_wall_speed);
|
||||
if (speed==-1 && loop.length() <= SMALL_PERIMETER_LENGTH(m_config.small_perimeter_threshold.value))
|
||||
small_peri_speed = m_config.small_perimeter_speed.get_abs_value(m_config.outer_wall_speed);
|
||||
|
||||
// extrude along the path
|
||||
std::string gcode;
|
||||
bool is_small_peri=false;
|
||||
for (ExtrusionPaths::iterator path = paths.begin(); path != paths.end(); ++path) {
|
||||
// description += ExtrusionLoop::role_to_string(loop.loop_role());
|
||||
// description += ExtrusionEntity::role_to_string(path->role);
|
||||
gcode += this->_extrude(*path, description, speed);
|
||||
//BBS: Small perimeter has been considered in curva and overhang detection in speed generater.
|
||||
is_small_peri=(small_peri_speed>0 && is_perimeter(path->role()) && !is_bridge(path->role()) && path->get_overhang_degree()==0);
|
||||
gcode += this->_extrude(*path, description, is_small_peri?small_peri_speed:speed);
|
||||
}
|
||||
|
||||
//BBS: don't reset acceleration when printing first layer. During first layer, acceleration is always same value.
|
||||
|
|
|
@ -3385,6 +3385,7 @@ double Model::findMaxSpeed(const ModelObject* object) {
|
|||
double solidInfillSpeedObj = Model::printSpeedMap.solidInfillSpeed;
|
||||
double topSolidInfillSpeedObj = Model::printSpeedMap.topSolidInfillSpeed;
|
||||
double supportSpeedObj = Model::printSpeedMap.supportSpeed;
|
||||
double smallPerimeterSpeedObj = Model::printSpeedMap.smallPerimeterSpeed;
|
||||
for (std::string objectKey : objectKeys) {
|
||||
if (objectKey == "inner_wall_speed"){
|
||||
perimeterSpeedObj = object->config.opt_float(objectKey);
|
||||
|
@ -3400,8 +3401,10 @@ double Model::findMaxSpeed(const ModelObject* object) {
|
|||
supportSpeedObj = object->config.opt_float(objectKey);
|
||||
if (objectKey == "outer_wall_speed")
|
||||
externalPerimeterSpeedObj = object->config.opt_float(objectKey);
|
||||
if (objectKey == "small_perimeter_speed")
|
||||
smallPerimeterSpeedObj = object->config.opt_float(objectKey);
|
||||
}
|
||||
objMaxSpeed = std::max(perimeterSpeedObj, std::max(externalPerimeterSpeedObj, std::max(infillSpeedObj, std::max(solidInfillSpeedObj, std::max(topSolidInfillSpeedObj, std::max(supportSpeedObj, objMaxSpeed))))));
|
||||
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.;
|
||||
return objMaxSpeed;
|
||||
}
|
||||
|
|
|
@ -1439,6 +1439,7 @@ struct GlobalSpeedMap
|
|||
double solidInfillSpeed;
|
||||
double topSolidInfillSpeed;
|
||||
double supportSpeed;
|
||||
double smallPerimeterSpeed;
|
||||
double maxSpeed;
|
||||
Polygon bed_poly;
|
||||
};
|
||||
|
|
|
@ -839,6 +839,7 @@ static std::vector<std::string> s_Preset_print_options {
|
|||
"seam_gap", "wipe_speed", "top_solid_infill_flow_ratio", "initial_layer_flow_ratio",
|
||||
"default_jerk", "outer_wall_jerk", "inner_wall_jerk", "infill_jerk", "top_surface_jerk", "initial_layer_jerk", "travel_jerk",
|
||||
"filter_out_gap_fill", "mmu_segmented_region_max_width", "mmu_segmented_region_interlocking_depth",
|
||||
"small_perimeter_speed", "small_perimeter_threshold",
|
||||
// calib
|
||||
"print_flow_ratio",
|
||||
//Orca
|
||||
|
|
|
@ -1168,6 +1168,28 @@ void PrintConfigDef::init_fff_params()
|
|||
def->mode = comAdvanced;
|
||||
def->set_default_value(new ConfigOptionFloat(60));
|
||||
|
||||
|
||||
def = this->add("small_perimeter_speed", coFloatOrPercent);
|
||||
def->label = L("Small perimeters");
|
||||
def->category = L("Speed");
|
||||
def->tooltip = L("This setting will affect the speed of perimeters having radius <= small perimeter threshold"
|
||||
"(usually holes). If expressed as percentage (for example: 80%) it will be calculated on"
|
||||
"the outer wall speed setting above. Set to zero for auto.");
|
||||
def->sidetext = L("mm/s or %");
|
||||
def->ratio_over = "outer_wall_speed";
|
||||
def->min = 0;
|
||||
def->mode = comAdvanced;
|
||||
def->set_default_value(new ConfigOptionFloatOrPercent(50, true));
|
||||
|
||||
def = this->add("small_perimeter_threshold", coFloat);
|
||||
def->label = L("Small perimter threshold");
|
||||
def->category = L("Speed");
|
||||
def->tooltip = L("This sets the threshold for small perimeter length. Default threshold is 0mm");
|
||||
def->sidetext = L("mm");
|
||||
def->min = 0;
|
||||
def->mode = comAdvanced;
|
||||
def->set_default_value(new ConfigOptionFloat(0));
|
||||
|
||||
def = this->add("wall_sequence", coEnum);
|
||||
def->label = L("Order of walls");
|
||||
def->category = L("Quality");
|
||||
|
@ -4465,7 +4487,7 @@ void PrintConfigDef::handle_legacy(t_config_option_key &opt_key, std::string &va
|
|||
// BBS
|
||||
, "support_sharp_tails","support_remove_small_overhangs", "support_with_sheath",
|
||||
"tree_support_branch_diameter_angle", "tree_support_collision_resolution", "tree_support_with_infill",
|
||||
"small_perimeter_speed", "max_volumetric_speed", "max_print_speed",
|
||||
"max_volumetric_speed", "max_print_speed",
|
||||
"support_closing_radius",
|
||||
"remove_freq_sweep", "remove_bed_leveling", "remove_extrusion_calibration",
|
||||
"support_transition_line_width", "support_transition_speed", "bed_temperature", "bed_temperature_initial_layer",
|
||||
|
|
|
@ -805,6 +805,8 @@ PRINT_CONFIG_CLASS_DEFINE(
|
|||
((ConfigOptionInt, top_shell_layers))
|
||||
((ConfigOptionFloat, top_shell_thickness))
|
||||
((ConfigOptionFloat, top_surface_speed))
|
||||
((ConfigOptionFloatOrPercent, small_perimeter_speed))
|
||||
((ConfigOptionFloat, small_perimeter_threshold))
|
||||
//BBS
|
||||
((ConfigOptionBool, enable_overhang_speed))
|
||||
((ConfigOptionFloat, overhang_1_4_speed))
|
||||
|
|
|
@ -906,6 +906,8 @@ bool PrintObject::invalidate_state_by_config_options(
|
|||
|| opt_key == "overhang_4_4_speed"
|
||||
|| 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"
|
||||
|
|
|
@ -67,7 +67,7 @@ static constexpr double SPARSE_INFILL_RESOLUTION = 0.04;
|
|||
static constexpr double SUPPORT_RESOLUTION = 0.1;
|
||||
#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.
|
||||
|
|
|
@ -536,7 +536,7 @@ void ConfigManipulation::toggle_print_fff_options(DynamicPrintConfig *config, co
|
|||
bool have_perimeters = config->opt_int("wall_loops") > 0;
|
||||
for (auto el : { "ensure_vertical_shell_thickness", "detect_thin_wall", "detect_overhang_wall",
|
||||
"seam_position","seam_gap","wipe_speed", "wall_sequence", "outer_wall_line_width",
|
||||
"inner_wall_speed", "outer_wall_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;
|
||||
|
|
|
@ -1954,6 +1954,8 @@ void TabPrint::build()
|
|||
optgroup = page->new_optgroup(L("Other layers speed"), L"param_speed", 15);
|
||||
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");
|
||||
|
|
Loading…
Reference in New Issue