Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

CURA-12038 Coasting affected by z seam not on vertex #2119

Merged
merged 2 commits into from
Jul 12, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading