2 slab_y = function(height, shift)
3 return { -0.5, -0.5+(shift or 0), -0.5, 0.5, -0.5+height+(shift or 0), 0.5 }
5 slab_z = function(depth)
6 return { -0.5, -0.5, -0.5+depth, 0.5, 0.5, 0.5 }
8 bar_y = function(radius)
9 return { -radius, -0.5, -radius, radius, 0.5, radius }
11 cuboid = function(radius_x, radius_y, radius_z)
12 return { -radius_x, -radius_y, -radius_z, radius_x, radius_y, radius_z }
17 regular = { type = "regular" },
18 null = { type = "fixed", fixed = { 0, 0, 0, 0, 0, 0 } }
22 mt.__index = function(table, key)
23 local ref = xdecor.box[key]
24 local ref_type = type(ref)
26 if ref_type == "function" then
28 return { type = "fixed", fixed = ref(...) }
30 elseif ref_type == "table" then
31 return { type = "fixed", fixed = ref }
32 elseif ref_type == "nil" then
33 error(key.."could not be found among nodebox presets and functions")
36 error("unexpected datatype "..tostring(type(ref)).." while looking for "..key)
39 setmetatable(xdecor.nodebox, mt)