Reputation: 599
I have some vertices whose coordinates were stored as NumPy array.
xyz_np:
array([[ 7, 53, 31],
[ 61, 130, 116],
[ 89, 65, 120],
...,
[ 28, 72, 88],
[ 77, 65, 82],
[117, 90, 72]], dtype=int32)
I want to save these vertices as a point cloud file(such as .ply) and visualize it in Blender.
I don't have face information.
Upvotes: 13
Views: 24278
Reputation: 2672
You can use Open3D to do this.
# Pass numpy array to Open3D.o3d.geometry.PointCloud and visualize
xyz = np.random.rand(100, 3)
pcd = o3d.geometry.PointCloud()
pcd.points = o3d.utility.Vector3dVector(xyz)
o3d.io.write_point_cloud("./data.ply", pcd)
You can also visualize the point cloud using Open3D.
o3d.visualization.draw_geometries([pcd])
Upvotes: 19