Closed daichi-ishida closed 1 year ago
Hi,
The platform is Windows, but as for the RVD build, running it on Linux does not finish the process as well. Could it be related to the point cloud being too dense? (As for point cloud, there no duplicated points)
Here is my dataset and example program: https://github.com/daichi-ishida/geogram_example
The data
directory contains success case and failure case (that causes stack overflow).
You can switch them on lines 175 and 176 in geogram_example/src/point_check/main.cpp
Thanks in advance
Fantastic ! Thank you very much for this detailed issue report (the best one I have ever received !).
I was able to get it and compile it. I will come back to you shortly, as soon as I make progress.
Got it ! Pretty nice example :-)
To obtain it, I changed two things:
1) insert this line right right after all the other GEO::CmdLine(...)
calls:
GEO::CmdLine::set_arg("algo:delaunay","PDEL");
2) replace the call to preprocess(M_domain)
with:
M_domain.facets.triangulate();
Explanations:
The default algorithm for RVD computation uses a KDTree, which is in general faster than computing a Delaunay triangulation. In the case of your second example, it has a very sharp variation of pointset density (around the border of the motorcycle). For this reason, the RVD algorithm needs to query a large number of nearest neighbors. Since they are allocated on the stack, it is what caused the stack overflow. The line GEO::CmdLine::set_arg("algo:delaunay","PDEL")
tells the system to use a standard Delaunay triangulation algorithm instead of nearest neighbor search (and the P
is for Parallel).
It seems that the pre-processing function is bugged. Need to investigate more (it generates a kind of weird pyramid instead of keeping the original box). Anyway, we do not really need it. We just need to make sure the facets are triangulated before tetrahedralizing it.
Just filed a pull request to https://github.com/daichi-ishida/geogram_example with the fix.
Thank you for your quick response and for resolving the issue! I have also tested and confirmed that it works on my end as well, so I have merged the Pull Request.
Hi Bruno, this library is very practical and I've been using this a lot!
I am currently facing an issue with a stack overflow exception when setting up a large-scale point cloud with around 650,000 points in CVT. Further investigation suggests that the
NearestNeighbors
andKdTree
used in theDelaunay_NearestNeighbors
class are consuming the stack excessively. Are there any options available to address this problem and prevent the stack overflow exception?This is how I set now (almost same as vorpalite)
Many thanks