tudelft3d / pprepair

Validation and Automatic Repair of Planar Partitions
GNU General Public License v3.0
57 stars 22 forks source link

PPRepair crashes due to stack overflow on input dataset #3

Closed safeBZ closed 11 years ago

safeBZ commented 12 years ago

Please see the attached dataset.

It appears in PlanarPartition::getBoundary()

kenohori commented 12 years ago

It's an interesting case. Apparently, the stack overflow is not caused by a bug in the code, but it's actually a very deep recursion due to the large number of triangles in the same polygon!

I think it can be solved by doing some preprocessing to remove triangles. I'll work on it in the coming weeks.

Another option is using tail recursion, but I'm not sure that it's really possible in this case...

kenohori commented 11 years ago

I've incorporated some simple preprocessing before the reconstruction, which solves this problem.