ENH: change infill params' name

Jira: none

Signed-off-by: qing.zhang <qing.zhang@bambulab.com>
Change-Id: I864f24a335d59b4ee6ae474c9a338cd2fbc2ebf1
This commit is contained in:
qing.zhang 2025-02-13 21:32:30 +08:00 committed by lane.wei
parent 2e0a953610
commit fb5bf37336
8 changed files with 30 additions and 30 deletions

View File

@ -135,6 +135,6 @@
"z_direction_outwall_speed_continuous": "0", "z_direction_outwall_speed_continuous": "0",
"enable_circle_compensation": "0", "enable_circle_compensation": "0",
"circle_compensation_manual_offset": "0", "circle_compensation_manual_offset": "0",
"crosszag_move_step": "0.4", "infill_shift_step": "0.4",
"zigzag_angle_step": "0" "infill_rotate_step": "0"
} }

View File

@ -62,8 +62,8 @@ struct SurfaceFillParams
float sparse_infill_speed = 0; float sparse_infill_speed = 0;
float top_surface_speed = 0; float top_surface_speed = 0;
float solid_infill_speed = 0; float solid_infill_speed = 0;
float crosszag_move_step = 0;// param for cross zag float infill_shift_step = 0;// param for cross zag
float zigzag_angle_step = 0; // param for zig zag to get cross texture float infill_rotate_step = 0; // param for zig zag to get cross texture
bool operator<(const SurfaceFillParams &rhs) const { bool operator<(const SurfaceFillParams &rhs) const {
#define RETURN_COMPARE_NON_EQUAL(KEY) if (this->KEY < rhs.KEY) return true; if (this->KEY > rhs.KEY) return false; #define RETURN_COMPARE_NON_EQUAL(KEY) if (this->KEY < rhs.KEY) return true; if (this->KEY > rhs.KEY) return false;
@ -90,8 +90,8 @@ struct SurfaceFillParams
RETURN_COMPARE_NON_EQUAL(sparse_infill_speed); RETURN_COMPARE_NON_EQUAL(sparse_infill_speed);
RETURN_COMPARE_NON_EQUAL(top_surface_speed); RETURN_COMPARE_NON_EQUAL(top_surface_speed);
RETURN_COMPARE_NON_EQUAL(solid_infill_speed); RETURN_COMPARE_NON_EQUAL(solid_infill_speed);
RETURN_COMPARE_NON_EQUAL(crosszag_move_step); RETURN_COMPARE_NON_EQUAL(infill_shift_step);
RETURN_COMPARE_NON_EQUAL(zigzag_angle_step); RETURN_COMPARE_NON_EQUAL(infill_rotate_step);
return false; return false;
} }
@ -113,8 +113,8 @@ struct SurfaceFillParams
this->sparse_infill_speed == rhs.sparse_infill_speed && this->sparse_infill_speed == rhs.sparse_infill_speed &&
this->top_surface_speed == rhs.top_surface_speed && this->top_surface_speed == rhs.top_surface_speed &&
this->solid_infill_speed == rhs.solid_infill_speed && this->solid_infill_speed == rhs.solid_infill_speed &&
this->crosszag_move_step == rhs.crosszag_move_step && this->infill_shift_step == rhs.infill_shift_step &&
this->zigzag_angle_step == rhs.zigzag_angle_step; this->infill_rotate_step == rhs.infill_rotate_step;
} }
}; };
@ -164,9 +164,9 @@ std::vector<SurfaceFill> group_fills(const Layer &layer)
params.pattern = region_config.sparse_infill_pattern.value; params.pattern = region_config.sparse_infill_pattern.value;
params.density = float(region_config.sparse_infill_density); params.density = float(region_config.sparse_infill_density);
if (params.pattern == ipCrossZag) if (params.pattern == ipCrossZag)
params.crosszag_move_step = scale_(region_config.crosszag_move_step); params.infill_shift_step = scale_(region_config.infill_shift_step);
if (params.pattern == ipZigZag) if (params.pattern == ipZigZag)
params.zigzag_angle_step = region_config.zigzag_angle_step * M_PI / 360; params.infill_rotate_step = region_config.infill_rotate_step * M_PI / 360;
if (surface.is_solid()) { if (surface.is_solid()) {
params.density = 100.f; params.density = 100.f;
@ -456,9 +456,9 @@ void Layer::make_fills(FillAdaptive::Octree* adaptive_fill_octree, FillAdaptive:
f->adapt_fill_octree = (surface_fill.params.pattern == ipSupportCubic) ? support_fill_octree : adaptive_fill_octree; f->adapt_fill_octree = (surface_fill.params.pattern == ipSupportCubic) ? support_fill_octree : adaptive_fill_octree;
if (surface_fill.params.pattern == ipZigZag) { if (surface_fill.params.pattern == ipZigZag) {
if (f->layer_id % 2 == 0) if (f->layer_id % 2 == 0)
f->angle -= surface_fill.params.zigzag_angle_step * (f->layer_id / 2); f->angle -= surface_fill.params.infill_rotate_step * (f->layer_id / 2);
else else
f->angle += surface_fill.params.zigzag_angle_step * (f->layer_id / 2); f->angle += surface_fill.params.infill_rotate_step * (f->layer_id / 2);
} }
if (surface_fill.params.pattern == ipConcentricInternal) { if (surface_fill.params.pattern == ipConcentricInternal) {
FillConcentricInternal *fill_concentric = dynamic_cast<FillConcentricInternal *>(f.get()); FillConcentricInternal *fill_concentric = dynamic_cast<FillConcentricInternal *>(f.get());
@ -508,9 +508,9 @@ void Layer::make_fills(FillAdaptive::Octree* adaptive_fill_octree, FillAdaptive:
params.no_extrusion_overlap = surface_fill.params.overlap; params.no_extrusion_overlap = surface_fill.params.overlap;
if (surface_fill.params.pattern == ipCrossZag) { if (surface_fill.params.pattern == ipCrossZag) {
if (f->layer_id % 2 == 0) if (f->layer_id % 2 == 0)
params.horiz_move -= surface_fill.params.crosszag_move_step * (f->layer_id / 2); params.horiz_move -= surface_fill.params.infill_shift_step * (f->layer_id / 2);
else else
params.horiz_move += surface_fill.params.crosszag_move_step * (f->layer_id / 2); params.horiz_move += surface_fill.params.infill_shift_step * (f->layer_id / 2);
} }
if (surface_fill.params.pattern == ipGrid) if (surface_fill.params.pattern == ipGrid)
params.can_reverse = false; params.can_reverse = false;

View File

@ -849,7 +849,7 @@ static std::vector<std::string> s_Preset_print_options {
"detect_overhang_wall", "detect_overhang_wall",
"smooth_speed_discontinuity_area","smooth_coefficient", "smooth_speed_discontinuity_area","smooth_coefficient",
"seam_position", "wall_sequence", "is_infill_first", "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","crosszag_move_step", "zigzag_angle_step", "top_surface_pattern", "bottom_surface_pattern", "internal_solid_infill_pattern", "infill_direction", "bridge_angle","infill_shift_step", "infill_rotate_step",
"minimum_sparse_infill_area", "reduce_infill_retraction", "ironing_pattern", "ironing_type", "minimum_sparse_infill_area", "reduce_infill_retraction", "ironing_pattern", "ironing_type",
"ironing_flow", "ironing_speed", "ironing_spacing","ironing_direction", "ironing_inset", "ironing_flow", "ironing_speed", "ironing_spacing","ironing_direction", "ironing_inset",
"max_travel_detour_distance", "max_travel_detour_distance",

View File

@ -2377,20 +2377,20 @@ void PrintConfigDef::init_fff_params()
def->mode = comAdvanced; def->mode = comAdvanced;
def->set_default_value(new ConfigOptionBool(false)); def->set_default_value(new ConfigOptionBool(false));
def = this->add("crosszag_move_step", coFloat); def = this->add("infill_shift_step", coFloat);
def->label = L("Cross Zag Move Step"); def->label = L("Infill shift step");
def->category = L("Strength"); def->category = L("Strength");
def->tooltip = L("move infill a bit to get cross texture."); def->tooltip = L("This parameter adds a slight displacement to each layer of infill to create a cross texture.");
def->sidetext = L("mm"); def->sidetext = L("mm");
def->min = 0; def->min = 0;
def->max = 10; def->max = 10;
def->mode = comAdvanced; def->mode = comAdvanced;
def->set_default_value(new ConfigOptionFloat(0.4)); def->set_default_value(new ConfigOptionFloat(0.4));
def = this->add("zigzag_angle_step", coFloat); def = this->add("infill_rotate_step", coFloat);
def->label = L("Zig Zag Angle Step"); def->label = L("Infill rotate step");
def->category = L("Strength"); def->category = L("Strength");
def->tooltip = L("rotate infill of each layer to get cross texture."); def->tooltip = L("This parameter adds a slight rotation to each layer of infill to create a cross cross texture.");
def->sidetext = L("°"); def->sidetext = L("°");
def->min = 0; def->min = 0;
def->max = 360; def->max = 360;

View File

@ -896,8 +896,8 @@ PRINT_CONFIG_CLASS_DEFINE(
((ConfigOptionFloat, outer_wall_line_width)) ((ConfigOptionFloat, outer_wall_line_width))
((ConfigOptionFloatsNullable, outer_wall_speed)) ((ConfigOptionFloatsNullable, outer_wall_speed))
((ConfigOptionFloat, infill_direction)) ((ConfigOptionFloat, infill_direction))
((ConfigOptionFloat, crosszag_move_step)) ((ConfigOptionFloat, infill_shift_step))
((ConfigOptionFloat, zigzag_angle_step)) ((ConfigOptionFloat, infill_rotate_step))
((ConfigOptionPercent, sparse_infill_density)) ((ConfigOptionPercent, sparse_infill_density))
((ConfigOptionEnum<InfillPattern>, sparse_infill_pattern)) ((ConfigOptionEnum<InfillPattern>, sparse_infill_pattern))
((ConfigOptionEnum<FuzzySkinType>, fuzzy_skin)) ((ConfigOptionEnum<FuzzySkinType>, fuzzy_skin))

View File

@ -1088,8 +1088,8 @@ bool PrintObject::invalidate_state_by_config_options(
|| opt_key == "initial_layer_line_width") { || opt_key == "initial_layer_line_width") {
steps.emplace_back(posInfill); steps.emplace_back(posInfill);
} else if (opt_key == "sparse_infill_pattern" } else if (opt_key == "sparse_infill_pattern"
|| opt_key == "crosszag_move_step" || opt_key == "infill_shift_step"
|| opt_key == "zigzag_angle_step") { || opt_key == "infill_rotate_step") {
steps.emplace_back(posPrepareInfill); steps.emplace_back(posPrepareInfill);
} else if (opt_key == "sparse_infill_density") { } else if (opt_key == "sparse_infill_density") {
// One likely wants to reslice only when switching between zero infill to simulate boolean difference (subtracting volumes), // One likely wants to reslice only when switching between zero infill to simulate boolean difference (subtracting volumes),

View File

@ -558,16 +558,16 @@ void ConfigManipulation::toggle_print_fff_options(DynamicPrintConfig *config, in
bool have_infill = config->option<ConfigOptionPercent>("sparse_infill_density")->value > 0; bool have_infill = config->option<ConfigOptionPercent>("sparse_infill_density")->value > 0;
// sparse_infill_filament uses the same logic as in Print::extruders() // sparse_infill_filament uses the same logic as in Print::extruders()
for (auto el : { "sparse_infill_pattern", "sparse_infill_anchor_max", "infill_combination", for (auto el : { "sparse_infill_pattern", "sparse_infill_anchor_max", "infill_combination",
"minimum_sparse_infill_area", "sparse_infill_filament","crosszag_move_step","zigzag_angle_step"}) "minimum_sparse_infill_area", "sparse_infill_filament","infill_shift_step","infill_rotate_step"})
toggle_line(el, have_infill); toggle_line(el, have_infill);
// Only allow configuration of open anchors if the anchoring is enabled. // Only allow configuration of open anchors if the anchoring is enabled.
bool has_infill_anchors = have_infill && config->option<ConfigOptionFloatOrPercent>("sparse_infill_anchor_max")->value > 0; bool has_infill_anchors = have_infill && config->option<ConfigOptionFloatOrPercent>("sparse_infill_anchor_max")->value > 0;
toggle_line("sparse_infill_anchor", has_infill_anchors); toggle_line("sparse_infill_anchor", has_infill_anchors);
//cross zag //cross zag
toggle_line("crosszag_move_step", config->option<ConfigOptionEnum<InfillPattern>>("sparse_infill_pattern")->value == InfillPattern::ipCrossZag); toggle_line("infill_shift_step", config->option<ConfigOptionEnum<InfillPattern>>("sparse_infill_pattern")->value == InfillPattern::ipCrossZag);
toggle_line("zigzag_angle_step", config->option<ConfigOptionEnum<InfillPattern>>("sparse_infill_pattern")->value == InfillPattern::ipZigZag); toggle_line("infill_rotate_step", config->option<ConfigOptionEnum<InfillPattern>>("sparse_infill_pattern")->value == InfillPattern::ipZigZag);
bool has_spiral_vase = config->opt_bool("spiral_mode"); bool has_spiral_vase = config->opt_bool("spiral_mode");
toggle_line("spiral_mode_smooth", has_spiral_vase); toggle_line("spiral_mode_smooth", has_spiral_vase);

View File

@ -2094,8 +2094,8 @@ void TabPrint::build()
optgroup = page->new_optgroup(L("Sparse infill"), L"param_infill"); optgroup = page->new_optgroup(L("Sparse infill"), L"param_infill");
optgroup->append_single_option_line("sparse_infill_density"); optgroup->append_single_option_line("sparse_infill_density");
optgroup->append_single_option_line("sparse_infill_pattern", "fill-patterns#infill types and their properties of sparse"); optgroup->append_single_option_line("sparse_infill_pattern", "fill-patterns#infill types and their properties of sparse");
optgroup->append_single_option_line("crosszag_move_step"); optgroup->append_single_option_line("infill_shift_step");
optgroup->append_single_option_line("zigzag_angle_step"); optgroup->append_single_option_line("infill_rotate_step");
optgroup->append_single_option_line("sparse_infill_anchor"); optgroup->append_single_option_line("sparse_infill_anchor");
optgroup->append_single_option_line("sparse_infill_anchor_max"); optgroup->append_single_option_line("sparse_infill_anchor_max");
optgroup->append_single_option_line("filter_out_gap_fill"); optgroup->append_single_option_line("filter_out_gap_fill");