Develop 1.8 #20

Merged
Kan18 merged 242 commits from develop-1.8 into master-1.8 2019-11-10 20:52:08 -05:00
Showing only changes of commit e14a71ab6a - Show all commits

View File

@@ -189,6 +189,8 @@ function Point.closest(reference, pts)
end
function Point.eachClosest(spt, ipts, fn)
if not ipts then error('Point.eachClosest: invalid points', 2) end
local pts = Util.shallowCopy(ipts)
while #pts > 0 do
local pt = Point.closest(spt, pts)
@@ -200,6 +202,17 @@ function Point.eachClosest(spt, ipts, fn)
end
end
function Point.iterateClosest(spt, ipts)
local pts = Util.shallowCopy(ipts)
return function()
local pt = Point.closest(spt, pts)
if pt then
Util.removeByValue(pts, pt)
return pt
end
end
end
function Point.adjacentPoints(pt)
local pts = { }