Top Surface Expansion (#14296)

Co-authored-by: Rodrigo Faselli <162915171+RF47@users.noreply.github.com>
This commit is contained in:
Ian Bassi
2026-07-08 14:20:40 -03:00
committed by GitHub
parent da149ee75a
commit 20a66fa99b
10 changed files with 173 additions and 1 deletions

View File

@@ -221,6 +221,13 @@ static t_config_enum_values s_keys_map_FuzzySkinMode {
};
CONFIG_OPTION_ENUM_DEFINE_STATIC_MAPS(FuzzySkinMode)
static t_config_enum_values s_keys_map_TopSurfaceExpansionDirection {
{ "inward_and_outward", int(TopSurfaceExpansionDirection::InwardAndOutward) },
{ "inward", int(TopSurfaceExpansionDirection::Inward) },
{ "outward", int(TopSurfaceExpansionDirection::Outward) }
};
CONFIG_OPTION_ENUM_DEFINE_STATIC_MAPS(TopSurfaceExpansionDirection)
static t_config_enum_values s_keys_map_InfillPattern {
{ "monotonic", ipMonotonic },
{ "monotonicline", ipMonotonicLine },
@@ -2123,6 +2130,47 @@ void PrintConfigDef::init_fff_params()
def->max = 100;
def->set_default_value(new ConfigOptionPercent(100));
def = this->add("top_surface_expansion", coFloat);
def->label = L("Top surface expansion");
def->category = L("Strength");
def->tooltip = L("Expands the top surfaces by this distance to connect distinct top surfaces and fill gaps.\n"
"Useful for cases where the top surface is interrupted by a raised feature, such as text on a plane."
"Expanding it removes the holes beneath these features and creates a continuous path with a better finish for printing on top."
"The expansion is applied to the original top surface, before any other processing such as bridging or overhang detection.");
def->sidetext = L("mm");
def->min = 0;
def->mode = comAdvanced;
def->set_default_value(new ConfigOptionFloat(0));
def = this->add("top_surface_expansion_margin", coFloat);
def->label = L("Top expansion wall margin");
def->category = L("Strength");
def->tooltip = L("Using “Top surface expansion” may cause a surface that did not previously touch the model's outer walls to now do so.\n"
"This can cause contraction marks (such as the hull line) on the outer walls.\n"
"By adding a small margin, this contraction will not occur directly on the walls, thereby preventing a visible mark.");
def->sidetext = L("mm");
def->min = 0;
def->max = 10;
def->mode = comAdvanced;
def->set_default_value(new ConfigOptionFloat(0));
def = this->add("top_surface_expansion_direction", coEnum);
def->label = L("Top expansion direction");
def->category = L("Strength");
def->tooltip = L("Direction in which the top surface expansion grows.\n"
" - Inward grows into the holes and gaps left by features rising from the middle of a top surface.\n"
" - Outward grows the outer edge of the surface, connecting surfaces separated by features that can divide a surface, such as a lattice pattern.\n"
" - Inward and Outward does both.");
def->enum_keys_map = &ConfigOptionEnum<TopSurfaceExpansionDirection>::get_enum_values();
def->enum_values.push_back("inward_and_outward");
def->enum_values.push_back("inward");
def->enum_values.push_back("outward");
def->enum_labels.push_back(L("Inward and Outward"));
def->enum_labels.push_back(L("Inward"));
def->enum_labels.push_back(L("Outward"));
def->mode = comAdvanced;
def->set_default_value(new ConfigOptionEnum<TopSurfaceExpansionDirection>(TopSurfaceExpansionDirection::InwardAndOutward));
def = this->add("bottom_surface_pattern", coEnum);
def->label = L("Bottom surface pattern");
def->category = L("Strength");