0

For a recent project I tried to find a path through a maze of polygons. The path is a line, only going in between these polygons or obstacles. I want to check if the line moved through one of the polygons.

I already found a build-in function in tkinter named find_overlapping, however this only works for rectangles. Is there another solution to this? Or it is possible to use find_overlapping

Thanks for your effort.:)

martineau
  • 119,623
  • 25
  • 170
  • 301
Tommynem
  • 21
  • 4
  • 1
    Hi, to improve your chances of getting an answer I suggest that you take a look at [how to ask good question](https://stackoverflow.com/help/how-to-ask) and how to create a [Minimal, Complete, and Verifiable example](https://stackoverflow.com/help/mcve). This will help you get the help you seek much faster. Regards, – Remy J Jan 27 '19 at 14:38
  • There's nothing built-in to do that, so you'll probably need to write your own. Since this would involve checking for an intersection between the path line and each of the lines comprising the edges of a given polygon, you can speed the whole process up considerable by doing some higher-level bounding-box testing before bothering to test all the edges—so using `find_overlapping` could be useful even with its limitations. – martineau Jan 27 '19 at 15:03
  • Ok, good to know that! Is there a easy way to find such a intersection between two lines? – Tommynem Jan 27 '19 at 15:12
  • [How do I compute the intersection point of two lines in Python?](https://stackoverflow.com/questions/20677795/how-do-i-compute-the-intersection-point-of-two-lines-in-python) Please learn how to use (and start using) this site's search capabilities. – martineau Jan 27 '19 at 16:03

0 Answers0