diff --git a/src/libslic3r/TreeModelVolumes.cpp b/src/libslic3r/TreeModelVolumes.cpp index 8bf26c90b..f29193dbf 100644 --- a/src/libslic3r/TreeModelVolumes.cpp +++ b/src/libslic3r/TreeModelVolumes.cpp @@ -42,7 +42,7 @@ TreeSupportMeshGroupSettings::TreeSupportMeshGroupSettings(const PrintObject &pr // const std::vector printing_extruders = print_object.object_extruders(); // Support must be enabled and set to Tree style. - assert(config.support_material); + assert(config.support_material || config.support_material_enforce_layers > 0); assert(config.support_material_style == smsTree || config.support_material_style == smsOrganic); // Calculate maximum external perimeter width over all printing regions, taking into account the default layer height. diff --git a/src/libslic3r/TreeSupport.cpp b/src/libslic3r/TreeSupport.cpp index 9649321c6..8082fab8e 100644 --- a/src/libslic3r/TreeSupport.cpp +++ b/src/libslic3r/TreeSupport.cpp @@ -154,7 +154,7 @@ static std::vector>> group_me const PrintObjectConfig &object_config = print_object.config(); #endif // NDEBUG // Support must be enabled and set to Tree style. - assert(object_config.support_material); + assert(object_config.support_material || object_config.support_material_enforce_layers > 0); assert(object_config.support_material_style == smsTree || object_config.support_material_style == smsOrganic); bool found_existing_group = false; @@ -227,7 +227,7 @@ void tree_supports_show_error(std::string_view message, bool critical) std::vector out(print_object.layer_count(), Polygons{}); const PrintObjectConfig &config = print_object.config(); - const bool support_auto = config.support_material_auto.value; + const bool support_auto = config.support_material.value && config.support_material_auto.value; const int support_enforce_layers = config.support_material_enforce_layers.value; std::vector enforcers_layers{ print_object.slice_support_enforcers() }; std::vector blockers_layers{ print_object.slice_support_blockers() }; @@ -240,7 +240,8 @@ void tree_supports_show_error(std::string_view message, bool critical) //FIXME this is a fudge constant! auto enforcer_overhang_offset = scaled(config.support_tree_tip_diameter.value); - tbb::parallel_for(tbb::blocked_range(1, out.size()), + size_t num_overhang_layers = support_auto ? out.size() : std::max(size_t(support_enforce_layers), enforcers_layers.size()); + tbb::parallel_for(tbb::blocked_range(1, num_overhang_layers), [&print_object, &enforcers_layers, &blockers_layers, support_auto, support_enforce_layers, support_threshold_auto, tan_threshold, enforcer_overhang_offset, &throw_on_cancel, &out] (const tbb::blocked_range &range) { for (LayerIndex layer_id = range.begin(); layer_id < range.end(); ++ layer_id) {