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. If an odd number of crossings, the p is inside.
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.
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.