forked from mtcontrib/vector_extras
parent
86d267e8f1
commit
472deb6c04
4
init.lua
4
init.lua
@ -235,7 +235,7 @@ function funcs.threeline(x, y, z)
|
|||||||
return line
|
return line
|
||||||
end
|
end
|
||||||
|
|
||||||
function funcs.sort(ps, preferred_coords)
|
function funcs.sort_positions(ps, preferred_coords)
|
||||||
preferred_coords = preferred_coords or {"z", "y", "x"}
|
preferred_coords = preferred_coords or {"z", "y", "x"}
|
||||||
local a,b,c = unpack(preferred_coords)
|
local a,b,c = unpack(preferred_coords)
|
||||||
local function ps_sorting(p1, p2)
|
local function ps_sorting(p1, p2)
|
||||||
@ -270,7 +270,7 @@ end
|
|||||||
--local areas = {}
|
--local areas = {}
|
||||||
function funcs.plane(ps)
|
function funcs.plane(ps)
|
||||||
-- sort positions and imagine the first one (A) as vector.zero
|
-- sort positions and imagine the first one (A) as vector.zero
|
||||||
ps = vector.sort(ps)
|
ps = vector.sort_positions(ps)
|
||||||
local pos = ps[1]
|
local pos = ps[1]
|
||||||
local B = vector.subtract(ps[2], pos)
|
local B = vector.subtract(ps[2], pos)
|
||||||
local C = vector.subtract(ps[3], pos)
|
local C = vector.subtract(ps[3], pos)
|
||||||
|
Loading…
Reference in New Issue
Block a user