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

signed distances are not calculated if distance is >1e5 #10

Closed
jefferis opened this issue Aug 24, 2017 · 8 comments
Closed

signed distances are not calculated if distance is >1e5 #10

jefferis opened this issue Aug 24, 2017 · 8 comments

Comments

@jefferis
Copy link
Contributor

I am working with some electron microscopy data calibrated in nm. I am using signed distance with vcgClostKD to determine if points are inside a mesh. Some of my distances from points outside the mesh are greater than 1E5.

Unfortunately 1E5 is being used as a signalling value in some contexts to mean out of range. The lines below effectively assumes that all distances are <1E5.

Rvcg/src/RvcgKD.h

Lines 188 to 193 in d689603

if (sign && (distances[i] < 1e5)) {
Point3f dif = clost - currp;
//float sign = dif.dot(vertexnormal);
if (dif.dot(vertexnormal) < 0)
distances[i] = -distances[i];
}

would it perhaps be possible to use a NAN/Inf or other signalling procedure?

@zarquon42b
Copy link
Owner

Hi Jeff,
I will look into this.

@zarquon42b
Copy link
Owner

Fixed in 63329d0: Set max dist to 1e12 and all beyond to NaN.
Please test and close issue if you deem it fixed.

@jefferis
Copy link
Contributor Author

Thanks a lot. I'll take a look later but based on the code change I think this will work for me.

@jefferis
Copy link
Contributor Author

Thanks again!

@jefferis
Copy link
Contributor Author

jefferis commented Sep 2, 2017

PS @zarquon42b do you have any plans for a CRAN release in the near future?

@zarquon42b
Copy link
Owner

If you need it, I will make one. No big deal.

@jefferis
Copy link
Contributor Author

jefferis commented Sep 3, 2017

Thank you! Would be very handy as Rvcg is a dependency for my packages and most of my users are on mac and do not have a development environment set up but can use binary packages from CRAN.

@zarquon42b
Copy link
Owner

Hi Greg,
FYI: it is now on CRAN
Best
Stefan

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

No branches or pull requests

2 participants