open3d生成4X4立方体散点点云

import open3d as o3d
import numpy as np


x, y, z = np.meshgrid(np.arange(4), np.arange(4), np.arange(3))
data = np.stack((x, y, z), axis=-1)
print(data.shape)
data = data.reshape(-1,3)
print(data.shape)


# 将数据转换成点云对象
point_cloud = o3d.geometry.PointCloud()
point_cloud.points = o3d.utility.Vector3dVector(data)

# 创建一个 visualization 窗口
vis = o3d.visualization.Visualizer()
vis.create_window()

# 将点云添加到窗口
vis.add_geometry(point_cloud)

# 显示窗口
vis.run()

open3d生成4X4立方体散点点云_第1张图片

你可能感兴趣的:(python,numpy,开发语言)