Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/Ultimaker/CuraEngine.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCasper Lamboo <c.lamboo@ultimaker.com>2022-05-12 18:34:12 +0300
committerGitHub <noreply@github.com>2022-05-12 18:34:12 +0300
commit4101921f8c5781022c0b7299762ce918e35baad6 (patch)
tree9c3a42f25a9d89ba0f50f91ba983aad577dc7093
parentd26020e5ffbd02c5c930759d75398669dc8e10ef (diff)
parent6a7c0749b8b0dbbddae40369cd174a9be1be37c4 (diff)
Merge pull request #1659 from Ultimaker/fix_microsegments_again5.0.05.0
[CURA-9293] Define 'too long' line segments as twice the length of smallest.
-rw-r--r--src/utils/ExtrusionLine.cpp2
-rw-r--r--src/utils/polygon.cpp2
2 files changed, 2 insertions, 2 deletions
diff --git a/src/utils/ExtrusionLine.cpp b/src/utils/ExtrusionLine.cpp
index 6523b4428..cdfb5ce90 100644
--- a/src/utils/ExtrusionLine.cpp
+++ b/src/utils/ExtrusionLine.cpp
@@ -136,7 +136,7 @@ void ExtrusionLine::simplify(const coord_t smallest_line_segment_squared, const
&& height_2 <= allowed_error_distance_squared) // Removing the junction (vertex) doesn't introduce too much error.
{
const coord_t next_length2 = vSize2(current - next);
- if (next_length2 > smallest_line_segment_squared)
+ if (next_length2 > 4 * smallest_line_segment_squared)
{
// Special case; The next line is long. If we were to remove this, it could happen that we get quite noticeable artifacts.
// We should instead move this point to a location where both edges are kept and then remove the previous point that we wanted to keep.
diff --git a/src/utils/polygon.cpp b/src/utils/polygon.cpp
index 9b2fbc83f..1e68fab49 100644
--- a/src/utils/polygon.cpp
+++ b/src/utils/polygon.cpp
@@ -540,7 +540,7 @@ void PolygonRef::_simplify(const coord_t smallest_line_segment_squared, const co
&& height_2 <= allowed_error_distance_squared) // removing the vertex doesn't introduce too much error.)
{
const coord_t next_length2 = vSize2(current - next);
- if (next_length2 > smallest_line_segment_squared)
+ if (next_length2 > 4 * smallest_line_segment_squared)
{
// Special case; The next line is long. If we were to remove this, it could happen that we get quite noticeable artifacts.
// We should instead move this point to a location where both edges are kept and then remove the previous point that we wanted to keep.