Approaches for filling volume of arbitrary 3D geometry with points

I want to fill the volume of an arbitrary mesh with points so that the resulting points form the rough shape of the original geometry.

I came across this article on mesh fetching that looks promising, but wanted to see if there are alternative approaches. Please note, although I do not want to perform this operation in real time, speed is still favorable compared to accuracy.

Sampling a Torus Mesh

+3


source to share


1 answer


A typical approach is rejection sampling. Place a bounding box around the object. Create random dots in the field. For each p point, shoot a ray in a random direction and intersect with your mesh of objects. If there is an odd number of intersections, p is inside.

There are two problems with this method. First, if your subject only fills a small percentage of the bounding box's volume, most of your samples will be rejected. Second, you need robust ray counting code. The latter was elaborated quite carefully. Naive approaches can easily fail.



More sophisticated approaches use random walks inside your object to end up in a random place inside.

+1


source







All Articles