Skip to content

Commit 644c0c2

Browse files
CopilotImLevath
andcommitted
Redesign: add Resin-like as new support type instead of tree style
Co-authored-by: ImLevath <191364547+ImLevath@users.noreply.github.com>
1 parent 38ceb3b commit 644c0c2

File tree

10 files changed

+45
-36
lines changed

10 files changed

+45
-36
lines changed

src/libslic3r/Print.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1318,7 +1318,7 @@ StringObjectException Print::validate(StringObjectException *warning, Polygons*
13181318
for (size_t print_object_idx = 0; print_object_idx < m_objects.size(); ++ print_object_idx)
13191319
if (const PrintObject &print_object = *m_objects[print_object_idx];
13201320
print_object.has_support_material() && is_tree(print_object.config().support_type.value) && (print_object.config().support_style.value == smsTreeOrganic ||
1321-
print_object.config().support_style.value == smsResinLike ||
1321+
is_resin_like(print_object.config().support_type.value) ||
13221322
// Orca: use organic as default
13231323
print_object.config().support_style.value == smsDefault) &&
13241324
print_object.model_object()->has_custom_layering()) {
@@ -1492,7 +1492,7 @@ StringObjectException Print::validate(StringObjectException *warning, Polygons*
14921492
// Prusa: Fixing crashes with invalid tip diameter or branch diameter
14931493
// https://github.com/prusa3d/PrusaSlicer/commit/96b3ae85013ac363cd1c3e98ec6b7938aeacf46d
14941494
if (is_tree(object->config().support_type.value) && (object->config().support_style == smsTreeOrganic ||
1495-
object->config().support_style == smsResinLike ||
1495+
is_resin_like(object->config().support_type.value) ||
14961496
// Orca: use organic as default
14971497
object->config().support_style == smsDefault)) {
14981498
float extrusion_width = std::min(

src/libslic3r/PrintConfig.cpp

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -299,8 +299,7 @@ static t_config_enum_values s_keys_map_SupportMaterialStyle {
299299
{ "organic", smsTreeOrganic },
300300
{ "tree_slim", smsTreeSlim },
301301
{ "tree_strong", smsTreeStrong },
302-
{ "tree_hybrid", smsTreeHybrid },
303-
{ "resin_like", smsResinLike }
302+
{ "tree_hybrid", smsTreeHybrid }
304303
};
305304
CONFIG_OPTION_ENUM_DEFINE_STATIC_MAPS(SupportMaterialStyle)
306305

@@ -314,10 +313,11 @@ static t_config_enum_values s_keys_map_SupportMaterialInterfacePattern {
314313
CONFIG_OPTION_ENUM_DEFINE_STATIC_MAPS(SupportMaterialInterfacePattern)
315314

316315
static t_config_enum_values s_keys_map_SupportType{
317-
{ "normal(auto)", stNormalAuto },
318-
{ "tree(auto)", stTreeAuto },
319-
{ "normal(manual)", stNormal },
320-
{ "tree(manual)", stTree }
316+
{ "normal(auto)", stNormalAuto },
317+
{ "tree(auto)", stTreeAuto },
318+
{ "normal(manual)", stNormal },
319+
{ "tree(manual)", stTree },
320+
{ "resin_like(auto)", stResinLikeAuto }
321321
};
322322
CONFIG_OPTION_ENUM_DEFINE_STATIC_MAPS(SupportType)
323323

@@ -5554,17 +5554,21 @@ void PrintConfigDef::init_fff_params()
55545554
def = this->add("support_type", coEnum);
55555555
def->label = L("Type");
55565556
def->category = L("Support");
5557-
def->tooltip = L("Normal (auto) and Tree (auto) are used to generate support automatically. "
5558-
"If Normal (manual) or Tree (manual) is selected, only support enforcers are generated.");
5557+
def->tooltip = L("Normal (auto) and Tree (auto) generate support automatically. "
5558+
"Normal (manual) or Tree (manual) generate support only on enforcers. "
5559+
"Resin-like (auto) generates thin-pillar point-contact supports inspired by SLA printers, "
5560+
"for easy removal.");
55595561
def->enum_keys_map = &ConfigOptionEnum<SupportType>::get_enum_values();
55605562
def->enum_values.push_back("normal(auto)");
55615563
def->enum_values.push_back("tree(auto)");
55625564
def->enum_values.push_back("normal(manual)");
55635565
def->enum_values.push_back("tree(manual)");
5566+
def->enum_values.push_back("resin_like(auto)");
55645567
def->enum_labels.push_back(L("Normal (auto)"));
55655568
def->enum_labels.push_back(L("Tree (auto)"));
55665569
def->enum_labels.push_back(L("Normal (manual)"));
55675570
def->enum_labels.push_back(L("Tree (manual)"));
5571+
def->enum_labels.push_back(L("Resin-like (auto)"));
55685572
def->mode = comSimple;
55695573
def->set_default_value(new ConfigOptionEnum<SupportType>(stNormalAuto));
55705574

@@ -5846,9 +5850,7 @@ void PrintConfigDef::init_fff_params()
58465850
"object scarring.\n"
58475851
"For tree support, slim and organic style will merge branches more aggressively and save "
58485852
"a lot of material (default organic), while hybrid style will create similar structure to normal support "
5849-
"under large flat overhangs.\n"
5850-
"Resin-like style uses very thin branching pillars with tiny contact tips inspired by SLA/resin printer "
5851-
"supports, minimizing contact area for easy removal while reliably supporting overhangs.");
5853+
"under large flat overhangs.");
58525854
def->enum_keys_map = &ConfigOptionEnum<SupportMaterialStyle>::get_enum_values();
58535855
def->enum_values.push_back("default");
58545856
def->enum_values.push_back("grid");
@@ -5857,15 +5859,13 @@ void PrintConfigDef::init_fff_params()
58575859
def->enum_values.push_back("tree_slim");
58585860
def->enum_values.push_back("tree_strong");
58595861
def->enum_values.push_back("tree_hybrid");
5860-
def->enum_values.push_back("resin_like");
58615862
def->enum_labels.push_back(L("Default (Grid/Organic)"));
58625863
def->enum_labels.push_back(L("Grid"));
58635864
def->enum_labels.push_back(L("Snug"));
58645865
def->enum_labels.push_back(L("Organic"));
58655866
def->enum_labels.push_back(L("Tree Slim"));
58665867
def->enum_labels.push_back(L("Tree Strong"));
58675868
def->enum_labels.push_back(L("Tree Hybrid"));
5868-
def->enum_labels.push_back(L("Resin-like"));
58695869

58705870
def->mode = comAdvanced;
58715871
def->set_default_value(new ConfigOptionEnum<SupportMaterialStyle>(smsDefault));

src/libslic3r/PrintConfig.hpp

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -160,7 +160,7 @@ enum SupportMaterialPattern {
160160
};
161161

162162
enum SupportMaterialStyle {
163-
smsDefault, smsGrid, smsSnug, smsTreeOrganic, smsTreeSlim, smsTreeStrong, smsTreeHybrid, smsResinLike,
163+
smsDefault, smsGrid, smsSnug, smsTreeOrganic, smsTreeSlim, smsTreeStrong, smsTreeHybrid,
164164
};
165165

166166
enum LongRectrationLevel
@@ -176,19 +176,23 @@ enum SupportMaterialInterfacePattern {
176176

177177
// BBS
178178
enum SupportType {
179-
stNormalAuto, stTreeAuto, stNormal, stTree
179+
stNormalAuto, stTreeAuto, stNormal, stTree, stResinLikeAuto
180180
};
181181
inline bool is_tree(SupportType stype)
182182
{
183-
return std::set<SupportType>{stTreeAuto, stTree}.count(stype) != 0;
183+
return std::set<SupportType>{stTreeAuto, stTree, stResinLikeAuto}.count(stype) != 0;
184184
};
185185
inline bool is_tree_slim(SupportType type, SupportMaterialStyle style)
186186
{
187187
return is_tree(type) && style==smsTreeSlim;
188188
};
189189
inline bool is_auto(SupportType stype)
190190
{
191-
return std::set<SupportType>{stNormalAuto, stTreeAuto}.count(stype) != 0;
191+
return std::set<SupportType>{stNormalAuto, stTreeAuto, stResinLikeAuto}.count(stype) != 0;
192+
};
193+
inline bool is_resin_like(SupportType stype)
194+
{
195+
return stype == stResinLikeAuto;
192196
};
193197

194198
enum SeamPosition {

src/libslic3r/Support/SupportCommon.cpp

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1745,8 +1745,7 @@ void generate_support_toolpaths(
17451745
filler->link_max_length = coord_t(scale_(filler->spacing * link_max_length_factor / density));
17461746
sheath = true;
17471747
no_sort = true;
1748-
} else if (support_params.support_style == SupportMaterialStyle::smsTreeOrganic ||
1749-
support_params.support_style == SupportMaterialStyle::smsResinLike) {
1748+
} else if (support_params.support_style == SupportMaterialStyle::smsTreeOrganic) {
17501749
// if the tree supports are too tall, use double wall to make it stronger
17511750
SupportParameters support_params2 = support_params;
17521751
if (support_layer.print_z > 100.0)

src/libslic3r/Support/SupportMaterial.cpp

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -650,7 +650,7 @@ class SupportGridPattern
650650
m_support_material_closing_radius(params.support_closing_radius)
651651
{
652652
if (m_style == smsDefault) m_style = smsGrid;
653-
if (std::set<SupportMaterialStyle>{smsTreeSlim, smsTreeStrong, smsTreeHybrid, smsTreeOrganic, smsResinLike}.count(m_style))
653+
if (std::set<SupportMaterialStyle>{smsTreeSlim, smsTreeStrong, smsTreeHybrid, smsTreeOrganic}.count(m_style))
654654
m_style = smsGrid;
655655
switch (m_style) {
656656
case smsGrid:
@@ -747,7 +747,6 @@ class SupportGridPattern
747747
case smsTreeStrong:
748748
case smsTreeHybrid:
749749
case smsTreeOrganic:
750-
case smsResinLike:
751750
assert(false);
752751
//[[fallthrough]];
753752
return Polygons();

src/libslic3r/Support/SupportParameters.hpp

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -173,11 +173,14 @@ struct SupportParameters {
173173
support_style = object_config.support_style;
174174
if (support_style != smsDefault) {
175175
if ((support_style == smsSnug || support_style == smsGrid) && is_tree(object_config.support_type)) support_style = smsDefault;
176-
if ((support_style == smsTreeSlim || support_style == smsTreeStrong || support_style == smsTreeHybrid || support_style == smsTreeOrganic || support_style == smsResinLike) &&
176+
if ((support_style == smsTreeSlim || support_style == smsTreeStrong || support_style == smsTreeHybrid || support_style == smsTreeOrganic) &&
177177
!is_tree(object_config.support_type))
178178
support_style = smsDefault;
179179
}
180-
if (support_style == smsDefault) {
180+
// Resin-like type always uses organic generation; ignore any user-set style.
181+
if (is_resin_like(object_config.support_type.value))
182+
support_style = smsTreeOrganic;
183+
else if (support_style == smsDefault) {
181184
if (is_tree(object_config.support_type)) {
182185
// Orca: use organic as default
183186
support_style = smsTreeOrganic;

src/libslic3r/Support/TreeSupport.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1659,7 +1659,7 @@ void TreeSupport::generate()
16591659
{
16601660
if (!is_tree(m_object_config->support_type.value)) return;
16611661

1662-
if (m_support_params.support_style == smsTreeOrganic || m_support_params.support_style == smsResinLike) {
1662+
if (m_support_params.support_style == smsTreeOrganic) {
16631663
generate_tree_support_3D(*m_object, this, this->throw_on_cancel);
16641664
return;
16651665
}

src/libslic3r/Support/TreeSupportCommon.hpp

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -92,19 +92,19 @@ struct TreeSupportMeshGroupSettings {
9292
// this->support_tree_tip_diameter = this->support_line_width;
9393
this->support_tree_tip_diameter = std::clamp(scaled<coord_t>(config.tree_support_tip_diameter.value), (coord_t)0, this->support_tree_branch_diameter);
9494

95-
// For resin-like style, use very thin contact tips and narrow branches (SLA-inspired).
96-
if (config.support_style.value == smsResinLike) {
97-
// Tip diameter: use support line width (the minimum printable size) for a pin-head contact point.
95+
// Resin-like type: apply SLA-inspired thin-pillar, pin-head parameters automatically.
96+
if (is_resin_like(config.support_type.value)) {
97+
// Tip diameter: use support line width for a single-extrusion pin-head contact point.
9898
this->support_tree_tip_diameter = this->support_line_width;
99-
// Branch diameter: keep branches thin — at most 2× the line width or the configured value, whichever is smaller.
99+
// Branch diameter: thin pillars — at most 2× line width or the configured value, whichever is smaller.
100100
this->support_tree_branch_diameter = std::min(this->support_tree_branch_diameter,
101101
this->support_line_width * 2);
102102
// Ensure tip_diameter does not exceed branch_diameter.
103103
this->support_tree_tip_diameter = std::min(this->support_tree_tip_diameter,
104104
this->support_tree_branch_diameter);
105-
// Use a high top-rate so the thin tips densely cover the overhang.
105+
// High top-rate so thin tips densely cover the overhang area.
106106
this->support_tree_top_rate = 30.;
107-
// Reduce roof/floor interface to 1 layer — resin supports need minimal flat interface.
107+
// Minimal flat interface (1 layer)easier removal, like resin supports.
108108
if (this->support_roof_enable && this->support_roof_layers > 1)
109109
this->support_roof_layers = 1;
110110
if (this->support_floor_enable && this->support_floor_layers > 1)

src/slic3r/GUI/ConfigManipulation.cpp

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -472,7 +472,7 @@ void ConfigManipulation::update_print_fff_config(DynamicPrintConfig* config, con
472472
auto support_type = config->opt_enum<SupportType>("support_type");
473473
auto support_style = config->opt_enum<SupportMaterialStyle>("support_style");
474474
std::set<int> enum_set_normal = { smsDefault, smsGrid, smsSnug };
475-
std::set<int> enum_set_tree = { smsDefault, smsTreeSlim, smsTreeStrong, smsTreeHybrid, smsTreeOrganic, smsResinLike };
475+
std::set<int> enum_set_tree = { smsDefault, smsTreeSlim, smsTreeStrong, smsTreeHybrid, smsTreeOrganic };
476476
auto & set = is_tree(support_type) ? enum_set_tree : enum_set_normal;
477477
if (set.find(support_style) == set.end()) {
478478
DynamicPrintConfig new_conf = *config;
@@ -743,9 +743,10 @@ void ConfigManipulation::toggle_print_fff_options(DynamicPrintConfig *config, co
743743
//toggle_field("support_closing_radius", have_support_material && support_style == smsSnug);
744744

745745
bool support_is_tree = config->opt_bool("enable_support") && is_tree(support_type);
746-
bool support_is_normal_tree = support_is_tree && support_style != smsTreeOrganic &&
746+
// Resin-like is always organic (auto-configured, no manual normal-tree settings needed)
747+
bool support_is_normal_tree = support_is_tree && !is_resin_like(support_type) && support_style != smsTreeOrganic &&
747748
// Orca: use organic as default
748-
support_style != smsDefault && support_style != smsResinLike;
749+
support_style != smsDefault;
749750
bool support_is_organic = support_is_tree && !support_is_normal_tree;
750751
// settings shared by normal and organic trees
751752
for (auto el : {"tree_support_branch_angle", "tree_support_branch_distance", "tree_support_branch_diameter" })

src/slic3r/GUI/Tab.cpp

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2749,7 +2749,7 @@ void TabPrint::toggle_options()
27492749
if (auto choice = dynamic_cast<Choice*>(field)) {
27502750
auto def = print_config_def.get("support_style");
27512751
std::vector<int> enum_set_normal = {smsDefault, smsGrid, smsSnug };
2752-
std::vector<int> enum_set_tree = { smsDefault, smsTreeSlim, smsTreeStrong, smsTreeHybrid, smsTreeOrganic, smsResinLike };
2752+
std::vector<int> enum_set_tree = { smsDefault, smsTreeSlim, smsTreeStrong, smsTreeHybrid, smsTreeOrganic };
27532753
auto & set = is_tree(support_type) ? enum_set_tree : enum_set_normal;
27542754
auto & opt = const_cast<ConfigOptionDef &>(field->m_opt);
27552755
auto cb = dynamic_cast<ComboBox *>(choice->window);
@@ -2763,6 +2763,9 @@ void TabPrint::toggle_options()
27632763
cb->Append(_(def->enum_labels[i]));
27642764
}
27652765
cb->SetValue(n);
2766+
// Hide the style selector for resin-like: its geometry is fully determined by the type.
2767+
if (auto line = m_active_page->get_line("support_style"))
2768+
line->toggle(!is_resin_like(support_type));
27662769
}
27672770

27682771
// BBL printers do not support cone wipe tower

0 commit comments

Comments
 (0)