From 436a454b2e5dc823c6a878b836f82f56922e8834 Mon Sep 17 00:00:00 2001 From: KARBOWSKI Piotr Date: Mon, 9 May 2022 10:35:50 +0200 Subject: [PATCH 1/5] Fix building with new Boost 1.79.0. Fixes #8302 --- src/slic3r/GUI/DesktopIntegrationDialog.cpp | 3 ++- src/slic3r/GUI/GUI_App.cpp | 1 + src/slic3r/Utils/AppUpdater.cpp | 3 ++- 3 files changed, 5 insertions(+), 2 deletions(-) diff --git a/src/slic3r/GUI/DesktopIntegrationDialog.cpp b/src/slic3r/GUI/DesktopIntegrationDialog.cpp index 81c681bc3..7f99a505c 100644 --- a/src/slic3r/GUI/DesktopIntegrationDialog.cpp +++ b/src/slic3r/GUI/DesktopIntegrationDialog.cpp @@ -10,6 +10,7 @@ #include "libslic3r/Platform.hpp" #include "libslic3r/Config.hpp" +#include #include #include #include @@ -503,4 +504,4 @@ DesktopIntegrationDialog::~DesktopIntegrationDialog() } // namespace GUI } // namespace Slic3r -#endif // __linux__ \ No newline at end of file +#endif // __linux__ diff --git a/src/slic3r/GUI/GUI_App.cpp b/src/slic3r/GUI/GUI_App.cpp index 8533854f4..4435f836b 100644 --- a/src/slic3r/GUI/GUI_App.cpp +++ b/src/slic3r/GUI/GUI_App.cpp @@ -13,6 +13,7 @@ #include #include #include +#include #include #include #include diff --git a/src/slic3r/Utils/AppUpdater.cpp b/src/slic3r/Utils/AppUpdater.cpp index 60739ccb3..80f31f69f 100644 --- a/src/slic3r/Utils/AppUpdater.cpp +++ b/src/slic3r/Utils/AppUpdater.cpp @@ -5,6 +5,7 @@ #include #include +#include #include #include #include @@ -242,7 +243,7 @@ boost::filesystem::path AppUpdater::priv::download_file(const DownloadAppData& d tmp_path += format(".%1%%2%", get_current_pid(), ".download"); try { - boost::filesystem::fstream file(tmp_path, std::ios::out | std::ios::binary | std::ios::trunc); + boost::nowide::fstream file(tmp_path, std::ios::out | std::ios::binary | std::ios::trunc); file.write(body.c_str(), body.size()); file.close(); boost::filesystem::rename(tmp_path, dest_path); From effad3a6f8a176ac7c45f6e0abc38a3524ad011b Mon Sep 17 00:00:00 2001 From: Filip Sykala Date: Mon, 9 May 2022 17:02:55 +0200 Subject: [PATCH 2/5] fix initialization type --- tests/libslic3r/test_mutable_priority_queue.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/libslic3r/test_mutable_priority_queue.cpp b/tests/libslic3r/test_mutable_priority_queue.cpp index 3e99eef08..78c97bc7e 100644 --- a/tests/libslic3r/test_mutable_priority_queue.cpp +++ b/tests/libslic3r/test_mutable_priority_queue.cpp @@ -356,7 +356,7 @@ TEST_CASE("Mutable priority queue - first pop", "[MutableSkipHeapPriorityQueue]" [](MyValue &l, MyValue &r) { return l.val < r.val; }); q.reserve(count); for (size_t id = 0; id < count; id++) { - MyValue mv{ id, rand()}; + MyValue mv{ id, rand() / 100.f }; q.push(mv); } MyValue it = q.top(); // copy From 0869f491245827857ce2bcc85a2648ceda0fcb00 Mon Sep 17 00:00:00 2001 From: YuSanka Date: Mon, 9 May 2022 17:04:10 +0200 Subject: [PATCH 3/5] Localization: Update for list.txt --- resources/localization/list.txt | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/resources/localization/list.txt b/resources/localization/list.txt index d68f99bff..bc8c9f272 100644 --- a/resources/localization/list.txt +++ b/resources/localization/list.txt @@ -17,15 +17,20 @@ src/slic3r/GUI/GalleryDialog.cpp src/slic3r/GUI/GCodeViewer.cpp src/slic3r/GUI/GLCanvas3D.cpp src/slic3r/GUI/Gizmos/GLGizmoCut.cpp +src/slic3r/GUI/Gizmos/GLGizmoCut.hpp src/slic3r/GUI/Gizmos/GLGizmoFdmSupports.cpp +src/slic3r/GUI/Gizmos/GLGizmoFdmSupports.hpp src/slic3r/GUI/Gizmos/GLGizmoFlatten.cpp src/slic3r/GUI/Gizmos/GLGizmoHollow.cpp src/slic3r/GUI/Gizmos/GLGizmoMmuSegmentation.cpp +src/slic3r/GUI/Gizmos/GLGizmoMmuSegmentation.hpp src/slic3r/GUI/Gizmos/GLGizmoMove.cpp src/slic3r/GUI/Gizmos/GLGizmoRotate.cpp src/slic3r/GUI/Gizmos/GLGizmoScale.cpp src/slic3r/GUI/Gizmos/GLGizmoSeam.cpp +src/slic3r/GUI/Gizmos/GLGizmoSeam.hpp src/slic3r/GUI/Gizmos/GLGizmoSimplify.cpp +src/slic3r/GUI/Gizmos/GLGizmoSlaSupports.hpp src/slic3r/GUI/Gizmos/GLGizmoSlaSupports.cpp src/slic3r/GUI/Gizmos/GLGizmosManager.cpp src/slic3r/GUI/Gizmos/GLGizmoPainterBase.cpp From 6be84d529d740c44c1e9bf533e70e167b3442063 Mon Sep 17 00:00:00 2001 From: enricoturri1966 Date: Tue, 10 May 2022 08:40:49 +0200 Subject: [PATCH 4/5] #8202 - Fixed detection of layers in vase mode --- src/libslic3r/GCode/GCodeProcessor.cpp | 20 +++++++++++++------- 1 file changed, 13 insertions(+), 7 deletions(-) diff --git a/src/libslic3r/GCode/GCodeProcessor.cpp b/src/libslic3r/GCode/GCodeProcessor.cpp index 92e0a698e..1611b2325 100644 --- a/src/libslic3r/GCode/GCodeProcessor.cpp +++ b/src/libslic3r/GCode/GCodeProcessor.cpp @@ -1991,14 +1991,15 @@ void GCodeProcessor::process_tags(const std::string_view comment, bool producers if (comment == reserved_tag(ETags::Layer_Change)) { ++m_layer_id; if (m_spiral_vase_active) { - if (m_result.moves.empty()) - m_result.spiral_vase_layers.push_back({ m_first_layer_height, { 0, 0 } }); + if (m_result.moves.empty() || m_result.spiral_vase_layers.empty()) + // add a placeholder for layer height. the actual value will be set inside process_G1() method + m_result.spiral_vase_layers.push_back({ FLT_MAX, { 0, 0 } }); else { const size_t move_id = m_result.moves.size() - 1; - if (!m_result.spiral_vase_layers.empty() && m_end_position[Z] == m_result.spiral_vase_layers.back().first) + if (!m_result.spiral_vase_layers.empty()) m_result.spiral_vase_layers.back().second.second = move_id; - else - m_result.spiral_vase_layers.push_back({ static_cast(m_end_position[Z]), { move_id, move_id } }); + // add a placeholder for layer height. the actual value will be set inside process_G1() method + m_result.spiral_vase_layers.push_back({ FLT_MAX, { move_id, move_id } }); } } return; @@ -2828,8 +2829,13 @@ void GCodeProcessor::process_G1(const GCodeReader::GCodeLine& line) m_seams_detector.set_first_vertex(m_result.moves.back().position - m_extruder_offsets[m_extruder_id]); } - if (m_spiral_vase_active && !m_result.spiral_vase_layers.empty() && !m_result.moves.empty()) - m_result.spiral_vase_layers.back().second.second = m_result.moves.size() - 1; + if (m_spiral_vase_active && !m_result.spiral_vase_layers.empty()) { + if (m_result.spiral_vase_layers.back().first == FLT_MAX && delta_pos[Z] > 0.0) + // replace layer height placeholder with correct value + m_result.spiral_vase_layers.back().first = static_cast(m_end_position[Z]); + if (!m_result.moves.empty()) + m_result.spiral_vase_layers.back().second.second = m_result.moves.size() - 1; + } // store move #if ENABLE_PROCESS_G2_G3_LINES From 8c133c01ee21258a701897ef71c1faccb4db4793 Mon Sep 17 00:00:00 2001 From: enricoturri1966 Date: Tue, 10 May 2022 09:07:12 +0200 Subject: [PATCH 5/5] Follow-up of 436a454b2e5dc823c6a878b836f82f56922e8834 - Fixed syntax error --- src/slic3r/Utils/AppUpdater.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/slic3r/Utils/AppUpdater.cpp b/src/slic3r/Utils/AppUpdater.cpp index 80f31f69f..27f2e34bc 100644 --- a/src/slic3r/Utils/AppUpdater.cpp +++ b/src/slic3r/Utils/AppUpdater.cpp @@ -243,7 +243,7 @@ boost::filesystem::path AppUpdater::priv::download_file(const DownloadAppData& d tmp_path += format(".%1%%2%", get_current_pid(), ".download"); try { - boost::nowide::fstream file(tmp_path, std::ios::out | std::ios::binary | std::ios::trunc); + boost::nowide::fstream file(tmp_path.string(), std::ios::out | std::ios::binary | std::ios::trunc); file.write(body.c_str(), body.size()); file.close(); boost::filesystem::rename(tmp_path, dest_path);