Hi,
Looks like we use different versions or "euclid" lib.
In euclid version here, hash use Point2.__repr__ basically rounding coords values with a 0.01 precision.
The rounding for hash is likely to fix precision issues when it comes to merge points as close enough points will inherit the same hash value.
def hash_point2(p):
# this assume a 2.f precision from __repr__
return hash(p.__repr__())
def hash_point2(p, precision):
return hash("Point2(%.{0}f, %.{0}f)".format(precision) % (p.x, p.y))
Hi,
Looks like we use different versions or "euclid" lib.
In euclid version here, hash use
Point2.__repr__basically rounding coords values with a 0.01 precision.The rounding for hash is likely to fix precision issues when it comes to merge points as close enough points will inherit the same hash value.