2 slab_y = function(height, shift) return { -0.5, -0.5+(shift or 0), -0.5, 0.5, -0.5+height+(shift or 0), 0.5 } end,
3 slab_z = function(depth) return { -0.5, -0.5, -0.5+depth, 0.5, 0.5, 0.5 } end,
4 bar_y = function(radius) return {-radius, -0.5, -radius, radius, 0.5, radius} end,
5 cuboid = function(radius_x, radius_y, radius_z) return {-radius_x, -radius_y, -radius_z, radius_x, radius_y, radius_z} end
9 regular = { type = "regular" },
10 null = { type = "fixed", fixed = { 0, 0, 0, 0, 0, 0 } }
14 mt.__index = function(table, key)
15 local ref = xdecor.box[key]
16 local ref_type = type(ref)
17 if ref_type == "function" then
19 return { type = "fixed", fixed = ref(...) }
21 elseif ref_type == "table" then
22 return { type = "fixed", fixed = ref }
23 elseif ref_type == "nil" then
24 error(key .. "could not be found among nodebox presets and functions")
26 error("unexpected datatype " .. tostring(type(ref)) .. " while looking for " .. key)
28 setmetatable(xdecor.nodebox, mt)