Is there a function to identify whether polylines are located inside a polygonal region?
Show older comments
I am trying to create a network which will first generate some random points within a polygon and then connect those points using polylines. The polygon has few holes in it and I don't want my network to pass through those holes. The function "inpolygon" is able to identify whether or not a point is inside a polygon. So, none of my points are generated within those holes. However, the problem is with the lines which connect those points. The lines are passing through those holes. Is there a function like 'inpolygon' which will be able to identify whether a line is inside a polygon? I have attached a screenshot of my problem. Any kind of help will be highly appreciated. Thanks!

2 Comments
Walter Roberson
on 2 May 2018
Do the holes follow the convention of having their vertices in the other order (clockwise / counterclockwise) from your polygon exterior?
Also, do you have R2017b or later?
Taufiq Rashid
on 3 May 2018
Accepted Answer
More Answers (0)
Categories
Find more on Polygonal Shapes in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!