artem-ogre / CDT

Constrained Delaunay Triangulation (C++)
https://artem-ogre.github.io/CDT/
Mozilla Public License 2.0
1.02k stars 129 forks source link

Assert during triangulation #142

Closed alkonior closed 12 months ago

alkonior commented 12 months ago

Assertion failed: outerTri != iT, file CDT\include\Triangulation.hpp, line 1625

Test file p2t-test.txt

This is a seriously simplified testbed from poly2tri. debug2.dat

alkonior commented 12 months ago

No intersections. No dots on the edges. The polygon must be triangulated successfully.

image

artem-ogre commented 12 months ago

Thanks @alkonior. This was probably introduced in the last PR. Feel free to roll back to the previous release if you need it to work urgently. Otherwise, I will look into it ASAP.

artem-ogre commented 12 months ago

@alkonior Could you please check the input file? It contains 9 vertices (indices from 0 to 8), but some edges have 9 as index. So maybe one vertex is missing?

artem-ogre commented 12 months ago

Should the right one be:

9 9
2.7145555 -1.5168651
2.5013921 -1.39569
3.0311139 -1.6827598
2.7610707 -1.5269606
2.7745042 -1.5207595
2.8049774 -1.4492451
4.2982483 -2.210517
2.8477705 -1.6077808
2.3252072 -1.3108287
0   1
1   2
2   3
3   4
4   5
5   6
6   7
7   8
8   0
alkonior commented 12 months ago

Yes, my bad. It still throws an assert.

artem-ogre commented 12 months ago

Yes, thanks. I am looking into it.

artem-ogre commented 12 months ago

I think I got the fix. I will hopefully merge it after some more testing. Here's the entire debug2 dataset: cdt_screenshot

artem-ogre commented 12 months ago

@alkonior I merged the fix and did a quick bugfix release.

Огромное спасибо за багрепорт!🙇