diff --git a/src/libslic3r/GCode/WipeTower.cpp b/src/libslic3r/GCode/WipeTower.cpp index b386795c11..a334159e9f 100644 --- a/src/libslic3r/GCode/WipeTower.cpp +++ b/src/libslic3r/GCode/WipeTower.cpp @@ -3771,9 +3771,10 @@ void WipeTower::plan_tower_new() } update_all_layer_depth(max_depth); - m_rib_length = std::max({m_rib_length, sqrt(m_wipe_tower_depth * m_wipe_tower_depth + m_wipe_tower_width * m_wipe_tower_width)}); + float diagonal = sqrt(m_wipe_tower_depth * m_wipe_tower_depth + m_wipe_tower_width * m_wipe_tower_width); + m_rib_length = std::max({m_rib_length, diagonal}); m_rib_length += m_extra_rib_length; - m_rib_length = std::max(0.f, m_rib_length); + m_rib_length = std::max(diagonal, m_rib_length); m_rib_width = std::min(m_rib_width, std::min(m_wipe_tower_depth, m_wipe_tower_width) / 2.f); // Ensure that the rib wall of the wipetower are attached to the infill. } diff --git a/src/libslic3r/Print.cpp b/src/libslic3r/Print.cpp index 77179b5c5c..eec86bdfdc 100644 --- a/src/libslic3r/Print.cpp +++ b/src/libslic3r/Print.cpp @@ -4861,7 +4861,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) { + if (!is_rib_wipe_tower || rib_length < EPSILON) { 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); wipe_tower_mesh_data->real_brim_mesh.translate({-brim_width, -brim_width, 0}); @@ -4878,6 +4878,8 @@ void WipeTowerData::construct_mesh(float width, float depth, float height, float wipe_tower_mesh_data->real_brim_mesh.translate(Vec3f(rib_offset[0], rib_offset[1], 0)); wipe_tower_mesh_data->bottom.translate(scaled(Vec2f(rib_offset[0], rib_offset[1]))); } + //wipe_tower_mesh_data->real_wipe_tower_mesh.write_ascii("../wipe_tower_mesh.obj"); + //wipe_tower_mesh_data->real_brim_mesh.write_ascii("../wipe_tower_brim_mesh.obj"); } } // namespace Slic3r diff --git a/src/slic3r/GUI/PartPlate.cpp b/src/slic3r/GUI/PartPlate.cpp index 62cb47515b..8da277fd14 100644 --- a/src/slic3r/GUI/PartPlate.cpp +++ b/src/slic3r/GUI/PartPlate.cpp @@ -2038,8 +2038,9 @@ Vec3d PartPlate::estimate_wipe_tower_size(const DynamicPrintConfig & config, con depth = std::sqrt(volume / layer_height * extra_spacing); if (need_wipe_tower || plate_extruder_size > 1) { float min_wipe_tower_depth = WipeTower::get_limit_depth_by_height(max_height); + double volume_depth = depth; depth = std::max((double) min_wipe_tower_depth, depth); - depth += rib_width / std::sqrt(2) + m_print->config().wipe_tower_extra_rib_length.value; + depth = rib_width / std::sqrt(2) + std::max(depth + m_print->config().wipe_tower_extra_rib_length.value, volume_depth); wipe_tower_size(0) = wipe_tower_size(1) = depth; } }