Skip to content

Commit

Permalink
fix build errors and handle more plate offset cases
Browse files Browse the repository at this point in the history
  • Loading branch information
SoftFever committed Oct 17, 2023
1 parent afa6457 commit 4e29aea
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions src/libslic3r/GCode.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -665,6 +665,8 @@ static std::vector<Vec2d> get_path_of_change_filament(const Print& print)

Vec2f wipe_tower_offset = tcr.priming ? Vec2f::Zero() : m_wipe_tower_pos;
float wipe_tower_rotation = tcr.priming ? 0.f : alpha;
Vec2f plate_origin_2d(m_plate_origin(0), m_plate_origin(1));


std::string tcr_rotated_gcode = post_process_wipe_tower_moves(tcr, wipe_tower_offset, wipe_tower_rotation);

Expand Down Expand Up @@ -802,8 +804,8 @@ static std::vector<Vec2d> get_path_of_change_filament(const Print& print)
}

// A phony move to the end position at the wipe tower.
gcodegen.writer().travel_to_xy(end_pos.cast<double>());
gcodegen.set_last_pos(wipe_tower_point_to_object_point(gcodegen, end_pos));
gcodegen.writer().travel_to_xy((end_pos + plate_origin_2d).cast<double>());
gcodegen.set_last_pos(wipe_tower_point_to_object_point(gcodegen, end_pos + plate_origin_2d));
if (!is_approx(z, current_z)) {
gcode += gcodegen.writer().retract();
gcode += gcodegen.writer().travel_to_z(current_z, "Travel back up to the topmost object layer.");
Expand Down

0 comments on commit 4e29aea

Please sign in to comment.