Skip to content

Commit

Permalink
Introduced filtering option
Browse files Browse the repository at this point in the history
  • Loading branch information
igiannakas committed Jan 9, 2024
1 parent fd9cac7 commit ae8d8f7
Show file tree
Hide file tree
Showing 3 changed files with 35 additions and 11 deletions.
36 changes: 28 additions & 8 deletions src/libslic3r/PrintConfig.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -248,6 +248,13 @@ static t_config_enum_values s_keys_map_SeamPosition {
};
CONFIG_OPTION_ENUM_DEFINE_STATIC_MAPS(SeamPosition)

static t_config_enum_values s_keys_map_InternalBridgeFilter {
{ "disabled", ibfDisabled },
{ "limited", ibfLimited },
{ "nofilter", ibfNofilter },
};
CONFIG_OPTION_ENUM_DEFINE_STATIC_MAPS(InternalBridgeFilter)

static const t_config_enum_values s_keys_map_SLADisplayOrientation = {
{ "landscape", sladoLandscape},
{ "portrait", sladoPortrait}
Expand Down Expand Up @@ -1219,19 +1226,32 @@ void PrintConfigDef::init_fff_params()
"consider turning it off if you are using large nozzles.");
def->mode = comAdvanced;
def->set_default_value(new ConfigOptionBool(true));
def = this->add("dont_filter_internal_bridges", coBool);

def = this->add("dont_filter_internal_bridges", coEnum);
def->label = L("Don't filter out small internal bridges (experimental)");
def->category = L("Quality");
def->tooltip = L("This option can help reducing pillowing on top surfaces in heavily slanted or curved models.\n\n"
def->tooltip = L("This option can help reducing pillowing on top surfaces in heavily slanted or curved models.\n\n"
"By default, small internal bridges are filtered out and the internal solid infill is printed directly"
" over the sparse infill. This works well in most cases, speeding up printing without too much compromise"
" on top surface quality. \n\nHowever, in heavily slanted or curved models especially where too low sparse infill"
" density is used, this may result in curling of the unsupported solid infill, causing pillowing.\n\n "
"Enabling this option will always print an internal bridge layer over even slightly unsupported internal"
" solid infill even in areas where it may be unecessary, increasing print time.");
" on top surface quality. \n\nHowever, in heavily slanted or curved models especially where too low sparse"
" infill density is used, this may result in curling of the unsupported solid infill, causing pillowing.\n\n"
"Enabling this option will print internal bridge layer over slightly unsupported internal"
" solid infill. The options below control the amount of filtering, i.e. the amount of internal bridges "
"created.\n"
"Disabled - Disables this option. This is the default behaviour and works well in most cases.\n"
"Limited filtering - Creates internal bridges on heavily slanted surfaces, while avoiding creating "
"uncessesary interal bridges. This works well for most difficult models.\n"
"No filtering - Creates internal bridges on every potential internal overhang. This option is useful "
"for heavily slanted top surface models. However, in most cases it creates too many unecessary bridges.");
def->enum_keys_map = &ConfigOptionEnum<InternalBridgeFilter>::get_enum_values();
def->enum_values.push_back("disabled");
def->enum_values.push_back("limited");
def->enum_values.push_back("nofilter");
def->enum_labels.push_back(L("Disabled"));
def->enum_labels.push_back(L("Limited filtering"));
def->enum_labels.push_back(L("No filtering"));
def->mode = comAdvanced;
def->set_default_value(new ConfigOptionBool(false));
def->set_default_value(new ConfigOptionEnum<InternalBridgeFilter>(ibfDisabled));


def = this->add("max_bridge_length", coFloat);
Expand Down
6 changes: 5 additions & 1 deletion src/libslic3r/PrintConfig.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -152,6 +152,10 @@ enum SeamPosition {
spNearest, spAligned, spRear, spRandom
};

enum InternalBridgeFilter {
ibfDisabled, ibfLimited, ibfNofilter
};

enum LiftType {
NormalLift,
SpiralLift,
Expand Down Expand Up @@ -744,7 +748,7 @@ PRINT_CONFIG_CLASS_DEFINE(
// Orca internal thick bridge
((ConfigOptionBool, thick_bridges))
((ConfigOptionBool, thick_internal_bridges))
((ConfigOptionBool, dont_filter_internal_bridges))
((ConfigOptionEnum<InternalBridgeFilter>, dont_filter_internal_bridges))
// Overhang angle threshold.
((ConfigOptionInt, support_threshold_angle))
((ConfigOptionFloat, support_object_xy_distance))
Expand Down
4 changes: 2 additions & 2 deletions src/libslic3r/PrintObject.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2030,7 +2030,7 @@ void PrintObject::bridge_over_infill()
// Orca:
// Lightning infill benefits from always having a bridge layer so don't filter out small unsupported areas. Also, don't filter small internal unsupported areas if the user has requested so.
double expansion_multiplier = 3;
if(has_lightning_infill || po->config().dont_filter_internal_bridges){
if(has_lightning_infill || po->config().dont_filter_internal_bridges.value !=ibfDisabled){
expansion_multiplier = 1;
}
// By expanding the lower layer solids, we avoid making bridges from the tiny internal overhangs that are (very likely) supported by previous layer solids
Expand All @@ -2048,7 +2048,7 @@ void PrintObject::bridge_over_infill()

// Orca: If the user has selected to always support internal overhanging regions, no matter how small
// skip the filtering
if (po->config().dont_filter_internal_bridges){
if (po->config().dont_filter_internal_bridges.value == ibfNofilter){
// expand the unsupported area by 4x spacing to trigger internal bridging
unsupported = expand(unsupported, 4 * spacing);
candidate_surfaces.push_back(CandidateSurface(s, lidx, unsupported, region, 0));
Expand Down

0 comments on commit ae8d8f7

Please sign in to comment.