[Bf-python] hash(ed) vs ed.key

Campbell Barton cbarton at metavr.com
Tue Dec 19 08:58:31 CET 2006


At the moment hash(ed) == ed.index,

So as to be able to reference edges from faces Iv added face.edge_keys
and ed.key

face.edge_keys might be.... (0,3), (1,6), (4,5), (2,3)

Where each pair is the 2 verts on the edge of the face, sorted by order.
ed.key == min(ed.v1.index, ed.v2.index), max(ed.v1.index, ed.v2.index)

Martin suggested ed.key be made into __hash__. anyone mind if the sorted
pair replace the index as the hash key?
its a bit slower in cases where the edge index would do but replaces the 
need for ed.key, people could always use the edge index as a hash still.

- Cam

-- 
Campbell J Barton

133 Hope Street
Geelong West, Victoria 3218 Australia

URL:    http://www.metavr.com
e-mail: cbarton at metavr.com
phone: AU (03) 5229 0241





More information about the Bf-python mailing list