Skip to content

Commit

Permalink
CURA-12038 Coasting affected by z seam not on vertex (#2119)
Browse files Browse the repository at this point in the history
  • Loading branch information
HellAholic authored Jul 12, 2024
2 parents e29a1ef + d05898a commit 6488675
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/LayerPlan.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1151,7 +1151,9 @@ void LayerPlan::addWall(
for (size_t piece = 0; piece < pieces; ++piece)
{
const double average_progress = (double(piece) + 0.5) / pieces; // How far along this line to sample the line width in the middle of this piece.
const coord_t line_width = p0.w_ + average_progress * delta_line_width;
// Round the line_width value to overcome floating point rounding issues, otherwise we may end up with slightly different values
// and the generated GCodePath objects will not be merged together, which some subsequent algorithms rely on (e.g. coasting)
const coord_t line_width = std::lrint(static_cast<double>(p0.w_) + average_progress * static_cast<double>(delta_line_width));
const Point2LL destination = p0.p_ + normal(line_vector, piece_length * (piece + 1));
if (is_small_feature)
{
Expand Down

0 comments on commit 6488675

Please sign in to comment.