Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

manual normals calculation from Pyntcloud.points object #311

Open
jkissi opened this issue Nov 7, 2021 · 1 comment
Open

manual normals calculation from Pyntcloud.points object #311

jkissi opened this issue Nov 7, 2021 · 1 comment

Comments

@jkissi
Copy link

jkissi commented Nov 7, 2021

Hello
I have a problem when load .pcd files.PyntCloud.from_file()does not automatically create normals from .pcd files as it does from .ply files. I have tried to manually load my point data into a PyntCloud object using

cloud = PyntCloud(points)

However the resulting dataframe only consists of the x y z coordinates and not the normal vectors, which I also need. Can you show an example of how these can be manually generated? Is there a way to automatically create all the same variables as if you are using the from_file() function?

Thanks!
J

@daavoo
Copy link
Owner

daavoo commented Nov 9, 2021

Hola @jkissi !

Unfortunately, there is no support for oriented normals, only unoriented which can be computed as follows:

k_neighbors = cloud.get_k_neighbors(k=10, ...)
cloud.add_scalar_field(
        "normals",
        k_neighbors=k_neighbors)

However, if your point cloud file already contains normal information, it looks like the way to go should be to extend read_pcd to correctly parse the normals from the file.

Alternatively (or in addition) we could add a new from_instance option to parse PCD instances directly (similar to from_pyvista)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants