简体   繁体   English

用点填充任意3D几何体积的方法

[英]Approaches for filling the volume of arbitrary 3D geometry with points

I'm looking to fill the volume of an arbitrary mesh with points, such that the resulting points form the rough shape of the original geometry. 我希望用点填充任意网格的体积,这样得到的点就形成了原始几何体的粗糙形状。

I've come across this article on mesh sampling, which looks promising, but wanted to see whether there were alternative approaches. 我已经看过关于网格采样的这篇文章看起来很有希望,但想看看是否有其他方法。 Note that although I'm not looking to perform this operation in real-time, speed is still favourable over accuracy. 请注意,虽然我打算实时执行此操作,但速度仍然优于准确性。

圆环的网格采样

A typical approach is rejection sampling . 典型的方法是拒绝抽样 Place a bounding box around your object. 在对象周围放置一个边界框。 Generate random points within the box. 在框内生成随机点。 For each point p, shoot a ray in a random direction and count crossings with your object mesh. 对于每个点p,以随机方向拍摄光线并使用对象网格计算交叉点。 If an odd number of crossings, the p is inside. 如果是奇数个交叉点,则p在内部。

There are two challenges to this method. 这种方法有两个挑战。 First, if your object only fills a small percentage of the bounding-box volume, most of your samples will be rejected. 首先,如果您的对象仅填充边界框体积的一小部分,则大多数样本将被拒绝。 Second, you need robust code for counting ray crossings. 其次,您需要强大的代码来计算射线交叉。 The latter has been worked out pretty thoroughly. 后者已经彻底解决了。 Naive approaches can easily fail. 天真的方法很容易失败。

More sophisticated approaches use random walks inside your object to end up at a random location inside. 更复杂的方法使用对象内部的随机漫游最终到达内部的随机位置。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM