Can I generate Point Cloud from mesh?

44.2k views Asked by At

I'm trying to generate point cloud data from mesh such as (.obj) file of Maya. But, I could find out only the opposite case, point cloud to mesh on the internet. Is there any way to create "point cloud data from mesh" using 3D tools like MeshLab or Maya? (I prefer using MeshLab)

Thanks. :)

6

There are 6 answers

3
D.J.Duff On BEST ANSWER

The Point Cloud Library has a couple of different command-line tools for turning meshes into point clouds, as far as I know by rendering the object into points from a set of views and combining the renderings. e.g. pcl_mesh2pcd, pcl_mesh_sampling

0
Maghoumi On

It's interesting that there aren't any definitive answers to this question on the web.

Conversion from a mesh to a point cloud is not similar to jamming the mesh's vertices into a point cloud! Mesh is a sparse representation of a point cloud. Therefore, to convert a mesh to a point cloud, you need to sample points on the surface of the mesh. PCL has a utility for doing that called pcl_mesh_sampling. The source code is located here.

Basically, the method samples N points uniformly from the surface of the mesh using VTK. It is very effective and you'll get point clouds with any number of points you want.

0
Geetchandra On

I wanted to do the same, but preferred something which can be done easily in Python. I found this post to be really useful. It uses a Python library called pyntcloud. It loads a mesh in .ply format and samples a specified number of points from it randomly such that it covers the surface in a more or less uniform manner. It can be easily adapted for other formats. I have done so for .off files and it works well.

3
Chris4d On

The free and open-source project CloudCompare can load OBJ meshes and then generate point clouds on the mesh, which you can then save in a variety of formats.

0
jackberry On

I was searching for the similar problem. I needed to project the mesh model in different poses to generate pointcloud data.

And then I found the below project in github. If anyone wants to generate pointclouds (.pcd) from a mesh object (.obj) in various poses, this would help.

This will simulate kinect-format pointcloud for the given mesh object.

https://github.com/jbohg/render_kinect

2
ALoopingIcon On

Converting a triangulated mesh to a point cloud means that you want make a point sampling on that surface. Depending on the required distribution (e.g. Uniform Montecarlo, Poisson Disk, etc.) there are different algorithms with quite different results. For example if you need well spaced random point you need a poisson disk distribution. You can test some of these algorithms inside meshlab or directly on the your browswer on http://www.meshlabjs.net/ (just load a mesh and type 'sampling' in the search box).

You can find a c++ open source implementation inside the mesh processing vcg library (http://www.vcglib.net) and a description of these algorithm (quite simple to be implemented) in:

Efficient and flexible sampling with blue noise properties of triangular meshes
M Corsini, P Cignoni, R Scopigno
IEEE Transactions on Visualization and Computer Graphics 18 (6), 914-924
http://vcg.isti.cnr.it/Publications/2012/CCS12/