【Python】【Open3D】.pcd及.obj三维可视化

如题

import numpy as np
import open3d as o3d

# pcd点云显示
pcd = o3d.io.read_point_cloud('xxx.pcd')
print(pcd)
o3d.visualization.draw_geometries([pcd], window_name="Open3D0")

# obj面片显示
textured_mesh= o3d.io.read_triangle_mesh('xxx.obj')
print(textured_mesh)
textured_mesh.compute_vertex_normals()
o3d.visualization.draw_geometries([textured_mesh], window_name="Open3D1")

# obj顶点显示
pcobj = o3d.geometry.PointCloud()
pcobj.points = o3d.utility.Vector3dVector(textured_mesh.vertices)
o3d.visualization.draw_geometries([pcobj], window_name="Open3D2")

# obj顶点转array
textured_pc =np.asarray(textured_mesh.vertices)
print(textured_pc)

【Python】【Open3D】.pcd及.obj三维可视化_第1张图片
(a) 面片显示

【Python】【Open3D】.pcd及.obj三维可视化_第2张图片
(b) 顶点显示

【Python】【Open3D】.pcd及.obj三维可视化_第3张图片

你可能感兴趣的:(Python,可视化,python,可视化,图形学)