我有一个多边形位于一个三维平面上。我想通过这个polygon.can任何封闭所有点帮助我吗? 我可以通过飞机更换扫描线进行三维扫描线算法,并得到飞机与我多边形的交集,但我希望有一个更快的解决方案。 先谢谢了。
I have a polygon that lies on a 3D plane. i want to get all points enclosed by this polygon.can anyone help me ? i can make a 3D scan line algorithm by replacing the scan lines by planes and get the intersection of planes with my polygon but i want a faster solution. Thanks in advance.
是的,它是一个凸多边形3P,但所有的点都在同一平面上
"yes it's a convex 3p polygon ,but it all its points lie in the same plane"
在这种情况下 - 只是转换多边形和所有测试点到平面的二维局部坐标系,并使用二维算法:
In that case - just convert the polygon and all the test points into 2D local coordinates of the plane and use a 2D algorithm:
2D射线拍摄:你仍然可以使用类似的算法来我的3D的建议 - 拍摄2D光线从你的测试点始发,并指望有多少次你打你的多边形的边界
2D ray shooting: You can still use similar algorithm to my 3d suggestion - shoot 2D rays originating from your test point and count how many times you hit the border of your polygon.
线性不等式:如果您的多边形是凸的,你可以按照suszterpatt的方式,与你的多边形定义为halfplanes AX +以&lt的交集; d
Linear inequalities: If your polygon is convex, you can follow suszterpatt's approach, with your polygon defined as an intersection of halfplanes ax+by<d
延伸阅读:
http://en.wikipedia.org/wiki/Point_in_polygon http://www.ecse.rpi.edu/主页/ WRF /科研/ Short_Notes / pnpoly.html http://paulbourke.net/geometry/insidepoly/ http://en.wikipedia.org/wiki/Point_in_polygon http://www.ecse.rpi.edu/Homepages/wrf/Research/Short_Notes/pnpoly.html http://paulbourke.net/geometry/insidepoly/