Closed coolinfan20 closed 5 years ago
Hi, you can install openmesh Framwork to solved your Problem.
import openmesh as om
mesh = om.TriMesh() om.read_mesh(mesh, source_file.stl) om.write_mesh(mesh, output_file.ply)
Hey does anyone know how to convert a .ply to .pcd
I tried this and it worked, if you want to convert triangular mesh to point cloud
import open3d as o3d
mesh = o3d.io.read_triangle_mesh("file.stl")
pointcloud = mesh.sample_points_poisson_disk(100000)
# you can plot and check
o3d.visualization.draw_geometries([mesh])
o3d.visualization.draw_geometries([pointcloud])
Hi,
How would I convert an STL file to a point cloud file (either .pcd or .ply file)? I have tried reading the STL file as a mesh file and then using the following code to try to convert it to a point cloud, but this does not work.
Using the python package numpy-stl, I did the following to read the mesh:
your_mesh = mesh.Mesh.from_file("/../../Open3D/examples/Python/Basic/Dog.stl")
and then your source code:
pcd = PointCloud()
pcd.points = Vector3dVector(your_mesh)
write_point_cloud("../../TestData/test_dog.ply", pcd)
pcd_load = read_point_cloud("../../TestData/test_dog.ply")
draw_geometries([pcd_load])
but it isn't able to execute the draw_geometries function. Is there another way to import and convert an stl file into a pcd or ply file?
Thanks!