Enhancement: Enabling base patterns (infill) for Organic supports (#12141)

Enhancement: Enabling base patterns for Organic supports
This commit is contained in:
Valerii Bokhan
2026-02-28 11:25:21 +01:00
committed by SoftFever
parent c924b8ed25
commit 0c666da430
4 changed files with 46 additions and 16 deletions

View File

@@ -1490,18 +1490,42 @@ StringObjectException Print::validate(StringObjectException *warning, Polygons*
// Prusa: Fixing crashes with invalid tip diameter or branch diameter
// https://github.com/prusa3d/PrusaSlicer/commit/96b3ae85013ac363cd1c3e98ec6b7938aeacf46d
if (is_tree(object->config().support_type.value) && (object->config().support_style == smsTreeOrganic ||
// Orca: use organic as default
object->config().support_style == smsDefault)) {
float extrusion_width = std::min(
support_material_flow(object).width(),
support_material_interface_flow(object).width());
if (object->config().tree_support_tip_diameter < extrusion_width - EPSILON)
return { L("Organic support tree tip diameter must not be smaller than support material extrusion width."), object, "tree_support_tip_diameter" };
if (object->config().tree_support_branch_diameter_organic < 2. * extrusion_width - EPSILON)
return { L("Organic support branch diameter must not be smaller than 2x support material extrusion width."), object, "tree_support_branch_diameter_organic" };
if (object->config().tree_support_branch_diameter_organic < object->config().tree_support_tip_diameter)
return { L("Organic support branch diameter must not be smaller than support tree tip diameter."), object, "tree_support_branch_diameter_organic" };
if (is_tree(object->config().support_type.value)) {
if (object->config().support_style == smsTreeOrganic ||
// Orca: use organic as default
object->config().support_style == smsDefault) {
if (warning) {
// Orca: check the support wall count and the base pattern
if (object->config().tree_support_wall_count > 1 &&
object->config().support_base_pattern != SupportMaterialPattern::smpNone &&
object->config().support_base_pattern != SupportMaterialPattern::smpDefault) {
warning->string = L("For Organic supports, two walls are supported only with the Hollow/Default base pattern.");
warning->opt_key = "support_base_pattern";
}
// Orca: check if the Lightning base pattern selected
if (object->config().support_base_pattern == SupportMaterialPattern::smpLightning) {
warning->string = L(
"The Lightning base pattern is not supported by this support type; Rectilinear will be used instead.");
warning->opt_key = "support_base_pattern";
}
}
float extrusion_width = std::min(
support_material_flow(object).width(),
support_material_interface_flow(object).width());
if (object->config().tree_support_tip_diameter < extrusion_width - EPSILON)
return { L("Organic support tree tip diameter must not be smaller than support material extrusion width."), object, "tree_support_tip_diameter" };
if (object->config().tree_support_branch_diameter_organic < 2. * extrusion_width - EPSILON)
return { L("Organic support branch diameter must not be smaller than 2x support material extrusion width."), object, "tree_support_branch_diameter_organic" };
if (object->config().tree_support_branch_diameter_organic < object->config().tree_support_tip_diameter)
return { L("Organic support branch diameter must not be smaller than support tree tip diameter."), object, "tree_support_branch_diameter_organic" };
}
} else if (object->config().support_base_pattern == SupportMaterialPattern::smpLightning && warning) {
// Orca: check if the Lightning base pattern selected
warning->string = L("The Lightning base pattern is not supported by this support type; Rectilinear will be used instead.");
warning->opt_key = "support_base_pattern";
}
}

View File

@@ -5775,7 +5775,12 @@ void PrintConfigDef::init_fff_params()
def = this->add("support_base_pattern", coEnum);
def->label = L("Base pattern");
def->category = L("Support");
def->tooltip = L("Line pattern of support.");
def->tooltip = L("Line pattern of support.\n\n"
"The Default option for Tree supports is Hollow, which means no base pattern. "
"For other support types, the Default option is the Rectilinear pattern.\n\n"
"NOTE: For Organic supports, the two walls are supported only with the Hollow/Default base pattern. "
"The Lightning base pattern is supported only by Tree Slim/Strong/Hybrid supports. "
"For the other support types, the Rectilinear will be used instead of Lightning.");
def->enum_keys_map = &ConfigOptionEnum<SupportMaterialPattern>::get_enum_values();
def->enum_values.push_back("default");
def->enum_values.push_back("rectilinear");

View File

@@ -1745,8 +1745,10 @@ void generate_support_toolpaths(
filler->link_max_length = coord_t(scale_(filler->spacing * link_max_length_factor / density));
sheath = true;
no_sort = true;
} else if (support_params.support_style == SupportMaterialStyle::smsTreeOrganic) {
// if the tree supports are too tall, use double wall to make it stronger
} else if (support_params.support_style == SupportMaterialStyle::smsTreeOrganic &&
(config.support_base_pattern == smpNone || config.support_base_pattern == smpDefault)) {
// Orca: A special case for the hollow Organic supports
// Orca: If the tree supports are too tall, use a double wall to make it stronger
SupportParameters support_params2 = support_params;
if (support_layer.print_z > 100.0)
support_params2.tree_branch_diameter_double_wall_area_scaled = 0.1;

View File

@@ -3549,7 +3549,6 @@ static void generate_support_areas(Print &print, TreeSupport* tree_support, cons
if (layer) layer->polygons = intersection(layer->polygons, volumes.m_bed_area);
});
// Don't fill in the tree supports, make them hollow with just a single sheath line.
print.set_status(69, _L("Generating support"));
generate_support_toolpaths(print_object.support_layers(), print_object.config(), support_params, print_object.slicing_parameters(),
raft_layers, bottom_contacts, top_contacts, intermediate_layers, interface_layers, base_interface_layers);