From 5047d4a10bc21e6e669001adf9a02f37ec5f6b9e Mon Sep 17 00:00:00 2001 From: Lukas Matena Date: Mon, 25 Apr 2022 08:45:01 +0200 Subject: [PATCH 1/4] Minor fix in github issue template --- .github/ISSUE_TEMPLATE/bug_report_form.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/ISSUE_TEMPLATE/bug_report_form.yml b/.github/ISSUE_TEMPLATE/bug_report_form.yml index 7cbaddc49f..cb35544473 100644 --- a/.github/ISSUE_TEMPLATE/bug_report_form.yml +++ b/.github/ISSUE_TEMPLATE/bug_report_form.yml @@ -22,7 +22,7 @@ body: label: Project file & How to reproduce description: "*Please* upload a ZIP archive containing the project file used when the problem arise. Please export it just before the problem occurs. Even if you did nothing and/or there is no object, export it! (it contains your current configuration)." placeholder: | - `File`->`Export project as...` then zip it & drop it here + `File`->`Save project as...` then zip it & drop it here Also, if needed include the steps to reproduce the bug: 1. Go to '...' 2. Click on '....' From 408e56f0390f20aaf793e0aa0c70c4d9544401d4 Mon Sep 17 00:00:00 2001 From: Vojtech Bubnik Date: Mon, 25 Apr 2022 08:33:48 +0200 Subject: [PATCH 2/4] Fix of Boost 1.79 deprecated boost::filesystem::ofstream #8238 Replacing boost::filesystem::fstream with boost::nowide::fstream variants with the unfortunate cost of string path conversion on Windows from 16 bits to UTF8 and back to 16 bits. Unfortunately we cannot use std::filesystem yet as it is missing on older MACs and because the interface is crooked minefield on Windows see https://github.com/microsoft/STL/issues/909 --- src/hints/HintsToPot.cpp | 2 +- src/libslic3r/Preset.cpp | 2 +- src/slic3r/GUI/HintNotification.cpp | 8 +++++--- 3 files changed, 7 insertions(+), 5 deletions(-) diff --git a/src/hints/HintsToPot.cpp b/src/hints/HintsToPot.cpp index 7c8029cdeb..4791f0612f 100644 --- a/src/hints/HintsToPot.cpp +++ b/src/hints/HintsToPot.cpp @@ -9,7 +9,7 @@ bool write_to_pot(boost::filesystem::path path, const std::vector>& data) { - boost::filesystem::ofstream file(std::move(path), std::ios_base::app); + boost::nowide::ofstream file(path.string(), std::ios_base::app); for (const auto& element : data) { //Example of .pot element diff --git a/src/libslic3r/Preset.cpp b/src/libslic3r/Preset.cpp index f3a1c15b3e..f171cb14dd 100644 --- a/src/libslic3r/Preset.cpp +++ b/src/libslic3r/Preset.cpp @@ -84,7 +84,7 @@ ConfigFileType guess_config_file_type(const ptree &tree) VendorProfile VendorProfile::from_ini(const boost::filesystem::path &path, bool load_all) { ptree tree; - boost::filesystem::ifstream ifs(path); + boost::nowide::ifstream ifs(path.string()); boost::property_tree::read_ini(ifs, tree); return VendorProfile::from_ini(tree, path, load_all); } diff --git a/src/slic3r/GUI/HintNotification.cpp b/src/slic3r/GUI/HintNotification.cpp index 93e0fb3259..820b74eedb 100644 --- a/src/slic3r/GUI/HintNotification.cpp +++ b/src/slic3r/GUI/HintNotification.cpp @@ -14,12 +14,14 @@ #include "libslic3r/Config.hpp" #include "libslic3r/PrintConfig.hpp" +#include + #include #include #include #include #include -#include + #include #include #include @@ -65,7 +67,7 @@ inline void push_style_color(ImGuiCol idx, const ImVec4& col, bool fading_out, f void write_used_binary(const std::vector& ids) { - boost::filesystem::ofstream file((boost::filesystem::path(data_dir()) / "cache" / "hints.cereal"), std::ios::binary); + boost::nowide::ofstream file((boost::filesystem::path(data_dir()) / "cache" / "hints.cereal").string(), std::ios::binary); cereal::BinaryOutputArchive archive(file); HintsCerealData cd { ids }; try @@ -84,7 +86,7 @@ void read_used_binary(std::vector& ids) BOOST_LOG_TRIVIAL(warning) << "Failed to load to hints.cereal. File does not exists. " << path.string(); return; } - boost::filesystem::ifstream file(path); + boost::nowide::ifstream file(path.string()); cereal::BinaryInputArchive archive(file); HintsCerealData cd; try From 142b924366971bad0da308699a23aac1d37c2307 Mon Sep 17 00:00:00 2001 From: Lukas Matena Date: Thu, 21 Apr 2022 15:36:35 +0200 Subject: [PATCH 3/4] Fixed MSVC debug assert in lightning infill (invalidated iterator) --- src/libslic3r/Fill/Lightning/TreeNode.cpp | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/libslic3r/Fill/Lightning/TreeNode.cpp b/src/libslic3r/Fill/Lightning/TreeNode.cpp index b36a66dbb7..d1820410ee 100644 --- a/src/libslic3r/Fill/Lightning/TreeNode.cpp +++ b/src/libslic3r/Fill/Lightning/TreeNode.cpp @@ -375,8 +375,9 @@ void Node::convertToPolylines(size_t long_line_idx, Polygons& output) const void Node::removeJunctionOverlap(Polygons& result_lines, const coord_t line_width) const { const coord_t reduction = line_width / 2; // TODO make configurable? - for (auto poly_it = result_lines.begin(); poly_it != result_lines.end(); ) { - Polygon &polyline = *poly_it; + size_t res_line_idx = 0; + while (res_line_idx < result_lines.size()) { + Polygon &polyline = result_lines[res_line_idx]; if (polyline.size() <= 1) { polyline = std::move(result_lines.back()); result_lines.pop_back(); @@ -403,7 +404,7 @@ void Node::removeJunctionOverlap(Polygons& result_lines, const coord_t line_widt polyline = std::move(result_lines.back()); result_lines.pop_back(); } else - ++ poly_it; + ++ res_line_idx; } } From 926ae0471800abd1e5335e251a5934570eb8f6ff Mon Sep 17 00:00:00 2001 From: Vojtech Bubnik Date: Mon, 25 Apr 2022 11:32:03 +0200 Subject: [PATCH 4/4] Follow-up to 408e56f0390f20aaf793e0aa0c70c4d9544401d4 Fixing compilation of tests on latest GCC/boost --- tests/fff_print/test_data.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/tests/fff_print/test_data.cpp b/tests/fff_print/test_data.cpp index 32e31c264c..f7077007db 100644 --- a/tests/fff_print/test_data.cpp +++ b/tests/fff_print/test_data.cpp @@ -11,6 +11,7 @@ #include #include +#include #include #include @@ -286,7 +287,7 @@ std::string gcode(Print & print) print.set_status_silent(); print.process(); print.export_gcode(temp.string(), nullptr, nullptr); - std::ifstream t(temp.string()); + boost::nowide::ifstream t(temp.string()); std::string str((std::istreambuf_iterator(t)), std::istreambuf_iterator()); boost::nowide::remove(temp.string().c_str()); return str;