You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Fails to Account for non-matching Normals Vector Size #212
Within the pybind11 folder, the following code is found for the ccPointCloudPy.normalsFromNPArray_copy:
if (!self.hasNormals())
self.reserveTheNormsTable();
constPointCoordinateType*s=reinterpret_cast<constPointCoordinateType*>(array.data());
for (size_ti=0; i<self.size(); ++i)
{
constCCVector3&N=reinterpret_cast<constCCVector3&>(s[3*i]);
CCVector3NN=N;
NN.normalize();
self.setPointNormal(i, NN);
}
When I export a cloud from CloudCompare, it has a normals vector with a shape of (1). I'm not entirely sure why this is, but to fix, the code just needs to check the size of the previous normals and confirm they match the shape expected(which is (N, 3)).
Hello,
Back on CloudComPy after a long summer break. I hope you have resolved your issue.
When using cloudComPy to obtain a Numpy array from normals, if the cloud does not contain normals, the result is a normal vector of shape (1): see ccPointCloudPy.normalsToNpArray_copy in the pybind11 folder. I think that's the case for you. You must first create normals with cloudComPy.
When the cloud contains normals, the result is a normal vector of shape (number of points, 3): see test054.py in the examples.
The piece of code you provide is used to define the normals in the cloud from a numpy array.
If this does not answer your question, please let me know.
Activity
prascle commentedon Sep 1, 2025
Hello,
Back on CloudComPy after a long summer break. I hope you have resolved your issue.
When using cloudComPy to obtain a Numpy array from normals, if the cloud does not contain normals, the result is a normal vector of shape (1): see ccPointCloudPy.normalsToNpArray_copy in the pybind11 folder. I think that's the case for you. You must first create normals with cloudComPy.
When the cloud contains normals, the result is a normal vector of shape (number of points, 3): see test054.py in the examples.
The piece of code you provide is used to define the normals in the cloud from a numpy array.
If this does not answer your question, please let me know.
Regards,
Paul