DotRecast
DotRecast copied to clipboard
Problem with contour simplification.
trafficstars
So I've got this error: rcBuildContours: Bad outline for region 6, contour simplification is likely too aggressive.
This is how raw vs simplified looks:
So yeah, the simplified polygon is self-intersecting, which is a problem. Looking at the code, however, I see this bit (rcContours.SimplifyContour):
- We start with raw vertices, iterate over all pairs and look for changes in either neighbour region id or area border flag, and add them as initial 'seed' vertices in simplified list - this is reasonable.
- Then we iterate over pairs of simplified vertices, and for each pair see whether error (max distance between simplified edge and raw vertex) is bigger than threshold, if so split the simplified edge - this is reasonable.
- However, this error check is only done for vertices that are either bordering wall or other area - this is not done for 'interior' vertices (bordering different region with same area). As a result, the error for them can be arbitrarily large, and it can create self intersections. This leads to a misleading error message (it blames aggressive simplification, while in reality all the checks using passed simplification parameters are skipped).
When comparing DotRecast and recastnavigation, I couldn't find any differences. Could this issue possibly be due to recastnavigation?
If so, it seems like it should be reported to recastnavigation. How should we proceed with this?