pyntcloud icon indicating copy to clipboard operation
pyntcloud copied to clipboard

Calculate height from base of a 3D point cloud

Open cravisjan97 opened this issue 5 years ago • 1 comments

I am finding it difficult to find an algorithm to calculate the height of a 3D shape given a point cloud. This feature is useful for many shape analysis operations

cravisjan97 avatar Oct 06 '20 17:10 cravisjan97

I'm not sure if I'm fully understanding the question but I think that you could get the height by computing the (maximum - minimum) of the z coordinate as follows:

from pyntcloud import PyntCloud
anky = PyntCloud.from_file("data/ankylosaurus_mesh.ply")
anky_cloud = anky.get_sample("mesh_random", n=100000, rgb=True, normals=True, as_PyntCloud=True)
height = anky_cloud.points["z"].ptp()

daavoo avatar Oct 09 '20 10:10 daavoo