Skip to content

[CURA-13287] Re-fix random dots without introducing microsegments. - #2357

Open
Remco Burema (rburema) wants to merge 3 commits into
mainfrom
CURA-13287_fix_microseg_regress
Open

[CURA-13287] Re-fix random dots without introducing microsegments.#2357
Remco Burema (rburema) wants to merge 3 commits into
mainfrom
CURA-13287_fix_microseg_regress

Conversation

@rburema

Copy link
Copy Markdown
Member

Originally, an issue (see #2089 / C-9399) was fixed, where we needed to re-insert some ignored local maxima.

This fix was intended to be applied only for very small areas. Large areas didn't need to be corrected for, certainly not ones large enough to be a problem w.r.t non-convexness. (And non-connected shapes won't be treated as a single area w.r.t. SkeletalTrapezoidation.)

We found, while doing some other work, that this could cause points to appear in the middle of nowhere (see comments in #2346 / C-13250). This was fixed by taking into account that averaged points should only be merged when close together.

The real problem was however that the fix was also applied to large areas (otherwise the middle of nowhere behaviour wouldn't be possible at all). If we restrict the fix to only be for cases where the total length of the covered lines is very small (as posited, but not actually implemented, in the first mentioned PR), we get the originally intended behaviour of the hack.

... and this is not a problem, because there can't be multiple areas within a single trapezoidation (other than holes), and areas otherwise large enough to contain multiple clearly separate local maxima are not the intended target for the original and now current fix anyway). (Even though the input for the trapezoidation is a Shape, not a SimpleShape ... but the outline that it receives as an input via SlicePart is, at the very least for the walls.)

P.S. I wanted the combined_local_maxima_point to be an optional, but that turned out to work a bit ugly with the +-operator.

Remco Burema (rburema) and others added 3 commits August 5, 2026 15:57
Originally, an issue (see #2089 / C-9399) was fixed, where we needed to re-insert some ignored local maxima. This fix was intended to be applied only for very small areas. Large areas didn't need to be corrected for, certainly not ones large enough to be a problem w.r.t non-convexness. (And non-connected shapes won't be treated as a single area w.r.t. SkeletalTrapezoidation.) -- We found, while doing some other work, that this could cause points to appear in the middle of nowhere (see commets in #2346 / C-13250). This was fixed by taking into account that averaged points should only be merged when close togehter. -- The real problem was however that the fix was also applied to large areas (otherwise the middle of nowhere behaviour wouldn't be possible at all). If we restrict the fix to only be for cases where the total length of the covered lines is very small, we get the originally inteded behaviour of the hack (and this is not a problem, because there can't be multiple areas within a single trapezoidation other than holes, and areas _otherwise_ large enough to contain multiple clearly separate local maxima are not the intended target for the original and now curent fix anyway).

CURA-13287
I actually wanted to use an optional, but that turned out to work a bit ugly with the += operator. But then I just deleted the 'does this actually exist' check, instead of replacing it with this. Fixed.

part of CURA-13287
@github-actions

github-actions Bot commented Aug 5, 2026

Copy link
Copy Markdown
Contributor

Test Results

31 tests   31 ✅  5s ⏱️
 1 suites   0 💤
 1 files     0 ❌

Results for commit bb861bc.

♻️ This comment has been updated with latest results.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just a minor remark. Code looks good, but I must admit I don't get the global meaning...

@@ -2212,11 +2212,22 @@ void SkeletalTrapezoidation::generateLocalMaximaSingleBeads()
Point2LL p_;
coord_t width_;
size_t acc_;

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I know this is not part of this PR, but could this variable be renamed with a more explicit name ? Out of the context, I don't know if this is acceleration, accumulation or something else 😄

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants