当前位置:网站首页>Use meshlab to sample the point cloud of CAD model and display it in PCL

Use meshlab to sample the point cloud of CAD model and display it in PCL

2022-06-11 06:16:00 A vegetable chicken of photoelectricity

The version used is solidworks 2016+meshlab 2016.12+PCL 1.8.0

solidworks part
Draw the model you want to render as point cloud data

Select when saving as STL file

mashlab part
2.1 File->import mesh-> The saved stl file

choice ok

Click to see the coordinate system of the model
2.2 Modify the coordinate system
Filters->normal, curvatures and orientation->transform:rotation( rotate )//translate, center, set origin( translation )
Modify the coordinate system you want according to the coordinates of the bounding box
2.3 Monte Carlo filter
Filters->sampling-> montecarlo sampling

When saving, choose ply Point cloud format for You can use PCL Open the

pcl::PointCloud<pcl::PointXYZ>::Ptr chip(new pcl::PointCloud<pcl::PointXYZ>);
	if (pcl::io::loadPLYFile<pcl::PointXYZ>("1.ply", *chip) == -1) //* load the file
	{
		PCL_ERROR("Couldn't read file test_pcd.pcd \n");
		return (-1);
	}
	else {
		cout << "chip's size is" << chip->size() << endl;
	}
原网站

版权声明
本文为[A vegetable chicken of photoelectricity]所创,转载请带上原文链接,感谢
https://yzsam.com/2022/162/202206110554090057.html