remove grid fn

This commit is contained in:
BuckarooBanzay 2022-03-27 17:08:14 +02:00
parent 5e8a7252d2
commit fecbfdbc40
3 changed files with 2 additions and 23 deletions

View File

@ -1,7 +1,7 @@
function mtscad.Context:with(node)
function mtscad.Context:with(node_or_nodename)
local ctx = self:clone()
ctx.node = node
ctx.node = type(node_or_nodename) == "string" and {name=node_or_nodename} or node_or_nodename
return ctx
end

View File

@ -1,20 +0,0 @@
function mtscad.Context:grid(x, y, z)
-- TODO: prevent negative sizes
local pos1 = vector.copy(self.pos)
local pos2 = vector.add(self.pos, {x=x-1, y=y-1, z=z-1})
-- TODO: lines between outer positions
for xi=pos1.x,pos2.x,x-1 do
for yi=pos1.y,pos2.y,y-1 do
for zi=pos1.z,pos2.z,z-1 do
local ipos = { x=xi, y=yi, z=zi }
local tpos = mtscad.transform_pos(pos1, ipos, self.rotation)
local tnode = mtscad.transform_node(self.node, self.rotation)
minetest.set_node(tpos, tnode)
end
end
end
return self
end

View File

@ -8,7 +8,6 @@ dofile(MP .. "/context/execute.lua")
dofile(MP .. "/context/translate.lua")
dofile(MP .. "/context/rotate.lua")
dofile(MP .. "/context/cube.lua")
dofile(MP .. "/context/grid.lua")
dofile(MP .. "/context/slope.lua")
dofile(MP .. "/util.lua")
dofile(MP .. "/load.lua")