diff --git a/src/BambuStudio.cpp b/src/BambuStudio.cpp index a56d650aa3..a5c10d5148 100644 --- a/src/BambuStudio.cpp +++ b/src/BambuStudio.cpp @@ -2065,6 +2065,11 @@ int CLI::run(int argc, char **argv) print->process(); } if (printer_technology == ptFFF) { + std::string conflict_result = dynamic_cast(print)->get_conflict_string(); + if (!conflict_result.empty()) { + BOOST_LOG_TRIVIAL(error) << "plate "<< index+1<< ": found slicing result conflict!"<< std::endl; + flush_and_exit(CLI_GCODE_PATH_CONFLICTS); + } // The outfile is processed by a PlaceholderParser. //outfile = part_plate->get_tmp_gcode_path(); if (outfile_dir.empty()) { diff --git a/src/libslic3r/Print.cpp b/src/libslic3r/Print.cpp index dc1f4d4fe0..c065889775 100644 --- a/src/libslic3r/Print.cpp +++ b/src/libslic3r/Print.cpp @@ -1691,6 +1691,7 @@ void Print::process(bool use_cache) if (conflictRes.has_value()) { m_conflict_result.set(conflictRes.value().first, conflictRes.value().second); + BOOST_LOG_TRIVIAL(error) << boost::format("gcode path conflicts found between %1% and %2%")%conflictRes.value().first %conflictRes.value().second; } else { m_conflict_result.reset(); } diff --git a/src/libslic3r/Print.hpp b/src/libslic3r/Print.hpp index 0e5e9c368b..ae19bce850 100644 --- a/src/libslic3r/Print.hpp +++ b/src/libslic3r/Print.hpp @@ -772,6 +772,15 @@ public: bool is_support_used() const {return m_support_used;} bool is_BBL_Printer() const { return m_isBBLPrinter;} void set_BBL_Printer(const bool isBBL) { m_isBBLPrinter = isBBL;} + std::string get_conflict_string() const + { + std::string result; + if (m_conflict_result.conflicted) { + result = "Found gcode path conflicts between object " + m_conflict_result.obj1 + " and " + m_conflict_result.obj2; + } + + return result; + } //BBS static StringObjectException sequential_print_clearance_valid(const Print &print, Polygons *polygons = nullptr, std::vector>* height_polygons = nullptr); diff --git a/src/libslic3r/Utils.hpp b/src/libslic3r/Utils.hpp index 98b8e33fc1..120db2ff9d 100644 --- a/src/libslic3r/Utils.hpp +++ b/src/libslic3r/Utils.hpp @@ -50,7 +50,8 @@ #define CLI_TRIANGLE_COUNT_EXCEEDS_LIMIT -59 #define CLI_NO_SUITABLE_OBJECTS_AFTER_SKIP -60 -#define CLI_SLICING_ERROR -100 +#define CLI_SLICING_ERROR -100 +#define CLI_GCODE_PATH_CONFLICTS -101 namespace boost { namespace filesystem { class directory_entry; }}