FIX: do not use organic tree with height ranger modifier

jira: STUDIO-7351
github: #4313
Change-Id: I5a99f88883ec68ab424613fd8b5fdd0d09ef829b
(cherry picked from commit 0b0c3fcd5bec5ee7f4519d936b31f3fb2926919c)
This commit is contained in:
Arthur 2024-06-26 15:19:05 +08:00 committed by Lane.Wei
parent de72331068
commit d2daa4bd16
3 changed files with 16 additions and 9 deletions

View File

@ -1059,14 +1059,20 @@ StringObjectException Print::validate(StringObjectException *warning, Polygons*
// Custom layering is not allowed for tree supports as of now.
for (size_t print_object_idx = 0; print_object_idx < m_objects.size(); ++ print_object_idx)
if (const PrintObject &print_object = *m_objects[print_object_idx];
print_object.has_support_material() && is_tree(print_object.config().support_type.value) && print_object.config().support_style.value == smsTreeOrganic &&
for (size_t print_object_idx = 0; print_object_idx < m_objects.size(); ++print_object_idx) {
PrintObject &print_object = *m_objects[print_object_idx];
print_object.has_variable_layer_heights = false;
if (print_object.has_support_material() && is_tree(print_object.config().support_type.value) &&
print_object.model_object()->has_custom_layering()) {
if (const std::vector<coordf_t> &layers = layer_height_profile(print_object_idx); ! layers.empty())
if (! check_object_layers_fixed(print_object.slicing_parameters(), layers))
return { L("Variable layer height is not supported with Organic supports.") };
if (const std::vector<coordf_t> &layers = layer_height_profile(print_object_idx); !layers.empty())
if (!check_object_layers_fixed(print_object.slicing_parameters(), layers)) {
print_object.has_variable_layer_heights = true;
BOOST_LOG_TRIVIAL(warning) << "print_object: " << print_object.model_object()->name
<< " has_variable_layer_heights: " << print_object.has_variable_layer_heights;
if (print_object.config().support_style.value == smsTreeOrganic) return {L("Variable layer height is not supported with Organic supports.")};
}
}
}
if (this->has_wipe_tower() && ! m_objects.empty()) {
// Make sure all extruders use same diameter filament and have the same nozzle diameter

View File

@ -446,6 +446,7 @@ public:
// BBS: returns 1-based indices of extruders used to print the first layer wall of objects
std::vector<int> object_first_layer_wall_extruders;
bool has_variable_layer_heights = false;
// OrcaSlicer
size_t get_klipper_object_id() const { return m_klipper_object_id; }

View File

@ -605,13 +605,13 @@ TreeSupport::TreeSupport(PrintObject& object, const SlicingParameters &slicing_p
support_type = m_object_config->support_type;
support_style = m_object_config->support_style;
if (support_style == smsDefault) {
// organic support doesn't work with adaptive layer height
if (object.model_object()->layer_height_profile.empty()) {
// organic support doesn't work with variable layer heights (including adaptive layer height and height range modifier, see #4313)
if (!m_object->has_variable_layer_heights) {
BOOST_LOG_TRIVIAL(warning) << "tree support default to organic support";
support_style = smsTreeOrganic;
}
else {
BOOST_LOG_TRIVIAL(warning) << "Adaptive layer height is not supported for organic support, using hybrid tree support instead.";
BOOST_LOG_TRIVIAL(warning) << "tree support default to hybrid tree due to adaptive layer height";
support_style = smsTreeHybrid;
}
}