Contour simplification fails with holes generated by the layer partition method

Skip to first unread message

Gabriel Garcia

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.

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"


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

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
0 new messages