ENH: put wall order to object level
Jira: [new] Signed-off-by: qing.zhang <qing.zhang@bambulab.com> Change-Id: Idda8b1351ac880602f5da518d1146042dcd77795 (cherry picked from commit c6a5c8233bb013f6e272fef4f6e77748549d81e4)
This commit is contained in:
parent
e0fbc1738f
commit
c5f1c22c51
|
@ -753,6 +753,8 @@ int ConfigBase::load_from_json(const std::string &file, ConfigSubstitutionContex
|
|||
json j;
|
||||
std::list<std::string> different_settings_append;
|
||||
std::string new_support_style;
|
||||
std::string is_infill_first;
|
||||
std::string get_wall_sequence;
|
||||
bool is_project_settings = false;
|
||||
|
||||
CNumericLocalesSetter locales_setter;
|
||||
|
@ -816,6 +818,16 @@ int ConfigBase::load_from_json(const std::string &file, ConfigSubstitutionContex
|
|||
different_settings_append.push_back("support_style");
|
||||
new_support_style = "tree_hybrid";
|
||||
}
|
||||
} else if (opt_key == "wall_infill_order") {
|
||||
//BBS: check wall_infill order to decide if it be different and append to diff_setting_append
|
||||
if (it.value() == "outer wall/inner wall/infill" || it.value() == "infill/outer wall/inner wall" || it.value() == "inner-outer-inner wall/infill") {
|
||||
get_wall_sequence = "wall_seq_diff_to_system";
|
||||
}
|
||||
|
||||
if (it.value() == "infill/outer wall/inner wall" || it.value() == "infill/inner wall/outer wall") {
|
||||
different_settings_append.push_back("is_infill_first");
|
||||
is_infill_first = "true";
|
||||
}
|
||||
}
|
||||
}
|
||||
else if (it.value().is_array()) {
|
||||
|
@ -887,6 +899,12 @@ int ConfigBase::load_from_json(const std::string &file, ConfigSubstitutionContex
|
|||
ConfigOptionEnum<SupportMaterialStyle>* opt = this->option<ConfigOptionEnum<SupportMaterialStyle>>("support_style", true);
|
||||
opt->value = smsTreeHybrid;
|
||||
}
|
||||
|
||||
if (!is_infill_first.empty()) {
|
||||
ConfigOptionBool *opt = this->option<ConfigOptionBool>("is_infill_first", true);
|
||||
opt->value = true;
|
||||
}
|
||||
|
||||
if (is_project_settings) {
|
||||
std::vector<std::string>& different_settings = this->option<ConfigOptionStrings>("different_settings_to_system", true)->values;
|
||||
size_t size = different_settings.size();
|
||||
|
@ -903,6 +921,25 @@ int ConfigBase::load_from_json(const std::string &file, ConfigSubstitutionContex
|
|||
is_first[index] = true;
|
||||
}
|
||||
else {
|
||||
// remove unneeded key
|
||||
if (get_wall_sequence.empty()) {
|
||||
std::string wall_sqe_string = "wall_sequence";
|
||||
int pos=different_settings[index].find(wall_sqe_string);
|
||||
|
||||
if (pos != different_settings[index].npos) {
|
||||
int erase_len = wall_sqe_string.size();
|
||||
if (pos + erase_len < different_settings[index].size() && different_settings[index][pos + erase_len] == ';')
|
||||
erase_len++;
|
||||
different_settings[index].erase(pos, erase_len);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
if (different_settings[index].empty()) {
|
||||
is_first[index] = true;
|
||||
continue;
|
||||
}
|
||||
|
||||
Slic3r::unescape_strings_cstyle(different_settings[index], original_diffs[index]);
|
||||
}
|
||||
}
|
||||
|
@ -916,6 +953,8 @@ int ConfigBase::load_from_json(const std::string &file, ConfigSubstitutionContex
|
|||
index = 0;
|
||||
else if (diff_key == "support_style")
|
||||
index = 0;
|
||||
else if (diff_key == "is_infill_first")
|
||||
index = 0;
|
||||
|
||||
//check whether exist firstly
|
||||
if (!original_diffs[index].empty()) {
|
||||
|
|
|
@ -3449,8 +3449,7 @@ GCode::LayerResult GCode::process_layer(
|
|||
m_last_obj_copy = this_object_copy;
|
||||
this->set_origin(unscale(offset));
|
||||
//FIXME the following code prints regions in the order they are defined, the path is not optimized in any way.
|
||||
bool is_infill_first = print.config().wall_infill_order == WallInfillOrder::InfillInnerOuter ||
|
||||
print.config().wall_infill_order == WallInfillOrder::InfillOuterInner;
|
||||
bool is_infill_first =print.config().is_infill_first;
|
||||
|
||||
auto has_infill = [](const std::vector<ObjectByExtruder::Island::Region> &by_region) {
|
||||
for (auto region : by_region) {
|
||||
|
@ -3735,8 +3734,7 @@ std::string GCode::extrude_loop(ExtrusionLoop loop, std::string description, dou
|
|||
Point last_pos = this->last_pos();
|
||||
if (!m_config.spiral_mode && description == "perimeter") {
|
||||
assert(m_layer != nullptr);
|
||||
bool is_outer_wall_first = m_config.wall_infill_order == WallInfillOrder::OuterInnerInfill
|
||||
|| m_config.wall_infill_order == WallInfillOrder::InfillOuterInner;
|
||||
bool is_outer_wall_first = m_config.wall_sequence == WallSequence::OuterInner;
|
||||
m_seam_placer.place_seam(m_layer, loop, is_outer_wall_first, this->last_pos());
|
||||
} else
|
||||
loop.split_at(last_pos, false);
|
||||
|
|
|
@ -1026,8 +1026,7 @@ float WipingExtrusions::mark_wiping_extrusions(const Print& print, unsigned int
|
|||
if (!object->config().flush_into_infill && !object->config().flush_into_objects && !object->config().flush_into_support)
|
||||
continue;
|
||||
bool wipe_into_infill_only = !object->config().flush_into_objects && object->config().flush_into_infill;
|
||||
bool is_infill_first = print.config().wall_infill_order == WallInfillOrder::InfillInnerOuter ||
|
||||
print.config().wall_infill_order == WallInfillOrder::InfillOuterInner;
|
||||
bool is_infill_first = print.config().is_infill_first;
|
||||
if (is_infill_first != perimeters_done || wipe_into_infill_only) {
|
||||
for (const ExtrusionEntity* ee : layerm->fills.entities) { // iterate through all infill Collections
|
||||
auto* fill = dynamic_cast<const ExtrusionEntityCollection*>(ee);
|
||||
|
@ -1140,8 +1139,7 @@ void WipingExtrusions::ensure_perimeters_infills_order(const Print& print)
|
|||
if (!object->config().flush_into_infill && !object->config().flush_into_objects)
|
||||
continue;
|
||||
|
||||
bool is_infill_first = print.config().wall_infill_order == WallInfillOrder::InfillInnerOuter ||
|
||||
print.config().wall_infill_order == WallInfillOrder::InfillOuterInner;
|
||||
bool is_infill_first = print.config().is_infill_first;
|
||||
for (const ExtrusionEntity* ee : layerm->fills.entities) { // iterate through all infill Collections
|
||||
auto* fill = dynamic_cast<const ExtrusionEntityCollection*>(ee);
|
||||
|
||||
|
|
|
@ -175,7 +175,6 @@ void Layer::make_perimeters()
|
|||
&& config.filter_out_gap_fill.value == other_config.filter_out_gap_fill.value
|
||||
&& config.opt_serialize("inner_wall_line_width") == other_config.opt_serialize("inner_wall_line_width")
|
||||
&& config.detect_thin_wall == other_config.detect_thin_wall
|
||||
//&& config.wall_infill_order == other_config.wall_infill_order
|
||||
&& config.infill_wall_overlap == other_config.infill_wall_overlap
|
||||
&& config.fuzzy_skin == other_config.fuzzy_skin
|
||||
&& config.fuzzy_skin_thickness == other_config.fuzzy_skin_thickness
|
||||
|
|
|
@ -1139,8 +1139,7 @@ void PerimeterGenerator::process_classic()
|
|||
// we continue inwards after having finished the brim
|
||||
// TODO: add test for perimeter order
|
||||
bool is_outer_wall_first =
|
||||
this->print_config->wall_infill_order == WallInfillOrder::OuterInnerInfill ||
|
||||
this->print_config->wall_infill_order == WallInfillOrder::InfillOuterInner;
|
||||
this->object_config->wall_sequence == WallSequence::OuterInner;
|
||||
if (is_outer_wall_first ||
|
||||
//BBS: always print outer wall first when there indeed has brim.
|
||||
(this->layer_id == 0 &&
|
||||
|
@ -1148,7 +1147,7 @@ void PerimeterGenerator::process_classic()
|
|||
this->object_config->brim_width.value > 0))
|
||||
entities.reverse();
|
||||
//BBS. adjust wall generate seq
|
||||
else if (this->print_config->wall_infill_order == WallInfillOrder::InnerOuterInnerInfill)
|
||||
else if (this->object_config->wall_sequence == WallSequence::InnerOuterInner)
|
||||
if (entities.entities.size() > 1){
|
||||
int last_outer=0;
|
||||
int outer = 0;
|
||||
|
@ -1461,9 +1460,7 @@ void PerimeterGenerator::process_arachne()
|
|||
int direction = -1;
|
||||
|
||||
bool is_outer_wall_first =
|
||||
this->print_config->wall_infill_order == WallInfillOrder::OuterInnerInfill ||
|
||||
this->print_config->wall_infill_order == WallInfillOrder::InfillOuterInner ||
|
||||
this->print_config->wall_infill_order == WallInfillOrder::InnerOuterInnerInfill;
|
||||
this->object_config->wall_sequence == WallSequence::OuterInner || this->object_config->wall_sequence == WallSequence::InnerOuterInner;
|
||||
if (is_outer_wall_first) {
|
||||
start_perimeter = 0;
|
||||
end_perimeter = int(perimeters.size());
|
||||
|
@ -1590,7 +1587,7 @@ void PerimeterGenerator::process_arachne()
|
|||
}
|
||||
}
|
||||
// BBS. adjust wall generate seq
|
||||
if (this->print_config->wall_infill_order == WallInfillOrder::InnerOuterInnerInfill){
|
||||
if (this->object_config->wall_sequence == WallSequence::InnerOuterInner) {
|
||||
if (ordered_extrusions.size() > 2) { // 3 walls minimum needed to do inner outer inner ordering
|
||||
int position = 0; // index to run the re-ordering for multiple external perimeters in a single island.
|
||||
int arr_i = 0; // index to run through the walls
|
||||
|
|
|
@ -780,7 +780,7 @@ static std::vector<std::string> s_Preset_print_options {
|
|||
"layer_height", "initial_layer_print_height", "wall_loops", "slice_closing_radius", "spiral_mode", "slicing_mode",
|
||||
"top_shell_layers", "top_shell_thickness", "bottom_shell_layers", "bottom_shell_thickness",
|
||||
"ensure_vertical_shell_thickness", "reduce_crossing_wall", "detect_thin_wall", "detect_overhang_wall",
|
||||
"seam_position", "wall_infill_order", "sparse_infill_density", "sparse_infill_pattern", "sparse_infill_anchor", "sparse_infill_anchor_max",
|
||||
"seam_position", "wall_sequence", "is_infill_first", "sparse_infill_density", "sparse_infill_pattern", "sparse_infill_anchor", "sparse_infill_anchor_max",
|
||||
"top_surface_pattern", "bottom_surface_pattern", "internal_solid_infill_pattern", "infill_direction", "bridge_angle",
|
||||
"minimum_sparse_infill_area", "reduce_infill_retraction", "ironing_pattern", "ironing_type",
|
||||
"ironing_flow", "ironing_speed", "ironing_spacing","ironing_direction",
|
||||
|
|
|
@ -154,6 +154,7 @@ bool Print::invalidate_state_by_config_options(const ConfigOptionResolver & /* n
|
|||
"chamber_temperatures",
|
||||
"required_nozzle_HRC",
|
||||
"upward_compatible_machine",
|
||||
"is_infill_first",
|
||||
//OrcaSlicer
|
||||
"seam_gap",
|
||||
"wipe_speed"
|
||||
|
@ -252,7 +253,7 @@ bool Print::invalidate_state_by_config_options(const ConfigOptionResolver & /* n
|
|||
//|| opt_key == "resolution"
|
||||
//BBS: when enable arc fitting, we must re-generate perimeter
|
||||
|| opt_key == "enable_arc_fitting"
|
||||
|| opt_key == "wall_infill_order") {
|
||||
|| opt_key == "wall_sequence") {
|
||||
osteps.emplace_back(posPerimeters);
|
||||
osteps.emplace_back(posInfill);
|
||||
osteps.emplace_back(posSupportMaterial);
|
||||
|
|
|
@ -163,6 +163,15 @@ static t_config_enum_values s_keys_map_WallInfillOrder {
|
|||
};
|
||||
CONFIG_OPTION_ENUM_DEFINE_STATIC_MAPS(WallInfillOrder)
|
||||
|
||||
//BBS
|
||||
static t_config_enum_values s_keys_map_WallSequence {
|
||||
{ "inner wall/outer wall", int(WallSequence::InnerOuter) },
|
||||
{ "outer wall/inner wall", int(WallSequence::OuterInner) },
|
||||
{ "inner-outer-inner wall", int(WallSequence::InnerOuterInner)}
|
||||
|
||||
};
|
||||
CONFIG_OPTION_ENUM_DEFINE_STATIC_MAPS(WallSequence)
|
||||
|
||||
//BBS
|
||||
static t_config_enum_values s_keys_map_PrintSequence {
|
||||
{ "by layer", int(PrintSequence::ByLayer) },
|
||||
|
@ -1160,23 +1169,26 @@ void PrintConfigDef::init_fff_params()
|
|||
def->mode = comAdvanced;
|
||||
def->set_default_value(new ConfigOptionFloat(60));
|
||||
|
||||
def = this->add("wall_infill_order", coEnum);
|
||||
def->label = L("Order of inner wall/outer wall/infil");
|
||||
def = this->add("wall_sequence", coEnum);
|
||||
def->label = L("Order of walls");
|
||||
def->category = L("Quality");
|
||||
def->tooltip = L("Print sequence of inner wall, outer wall and infill. ");
|
||||
def->enum_keys_map = &ConfigOptionEnum<WallInfillOrder>::get_enum_values();
|
||||
def->enum_values.push_back("inner wall/outer wall/infill");
|
||||
def->enum_values.push_back("outer wall/inner wall/infill");
|
||||
def->enum_values.push_back("infill/inner wall/outer wall");
|
||||
def->enum_values.push_back("infill/outer wall/inner wall");
|
||||
def->enum_values.push_back("inner-outer-inner wall/infill");
|
||||
def->enum_labels.push_back(L("inner/outer/infill"));
|
||||
def->enum_labels.push_back(L("outer/inner/infill"));
|
||||
def->enum_labels.push_back(L("infill/inner/outer"));
|
||||
def->enum_labels.push_back(L("infill/outer/inner"));
|
||||
def->enum_labels.push_back(L("inner-outer-inner/infill"));
|
||||
def->tooltip = L("Print sequence of inner wall and outer wall. ");
|
||||
def->enum_keys_map = &ConfigOptionEnum<WallSequence>::get_enum_values();
|
||||
def->enum_values.push_back("inner wall/outer wall");
|
||||
def->enum_values.push_back("outer wall/inner wall");
|
||||
def->enum_values.push_back("inner-outer-inner wall");
|
||||
def->enum_labels.push_back(L("inner/outer"));
|
||||
def->enum_labels.push_back(L("outer/inner"));
|
||||
def->enum_labels.push_back(L("inner wall/outer wall/inner wall"));
|
||||
def->mode = comAdvanced;
|
||||
def->set_default_value(new ConfigOptionEnum<WallInfillOrder>(WallInfillOrder::InnerOuterInfill));
|
||||
def->set_default_value(new ConfigOptionEnum<WallSequence>(WallSequence::InnerOuter));
|
||||
|
||||
def = this->add("is_infill_first",coBool);
|
||||
def->label = L("Print infill first");
|
||||
def->tooltip = L("Order of wall/infill. false means print wall first. ");
|
||||
def->category = L("Quality");
|
||||
def->mode = comAdvanced;
|
||||
def->set_default_value(new ConfigOptionBool{false});
|
||||
|
||||
def = this->add("extruder", coInt);
|
||||
def->gui_type = ConfigOptionDef::GUIType::i_enum_open;
|
||||
|
@ -4413,6 +4425,19 @@ void PrintConfigDef::handle_legacy(t_config_option_key &opt_key, std::string &va
|
|||
}
|
||||
} else if (opt_key == "overhang_fan_threshold" && value == "5%") {
|
||||
value = "10%";
|
||||
} else if( opt_key == "wall_infill_order" ) {
|
||||
if (value == "inner wall/outer wall/infill" || value == "infill/inner wall/outer wall") {
|
||||
opt_key = "wall_sequence";
|
||||
value = "inner wall/outer wall";
|
||||
} else if (value == "outer wall/inner wall/infill" || value == "infill/outer wall/inner wall") {
|
||||
opt_key = "wall_sequence";
|
||||
value = "outer wall/inner wall";
|
||||
} else if (value == "inner-outer-inner wall/infill") {
|
||||
opt_key = "wall_sequence";
|
||||
value = "inner-outer-inner wall";
|
||||
} else {
|
||||
opt_key = "wall_sequence";
|
||||
}
|
||||
}
|
||||
|
||||
// Ignore the following obsolete configuration keys:
|
||||
|
|
|
@ -75,6 +75,14 @@ enum class WallInfillOrder {
|
|||
InnerOuterInnerInfill,
|
||||
Count,
|
||||
};
|
||||
|
||||
// BBS
|
||||
enum class WallSequence {
|
||||
InnerOuter,
|
||||
OuterInner,
|
||||
InnerOuterInner,
|
||||
Count,
|
||||
};
|
||||
//BBS
|
||||
enum class PrintSequence {
|
||||
ByLayer,
|
||||
|
@ -718,6 +726,7 @@ PRINT_CONFIG_CLASS_DEFINE(
|
|||
// BBS
|
||||
((ConfigOptionBool, flush_into_infill))
|
||||
((ConfigOptionBool, flush_into_support))
|
||||
((ConfigOptionEnum<WallSequence>, wall_sequence))
|
||||
// BBS
|
||||
((ConfigOptionFloat, tree_support_branch_distance))
|
||||
((ConfigOptionFloat, tree_support_branch_diameter))
|
||||
|
@ -970,7 +979,6 @@ PRINT_CONFIG_CLASS_DERIVED_DEFINE(
|
|||
((ConfigOptionFloat, initial_layer_infill_speed))
|
||||
((ConfigOptionInts, nozzle_temperature_initial_layer))
|
||||
((ConfigOptionInts, full_fan_speed_layer))
|
||||
((ConfigOptionEnum<WallInfillOrder>,wall_infill_order))
|
||||
((ConfigOptionInts, fan_max_speed))
|
||||
((ConfigOptionFloats, max_layer_height))
|
||||
((ConfigOptionInts, fan_min_speed))
|
||||
|
@ -1029,7 +1037,7 @@ PRINT_CONFIG_CLASS_DERIVED_DEFINE(
|
|||
((ConfigOptionFloat, top_surface_jerk))
|
||||
((ConfigOptionFloat, initial_layer_jerk))
|
||||
((ConfigOptionFloat, travel_jerk))
|
||||
|
||||
((ConfigOptionBool, is_infill_first))
|
||||
// BBS: move from PrintObjectConfig
|
||||
((ConfigOptionBool, independent_support_layer_height))
|
||||
((ConfigOptionBool, exclude_object))
|
||||
|
|
|
@ -555,7 +555,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_infill_order", "outer_wall_line_width",
|
||||
"seam_position","seam_gap","wipe_speed", "wall_sequence", "outer_wall_line_width",
|
||||
"inner_wall_speed", "outer_wall_speed" })
|
||||
toggle_field(el, have_perimeters);
|
||||
|
||||
|
|
|
@ -74,9 +74,10 @@ std::map<std::string, std::vector<SimpleSettingData>> SettingsFactory::OBJECT_C
|
|||
{
|
||||
{ L("Quality"), {{"layer_height", "",1},
|
||||
//{"initial_layer_print_height", "",2},
|
||||
{"seam_position", "",2}, {"seam_gap", "",3}, {"wipe_speed", "",4},
|
||||
{"slice_closing_radius", "",5}, {"resolution", "",6},
|
||||
{"xy_hole_compensation", "",7}, {"xy_contour_compensation", "",8}, {"elefant_foot_compensation", "",9}
|
||||
{"wall_sequence","",2},
|
||||
{"seam_position", "",3}, {"seam_gap", "",4}, {"wipe_speed", "",5},
|
||||
{"slice_closing_radius", "",6}, {"resolution", "",7},
|
||||
{"xy_hole_compensation", "",8}, {"xy_contour_compensation", "",9}, {"elefant_foot_compensation", "",10}
|
||||
}},
|
||||
{ L("Support"), {{"brim_type", "",1},{"brim_width", "",2},{"brim_object_gap", "",3},
|
||||
{"enable_support", "",4},{"support_type", "",5},{"support_threshold_angle", "",6},{"support_on_build_plate_only", "",7},
|
||||
|
|
|
@ -1886,7 +1886,8 @@ void TabPrint::build()
|
|||
optgroup->append_single_option_line("min_feature_size");
|
||||
|
||||
optgroup = page->new_optgroup(L("Advanced"), L"param_advanced");
|
||||
optgroup->append_single_option_line("wall_infill_order");
|
||||
optgroup->append_single_option_line("wall_sequence");
|
||||
optgroup->append_single_option_line("is_infill_first");
|
||||
optgroup->append_single_option_line("bridge_flow");
|
||||
optgroup->append_single_option_line("thick_bridges");
|
||||
optgroup->append_single_option_line("top_solid_infill_flow_ratio");
|
||||
|
|
Loading…
Reference in New Issue