NEW: only one wall for first layer

Signed-off-by: qing.zhang <qing.zhang@bambulab.com>
Change-Id: I4ed31db361230b7192c210e506717e16bd28a6f3
This commit is contained in:
qing.zhang 2023-04-18 12:21:05 +08:00 committed by Lane.Wei
parent 345536e07f
commit b5c7532700
6 changed files with 18 additions and 7 deletions

View file

@ -838,8 +838,8 @@ void PerimeterGenerator::process_classic()
for (const Surface &surface : this->slices->surfaces) { for (const Surface &surface : this->slices->surfaces) {
// detect how many perimeters must be generated for this island // detect how many perimeters must be generated for this island
int loop_number = this->config->wall_loops + surface.extra_perimeters - 1; // 0-indexed loops int loop_number = this->config->wall_loops + surface.extra_perimeters - 1; // 0-indexed loops
//BBS: set the topmost layer to be one wall //BBS: set the topmost and bottom most layer to be one wall
if (loop_number > 0 && config->only_one_wall_top && this->upper_slices == nullptr) if (loop_number > 0 && ((this->object_config->only_one_wall_top && this->upper_slices == nullptr) || (this->object_config->only_one_wall_first_layer && layer_id == 0)))
loop_number = 0; loop_number = 0;
ExPolygons last = union_ex(surface.expolygon.simplify_p(surface_simplify_resolution)); ExPolygons last = union_ex(surface.expolygon.simplify_p(surface_simplify_resolution));
@ -986,7 +986,7 @@ void PerimeterGenerator::process_classic()
//BBS: refer to superslicer //BBS: refer to superslicer
//store surface for top infill if only_one_wall_top //store surface for top infill if only_one_wall_top
if (i == 0 && i!=loop_number && config->only_one_wall_top && this->upper_slices != NULL) { if (i == 0 && i != loop_number && this->object_config->only_one_wall_top && this->upper_slices != NULL) {
//split the polygons with top/not_top //split the polygons with top/not_top
//get the offset from solid surface anchor //get the offset from solid surface anchor
coord_t offset_top_surface = scale_(1.5 * (config->wall_loops.value == 0 ? 0. : unscaled(double(ext_perimeter_width + perimeter_spacing * int(int(config->wall_loops.value) - int(1)))))); coord_t offset_top_surface = scale_(1.5 * (config->wall_loops.value == 0 ? 0. : unscaled(double(ext_perimeter_width + perimeter_spacing * int(int(config->wall_loops.value) - int(1))))));
@ -1283,6 +1283,9 @@ void PerimeterGenerator::process_arachne()
for (const Surface& surface : this->slices->surfaces) { for (const Surface& surface : this->slices->surfaces) {
// detect how many perimeters must be generated for this island // detect how many perimeters must be generated for this island
int loop_number = this->config->wall_loops + surface.extra_perimeters - 1; // 0-indexed loops int loop_number = this->config->wall_loops + surface.extra_perimeters - 1; // 0-indexed loops
if (loop_number > 0 && this->object_config->only_one_wall_first_layer && layer_id == 0)
loop_number = 0;
ExPolygons last = offset_ex(surface.expolygon.simplify_p(surface_simplify_resolution), -float(ext_perimeter_width / 2. - ext_perimeter_spacing / 2.)); ExPolygons last = offset_ex(surface.expolygon.simplify_p(surface_simplify_resolution), -float(ext_perimeter_width / 2. - ext_perimeter_spacing / 2.));
Polygons last_p = to_polygons(last); Polygons last_p = to_polygons(last);

View file

@ -744,7 +744,7 @@ static std::vector<std::string> s_Preset_print_options {
"detect_narrow_internal_solid_infill", "detect_narrow_internal_solid_infill",
"gcode_add_line_number", "enable_arc_fitting", "infill_combination", /*"adaptive_layer_height",*/ "gcode_add_line_number", "enable_arc_fitting", "infill_combination", /*"adaptive_layer_height",*/
"support_bottom_interface_spacing", "enable_overhang_speed", "overhang_1_4_speed", "overhang_2_4_speed", "overhang_3_4_speed", "overhang_4_4_speed", "support_bottom_interface_spacing", "enable_overhang_speed", "overhang_1_4_speed", "overhang_2_4_speed", "overhang_3_4_speed", "overhang_4_4_speed",
"initial_layer_infill_speed", "only_one_wall_top", "initial_layer_infill_speed", "only_one_wall_top", "only_one_wall_first_layer",
"timelapse_type", "internal_bridge_support_thickness", "timelapse_type", "internal_bridge_support_thickness",
"wall_generator", "wall_transition_length", "wall_transition_filter_deviation", "wall_transition_angle", "wall_generator", "wall_transition_length", "wall_transition_filter_deviation", "wall_transition_angle",
"wall_distribution_count", "min_feature_size", "min_bead_width", "post_process" "wall_distribution_count", "min_feature_size", "min_bead_width", "post_process"

View file

@ -695,6 +695,12 @@ void PrintConfigDef::init_fff_params()
def->tooltip = L("Use only one wall on flat top surface, to give more space to the top infill pattern"); def->tooltip = L("Use only one wall on flat top surface, to give more space to the top infill pattern");
def->set_default_value(new ConfigOptionBool(false)); def->set_default_value(new ConfigOptionBool(false));
def = this->add("only_one_wall_first_layer", coBool);
def->label = L("Only one wall on first layer");
def->category = L("Quality");
def->tooltip = L("Use only one wall on the first layer of model");
def->set_default_value(new ConfigOptionBool(false));
def = this->add("enable_overhang_speed", coBool); def = this->add("enable_overhang_speed", coBool);
def->label = L("Slow down for overhang"); def->label = L("Slow down for overhang");
def->category = L("Speed"); def->category = L("Speed");

View file

@ -696,6 +696,8 @@ PRINT_CONFIG_CLASS_DEFINE(
((ConfigOptionInt, wall_distribution_count)) ((ConfigOptionInt, wall_distribution_count))
((ConfigOptionPercent, min_feature_size)) ((ConfigOptionPercent, min_feature_size))
((ConfigOptionPercent, min_bead_width)) ((ConfigOptionPercent, min_bead_width))
((ConfigOptionBool, only_one_wall_top))
((ConfigOptionBool, only_one_wall_first_layer))
) )
// This object is mapped to Perl as Slic3r::Config::PrintRegion. // This object is mapped to Perl as Slic3r::Config::PrintRegion.
@ -752,9 +754,7 @@ PRINT_CONFIG_CLASS_DEFINE(
((ConfigOptionFloat, overhang_1_4_speed)) ((ConfigOptionFloat, overhang_1_4_speed))
((ConfigOptionFloat, overhang_2_4_speed)) ((ConfigOptionFloat, overhang_2_4_speed))
((ConfigOptionFloat, overhang_3_4_speed)) ((ConfigOptionFloat, overhang_3_4_speed))
((ConfigOptionFloat, overhang_4_4_speed)) ((ConfigOptionFloat, overhang_4_4_speed)))
((ConfigOptionBool, only_one_wall_top))
)
PRINT_CONFIG_CLASS_DEFINE( PRINT_CONFIG_CLASS_DEFINE(
MachineEnvelopeConfig, MachineEnvelopeConfig,

View file

@ -692,6 +692,7 @@ bool PrintObject::invalidate_state_by_config_options(
} else if ( } else if (
opt_key == "wall_loops" opt_key == "wall_loops"
|| opt_key == "only_one_wall_top" || opt_key == "only_one_wall_top"
|| opt_key == "only_one_wall_first_layer"
|| opt_key == "initial_layer_line_width" || opt_key == "initial_layer_line_width"
|| opt_key == "inner_wall_line_width" || opt_key == "inner_wall_line_width"
|| opt_key == "infill_wall_overlap") { || opt_key == "infill_wall_overlap") {

View file

@ -1870,6 +1870,7 @@ void TabPrint::build()
optgroup->append_single_option_line("bridge_flow"); optgroup->append_single_option_line("bridge_flow");
optgroup->append_single_option_line("thick_bridges"); optgroup->append_single_option_line("thick_bridges");
optgroup->append_single_option_line("only_one_wall_top"); optgroup->append_single_option_line("only_one_wall_top");
optgroup->append_single_option_line("only_one_wall_first_layer");
optgroup->append_single_option_line("detect_overhang_wall"); optgroup->append_single_option_line("detect_overhang_wall");
optgroup->append_single_option_line("reduce_crossing_wall"); optgroup->append_single_option_line("reduce_crossing_wall");
optgroup->append_single_option_line("max_travel_detour_distance"); optgroup->append_single_option_line("max_travel_detour_distance");