Crashing when computing distance cloud/mesh

If you are allergic to bug trackers, you can post here any remarks, issues and potential bugs you encounter
Post Reply
JDA
Posts: 3
Joined: Wed Dec 24, 2014 8:51 am

Crashing when computing distance cloud/mesh

Post by JDA »

Hi,

I have a crash when I compute distance between "particular" (?) cloud and mesh. Particular because the cloud has "only" 1000 points and the mesh is "small" (see attached files).

It seems that determineBestOctreeLevel() function of comparison dialog always return 20, which is used as default octree level and lead to very big allocations when calling computePointCloud2MeshDistance() function.

Putting a lower octree value in comparison dialog works perfectly.


Additionally, if I convert the attached sphere.obj in STL the importation is always running after 30 minutes (it seems that CC is again working on a 20 levels octree).
Crash.zip
Crash distance cloud/mesh
(36.8 KiB) Downloaded 958 times
daniel
Site Admin
Posts: 7707
Joined: Wed Oct 13, 2010 7:34 am
Location: Grenoble, France
Contact:

Re: Crashing when computing distance cloud/mesh

Post by daniel »

Hi Jean,

Indeed, the first bug is silly (I just forgot that the level should never be bigger than 9 or 10 for meshes - even with a level 21 octree!).

For the other one I'll look at this asap.

Daniel
Daniel, CloudCompare admin
JDA
Posts: 3
Joined: Wed Dec 24, 2014 8:51 am

Re: Crashing when computing distance cloud/mesh

Post by JDA »

Ok, it works! I think you have the same problem on STL load when unifying vertices (line 417 of STLFilter.cpp).
sphere.zip
STL crash
(64.86 KiB) Downloaded 963 times
daniel
Site Admin
Posts: 7707
Joined: Wed Oct 13, 2010 7:34 am
Location: Grenoble, France
Contact:

Re: Crashing when computing distance cloud/mesh

Post by daniel »

Indeed!

That's even worse: this should be a parameter set by the user himself (as it directly controls the relative accuracy of the coordinate values). But I doubt many users would know how to set it properly...
Daniel, CloudCompare admin
dromeuf
Posts: 1
Joined: Thu Jan 04, 2024 8:55 am

Re: Crashing when computing distance cloud/mesh

Post by dromeuf »

daniel wrote: Wed Dec 24, 2014 10:38 am Indeed, the first bug is silly (I just forgot that the level should never be bigger than 9 or 10 for meshes - even with a level 21 octree!).
Daniel
Hi Daniel, I want to compare two 3D models of a 40 million facets mesh. I've used the "Compute Cloud/Mesh distance" tool on the latest beta version 2024 01 27. At first, I used AUTO parameter for the Octree Level, which was evaluated at 8 in the console logs. Later I wanted to refine it as much as possible, but as soon as I exceeded 10, CloudCompare crashed. I couldn't find any log file that would give me a clue, so I searched the forum. I found your sentence in this thread, which is probably the explanation. To understand the problem, I'd like to know why you can't exceed 10 in Octree Level? It starts calculating, I see the memory growing up but not reaching the maximum of my 64 GB and it crashes. Is it a problem of limitation in the algorithm that the developers wanted ? A mathematical impossibility ?
by the way, congratulations for your extraordinary software.
daniel
Site Admin
Posts: 7707
Joined: Wed Oct 13, 2010 7:34 am
Location: Grenoble, France
Contact:

Re: Crashing when computing distance cloud/mesh

Post by daniel »

Hum, with a mesh that may be challenging in terms of memory (due to the acceleration structure with use). But it shouldn't crash... I'll try to investigate this.
Daniel, CloudCompare admin
daniel
Site Admin
Posts: 7707
Joined: Wed Oct 13, 2010 7:34 am
Location: Grenoble, France
Contact:

Re: Crashing when computing distance cloud/mesh

Post by daniel »

I found the issue. This happens when the internal grid used to speed up the process would have more than 2 billion cells. I fixed the code, but you'll likely hit an error due to the lack of memory (but that's always better than crashing). This will be available in the soon to be release official 2.13.0 version.
Daniel, CloudCompare admin
daniel
Site Admin
Posts: 7707
Joined: Wed Oct 13, 2010 7:34 am
Location: Grenoble, France
Contact:

Re: Crashing when computing distance cloud/mesh

Post by daniel »

Waiting for the release (next week), I've uploaded a new version of the 2.13.beta online.
Daniel, CloudCompare admin
Post Reply