Sfoglia il codice sorgente

Made the edge equals functions independant of orientation.

Eiyeron Fulmincendii 9 anni fa
parent
commit
615b6214e4
1 ha cambiato i file con 2 aggiunte e 2 eliminazioni
  1. 2 2
      delaunay.lua

+ 2 - 2
delaunay.lua

@@ -57,7 +57,7 @@ end
 --- `Edge` class
 -- @type Edge
 local Edge = class()
-Edge.__eq = function(a, b) return (a.p1 == b.p1 and a.p2 == b.p2) end
+Edge.__eq = function(a, b) return (a.p1 == b.p1 and a.p2 == b.p2) or (a.p1 == b.p2 and a.p2 == b.p1) end
 Edge.__tostring = function(e)
   return (('Edge :\n  %s\n  %s'):format(tostring(e.p1), tostring(e.p2)))
 end
@@ -448,4 +448,4 @@ function Delaunay.triangulate(...)
 
 end
 
-return Delaunay
+return Delaunay