Contour simplification fails with holes generated by the layer partition method

22 views
Skip to first unread message

Gabriel Garcia

unread,
Apr 24, 2024, 4:59:28 PMApr 24
to recastnavigation
Hello there!

I'm having a tough time deciding on partition methods, I'm having this issue with watershed, where a staircase going up back and forth generates an overlapping contour which fails to triangulate.

watershed_overlap.jpg
Red circles are the overlapping areas, and you can see the polygon mesh (dark blue) is all sorts of borked due to failed triangulation, outlines are the raw and simplified contours.

I decided to test the layer partition method which claims to fix watershed's edge cases but I ended up with this hole, which contour simplification failed to deal with, do I have a bug in my contour simplification code maybe? Because layers does say "relies on the triangulation code to cope with holes"

hole_issues.jpg
simplification_hole_error.jpg


Only monotone generated no edge cases in my game's maps, I think my strategy will be, per tile, trying watershed, if triangulation fails, try layer, if triangulation fails, try monotone, if triangulation fails, give up on game development and open a mechanic car shop. Is that a reasonable strategy?

Really appreciate the work, the library is amazing, and I look forward to eventually be contributing!

Thanks a lot! Cheers!

Gabriel Garcia

unread,
Apr 24, 2024, 6:32:27 PMApr 24
to recastnavigation
I just realized I mixed the balls a bit here, when this is mentioned:

"relies on the triangulation code to cope with holes"

It's not talking about the polygon mesh triangulation code, instead, it's talking about rcBuildLayerRegions triangulation code, with that in mind, I think my question is: "do I maybe have a bug in my build layer regions code?"

Reply all
Reply to author
Forward
0 new messages