在复杂多边形中查找点

发布于 2024-08-06 17:52:55 字数 177 浏览 6 评论 0原文

这个多边形的形状可以像 C

我尝试了这里的公式 如何确定 2D 点是否在多边形内?

但是它没有实际上并不能正确预测该点是否在多边形中。

This polygon could be shaped like a C

I tried the formula located here
How can I determine whether a 2D Point is within a Polygon?

however it doesn't actually correctly predict if the point is in the polygon.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

玩物 2024-08-13 17:52:55

最简单的方法 - 特别是对于很多点来说,是对多边形进行三角测量,然后进行三角形测试中的一个点。
您可以将多边形转换为一组凸多边形,但这比较棘手。

另请参阅4 边多边形内的随机点

Easiest way - especially for lots of points is to triangulate the polygon then do a point in triangle test.
You could convert the polygon into a set of convex polygons but that is trickier.

See also Random points inside a 4-sided Polygon

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文