7
3

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 1 year has passed since last update.

Pythonのリストをポイントクラウドとして保存する

Last updated at Posted at 2021-02-11
インストール
pip3 install open3d 
GetPCD.py

# coding: utf-8
import open3d as o3d
import numpy as np

world = [[0.0, 0.0, 0.0], [0.0, 0.05, 0.0], [0.0, 0.1, 0.0], [0.05, 0.0, 0.0], [0.05, 0.05, 0.0], [0.05, 0.1, 0.0], [0.1, 0.0, 0.0], [0.1, 0.05, 0.0], [0.1, 0.1, 0.0], [0.0, 0.0, 0.05], [0.0, 0.05, 0.05], [0.0, 0.1, 0.05], [0.05, 0.0, 0.05], [0.05, 0.05, 0.05], [0.05, 0.1, 0.05], [0.1, 0.0, 0.05], [0.1, 0.05, 0.05], [0.1, 0.1, 0.05]]

xyz = np.array(world)
pcd = o3d.geometry.PointCloud()
pcd.points = o3d.utility.Vector3dVector(xyz)
o3d.io.write_point_cloud("test.pcd", pcd)

pcd以外にもplyなどの形式で保存可能.
拡張子を変えればok.

7
3
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
7
3

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?