From c0899d5895735eae82744c7223309920172f5501 Mon Sep 17 00:00:00 2001 From: alves Date: Sat, 28 Feb 2026 15:45:36 +0800 Subject: [PATCH] fix linux build failed bug. --- src/libslic3r/GCodeWriter.cpp | 26 ++------------------------ 1 file changed, 2 insertions(+), 24 deletions(-) diff --git a/src/libslic3r/GCodeWriter.cpp b/src/libslic3r/GCodeWriter.cpp index fa19ea31ed..f2ffcc8683 100644 --- a/src/libslic3r/GCodeWriter.cpp +++ b/src/libslic3r/GCodeWriter.cpp @@ -30,7 +30,6 @@ void GCodeWriter::apply_print_config(const PrintConfig &print_config) m_physical_extruder_count = print_config.nozzle_diameter.values.size(); if (m_physical_extruder_count == 0) { m_physical_extruder_count = 1; // 防止除零,默认为1 - BOOST_LOG_TRIVIAL(warning) << "GCodeWriter::apply_print_config: nozzle_diameter is empty, using default physical_extruder_count=1"; } bool use_mach_limits = print_config.gcode_flavor.value == gcfMarlinLegacy || print_config.gcode_flavor.value == gcfMarlinFirmware || print_config.gcode_flavor.value == gcfKlipper || print_config.gcode_flavor.value == gcfRepRapFirmware; @@ -50,7 +49,6 @@ void GCodeWriter::apply_print_config(const PrintConfig &print_config) void GCodeWriter::set_extruders(std::vector extruder_ids) { - BOOST_LOG_TRIVIAL(info) << "GCodeWriter::set_extruders: START - Creating Extruder objects for " << extruder_ids.size() << " extruders"; std::sort(extruder_ids.begin(), extruder_ids.end()); m_extruder = nullptr; // this points to object inside `m_extruders`, so should be cleared too @@ -58,16 +56,11 @@ void GCodeWriter::set_extruders(std::vector extruder_ids) m_extruders.reserve(extruder_ids.size()); for (unsigned int extruder_id : extruder_ids) { int physical_extruder_id = get_physical_extruder(extruder_id); - BOOST_LOG_TRIVIAL(info) << "GCodeWriter::set_extruders: Creating Extruder - filament_id=" << extruder_id - << " -> physical_extruder_id=" << physical_extruder_id; + m_extruders.emplace_back(Extruder(extruder_id, physical_extruder_id, &this->config, config.single_extruder_multi_material.value)); } - /* we enable support for multiple extruder if any extruder greater than 0 is used - (even if prints only uses that one) since we need to output Tx commands - first extruder has index 0 */ - this->multiple_extruders = (*std::max_element(extruder_ids.begin(), extruder_ids.end())) > 0; - BOOST_LOG_TRIVIAL(info) << "GCodeWriter::set_extruders: END - multiple_extruders=" << this->multiple_extruders; + this->multiple_extruders = (*std::max_element(extruder_ids.begin(), extruder_ids.end())) > 0; } std::string GCodeWriter::preamble() @@ -504,13 +497,6 @@ std::string GCodeWriter::set_speed(double F, const std::string &comment, const s std::string GCodeWriter::travel_to_xy(const Vec2d &point, const std::string &comment) { - if (std::isnan(point(0)) || std::isinf(point(0)) || std::isnan(point(1)) || std::isinf(point(1))) { - BOOST_LOG_TRIVIAL(error) << "SM Orca: travel_to_xy received NaN/inf point" - << " extruder=" << (m_extruder ? m_extruder->id() : -1) - << " point=(" << point(0) << ", " << point(1) << ")" - << " comment=" << comment; - } - m_pos(0) = point(0); m_pos(1) = point(1); @@ -731,14 +717,6 @@ bool GCodeWriter::will_move_z(double z) const std::string GCodeWriter::extrude_to_xy(const Vec2d &point, double dE, const std::string &comment, bool force_no_extrusion) { - if (std::isnan(point(0)) || std::isinf(point(0)) || std::isnan(point(1)) || std::isinf(point(1))) { - BOOST_LOG_TRIVIAL(error) << "SM Orca: extrude_to_xy received NaN/inf point" - << " extruder=" << (m_extruder ? m_extruder->id() : -1) - << " point=(" << point(0) << ", " << point(1) << ")" - << " dE=" << dE - << " comment=" << comment; - } - m_pos(0) = point(0); m_pos(1) = point(1); if(std::abs(dE) <= std::numeric_limits::epsilon())