FIX:Crash caused by wipe_tower depth = 0

and remove useless assert

jira: STUDIO-12514,STUDIO-12474,github#7064
Change-Id: I8faf498251c8f7ca2c1eead463f38e8a3d836299
(cherry picked from commit 723e2d7ced6b466f2166085b8ca007762aaf17aa)
This commit is contained in:
jiangkai.zhao
2025-06-04 14:34:09 +08:00
committed by Noisyfox
parent 2ba649d7ef
commit fd17dd6382
2 changed files with 7 additions and 2 deletions

View File

@@ -4705,6 +4705,7 @@ void WipeTowerData::construct_mesh(float width, float depth, float height, float
{
wipe_tower_mesh_data = WipeTowerMeshData{};
float first_layer_height=0.08; //brim height
if (width < EPSILON || depth < EPSILON || height < EPSILON) return;
if (!is_rib_wipe_tower) {
wipe_tower_mesh_data->real_wipe_tower_mesh = make_cube(width, depth, height);
wipe_tower_mesh_data->real_brim_mesh = make_cube(width + 2 * brim_width, depth + 2 * brim_width, first_layer_height);
@@ -4714,7 +4715,9 @@ void WipeTowerData::construct_mesh(float width, float depth, float height, float
} else {
wipe_tower_mesh_data->real_wipe_tower_mesh = WipeTower::its_make_rib_tower(width, depth, height, rib_length, rib_width, fillet_wall);
wipe_tower_mesh_data->bottom = WipeTower::rib_section(width, depth, rib_length, rib_width, fillet_wall);
wipe_tower_mesh_data->bottom = offset(wipe_tower_mesh_data->bottom, scaled(brim_width)).front();
auto brim_bottom = offset(wipe_tower_mesh_data->bottom, scaled(brim_width));
if (!brim_bottom.empty())
wipe_tower_mesh_data->bottom = brim_bottom.front();
wipe_tower_mesh_data->real_brim_mesh = WipeTower::its_make_rib_brim(wipe_tower_mesh_data->bottom, first_layer_height);
wipe_tower_mesh_data->real_wipe_tower_mesh.translate(Vec3f(rib_offset[0], rib_offset[1],0));
wipe_tower_mesh_data->real_brim_mesh.translate(Vec3f(rib_offset[0], rib_offset[1], 0));