diff --git a/src/libslic3r/GCode/WipeTower2.cpp b/src/libslic3r/GCode/WipeTower2.cpp index cf5a68b436..6bec4168f4 100644 --- a/src/libslic3r/GCode/WipeTower2.cpp +++ b/src/libslic3r/GCode/WipeTower2.cpp @@ -1215,6 +1215,10 @@ WipeTower::ToolChangeResult WipeTower2::construct_tcr(WipeTowerWriter2& writer, result.extrusions = std::move(writer.extrusions()); result.wipe_path = std::move(writer.wipe_path()); result.is_finish_first = is_finish; + // ORCA: Always initialize the tool_change_start_pos with a valid position + // to avoid undefined variable travel on X in Gcode.cpp function std::string WipeTowerIntegration::post_process_wipe_tower_moves + result.tool_change_start_pos = result.start_pos; // always valid fallback + return result; } diff --git a/src/libslic3r/GCode/WipeTower2.hpp b/src/libslic3r/GCode/WipeTower2.hpp index 3dbc066634..6242b634a8 100644 --- a/src/libslic3r/GCode/WipeTower2.hpp +++ b/src/libslic3r/GCode/WipeTower2.hpp @@ -58,10 +58,18 @@ public: std::vector> get_z_and_depth_pairs() const; float get_brim_width() const { return m_wipe_tower_brim_width_real; } float get_wipe_tower_height() const { return m_wipe_tower_height; } - - - - + // ORCA: Match WipeTower API used by Print skirt/brim planning. + // Returned bounding box is in WIPE-TOWER-LOCAL coordinates (before placement on the bed). + // Include brim and y-shift to match what WT gcode actually prints. + BoundingBoxf get_bbx() const{ + const float brim = m_wipe_tower_brim_width_real; + const Vec2d min(-brim, -brim + double(m_y_shift)); + const Vec2d max(double(m_wipe_tower_width) + brim, double(m_wipe_tower_depth) + brim + double(m_y_shift)); + return BoundingBoxf(min, max); + } + // WT2 doesn't currently compute a rib-origin compensation like WipeTower (m_rib_offset), + // so expose a zero offset for consistency purposes (to maintain API parity). + Vec2f get_rib_offset() const { return Vec2f::Zero(); } // Switch to a next layer. void set_layer( diff --git a/src/libslic3r/Print.cpp b/src/libslic3r/Print.cpp index 330b489141..7a0a6dd867 100644 --- a/src/libslic3r/Print.cpp +++ b/src/libslic3r/Print.cpp @@ -3333,6 +3333,8 @@ void Print::_make_wipe_tower() m_wipe_tower_data.z_and_depth_pairs = wipe_tower.get_z_and_depth_pairs(); m_wipe_tower_data.brim_width = wipe_tower.get_brim_width(); m_wipe_tower_data.height = wipe_tower.get_wipe_tower_height(); + m_wipe_tower_data.bbx = wipe_tower.get_bbx(); + m_wipe_tower_data.rib_offset = wipe_tower.get_rib_offset(); // Unload the current filament over the purge tower. coordf_t layer_height = m_objects.front()->config().layer_height.value;