Bye Bye Moore

PoCソルジャーな零細事業主が作業メモを残すブログ

open3d その2:VoxelGridで埋める

実際のところ

スクリプト

VoxelGridのcreate_from_point_cloud

import open3d
import numpy


# 点群型データ作成
pcd = open3d.geometry.PointCloud()

# 座標設定
for x in range(10):
  pcd.points.append([       0, float(x), 1.0])
  pcd.points.append([float(x),      0.0, 3.0])

# ボクセルのサイズ指定
voxel = open3d.geometry.VoxelGrid.create_from_point_cloud(pcd, 1.0)

open3d.visualization.draw_geometries(
  [voxel],
  width=400,
  height=400,
  point_show_normal = True
  )

f:id:shuzo_kino:20220217125023p:plain
f:id:shuzo_kino:20220217125047p:plain