Create point cloud from mesh.

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

Create point cloud from mesh.

Lucas
My goal is to create a point cloud from a CAD model. I create the model with AutoCAD and save it as stl file and then do the following steps:

pcl::PolygonMesh::Ptr stl_file(new pcl::PolygonMesh);
pcl::io::loadPolygonFileSTL("cad_model.stl", *stl_file);
pcl::PointCloud<pcl::PointXYZ>::Ptr cloud_ptr(new pcl::PointCloud<pcl::PointXYZ>);
pcl::fromROSMsg(stl_file->cloud, *cloud_ptr);

This works, but I would actually like to have a point cloud that represents the surface of my CAD model and not only the mesh verticies. It would be ideal if I could create a model with AutoCAD and then transform this into a point cloud (maybe by setting a certain density for the points on the surface). Is this possible or do I have to roll my own function (e.g. filling out the polygons with points)?
Reply | Threaded
Open this post in threaded view
|

Re: Create point cloud from mesh.

koen buys-2
I think this functionality is in the simulation sublibrary in trunk.

Koen


On 24 April 2013 13:14, Lucas <[hidden email]> wrote:
My goal is to create a point cloud from a CAD model. I create the model with
AutoCAD and save it as stl file and then do the following steps:

pcl::PolygonMesh::Ptr stl_file(new pcl::PolygonMesh);
pcl::io::loadPolygonFileSTL("cad_model.stl", *stl_file);
pcl::PointCloud<pcl::PointXYZ>::Ptr cloud_ptr(new
pcl::PointCloud<pcl::PointXYZ>);
pcl::fromROSMsg(stl_file->cloud, *cloud_ptr);

This works, but I would actually like to have a point cloud that represents
the surface of my CAD model and not only the mesh verticies. It would be
ideal if I could create a model with AutoCAD and then transform this into a
point cloud (maybe by setting a certain density for the points on the
surface). Is this possible or do I have to roll my own function (e.g.
filling out the polygons with points)?



--
View this message in context: http://www.pcl-users.org/Create-point-cloud-from-mesh-tp4027497.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: Create point cloud from mesh.

ppwwyyxx
I'm also in need of this functionality. I've checked the documentation of the simulation trunk,  but I still cannot get any idea on how to sample points on the surface of a PolygonMesh to generate a point cloud.

Could you be more clear pls? or can anyone else help?

Thanks
Reply | Threaded
Open this post in threaded view
|

Re: Create point cloud from mesh.

shome
In reply to this post by Lucas
where is the header for loadPolygonFileSTL?

i would like to load an stl file
Reply | Threaded
Open this post in threaded view
|

Re: Create point cloud from mesh.

shome
use pcl_mesh2pcd for conversion for conversion to pcd.
Reply | Threaded
Open this post in threaded view
|

Re: Create point cloud from mesh.

Transpose
Hello:

Does mesh2pcd works for you? Now I want to generate point cloud from vertices and triangles from CAD. I don't just want vertices, instead, I need an algorithm to create a point cloud with uniform density (could be a parameter). I am not sure if mesh2pcd will work for it, and can you give me some clue?

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

Re: Create point cloud from mesh.

VictorLamoine
Administrator
Hello,

The mesh_sampling program probably fits your needs.
Tell me if it doesn't!

Bye