How to determine which side of a polygon edge is inside a polygon, and which is outside?

白昼怎懂夜的黑 提交于 2019-12-02 02:19:47

Traverse the whole polygon in that direction. If you find that you went clockwise, then the interior is to the right; if you went counter-clockwise, it's to the left.

Another approach:

Project a perpendicular line and count how many times it crosses other edges.

odd -> interior

zero or even -> exterior

Equivalently If you happen to have a well optimized point-in-polygon routine available you can project a point some epsilon off the line and throw it into the inside test.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!