rowanwins / visibility-graph

Visibility graph implementation to support shortest path calculations such as dijkstra or a-star
https://rowanwins.github.io/visibility-graph/debug/dist
MIT License
51 stars 7 forks source link

Visibility graph calculation is very slow for large polygon set #4

Open dhivehi opened 4 years ago

dhivehi commented 4 years ago

Visibility graph can be optimized by removing unneeded lines. If both ends of a line is tangent to a polygon, then it's needed. Else it is not needed. Please make a way to check if p1 and p2 are tangent to a polygon before adding to visibility graph as it would make visibility graph generation multiple times faster.