You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I want to sample CAD models in stl format, and find that stl can be convert to pcd files with pcl.
There is code in c++:
//read CAD model in stl format
vtkSmartPointer<vtkSTLReader> reader = vtkSmartPointer<vtkSTLReader>::New();
reader->SetFileName("T0-2.stl");
reader->Update();
//convert to ply format
vtkSmartPointer<vtkPolyData> polyData = vtkSmartPointer<vtkPolyData>::New();
polyData = reader->GetOutput();
polyData->GetNumberOfPoints();
pcl::PointCloud<pcl::PointXYZRGBA>::Ptr cloud(new pcl::PointCloud<pcl::PointXYZRGBA>());
//ply to pcd
pcl::io::vtkPolyDataToPointCloud(polyData, *cloud);
//show point cloud
pcl::visualization::PCLVisualizer visual("stl2pcd");
visual.setBackgroundColor(255, 255, 255);
visual.addPointCloud(cloud, "input_cloud");
visual.spin();
//save pcd file
pcl::io::savePCDFileASCII("stl2pcd.pcd", *cloud);
When I rewrite these code in python with pclpy, I meet a problem that there is pcl::io::vtkPolyDataToPointCloud(polyData, *cloud); in c++ code, but there is no vtkPolyDataToPointCloud function or sth like this in pclpy.pcl.io.
Is it a bug or is there other parts in pclpy that can get the same result?
The text was updated successfully, but these errors were encountered:
I want to sample CAD models in stl format, and find that stl can be convert to pcd files with pcl.
There is code in c++:
When I rewrite these code in python with pclpy, I meet a problem that there is
pcl::io::vtkPolyDataToPointCloud(polyData, *cloud);
in c++ code, but there is novtkPolyDataToPointCloud
function or sth like this in pclpy.pcl.io.Is it a bug or is there other parts in pclpy that can get the same result?
The text was updated successfully, but these errors were encountered: