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

Fix for wrongly simplified neighbour contours #97

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

carlesros
Copy link

Two fixes for walkContour/simplifyContour:

  • Fix for floating error innacuracy when calculating the maximum
    deviation during simplifyContour: ensure points are passed to
    distancePtSeg on the same order for both neighbour contours.
  • Fix for regions touching only in one vertex: during walkContour mark
    vertices that touch another region in only one vertex, and then let
    simplifyContour insert that vertex in the initial polygon.

See the post "Two bugs in contour generation (and fixes)" in Recast
forum for a detailed description
https://groups.google.com/forum/#!topic/recastnavigation/OHK5JWLvWs0

Two fixes for walkContour/simplifyContour:
- Fix for floating error innacuracy when calculating the maximum
deviation during simplifyContour: ensure points are passed to
distancePtSeg on the same order for both neighbour contours.
- Fix for regions touching only in one vertex: during walkContour mark
vertices that touch another region in only one vertex, and then let
simplifyContour insert that vertex in the initial polygon.

See the post "Two bugs in contour generation (and fixes)" in Recast
forum for a detailed description
https://groups.google.com/forum/#!topic/recastnavigation/OHK5JWLvWs0
@Sandern
Copy link
Contributor

Sandern commented Aug 15, 2015

It seems the changes assume dtTempContour::verts are unsigned shorts, rather than unsigned chars. Mistake, or am I missing something?

@TheMartin
Copy link

Is there a chance this could be ported into the version of walkContour and simplifyContour that's being called from rcBuildContours?

@jakobbotsch jakobbotsch mentioned this pull request Feb 9, 2017
@grahamboree grahamboree self-assigned this Dec 28, 2022
@grahamboree grahamboree removed their assignment Jul 4, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants