Open3D icon indicating copy to clipboard operation
Open3D copied to clipboard

How to create a point cloud by x,y,z?

Open JimXu1989 opened this issue 6 years ago • 2 comments

Is your feature request related to a problem? Please describe. I want to know whether there is a function can make a point cloud from x,y,z directly?

Thanks a lot!

JimXu1989 avatar May 26 '20 12:05 JimXu1989

You mean like this?

p1 = [1, 2, 3]
p2 = [4, 5, 6]
xyz = np.vstack([p1, p2])
pcd = o3d.geometry.PointCloud()
pcd.points = o3d.utility.Vector3dVector(xyz)

p1 would be your first point with x = 1, y = 2, z = 3. p2 would be your second point with x = 4, y = 5, z = 6.

Here are a few more methods: NumPy Tutorial

GnnrMrkr avatar May 26 '20 14:05 GnnrMrkr

You mean like this?

p1 = [1, 2, 3]
p2 = [4, 5, 6]
xyz = np.vstack([p1, p2])
pcd = o3d.geometry.PointCloud()
pcd.points = o3d.utility.Vector3dVector(xyz)

p1 would be your first point with x = 1, y = 2, z = 3. p2 would be your second point with x = 4, y = 5, z = 6.

Here are a few more methods: NumPy Tutorial

Yes! Thanks a lot!!

JimXu1989 avatar May 31 '20 08:05 JimXu1989