Open GoogleCodeExporter opened 9 years ago
Whoops.
"problem_point = euclid.Point2(0, 30)
problem_line = euclid.Line2(euclid.Point2(0, 0), euclid.Point2(0, 50))"
In the steps to reproduce should be
"problem_point = euclid.Point2(0.0, 30.0)
problem_line = euclid.Line2(euclid.Point2(0.0, 0.0), euclid.Point2(0.0, 50.0))"
The direct copy and paste from my interpreter under "What do you see instead?"
correctly uses floats instead of integers.
Sorry.
Original comment by asd454...@yahoo.com
on 23 May 2011 at 1:55
So I may have a fix, more so a patch. I am new to fixing things and posting so let me know if I am real off here... This error only occurs when the point is inside the line so the distance between them is 0. It is creating a line and trying to measure the length of it, but euclid cannot create 0 length lines. To patch this I did the following and it seemed to work. Let me know you thoughts.
def distance(self, other): try: c = self.connect(other) except AttributeError: c = 0 if c: return c.length return 0.0
Original issue reported on code.google.com by
asd454...@yahoo.com
on 23 May 2011 at 1:51