Added option to switch between BoundedRectilinear and Concentric infill for the ensure vertical shell thickness.

This commit is contained in:
Lukáš Hejl 2023-01-05 14:37:05 +01:00
parent df01923631
commit 063ae0ccfc
6 changed files with 35 additions and 5 deletions

View File

@ -13,8 +13,9 @@ ThickPolylines FillEnsuring::fill_surface_arachne(const Surface *surface, const
assert(params.use_arachne);
assert(this->print_config != nullptr && this->print_object_config != nullptr && this->print_region_config != nullptr);
const coord_t scaled_spacing = scaled<coord_t>(this->spacing);
const bool is_bounded_rectilinear = true;
const coord_t scaled_spacing = scaled<coord_t>(this->spacing);
const EnsuringInfillPattern infill_patter = this->print_object_config->ensure_vertical_shell_infill;
const bool is_bounded_rectilinear = infill_patter == EnsuringInfillPattern::eipBoundedRectilinear;
// Perform offset.
Slic3r::ExPolygons expp = this->overlap != 0. ? offset_ex(surface->expolygon, scaled<float>(this->overlap)) : ExPolygons{surface->expolygon};
@ -96,7 +97,8 @@ ThickPolylines FillEnsuring::fill_surface_arachne(const Surface *surface, const
BOOST_LOG_TRIVIAL(error) << "FillBoundedRectilinear::fill_surface() failed to fill a region.";
append(thick_polylines_out, to_thick_polylines(std::move(polylines), scaled<coord_t>(this->spacing)));
}
}
} else
assert(infill_patter == EnsuringInfillPattern::eipConcentric);
}
return thick_polylines_out;

View File

@ -449,7 +449,7 @@ static std::vector<std::string> s_Preset_print_options {
"wipe_tower_width", "wipe_tower_rotation_angle", "wipe_tower_brim_width", "wipe_tower_bridging", "single_extruder_multi_material_priming", "mmu_segmented_region_max_width",
"wipe_tower_no_sparse_layers", "compatible_printers", "compatible_printers_condition", "inherits",
"perimeter_generator", "wall_transition_length", "wall_transition_filter_deviation", "wall_transition_angle",
"wall_distribution_count", "min_feature_size", "min_bead_width"
"wall_distribution_count", "min_feature_size", "min_bead_width", "ensure_vertical_shell_infill"
};
static std::vector<std::string> s_Preset_filament_options {

View File

@ -220,6 +220,12 @@ static t_config_enum_values s_keys_map_PerimeterGeneratorType {
};
CONFIG_OPTION_ENUM_DEFINE_STATIC_MAPS(PerimeterGeneratorType)
static t_config_enum_values s_keys_map_EnsuringInfillPattern {
{ "bounded_rectilinear", int(EnsuringInfillPattern::eipBoundedRectilinear) },
{ "concentric", int(EnsuringInfillPattern::eipConcentric) }
};
CONFIG_OPTION_ENUM_DEFINE_STATIC_MAPS(EnsuringInfillPattern)
static void assign_printer_technology_to_unknown(t_optiondef_map &options, PrinterTechnology printer_technology)
{
for (std::pair<const t_config_option_key, ConfigOptionDef> &kvp : options)
@ -3214,6 +3220,18 @@ void PrintConfigDef::init_fff_params()
def->min = 0;
def->set_default_value(new ConfigOptionFloatOrPercent(85, true));
def = this->add("ensure_vertical_shell_infill", coEnum);
def->label = L("Ensure vertical shell infill");
def->category = L("Layers and Perimeters");
def->tooltip = L("Ensure vertical shell infill.");
def->enum_keys_map = &ConfigOptionEnum<EnsuringInfillPattern>::get_enum_values();
def->enum_values.push_back("bounded_rectilinear");
def->enum_values.push_back("concentric");
def->enum_labels.push_back(L("Bounded Rectilinear"));
def->enum_labels.push_back(L("Concentric"));
def->mode = comAdvanced;
def->set_default_value(new ConfigOptionEnum<EnsuringInfillPattern>(EnsuringInfillPattern::eipBoundedRectilinear));
// Declare retract values for filament profile, overriding the printer's extruder profile.
for (const char *opt_key : {
// floats

View File

@ -133,6 +133,11 @@ enum class PerimeterGeneratorType
Arachne
};
enum class EnsuringInfillPattern {
eipBoundedRectilinear,
eipConcentric
};
enum class GCodeThumbnailsFormat {
PNG, JPG, QOI
};
@ -162,6 +167,8 @@ CONFIG_OPTION_ENUM_DECLARE_STATIC_MAPS(DraftShield)
CONFIG_OPTION_ENUM_DECLARE_STATIC_MAPS(GCodeThumbnailsFormat)
CONFIG_OPTION_ENUM_DECLARE_STATIC_MAPS(ForwardCompatibilitySubstitutionRule)
CONFIG_OPTION_ENUM_DECLARE_STATIC_MAPS(PerimeterGeneratorType)
CONFIG_OPTION_ENUM_DECLARE_STATIC_MAPS(EnsuringInfillPattern)
#undef CONFIG_OPTION_ENUM_DECLARE_STATIC_MAPS
@ -490,6 +497,7 @@ PRINT_CONFIG_CLASS_DEFINE(
((ConfigOptionBool, clip_multipart_objects))
((ConfigOptionBool, dont_support_bridges))
((ConfigOptionFloat, elefant_foot_compensation))
((ConfigOptionEnum<EnsuringInfillPattern>, ensure_vertical_shell_infill))
((ConfigOptionFloatOrPercent, extrusion_width))
((ConfigOptionFloat, first_layer_acceleration_over_raft))
((ConfigOptionFloatOrPercent, first_layer_speed_over_raft))

View File

@ -751,7 +751,8 @@ bool PrintObject::invalidate_state_by_config_options(
|| opt_key == "wall_transition_angle"
|| opt_key == "wall_distribution_count"
|| opt_key == "min_feature_size"
|| opt_key == "min_bead_width") {
|| opt_key == "min_bead_width"
|| opt_key == "ensure_vertical_shell_infill") {
steps.emplace_back(posSlice);
} else if (
opt_key == "seam_position"

View File

@ -1425,6 +1425,7 @@ void TabPrint::build()
optgroup->append_single_option_line("extra_perimeters", category_path + "extra-perimeters-if-needed");
optgroup->append_single_option_line("extra_perimeters_on_overhangs", category_path + "extra-perimeters-on-overhangs");
optgroup->append_single_option_line("ensure_vertical_shell_thickness", category_path + "ensure-vertical-shell-thickness");
optgroup->append_single_option_line("ensure_vertical_shell_infill");
optgroup->append_single_option_line("avoid_curled_filament_during_travels", category_path + "avoid-curled-filament-during-travels");
optgroup->append_single_option_line("avoid_crossing_perimeters", category_path + "avoid-crossing-perimeters");
optgroup->append_single_option_line("avoid_crossing_perimeters_max_detour", category_path + "avoid_crossing_perimeters_max_detour");