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

addNormals warnings #372

Closed
stla opened this issue Jun 21, 2023 · 1 comment · Fixed by #373
Closed

addNormals warnings #372

stla opened this issue Jun 21, 2023 · 1 comment · Fixed by #373

Comments

@stla
Copy link

stla commented Jun 21, 2023

Hello,

I have this mesh (you can read it with Rvcg::vcgPlyRead).

When I do addNormals(mesh), I have some warnings:

1: In acos(dot/veclen(a)/veclen(b)) : NaNs produced
2: In acos(dot/veclen(a)/veclen(b)) : NaNs produced
......

I find it's strange because I don't see what is bad in this mesh.

When I do addNormals(mesh, angleWeighted = FALSE), there's no warning.

There's also an angle weighted method in the Rvcg package (Rvcg::vcgUpdateNormals(mesh, type=1)), it works without errors/warnings.

@dmurdoch
Copy link
Owner

I think that's caused by rounding error. In the first case, the dot/veclen(a)/veclen(b) value comes out to 1 + 2e-16, and acos gives NaN as the answer. I'll force the values to the range -1 to 1.

Thanks for the report.

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

Successfully merging a pull request may close this issue.

2 participants