Generating Point cloud from mesh

classic Classic list List threaded Threaded
6 messages Options
Reply | Threaded
Open this post in threaded view
|

Generating Point cloud from mesh

Transpose
Hello,

I want to create a point cloud from the cad model, I don't just want vertices. Instead, I need a point cloud which could represent the input cad model.

Is there any function in PCL or some algorithms for it?

Thanks!
Jun
Reply | Threaded
Open this post in threaded view
|

Re: Generating Point cloud from mesh

Sjoberg
Hi,

I have struggled to find a way to do this as well. I believe that my solution lacks "elegance" and is rather brute forced in its nature, but here we go:

- Create a desired CAD model(I assume you have done this already) and save it as an .stl-file.

- For the next step, I use MeshLab(simply download it if you don't have it installed on your computer already). Import the .stl-file that you created earlier. Change the visualization of the model to "Points".

- Go to Filters -> Remeshing, Simplification and Reconstruction -> Refine User-Defined, then click "apply".

At this point, you should be able to see that your CAD model becomes a point cloud when you click on the "apply" button. When you are happy with your point cloud, convert your .stl-file to the .ply format. As soon as you have obtained the .ply-file, you should be able to convert it to a .pcd-file by using the ply2pcd functionality in the PCL.

In summary, I convert .stl->.ply, and then .ply->.pcd, but I use MeshCad to obtain the point cloud of my CAD model.

Alexander
Reply | Threaded
Open this post in threaded view
|

Re: Generating Point cloud from mesh

nenadpol
This post was updated on .
In reply to this post by Transpose
Hi,

Any decent CAD software (Autocad, MicroStation) has built in functions to extract points from cad objects ( surface, primitives, b-spline...).
By setting up different input parameters you can control point cloud density in different directions.

cheers
Nenad
Reply | Threaded
Open this post in threaded view
|

Re: Generating Point cloud from mesh

MechanicalMonk

Just throwing my two cents in. Given the assumption that your mesh is already subdivided enough (which it would be if it is exported as an stl from a cad program), you can just straight up convert it to a ply file (using Blender or something similar) and load up the resulting file in pcl. Ply can store mesh data but pcl ignores it!

Jari

On Mar 4, 2016 9:50 AM, "nenadpol" <[hidden email]> wrote:
Hi,

Any decent CAD software (Autocad, MicroStation) has built in functions to
extract points from cad objects ( surface, primitives, b-spline...).

cheers
Nenad



--
View this message in context: http://www.pcl-users.org/Generating-Point-cloud-from-mesh-tp4041106p4041121.html
Sent from the Point Cloud Library (PCL) Users mailing list mailing list archive at Nabble.com.
_______________________________________________
[hidden email] / http://pointclouds.org
http://pointclouds.org/mailman/listinfo/pcl-users

_______________________________________________
[hidden email] / http://pointclouds.org
http://pointclouds.org/mailman/listinfo/pcl-users
Reply | Threaded
Open this post in threaded view
|

Re: Generating Point cloud from mesh

VictorLamoine
Administrator
Hello,

PCL does not ingore mesh data in PLY file.
If you load a PLY file into a point cloud then you load only the vertices.
If you load a PLY file into a PolygonMesh then you will retain faces information.

You can extract points from a mesh just by extracting the cloud underlying the polygonmesh.
Another alternative is to use the mesh_sampling tool to create a dense point cloud from a point cloud.

Bye
Reply | Threaded
Open this post in threaded view
|

Re: Generating Point cloud from mesh

MechanicalMonk

That's what I had meant Victor but I was too lazy to point out the specific loading function :D

On Mar 4, 2016 11:20 AM, "VictorLamoine" <[hidden email]> wrote:
Hello,

PCL does not ingore mesh data in PLY file.
If you load a PLY file into a point cloud then you load only the vertices.
If you load a PLY file into a  PolygonMesh
<http://docs.pointclouds.org/trunk/classpcl_1_1geometry_1_1_polygon_mesh.html#a744914c3029e17ed01e12ee19a29f068>
then you will retain faces information.

You can extract points from a mesh just by extracting the cloud underlying
the polygonmesh.
Another alternative is to use the  mesh_sampling
<https://github.com/PointCloudLibrary/pcl/blob/master/tools/mesh_sampling.cpp>
tool to create a dense point cloud from a point cloud.

Bye



--
View this message in context: http://www.pcl-users.org/Generating-Point-cloud-from-mesh-tp4041106p4041124.html
Sent from the Point Cloud Library (PCL) Users mailing list mailing list archive at Nabble.com.
_______________________________________________
[hidden email] / http://pointclouds.org
http://pointclouds.org/mailman/listinfo/pcl-users

_______________________________________________
[hidden email] / http://pointclouds.org
http://pointclouds.org/mailman/listinfo/pcl-users