ENH: protect for accuracy issue
Jira: none Signed-off-by: qing.zhang <qing.zhang@bambulab.com> Change-Id: Ief104b8ea449e1292db5bd3847ecea779bccff39
This commit is contained in:
parent
3e9006e2d4
commit
6201da0a6d
|
@ -551,7 +551,8 @@ ExtrusionLoopSloped::ExtrusionLoopSloped( ExtrusionPaths &original_paths,
|
|||
paths.emplace_back(std::move(flat_path), *path);
|
||||
remaining_length = 0;
|
||||
} else {
|
||||
remaining_length -= path_len;
|
||||
// BBS: protection for accuracy issues
|
||||
remaining_length = remaining_length - path_len < EPSILON ? 0 : remaining_length - path_len;
|
||||
const double end_ratio = lerp(1.0, start_slope_ratio, remaining_length / slope_min_length);
|
||||
add_slop(*path, path->polyline, start_ratio, end_ratio);
|
||||
start_ratio = end_ratio;
|
||||
|
|
Loading…
Reference in New Issue