pixelsandcandy / poly2tri

Automatically exported from code.google.com/p/poly2tri
Other
0 stars 0 forks source link

Null reference exception #51

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
Hi,

The triangulation of the polyline (contour) below crashes with a null reference 
exception in DTSweep.IsEdgeSideOfTriangle.
See screenshots.
(Previously the triangle.NeighborAcrossFrom() returns a null.)

I consider the polyline as fairly simple, so therefore it is strange why it 
crashes. Any idea?

Version: The latest C# code from the repository, under Visual Studio 2010.

The poly line has the following 2D points (the Z coordinate is always 0):
51.708656311035156, 20.808914184570309,
46.708656311035156, 20.808914184570309,
46.708656311035156, 23.308914184570309,
41.708656311035156, 23.308914184570309,
41.708656311035156, 25.808914184570309,
26.708656311035156, 25.808914184570312,
26.708656311035156, 28.308914184570312,
21.708656311035156, 28.308914184570312,
21.70865631103516, 30.808914184570312,
11.708654403686525, 30.808914184570312,
11.708654403686525, 33.308914184570312,
1.7086552381515523, 33.308914184570312,
1.7086552381515521, 30.808914184570312,
-8.291343688964842, 30.808914184570312,
-8.291343688964842, 28.308914184570312,
-13.291345596313475, 28.308914184570312,
-13.291345596313475, 25.808914184570312,
-38.291343688964844, 25.808914184570316,
-38.291343688964844, 23.308914184570316,
-43.291343688964844, 23.308914184570316,
-43.291343688964844, 20.808914184570316,
-48.291343688964844, 20.808914184570316,
-48.291343688964844, 18.308914184570316,
-53.291343688964844, 18.308914184570316,
-53.291343688964844, 14.708912849426273,
-58.291343688964844, 14.708912849426273,
-58.291343688964844, 11.908915519714359,
-53.291343688964844, 11.908915519714359,
-53.291343688964844, 8.5089139938354528,
-50, 8.5089139938354528,
-50, 9.180425643920902,
-48.291343688964844, 9.180425643920902,
-48.291343688964844, 9.70891380310059,
-45, 9.70891380310059,
-45, 9.79564189910889,
-40, 9.7956418991088885,
-40, 10.37069606781006,
-35, 10.37069606781006,
-35, 10.530872344970705,
-33.291343688964844, 10.530872344970705,
-33.291343688964844, 17.508914947509769,
-28.291343688964844, 17.508914947509766,
-28.291343688964844, 17.908914566040039,
-23.291343688964844, 17.908914566040039,
-23.291343688964844, 18.208913803100586,
-13.291345596313475, 18.208913803100586,
-13.291345596313475, 18.008914947509766,
-8.291343688964842, 18.008914947509766,
-8.291343688964842, 21.008914947509766,
-3.2913444042205797, 21.008914947509766,
-3.2913444042205797, 24.008914947509766,
1.7086552381515519, 24.008914947509766,
1.7086552381515516, 22.408914566040039,
6.7086567878723162, 22.408914566040039,
6.7086567878723162, 24.008914947509766,
11.708654403686525, 24.008914947509766,
11.708654403686525, 24.108913421630859,
16.708656311035156, 24.108913421630859,
16.708656311035156, 21.308914184570312,
21.708656311035156, 21.308914184570312,
21.708656311035156, 20.008914947509766,
26.708656311035156, 20.008914947509766,
26.708656311035156, 17.908914566040039,
31.708656311035156, 17.908914566040036,
31.708656311035156, 10.370696067810057,
35, 10.370696067810057,
35, 11.291717529296873,
40, 11.291717529296873,
40, 7.5089135169982884,
41.708656311035156, 7.5089135169982884,
41.708656311035156, 9.7089138031005842,
46.708656311035156, 9.7089138031005824,
46.708656311035156, 17.508914947509762,
51.708656311035156, 17.508914947509762,

Cheers,
Janos

Original issue reported on code.google.com by janos.za...@gmail.com on 4 Jun 2012 at 4:23

Attachments:

GoogleCodeExporter commented 9 years ago
C# not officially supported. You're more than welcome to submit a patch.

Original comment by mason.gr...@gmail.com on 9 Jul 2012 at 10:46