-
Notifications
You must be signed in to change notification settings - Fork 79
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
Variable corruption crash with ICP #13
Comments
What is the exact call you're using to invoke the ICP method? |
With the following parameters: for (int i = 0; i < this->movingVertices->getNum(); i++) { |
I've pulled in some ICP-related fixes from upstream: #14 |
Hmm, I will try it :) |
So far I can see i do not get any error messages yet. Thank you for your time. |
All credit goes to Szymon upstream, I just pulled in the changes. |
Hi Forceflow, i found a reproducer. If you use the Mesh_Align.exe with the two times the same mesh it will cause a variable corruption. What won't work:
What does work:
What is remarkable is that the A matrix on rule 344 is filled with -nan(ind) values. |
I've found the problem. As the model is exact the same, the median_dist in rule 205 (ICP.cc) is 0, causing a devision by zero a few rules later. |
Okay - that's a good repro. I'd report this upstream, but thinking about this more has got me wondering: Why are you using ICP on two times the exact same mesh? Doesn't that defeat the point of using ICP? Make me understand what the use case for this is, and I'll happily fix locally or upstream it to Szymon. |
Thank you for your quick reply!, I use the same mesh often for testing / debugging purposes, furthermore I use it to get the transformation between two meshes. This bug also arises when one of the 'same' models is cut and vertices are deleted. |
How would you propose fixing this? Adding a tiny perturbation to the result? |
Hmmm I see the original author tries to overcome this within the code with a check (!if(median_dist)) but i do not think it triggers it. From which git do you pull? maybe i can create a pull request? |
That's part of the reason this fork exists: AFAIK, Szymon only publishes by releasing a ZIP file every now and then. He's a busy man :) You can make a PR against this repo if you want, but maybe it would be smart to keep a little "patches" folder that contains the diffs of what we did to original Trimesh2 code. So when I update to whenever 2.17 releases and this bug isn't fixed upstream, I can just patch here. So
It's a bit cumbersome, but it keeps it easy for me. I'll document whatever I do upstream to get it working here too. It's not much lately, some freeglut fixes. If you're not comfortable doing that, I'd be happy to do it for you as well 👍 |
Hi,
When upgrading from 2.14 to 2.15 we got a crash when using the ICP method.
I've build the libs with use of VS 2017.
The crash is located on line 374 of lineqn.h with the exception: Run-Time Check Failure #2 - Stack around the variable 'e' was corrupted.
We are using the default, unmodified version of the Trimesh2 from this Github.
Callstack:

The text was updated successfully, but these errors were encountered: