AllenMooo / poly2tri

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

seidel.py: AttributeError: 'NoneType' object has no attribute 'right_point' #72

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?

===================================================
from seidel import Triangulator

verts = [(26.090910000000008, 20.543109999999956),
         (33.597770000000025, 20.543109999999956),
         (33.597770000000025, 12.413719999999955),
         (25.46839, 12.413719999999955),
         (25.46839, 20.451549999999997),
         (26.090910000000008, 20.451549999999997),
         (26.090910000000008, 20.54314999999997)]

triangulator = Triangulator(verts)
===================================================

Because the seidel.py module randomly shuffles the edges each time, the error 
only occurs ~50% of the time.

What version of the product are you using? On what operating system?

Revision: 5ad6efedc1c1
Python 2.7.2 on Windows 7.

Please provide any additional information below.

I tracked the problem to line 511 of seidel.py. Whenever 
trapezoids[-1].lower_right==None, the following iteration of the while loop 
raises the exception.

Original issue reported on code.google.com by r...@fobel.net on 10 Apr 2013 at 2:58

GoogleCodeExporter commented 9 years ago
This appears to be related to having 2 points close together. Is there a 
minimum distance between points that will cause the algorithm to fail?

-Ryan

Original comment by r...@fobel.net on 11 Apr 2013 at 5:31

GoogleCodeExporter commented 9 years ago
thanks - will take a look.

Original comment by mason.gr...@gmail.com on 2 May 2013 at 1:25