Closed sheiling closed 2 years ago
Hi Even I am facing a similar error while trying to triangulate a 2D contour in the shape of letter 'D'. The error I am facing is exactly like the above example where two points are wrongly generated on the bottom left and bottom right.
Hi,when I searched some tips about this problem,but not got a direct answer. So I using " ear cut " make the polygon triangle right!
---Original--- From: "Praveen Agrawal"<notifications@github.com> Date: Mon, Oct 21, 2019 20:51 PM To: "jhasse/poly2tri"<poly2tri@noreply.github.com>; Cc: "sheiling"<863583026@qq.com>;"Author"<author@noreply.github.com>; Subject: Re: [jhasse/poly2tri] Simple polygon triangles error! (#8)
Hi Even I am facing a similar error while trying to triangulate a 2D contour in the shape of letter 'D'. The error I am facing is exactly like the above example where two points are wrongly generated on the bottom left and bottom right.
— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub, or unsubscribe.
Hello, I have found out that sometimes generated triangles use head and tail points from the SweepContext. Any idea why?
Hello,
I investigated this issue. It turns out that the input polygon isn't simple, which is a requirement of the input of poly2tri
(see README for more information.)
More precisely, the following edges taken from the original input are self-intersecting:
628 511
628 508
632 508
610 509
This can be seen by zooming in on that area:
./p2t.exe ./testbed/data/triangles-issue-8.dat 620 510 40
In addition to my previous post, if we move one of the points to make the polygon simple, then the triangulation works properly.
Moving point 628 508
to 628 509
:
Whole solution with the patched polygon:
When I using "poly2tri" to triangles my polygons, amlost of them can work fines! But, this polygon works invalid.
triangles.zip
Can your help me,thanks!