获得积分围了3D多边形 [英] Get points enclosed by a 3d polygon

查看:195
本文介绍了获得积分围了3D多边形的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个多边形位于一个三维平面上。我想通过这个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/Homepages/wrf/Research/Short_Notes/pnpoly.html
  • http://paulbourke.net/geometry/insidepoly/

这篇关于获得积分围了3D多边形的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆