# Line - Polygon Intersetion Detection

**URL:** <https://forum.kirupa.com/t/line-polygon-intersetion-detection/324528>\
**Category:** flash\
**Created:** [August 25, 2011, 1:12pm UTC](https://forum.kirupa.com/t/line-polygon-intersetion-detection/324528 "2011-08-25T13:12:14Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![fikontrollet](https://avatars.discourse-cdn.com/v4/letter/f/35a633/32.png) [@fikontrollet](https://forum.kirupa.com/u/fikontrollet)\
**Post date:** [August 25, 2011, 1:12pm UTC](https://forum.kirupa.com/t/line-polygon-intersetion-detection/324528/1 "2011-08-25T13:12:14Z")

</div>

The problem:  
I’m working on a method to do more accurate path finding for a special project. I haven’t yet found any sources on this so i have to write it myself.

The idea was to use a polygon mesh, draw waypoints between all points then discard ways intersecting with a polygon. After that use dijkstra’s algorithm to find the closest path.

Detecting whether a line intersects with a polygon mesh is the tricky part. I haven’t yet come up with any viable solution that is fast.

Any ideas of how i can determine whether a waypoint travels through a polygon?
