title: Polygon based pathfinding
body: <p>I have implemented a basic grid based A* pathfindinder in Java. I would like to make a navigational mesh/polygon based pathfinder, but the problem I have is this:</p>
  
  <p><img src="https://i.stack.imgur.com/m8FTS.png" alt="basic polygon map with possible routes"></p>
  
  <p>If I found the orange route then I could use something like <a href="http://digestingduck.blogspot.com/2010/03/simple-stupid-funnel-algorithm.html" rel="noreferrer">a funnel algorithm</a> to straighten it to get the desired route (blue). However, if the program calculates the cost of each of the routes, red and orange, then it will say the red one is the cheaper one. How do I program my A* algorithm and/or create my meshes so that this doesn't happen.</p>