ENH: add back even-odd mode

Add back even-odd mode to support slicing 3DLabPrint
airplane models

Signed-off-by: salt.wei <salt.wei@bambulab.com>
Change-Id: Id3efcfb0ecf98350add7a19885750df74d4fdedd
(cherry picked from commit 553371e61e35355b3a73694d4cf9acb179b2a427)
This commit is contained in:
salt.wei 2022-10-26 16:20:18 +08:00 committed by Lane.Wei
parent 5791ca7e8d
commit c1599aa138
7 changed files with 28 additions and 12 deletions

View File

@ -690,7 +690,7 @@ bool Preset::is_custom_defined()
}
static std::vector<std::string> s_Preset_print_options {
"layer_height", "initial_layer_print_height", "wall_loops", "slice_closing_radius", "spiral_mode",
"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", "top_surface_pattern", "bottom_surface_pattern",

View File

@ -2323,6 +2323,20 @@ void PrintConfigDef::init_fff_params()
def->mode = comAdvanced;
def->set_default_value(new ConfigOptionFloat(0.049));
def = this->add("slicing_mode", coEnum);
def->label = L("Slicing Mode");
def->category = L("Other");
def->tooltip = L("Use \"Even-odd\" for 3DLabPrint airplane models. Use \"Close holes\" to close all holes in the model.");
def->enum_keys_map = &ConfigOptionEnum<SlicingMode>::get_enum_values();
def->enum_values.push_back("regular");
def->enum_values.push_back("even_odd");
def->enum_values.push_back("close_holes");
def->enum_labels.push_back(L("Regular"));
def->enum_labels.push_back(L("Even-odd"));
def->enum_labels.push_back(L("Close holes"));
def->mode = comAdvanced;
def->set_default_value(new ConfigOptionEnum<SlicingMode>(SlicingMode::Regular));
def = this->add("enable_support", coBool);
//BBS: remove material behind support
def->label = L("Enable support");
@ -3703,7 +3717,7 @@ void PrintConfigDef::handle_legacy(t_config_option_key &opt_key, std::string &va
, "support_sharp_tails","remove_small_overhangs", "support_with_sheath",
"tree_support_branch_diameter_angle", "tree_support_collision_resolution",
"small_perimeter_speed", "max_volumetric_speed", "max_print_speed",
"support_bottom_z_distance", "support_closing_radius", "slicing_mode",
"support_bottom_z_distance", "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",
"can_switch_nozzle_type", "can_add_auxiliary_fan", "extra_flush_volume", "spaghetti_detector"

View File

@ -609,6 +609,7 @@ PRINT_CONFIG_CLASS_DEFINE(
((ConfigOptionInt, raft_layers))
((ConfigOptionEnum<SeamPosition>, seam_position))
((ConfigOptionFloat, slice_closing_radius))
((ConfigOptionEnum<SlicingMode>, slicing_mode))
((ConfigOptionBool, enable_support))
// Automatic supports (generated based on support_threshold_angle).
((ConfigOptionEnum<SupportType>, support_type))

View File

@ -703,7 +703,8 @@ bool PrintObject::invalidate_state_by_config_options(
|| opt_key == "adaptive_layer_height"
|| opt_key == "raft_layers"
|| opt_key == "raft_contact_distance"
|| opt_key == "slice_closing_radius") {
|| opt_key == "slice_closing_radius"
|| opt_key == "slicing_mode") {
steps.emplace_back(posSlice);
} else if (
opt_key == "elefant_foot_compensation"

View File

@ -141,13 +141,11 @@ static std::vector<VolumeSlices> slice_volumes_inner(
//BBS: 0.0025mm is safe enough to simplify the data to speed slicing up for high-resolution model.
//Also has on influence on arc fitting which has default resolution 0.0125mm.
params_base.resolution = 0.0025;
//BBS: remove slice mode, always regular
//switch (print_object_config.slicing_mode.value) {
//case SlicingMode::Regular: params_base.mode = MeshSlicingParams::SlicingMode::Regular; break;
//case SlicingMode::EvenOdd: params_base.mode = MeshSlicingParams::SlicingMode::EvenOdd; break;
//case SlicingMode::CloseHoles: params_base.mode = MeshSlicingParams::SlicingMode::Positive; break;
//}
params_base.mode = MeshSlicingParams::SlicingMode::Regular;
switch (print_object_config.slicing_mode.value) {
case SlicingMode::Regular: params_base.mode = MeshSlicingParams::SlicingMode::Regular; break;
case SlicingMode::EvenOdd: params_base.mode = MeshSlicingParams::SlicingMode::EvenOdd; break;
case SlicingMode::CloseHoles: params_base.mode = MeshSlicingParams::SlicingMode::Positive; break;
}
params_base.mode_below = params_base.mode;

View File

@ -73,7 +73,8 @@ std::map<std::string, std::vector<SimpleSettingData>> SettingsFactory::OBJECT_C
{ L("Quality"), {{"layer_height", "",1},
//{"initial_layer_print_height", "",2},
{"adaptive_layer_height", "",2},{"seam_position", "",3},
{"xy_hole_compensation", "",4}, {"xy_contour_compensation", "",5}, {"elefant_foot_compensation", "",6}
{"slice_closing_radius", "",4}, {"resolution", "",5},
{"xy_hole_compensation", "",6}, {"xy_contour_compensation", "",7}, {"elefant_foot_compensation", "",8}
}},
{ 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},
@ -89,7 +90,7 @@ std::map<std::string, std::vector<SimpleSettingData>> SettingsFactory::OBJECT_C
std::map<std::string, std::vector<SimpleSettingData>> SettingsFactory::PART_CATEGORY_SETTINGS=
{
{ L("Quality"), {{"ironing_type", "",7},{"ironing_flow", "",8},{"ironing_spacing", "",9},{"bridge_flow", "",10}
{ L("Quality"), {{"ironing_type", "",9},{"ironing_flow", "",10},{"ironing_spacing", "",11},{"bridge_flow", "",12}
}},
{ L("Strength"), {{"wall_loops", "",1},{"top_shell_layers", L("Top Solid Layers"),1},{"top_shell_thickness", L("Top Minimum Shell Thickness"),1},
{"bottom_shell_layers", L("Bottom Solid Layers"),1}, {"bottom_shell_thickness", L("Bottom Minimum Shell Thickness"),1},

View File

@ -1913,6 +1913,7 @@ void TabPrint::build()
optgroup->append_single_option_line("flush_into_support", "reduce-wasting-during-filament-change#wipe-into-support-enabled-by-default");
optgroup = page->new_optgroup(L("Special mode"), L"param_special");
optgroup->append_single_option_line("slicing_mode");
optgroup->append_single_option_line("print_sequence");
optgroup->append_single_option_line("spiral_mode", "spiral-vase");
optgroup->append_single_option_line("timelapse_type", "Timelapse");