Fix: crash when top_interface_layer==1 in NormalSupport

it's caused by "33666: ENH: add transition_layer for normal support | https://gerrit.bambooolab.com/c/bbl/bamboo_slicer/+/33666", when top_interface_layer==1, return size_t(-1).

jira: none
Change-Id: Id0f5e53165df96bf955cddcaf66c97c179e132c1
(cherry picked from commit 73e9023b5644dd8bf89243cc2cba5f936ad4f3e9)
This commit is contained in:
jiaxi.chen 2025-04-16 15:45:16 +08:00 committed by Lane.Wei
parent 4364a4ecca
commit ded96083bb
1 changed files with 2 additions and 2 deletions

View File

@ -43,7 +43,7 @@ struct SupportParameters {
// support_filament==0
bool differnt_support_interface_filament = object_config.support_interface_filament != 0 &&
object_config.support_interface_filament != object_config.support_filament;
this->num_top_base_interface_layers = differnt_support_interface_filament ? 2 : 0;
this->num_top_base_interface_layers = differnt_support_interface_filament && num_top_interface_layers > 0 ? 2 : 0;
this->num_bottom_base_interface_layers = differnt_support_interface_filament ? 1 : 0;
}
}
@ -235,7 +235,7 @@ struct SupportParameters {
bool has_contacts() const { return this->has_top_contacts || this->has_bottom_contacts; }
bool has_interfaces() const { return this->num_top_interface_layers + this->num_bottom_interface_layers > 0; }
bool has_base_interfaces() const { return this->num_top_base_interface_layers + this->num_bottom_base_interface_layers > 0; }
size_t num_top_interface_layers_only() const { return this->num_top_interface_layers - this->num_top_base_interface_layers; }
size_t num_top_interface_layers_only() const { return std::max(0, int(this->num_top_interface_layers) - int(this->num_top_base_interface_layers)); }
size_t num_bottom_interface_layers_only() const { return this->num_bottom_interface_layers - this->num_bottom_base_interface_layers; }
Flow first_layer_flow;
Flow support_material_flow;