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
I'm using EstimateNormals to calculate orientations of user-generated calculation grids. While the points typically are on a plane or a slope there are other cases where the points have a linear dependency where I simply want to fallback to a default orientation. With k=5 I get inconsistent (almost random appearing) orientations in this case (maybe not all points are perfectly linear):
One possibility would to implement a version of EstimateNormals where a default normal can be specified in case the calculation is degenerated (count < 3 or any group of neighboring points have a linear dependency) and some kind of threshold: V3f[] EstimateNormals(this V3d[] points, int k, V3f fallback, double epsilon)
An alternative would be to only add an epsilon parameter and return V3f.Zero (like in one case already), so degenerated normals can be identified on the user side: V3f[] EstimateNormals(this V3d[] points, int k, double epsilon)
The additional pass should not be that expensive compared to the method and the API change would be minimal. It would actually be even more useful than with a directly specified fallback because it can be distinguished between the degenerated case and a point where the normal is calculated as the fallback.
I could start with a local copy of EstimateNormals, but it would be great to have it in this library.
The one thing I'm not sure yet is how the epsilon parameter should be interpreted. I guess since the smallest eigenvalue is the normal, in case there is a second very small value the points are degenerated? Do you have a suggestion on how this check should actually look like?
The text was updated successfully, but these errors were encountered:
We could also return the "quality" of the normal encoded into its length which would allow to filter these things and offload the task of finding a proper epsilon to the user
I'm using EstimateNormals to calculate orientations of user-generated calculation grids. While the points typically are on a plane or a slope there are other cases where the points have a linear dependency where I simply want to fallback to a default orientation. With k=5 I get inconsistent (almost random appearing) orientations in this case (maybe not all points are perfectly linear):
One possibility would to implement a version of EstimateNormals where a default normal can be specified in case the calculation is degenerated (count < 3 or any group of neighboring points have a linear dependency) and some kind of threshold:
V3f[] EstimateNormals(this V3d[] points, int k, V3f fallback, double epsilon)
An alternative would be to only add an epsilon parameter and return V3f.Zero (like in one case already), so degenerated normals can be identified on the user side:
V3f[] EstimateNormals(this V3d[] points, int k, double epsilon)
The additional pass should not be that expensive compared to the method and the API change would be minimal. It would actually be even more useful than with a directly specified fallback because it can be distinguished between the degenerated case and a point where the normal is calculated as the fallback.
I could start with a local copy of EstimateNormals, but it would be great to have it in this library.
The one thing I'm not sure yet is how the epsilon parameter should be interpreted. I guess since the smallest eigenvalue is the normal, in case there is a second very small value the points are degenerated? Do you have a suggestion on how this check should actually look like?
The text was updated successfully, but these errors were encountered: