[Mod] NonCubic Blocks Mod [1.4] [noncubic]

User avatar
LazyJ
Member
Posts: 603
Joined: Wed Sep 12, 2012 12:29
Location: Podunk, Nowhere, USA

by LazyJ » Post

Suggestion for, somewhat, new shapes: quarter, half, and three-quarter versions to compliment Calinou's moreblocks and stairsplus mods.

I built a diagonal bridge using the noncubic mod to make the edges of the bridge straight instead of jagged. However, I would have liked to use a quarter slab for the bridge instead of using a full-sized block but the noncubic shapes are currently suited for full-sized blocks.

Thanks for a great mod!

User avatar
shadowwraith
Member
Posts: 63
Joined: Fri Feb 15, 2013 23:27
Location: Scotland

by shadowwraith » Post

Hi i've hit a problem when trying to remove the milling machine. once placed it cannot be removed no matter what i use, ive looked in debug.txt and found the following error message
node_dig
not diggable
I'm on Minetest 0.4.4-d1 ubuntu 12.10 Daily build
"Spill some blood for me dear Brother" Vicente Valtiare, Oblivion

Currently using Minetest 0.4.7 Ubuntu Daily Build on Ubuntustudio 13.10 Saucy Salamander 64bit (based on Ubuntu 13:10)
Trolls will be shot on sight!!!

User avatar
Topywo
Member
Posts: 1721
Joined: Fri May 18, 2012 20:27

by Topywo » Post

shadowwraith wrote:Hi i've hit a problem when trying to remove the milling machine. once placed it cannot be removed no matter what i use, ive looked in debug.txt and found the following error message
node_dig
not diggable
I'm on Minetest 0.4.4-d1 ubuntu 12.10 Daily build
Did you check if you emptied the milling machine?

User avatar
shadowwraith
Member
Posts: 63
Joined: Fri Feb 15, 2013 23:27
Location: Scotland

by shadowwraith » Post

Did you check if you emptied the milling machine?
*facepalm*

Sorry, my mistake, there was a block of clear glass in the machine that i didn't see.
"Spill some blood for me dear Brother" Vicente Valtiare, Oblivion

Currently using Minetest 0.4.7 Ubuntu Daily Build on Ubuntustudio 13.10 Saucy Salamander 64bit (based on Ubuntu 13:10)
Trolls will be shot on sight!!!

User avatar
LazyJ
Member
Posts: 603
Joined: Wed Sep 12, 2012 12:29
Location: Podunk, Nowhere, USA

by LazyJ » Post

Another suggestion: different posistions of shapes.... sideways and upside down.

I recently tried to mak a rounded edge along the bottom but the current rounded edges and corners only work for the top. Perhaps looking at Calinou's moreblocks (now with stairs+ merged into it) code will help with the different orientation of shapes.

Thanks for a great mod!

User avatar
12Me21
Member
Posts: 873
Joined: Tue Mar 05, 2013 00:36
GitHub: 12Me21
Location: (Ignore all of my posts before 2018)

by 12Me21 » Post

could you give me the code for the corner slope by it's self, in only one material?
Shoutouts to Simpleflips

User avatar
kpo
Member
Posts: 38
Joined: Sun Mar 31, 2013 19:01

by kpo » Post

Hi yves_de_beck

I took the liberty to "adjust" your code a little (quite a lot) ...
I did the following:
Allow other mods to register themselves for milling purposes.
Example my personal version of white bricks from the industrial mod:

Code: Select all

noncubic.register_slope_edge_etc("kpomod:white_brick",
                {cracky=3},
                {"kpomod_white_brick.png"},
                "White Brick Slope",
        "White Brick Slope Lying",
        "White Brick Slope Upside Down",
                "White Brick Slope Edge",
                "White Brick Slope Inner Edge",
        "White Brick Slope Upside Down Edge",
        "White Brick Slope Upside Down Inner Edge",
        "White Brick Pyramid",
        "White Brick Spike",
        "White Brick One Curved Edge Block",
        "White Brick Two Curved Edge Block",
        "White Brick Cylinder",
        "White Brick Cylinder Horizontal",
        "White Brick Sphere",
        "White Brick Element Straight",
        "White Brick Element Edge",
        "White Brick Element T",
        "White Brick Element Cross",
        "White Brick Element End")

noncubic.register_stick_etc("kpomod:white_brick",
                {cracky=3},
                {"kpomod_white_brick.png"},
                "White Brick Stick")

noncubic.register_elements("kpomod:white_brick",
                {cracky=3},
                {"kpomod_white_brick.png"},
                "White Brick Straight Double",
                "White Brick Edge Double",
        "White Brick T Double",
        "White Brick Cross Double",
        "White Brick End Double")
Also I optimised a lot of code away and made use of better functions in the milling process.
I removed all the recipes for manual creation as it goes against the purpose of the machine.
The recipes turning blocks I kept.

The code is here. Just replace the existing files in the mod with these and start registering your own materials:

init.lua:

Code: Select all

-- NonCubic Blocks MOD v1.4
------------by yves_de_beck
----------- modified by kpo to allow registering more materials

-- HERE YOU CAN CHANGE THE DETAIL-LEVEL:
----------------------------------------
detail_level = 16

-- HERE YOU CAN DE/ACTIVATE BACKGROUND FOR MILLING MENU:
--------------------------------------------------------
allow_menu_background = false

-- Includes:
------------
dofile(minetest.get_modpath("noncubic").."/mill.lua")


-- VAR DECLARATION:
-------------------
noncubic = {}

-- REGISTER NONCUBIC FORMS, CREATE MODELS AND RECIPES:
------------------------------------------------------

-- SLOPE
--------
function noncubic.register_slope(recipeitem, groups, images, description)

local slopebox = {}
local detail = detail_level
for i = 0, detail-1 do
        slopebox[i+1]={-0.5, (i/detail)-0.5, (i/detail)-0.5, 0.5, (i/detail)-0.5+(1/detail), 0.5}
end

minetest.register_node(":" .. recipeitem .. "_noncubic_slope", {
        description = description,
        drawtype = "nodebox",
        tiles = images,
        paramtype = "light",
        paramtype2 = "facedir",
        walkable = true,
        selection_box = {
                type = "fixed",
                fixed = {-0.5, -0.5, -0.5, 0.5, 0.5, 0.5},
        },
        node_box = {
                type = "fixed",
                fixed = slopebox,
        },
        groups = groups,
        })
end


-- SLOPE Lying
----------------
function noncubic.register_slope_lying(recipeitem, groups, images, description)

local slopeboxlying = {}
local detail = detail_level
for i = 0, detail-1 do
        slopeboxlying[i+1]={(i/detail)-0.5, -0.5, (i/detail)-0.5, (i/detail)-0.5+(1/detail), 0.5 , 0.5}
end
minetest.register_node(":" .. recipeitem .. "_noncubic_slope_lying", {
        description = description,
        drawtype = "nodebox",
        tiles = images,
        paramtype = "light",
        paramtype2 = "facedir",
        walkable = true,
        selection_box = {
                type = "fixed",
                fixed = {-0.5, -0.5, -0.5, 0.5, 0.5, 0.5},
        },
        node_box = {
                type = "fixed",
                fixed = slopeboxlying,
        },
        groups = groups,
        })
        minetest.register_craft({
                output = recipeitem .. "_noncubic_slope_lying 1",
                recipe = {
                        {"", "", ""},
                        {"", recipeitem .. "_noncubic_slope", ""},
                        {"", "", ""},           
                },
        })

end


-- SLOPE UPSIDE DOWN
--------------------
function noncubic.register_slope_upsdown(recipeitem, groups, images, description)

if subname == "dirt" then
return
end

local slopeupdwnbox = {}
local detail = detail_level
for i = 0, detail-1 do
        slopeupdwnbox[i+1]={-0.5, (i/detail)-0.5, (-1*(i/detail))+0.5-(1/detail), 0.5, (i/detail)-0.5+(1/detail), 0.5}
end
minetest.register_node(":" .. recipeitem .. "_noncubic_slope_upsdown", {
        description = description,
        drawtype = "nodebox",
        tiles = images,
        paramtype = "light",
        paramtype2 = "facedir",
        walkable = true,
        selection_box = {
                type = "fixed",
                fixed = {-0.5, -0.5, -0.5, 0.5, 0.5, 0.5},
        },
        node_box = {
                type = "fixed",
                fixed = slopeupdwnbox,
        },
        groups = groups,
        })
end


-- SLOPE EDGE
-------------
function noncubic.register_slope_edge(recipeitem, groups, images, description)

local slopeboxedge = {}
local detail = detail_level
for i = 0, detail-1 do
        slopeboxedge[i+1]={(i/detail)-0.5, -0.5, (i/detail)-0.5, 0.5, (i/detail)-0.5+(1/detail), 0.5}
end
minetest.register_node(":" .. recipeitem .. "_noncubic_slope_edge", {
        description = description,
        drawtype = "nodebox",
        tiles = images,
        paramtype = "light",
        paramtype2 = "facedir",
        walkable = true,
        selection_box = {
                type = "fixed",
                fixed = {-0.5, -0.5, -0.5, 0.5, 0.5, 0.5},
        },
        node_box = {
                type = "fixed",
                fixed = slopeboxedge,
        },
        groups = groups,
        })
end


-- SLOPE INNER EDGE
-------------------
function noncubic.register_slope_inner_edge(recipeitem, groups, images, description)

minetest.register_node(":" .. recipeitem .. "_noncubic_slope_inner_edge", {
        description = description,
        drawtype = "nodebox",
        tiles = images,
        paramtype = "light",
        paramtype2 = "facedir",
        walkable = true,
        selection_box = {
                type = "fixed",
                fixed = {-0.5, -0.5, -0.5, 0.5, 0.5, 0.5},
        },
        node_box = {
                type = "fixed",
                fixed = {
                        -- PART 1
                        {-0.5, -0.5, -0.5, 0.5, -0.45, 0.5},
                        {-0.45, -0.5, -0.5, 0.5, -0.4, 0.5},
                        {-0.4, -0.5, -0.5, 0.5, -0.35, 0.5},
                        {-0.35, -0.5, -0.5, 0.5, -0.3, 0.5},
                        {-0.3, -0.5, -0.5, 0.5, -0.25, 0.5},
                        {-0.25, -0.5, -0.5, 0.5, -0.2, 0.5},
                        {-0.2, -0.5, -0.5, 0.5, -0.15, 0.5},
                        {-0.15, -0.5, -0.5, 0.5, -0.1, 0.5},
                        {-0.1, -0.5, -0.5, 0.5, -0.05, 0.5},
                        {-0.05, -0.5, -0.5, 0.5, 0, 0.5},
                        {0, -0.5, -0.5, 0.5, 0.05, 0.5},
                        {0.05, -0.5, -0.5, 0.5, 0.1, 0.5},
                        {0.1, -0.5, -0.5, 0.5, 0.15, 0.5},
                        {0.15, -0.5, -0.5, 0.5, 0.2, 0.5},
                        {0.2, -0.5, -0.5, 0.5, 0.25, 0.5},
                        {0.25, -0.5, -0.5, 0.5, 0.3, 0.5},
                        {0.3, -0.5, -0.5, 0.5, 0.35, 0.5},
                        {0.35, -0.5, -0.5, 0.5, 0.4, 0.5},
                        {0.4, -0.5, -0.5, 0.5, 0.45, 0.5},
                        {0.45, -0.5, -0.5, 0.5, 0.5, 0.5},
                        -- PART 2
                        {-0.5, -0.5, -0.45, 0.5, -0.45, 0.5},
                        {-0.5, -0.5, -0.4, 0.5, -0.4, 0.5},
                        {-0.5, -0.5, -0.35, 0.5, -0.35, 0.5},
                        {-0.5, -0.5, -0.3, 0.5, -0.3, 0.5},
                        {-0.5, -0.5, -0.25, 0.5, -0.25, 0.5},
                        {-0.5, -0.5, -0.2, 0.5, -0.2, 0.5},
                        {-0.5, -0.5, -0.15, 0.5, -0.15, 0.5},
                        {-0.5, -0.5, -0.1, 0.5, -0.1, 0.5},
                        {-0.5, -0.5, -0.05, 0.5, -0.05, 0.5},
                        {-0.5, -0.5, 0, 0.5, 0, 0.5},
                        {-0.5, -0.5, 0.05, 0.5, 0.05, 0.5},
                        {-0.5, -0.5, 0.1, 0.5, 0.1, 0.5},
                        {-0.5, -0.5, 0.15, 0.5, 0.15, 0.5},
                        {-0.5, -0.5, 0.2, 0.5, 0.2, 0.5},
                        {-0.5, -0.5, .25, 0.5, 0.25, 0.5},
                        {-0.5, -0.5, 0.3, 0.5, 0.3, 0.5},
                        {-0.5, -0.5, 0.35, 0.5, 0.35, 0.5},
                        {-0.5, -0.5, 0.4, 0.5, 0.4, 0.5},
                        {-0.5, -0.5, 0.45, 0.5, 0.45, 0.5},
                        {-0.5, -0.5, 0.5, 0.5, 0.5, 0.5},
                        },
        },
        groups = groups,
        })
end


-- SLOPE EDGE UPSIDE DOWN
-------------------------
function noncubic.register_slope_upsdown_edge(recipeitem, groups, images, description)

if recipeitem == "default:dirt" then
   return
end

local slopeupdwnboxedge = {}
local detail = detail_level
for i = 0, detail-1 do
        slopeupdwnboxedge[i+1]={(-1*(i/detail))+0.5-(1/detail), (i/detail)-0.5, (-1*(i/detail))+0.5-(1/detail), 0.5, (i/detail)-0.5+(1/detail), 0.5}
end
minetest.register_node(":" .. recipeitem .. "_noncubic_slope_upsdown_edge", {
        description = description,
        drawtype = "nodebox",
        tiles = images,
        paramtype = "light",
        paramtype2 = "facedir",
        walkable = true,
        selection_box = {
                type = "fixed",
                fixed = {-0.5, -0.5, -0.5, 0.5, 0.5, 0.5},
        },
        node_box = {
                type = "fixed",
                fixed = slopeupdwnboxedge,
        },
        groups = groups,
        })
end


-- SLOPE INNER EDGE UPSIDE DOWN
-------------------------------
function noncubic.register_slope_upsdown_inner_edge(recipeitem, groups, images, description)

if recipename == "default:dirt" then
return
end

minetest.register_node(":" .. recipeitem .. "_noncubic_slope_upsdown_inner_edge", {
        description = description,
        drawtype = "nodebox",
        tiles = images,
        paramtype = "light",
        paramtype2 = "facedir",
        walkable = true,
        selection_box = {
                type = "fixed",
                fixed = {-0.5, -0.5, -0.5, 0.5, 0.5, 0.5},
        },
        node_box = {
                type = "fixed",
                fixed = {
                        {0.45, -0.5, -0.5, 0.5, -0.45, 0.5},
                        {0.4, -0.45, -0.5, 0.5, -0.4, 0.5},
                        {0.35, -0.4, -0.5, 0.5, -0.35, 0.5},
                        {0.3, -0.35, -0.5, 0.5, -0.3, 0.5},
                        {0.25, -0.3, -0.5, 0.5, -0.25, 0.5},
                        {0.2, -0.25, -0.5, 0.5, -0.2, 0.5},
                        {0.15, -0.2, -0.5, 0.5, -0.15, 0.5},
                        {0.1, -0.15, -0.5, 0.5, -0.1, 0.5},
                        {0.05, -0.1, -0.5, 0.5, -0.05, 0.5},
                        {0, -0.05, -0.5, 0.5, 0, 0.5},
                        {-0.05, 0, -0.5, 0.5, 0.05, 0.5},
                        {-0.1, 0.05, -0.5, 0.5, 0.1, 0.5},
                        {-0.15, 0.1, -0.5, 0.5, 0.15, 0.5},
                        {-0.2, 0.15, -0.5, 0.5, 0.2, 0.5},
                        {-0.25, 0.2, -0.5, 0.5, 0.25, 0.5},
                        {-0.3, 0.25, -0.5, 0.5, 0.3, 0.5},
                        {-0.35, 0.3, -0.5, 0.5, 0.35, 0.5},
                        {-0.4, 0.35, -0.5, 0.5, 0.4, 0.5},
                        {-0.45, 0.4, -0.5, 0.5, 0.45, 0.5},
                        {-0.5, 0.45, -0.5, 0.5, 0.5, 0.5},

                        {-0.5, -0.5, 0.45, 0.5, -0.45, 0.5},
                        {-0.5, -0.45, 0.4, 0.5, -0.4, 0.5},
                        {-0.5, -0.4, 0.35, 0.5, -0.35, 0.5},
                        {-0.5, -0.35, 0.3, 0.5, -0.3, 0.5},
                        {-0.5, -0.3, 0.25, 0.5, -0.25, 0.5},
                        {-0.5, -0.25, 0.2, 0.5, -0.2, 0.5},
                        {-0.5, -0.2, 0.15, 0.5, -0.15, 0.5},
                        {-0.5, -0.15, 0.1, 0.5, -0.1, 0.5},
                        {-0.5, -0.1, 0.05, 0.5, -0.05, 0.5},
                        {-0.5, -0.05, 0, 0.5, 0, 0.5},
                        {-0.5, 0, -0.05, 0.5, 0.05, 0.5},
                        {-0.5, 0.05, -0.1, 0.5, 0.1, 0.5},
                        {-0.5, 0.1, -0.15, 0.5, 0.15, 0.5},
                        {-0.5, 0.15, -0.2, 0.5, 0.2, 0.5},
                        {-0.5, 0.2, -0.25, 0.5, 0.25, 0.5},
                        {-0.5, 0.25, -0.3, 0.5, 0.3, 0.5},
                        {-0.5, 0.3, -0.35, 0.5, 0.35, 0.5},
                        {-0.5, 0.35, -0.4, 0.5, 0.4, 0.5},
                        {-0.5, 0.4, -0.45, 0.5, 0.45, 0.5},
                        {-0.5, 0.45, -0.5, 0.5, 0.5, 0.5},

                        },
        },
        groups = groups,
        })
end


-- PYRAMID
----------
function noncubic.register_pyramid(recipeitem, groups, images, description)

local pyrabox = {}
local detail = detail_level/2
for i = 0, detail-1 do
        pyrabox[i+1]={(i/detail/2)-0.5, (i/detail/2)-0.5, (i/detail/2)-0.5, 0.5-(i/detail/2), (i/detail/2)-0.5+(1/detail), 0.5-(i/detail/2)}
end
minetest.register_node(":" .. recipeitem .. "_noncubic_pyramid", {
        description = description,
        drawtype = "nodebox",
        tiles = images,
        paramtype = "light",
        paramtype2 = "facedir",
        walkable = true,
        selection_box = {
                type = "fixed",
                fixed = {-0.5, -0.5, -0.5, 0.5, 0, 0.5},
        },
        node_box = {
                type = "fixed",
                fixed = pyrabox,
        },
        groups = groups,
        })
end


-- SPIKE
--------
function noncubic.register_spike(recipeitem, groups, images, description)

if recipename == "default:dirt" then
       return
end

local spikebox = {}
local detail = detail_level
for i = 0, detail-1 do
        spikebox[i+1]={(i/detail/2)-0.5, (i/detail/2)-0.5, (i/detail/2)-0.5, 0.5-(i/detail/2), (i/detail)-0.5+(1/detail), 0.5-(i/detail/2)}
end
minetest.register_node(":" .. recipeitem .. "_noncubic_spike", {
        description = description,
        drawtype = "nodebox",
        tiles = images,
        paramtype = "light",
        paramtype2 = "facedir",
        walkable = true,
        selection_box = {
                type = "fixed",
                fixed = {-0.5, -0.5, -0.5, 0.5, 0.5, 0.5},
        },
        node_box = {
                type = "fixed",
                fixed = spikebox,
        },
        groups = groups,
        })
end


-- Block one curved edge 
------------------------
function noncubic.register_onecurvededge(recipeitem, groups, images, description)

local quartercyclebox = {}
local detail = detail_level*2
local sehne
for i = (detail/2)-1, detail-1 do
        sehne = math.sqrt(0.25 - (((i/detail)-0.5)^2))
        quartercyclebox[i]={-0.5, -0.5, -sehne, 0.5, (i/detail)+(1/detail)-0.5, 0.5}
end
minetest.register_node(":" .. recipeitem .. "_noncubic_onecurvededge", {
        description = description,
        drawtype = "nodebox",
        tiles = images,
        paramtype = "light",
        paramtype2 = "facedir",
        walkable = true,
        selection_box = {
                type = "fixed",
                fixed = {-0.5, -0.5, -0.5, 0.5, 0.5, 0.5},
        },
        node_box = {
                type = "fixed",
                fixed = quartercyclebox,
        },
        groups = groups,
        })
end


-- Block two curved edges 
-------------------------
function noncubic.register_twocurvededge(recipeitem, groups, images, description)

local quartercyclebox2 = {}
local detail = detail_level*2
local sehne
for i = (detail/2)-1, detail-1 do
        sehne = math.sqrt(0.25 - (((i/detail)-0.5)^2))
        quartercyclebox2[i]={-sehne, -0.5, -sehne, 0.5, (i/detail)+(1/detail)-0.5, 0.5}
end
minetest.register_node(":" .. recipeitem .. "_noncubic_twocurvededge", {
        description = description,
        drawtype = "nodebox",
        tiles = images,
        paramtype = "light",
        paramtype2 = "facedir",
        walkable = true,
        selection_box = {
                type = "fixed",
                fixed = {-0.5, -0.5, -0.5, 0.5, 0.5, 0.5},
        },
        node_box = {
                type = "fixed",
                fixed = quartercyclebox2,
        },
        groups = groups,
        })
        minetest.register_craft({
                output = recipeitem .. "_noncubic_twocurvededge 3",
                recipe = {
                        {"", "", ""},
                        {recipeitem .. "_noncubic_onecurvededge", "", ""},
                        {recipeitem .. "_noncubic_onecurvededge", recipeitem .. "_noncubic_onecurvededge", ""},         
                },
        })

end

-- Cylinder
-----------
function noncubic.register_cylinder(recipeitem, groups, images, description)

if recipename == "default:dirt" then
return
end

local cylbox = {}
local detail = detail_level
local sehne
for i = 1, detail-1 do
        sehne = math.sqrt(0.25 - (((i/detail)-0.5)^2))
        cylbox[i]={(i/detail)-0.5, -0.5, -sehne, (i/detail)+(1/detail)-0.5, 0.5, sehne}
end
minetest.register_node(":" .. recipeitem .. "_noncubic_cylinder", {
        description = description,
        drawtype = "nodebox",
        tiles = images,
        paramtype = "light",
        paramtype2 = "facedir",
        walkable = true,
        selection_box = {
                type = "fixed",
                fixed = {-0.5, -0.5, -0.5, 0.5, 0.5, 0.5},
        },
        node_box = {
                type = "fixed",
                fixed = cylbox,
        },
        groups = groups,
        })
        minetest.register_craft({
                output = recipeitem .. "_noncubic_cylinder 1",
                recipe = {
                        {"", "", ""},
                        {"", recipeitem .. "_noncubic_cylinder_horizontal", ""},
                        {"", "", ""},           
                },
        })

end


-- Cylinder Horizontal
----------------------
function noncubic.register_cylinder_horizontal(recipeitem, groups, images, description)

if recipename == "default:dirt" then
       return
end

local cylbox_horizontal = {}
local detail = detail_level
local sehne
for i = 1, detail-1 do
        sehne = math.sqrt(0.25 - (((i/detail)-0.5)^2))
        cylbox_horizontal[i]={-0.5, (i/detail)-0.5, -sehne, 0.5, (i/detail)+(1/detail)-0.5, sehne}
end
minetest.register_node(":" .. recipeitem .. "_noncubic_cylinder_horizontal", {
        description = description,
        drawtype = "nodebox",
        tiles = images,
        paramtype = "light",
        paramtype2 = "facedir",
        walkable = true,
        selection_box = {
                type = "fixed",
                fixed = {-0.5, -0.5, -0.5, 0.5, 0.5, 0.5},
        },
        node_box = {
                type = "fixed",
                fixed = cylbox_horizontal,
        },
        groups = groups,
        })
        minetest.register_craft({
                output = recipeitem .. "_noncubic_cylinder_horizontal 1",
                recipe = {
                        {"", "", ""},
                        {"", recipeitem .. "_noncubic_cylinder", ""},
                        {"", "", ""},           
                },
        })
end


-- Sphere
---------
function noncubic.register_sphere(recipeitem, groups, images, description)

if recipename == "default:dirt" then
       return
end

local spherebox = {}
local detail = detail_level
local sehne
for i = 1, detail-1 do
        sehne = math.sqrt(0.25 - (((i/detail)-0.5)^2))
        spherebox[i]={-sehne, (i/detail)-0.5, -sehne, sehne, (i/detail)+(1/detail)-0.5, sehne}
end
minetest.register_node(":" .. recipeitem .. "_noncubic_cylinder_sphere", {
        description = description,
        drawtype = "nodebox",
        tiles = images,
        paramtype = "light",
        paramtype2 = "facedir",
        walkable = true,
        selection_box = {
                type = "fixed",
                fixed = {-0.5, -0.5, -0.5, 0.5, 0.5, 0.5},
        },
        node_box = {
                type = "fixed",
                fixed = spherebox,
        },
        groups = groups,
        })
end


-- Element straight
-------------------
function noncubic.register_element_straight(recipeitem, groups, images, description)

minetest.register_node(":" .. recipeitem .. "_noncubic_element_straight", {
        description = description,
        drawtype = "nodebox",
        tiles = images,
        paramtype = "light",
        paramtype2 = "facedir",
        walkable = true,
        selection_box = {
                type = "fixed",
                fixed = {-0.3, -0.5, -0.5, 0.3, 0, 0.5},
        },
        node_box = {
                type = "fixed",
                fixed = {
                        {-0.3, -0.5, -0.5, 0.3, 0, 0.5},
                        },
        },
        groups = groups,
        })
end


-- Element Edge
---------------
function noncubic.register_element_edge(recipeitem, groups, images, description)

minetest.register_node(":" .. recipeitem .. "_noncubic_element_edge", {
        description = description,
        drawtype = "nodebox",
        tiles = images,
        paramtype = "light",
        paramtype2 = "facedir",
        walkable = true,
        selection_box = {
                type = "fixed",
                fixed = {
                        {-0.3, -0.5, -0.5, 0.3, 0, 0.3},
                        {-0.5, -0.5, -0.3, -0.3, 0, 0.3},
                        },
        },
        node_box = {
                type = "fixed",
                fixed = {
                        {-0.3, -0.5, -0.5, 0.3, 0, 0.3},
                        {-0.5, -0.5, -0.3, -0.3, 0, 0.3},
                        },
        },
        groups = groups,
        })
end


-- Element T
------------
function noncubic.register_element_t(recipeitem, groups, images, description)

minetest.register_node(":" .. recipeitem .. "_noncubic_element_t", {
        description = description,
        drawtype = "nodebox",
        tiles = images,
        paramtype = "light",
        paramtype2 = "facedir",
        walkable = true,
        selection_box = {
                type = "fixed",
                fixed = {
                        {-0.3, -0.5, -0.5, 0.3, 0, 0.3},
                        {-0.5, -0.5, -0.3, -0.3, 0, 0.3},
                        {0.3, -0.5, -0.3, 0.5, 0, 0.3},
                        },
        },
        node_box = {
                type = "fixed",
                fixed = {
                        {-0.3, -0.5, -0.5, 0.3, 0, 0.3},
                        {-0.5, -0.5, -0.3, -0.3, 0, 0.3},
                        {0.3, -0.5, -0.3, 0.5, 0, 0.3},
                        },
        },
        groups = groups,
        })
end


-- Element Cross
----------------
function noncubic.register_element_cross(recipeitem, groups, images, description)

minetest.register_node(":" .. recipeitem .. "_noncubic_element_cross", {
        description = description,
        drawtype = "nodebox",
        tiles = images,
        paramtype = "light",
        paramtype2 = "facedir",
        walkable = true,
        selection_box = {
                type = "fixed",
                fixed = {
                        {0.3, -0.5, -0.3, 0.5, 0, 0.3},
                        {-0.3, -0.5, -0.5, 0.3, 0, 0.5},
                        {-0.5, -0.5, -0.3, -0.3, 0, 0.3},
                        },
        },
        node_box = {
                type = "fixed",
                fixed = {
                        {0.3, -0.5, -0.3, 0.5, 0, 0.3},
                        {-0.3, -0.5, -0.5, 0.3, 0, 0.5},
                        {-0.5, -0.5, -0.3, -0.3, 0, 0.3},
                        },
        },
        groups = groups,
        })
end


-- Element End
--------------
function noncubic.register_element_end(recipeitem, groups, images, description)

minetest.register_node(":" .. recipeitem .. "_noncubic_element_end", {
        description = description,
        drawtype = "nodebox",
        tiles = images,
        paramtype = "light",
        paramtype2 = "facedir",
        walkable = true,
        selection_box = {
                type = "fixed",
                fixed = {-0.3, -0.5, -0.3, 0.3, 0, 0.5},
        },
        node_box = {
                type = "fixed",
                fixed = {-0.3, -0.5, -0.3, 0.3, 0, 0.5},
        },
        groups = groups,
        })
end


-- Element straight DOUBLE
--------------------------
function noncubic.register_element_straight_double(recipeitem, groups, images, description)

minetest.register_node(":" .. recipeitem .. "_noncubic_element_straight_double", {
        description = description,
        drawtype = "nodebox",
        tiles = images,
        paramtype = "light",
        paramtype2 = "facedir",
        walkable = true,
        selection_box = {
                type = "fixed",
                fixed = {-0.3, -0.5, -0.5, 0.3, 0.5, 0.5},
        },
        node_box = {
                type = "fixed",
                fixed = {
                        {-0.3, -0.5, -0.5, 0.3, 0.5, 0.5},
                        },
        },
        groups = groups,
        })
        minetest.register_craft({
                output = recipeitem .. "_noncubic_element_straight_double 1",
                recipe = {
                        {"", "", ""},
                        {"", recipeitem .. "_noncubic_element_straight", ""},
                        {"", recipeitem .. "_noncubic_element_straight", ""},           
                },
        })
end


-- Element Edge DOUBLE
----------------------
function noncubic.register_element_edge_double(recipeitem, groups, images, description)

minetest.register_node(":" .. recipeitem .. "_noncubic_element_edge_double", {
        description = description,
        drawtype = "nodebox",
        tiles = images,
        paramtype = "light",
        paramtype2 = "facedir",
        walkable = true,
        selection_box = {
                type = "fixed",
                fixed = {
                        {-0.3, -0.5, -0.5, 0.3, 0.5, 0.3},
                        {-0.5, -0.5, -0.3, -0.3, 0.5, 0.3},
                        },
        },
        node_box = {
                type = "fixed",
                fixed = {
                        {-0.3, -0.5, -0.5, 0.3, 0.5, 0.3},
                        {-0.5, -0.5, -0.3, -0.3, 0.5, 0.3},
                        },
        },
        groups = groups,
        })
        minetest.register_craft({
                output = recipeitem .. "_noncubic_element_edge_double 1",
                recipe = {
                        {"", "", ""},
                        {"", recipeitem .. "_noncubic_element_edge", ""},
                        {"", recipeitem .. "_noncubic_element_edge", ""},               
                },
        })
end


-- Element T DOUBLE
-------------------
function noncubic.register_element_t_double(recipeitem, groups, images, description)

minetest.register_node(":" .. recipeitem .. "_noncubic_element_t_double", {
        description = description,
        drawtype = "nodebox",
        tiles = images,
        paramtype = "light",
        paramtype2 = "facedir",
        walkable = true,
        selection_box = {
                type = "fixed",
                fixed = {
                        {-0.3, -0.5, -0.5, 0.3, 0.5, 0.3},
                        {-0.5, -0.5, -0.3, -0.3, 0.5, 0.3},
                        {0.3, -0.5, -0.3, 0.5, 0.5, 0.3},
                        },
        },
        node_box = {
                type = "fixed",
                fixed = {
                        {-0.3, -0.5, -0.5, 0.3, 0.5, 0.3},
                        {-0.5, -0.5, -0.3, -0.3, 0.5, 0.3},
                        {0.3, -0.5, -0.3, 0.5, 0.5, 0.3},
                        },
        },
        groups = groups,
        })
        minetest.register_craft({
                output = recipeitem .. "_noncubic_element_t_double 1",
                recipe = {
                        {"", "", ""},
                        {"", recipeitem .. "_noncubic_element_t", ""},
                        {"", recipeitem .. "_noncubic_element_t", ""},          
                },
        })
end


-- Element Cross Double
-----------------------
function noncubic.register_element_cross_double(recipeitem, groups, images, description)

minetest.register_node(":" .. recipeitem .. "_noncubic_element_cross_double", {
        description = description,
        drawtype = "nodebox",
        tiles = images,
        paramtype = "light",
        paramtype2 = "facedir",
        walkable = true,
        selection_box = {
                type = "fixed",
                fixed = {
                        {0.3, -0.5, -0.3, 0.5, 0.5, 0.3},
                        {-0.3, -0.5, -0.5, 0.3, 0.5, 0.5},
                        {-0.5, -0.5, -0.3, -0.3, 0.5, 0.3},
                        },
        },
        node_box = {
                type = "fixed",
                fixed = {
                        {0.3, -0.5, -0.3, 0.5, 0.5, 0.3},
                        {-0.3, -0.5, -0.5, 0.3, 0.5, 0.5},
                        {-0.5, -0.5, -0.3, -0.3, 0.5, 0.3},
                        },
        },
        groups = groups,
        })
        minetest.register_craft({
                output = recipeitem .. "_noncubic_element_cross_double 1",
                recipe = {
                        {"", "", ""},
                        {"", recipeitem .. "_noncubic_element_cross", ""},
                        {"", recipeitem .. "_noncubic_element_cross", ""},              
                        },
        })

end


-- Element End Double
---------------------
function noncubic.register_element_end_double(recipeitem, groups, images, description)

minetest.register_node(":" .. recipeitem .. "_noncubic_element_end_double", {
        description = description,
        drawtype = "nodebox",
        tiles = images,
        paramtype = "light",
        paramtype2 = "facedir",
        walkable = true,
        selection_box = {
                type = "fixed",
                fixed = {-0.3, -0.5, -0.3, 0.3, 0.5, 0.5},
        },
        node_box = {
                type = "fixed",
                fixed = {-0.3, -0.5, -0.3, 0.3, 0.5, 0.5},
        },
        groups = groups,
        })
        minetest.register_craft({
                output = recipeitem .. "_noncubic_element_end_double 1",
                recipe = {
                        {"", "", ""},
                        {"", recipeitem .. "_noncubic_element_end", ""},
                        {"", recipeitem .. "_noncubic_element_end", ""},                
                        },
        })
end


-- STICK
--------
function noncubic.register_stick(recipeitem, groups, images, description)

minetest.register_node(":" .. recipeitem .. "_noncubic_stick", {
        description = description,
        drawtype = "nodebox",
        tiles = images,
        paramtype = "light",
        paramtype2 = "facedir",
        walkable = true,
        selection_box = {
                type = "fixed",
                fixed = {-0.15, -0.5, -0.15, 0.15, 0.5, 0.15},
        },
        node_box = {
                type = "fixed",
                fixed = {-0.15, -0.5, -0.15, 0.15, 0.5, 0.15},
        },
        groups = groups,
        })
        minetest.register_craft({
                output = recipeitem .. "_noncubic_stick 8",
                recipe = {
                        {'default:stick', "", ""},
                        {"", "", ""},
                        {recipeitem, "", ""},           
                },
        })
end



-- REGISTER NEW NONCUBIC's PART 2: noncubic.register_element_end(subname, recipeitem, groups, images, desc_element_xyz)
-----------------------------------------------------------------------------------------------------------------------
function noncubic.register_slope_edge_etc(recipeitem, groups, images, desc_slope, desc_slope_lying, desc_slope_upsdown, desc_slope_edge, desc_slope_inner_edge, desc_slope_upsdwn_edge, desc_slope_upsdwn_inner_edge, desc_pyramid, desc_spike, desc_onecurvededge, desc_twocurvededge, desc_cylinder, desc_cylinder_horizontal, desc_sphere, desc_element_straight, desc_element_edge, desc_element_t, desc_element_cross, desc_element_end)

         noncubic.register_slope(recipeitem, groups, images, desc_slope)
         noncubic.register_slope_lying(recipeitem, groups, images, desc_slope_lying)
         noncubic.register_slope_upsdown(recipeitem, groups, images, desc_slope_upsdown)
         noncubic.register_slope_edge(recipeitem, groups, images, desc_slope_edge)
         noncubic.register_slope_inner_edge(recipeitem, groups, images, desc_slope_inner_edge)
         noncubic.register_slope_upsdown_edge(recipeitem, groups, images, desc_slope_upsdwn_edge)
         noncubic.register_slope_upsdown_inner_edge(recipeitem, groups, images, desc_slope_upsdwn_inner_edge)
         noncubic.register_pyramid(recipeitem, groups, images, desc_pyramid)
         noncubic.register_spike(recipeitem, groups, images, desc_spike)
         noncubic.register_onecurvededge(recipeitem, groups, images, desc_onecurvededge)
         noncubic.register_twocurvededge(recipeitem, groups, images, desc_twocurvededge)
         noncubic.register_cylinder(recipeitem, groups, images, desc_cylinder)
         noncubic.register_cylinder_horizontal(recipeitem, groups, images, desc_cylinder_horizontal)
         noncubic.register_sphere(recipeitem, groups, images, desc_sphere)
         noncubic.register_element_straight(recipeitem, groups, images, desc_element_straight)
         noncubic.register_element_edge(recipeitem, groups, images, desc_element_edge)
         noncubic.register_element_t(recipeitem, groups, images, desc_element_t)
         noncubic.register_element_cross(recipeitem, groups, images, desc_element_cross)
         noncubic.register_element_end(recipeitem, groups, images, desc_element_end)
end


-- REGISTER MATERIALS AND PROPERTIES FOR NONCUBIC ELEMENTS:
-----------------------------------------------------------

-- WOOD
-------
noncubic.register_slope_edge_etc("default:wood",
                {snappy=2,choppy=2,oddly_breakable_by_hand=2},
                {"default_wood.png"},
                "Wooden Slope",
                "Wooden Slope Lying",
                "Wooden Slope Upside Down",
                "Wooden Slope Edge",
                "Wooden Slope Inner Edge",
                "Wooden Slope Upside Down Edge",
                "Wooden Slope Upside Down Inner Edge",
                "Wooden Pyramid",
                "Wooden Spike",
                "Wooden One Curved Edge Block",
                "Wooden Two Curved Edge Block",
                "Wooden Cylinder",
                "Wooden Cylinder Horizontal",
                "Wooden Sphere",
                "Wooden Element Straight",
                "Wooden Element Edge",
                "Wooden Element T",
                "Wooden Element Cross",
                "Wooden Element End")
-- STONE
--------
noncubic.register_slope_edge_etc("default:stone",
                {cracky=3},
                {"default_stone.png"},
                "Stone Slope",
                "Stone Slope Lying",
                "Stone Slope Upside Down",
                "Stone Slope Edge",
                "Stone Slope Inner Edge",
                "Stone Slope Upside Down Edge",
                "Stone Slope Upside Down Inner Edge",
                "Stone Pyramid",
                "Stone Spike",
                "Stone One Curved Edge Block",
                "Stone Two Curved Edge Block",
                "Stone Cylinder",
                "Stote Cylinder Horizontal",
                "Stone Sphere",
                "Stone Element Straight",
                "Stone Element Edge",
                "Stone Element T",
                "Stone Element Cross",
                "Stone Element End")
-- COBBLE
---------
noncubic.register_slope_edge_etc("default:cobble",
                {cracky=3},
                {"default_cobble.png"},
                "Cobble Slope",
                "Cobble Slope Lying",
                "Cobble Slope Upside Down",
                "Cobble Slope Edge",
                "Cobble Slope Inner Edge",
                "Cobble Slope Upside Down Edge",
                "Cobble Slope Upside Down Inner Edge",
                "Cobble Pyramid",
                "Cobble Spike",
                "Cobble One Curved Edge Block",
                "Cobble Two Curved Edge Block",
                "Cobble Cylinder",
                "Cobble Cylinder Horizontal",
                "Cobble Sphere",
                "Cobble Element Straight",
                "Cobble Element Edge",
                "Cobble Element T",
                "Cobble Element Cross",
                "Cobble Element End")
-- BRICK
--------
noncubic.register_slope_edge_etc("default:brick",
                {cracky=3},
                {"default_brick.png"},
                "Brick Slope",
                "Brick Slope Upside Down",
                "Brick Slope Edge",
                "Brick Slope Inner Edge",
                "Brick Slope Upside Down Edge",
                "Brick Slope Upside Down Inner Edge",
                "Brick Pyramid",
                "Brick Spike",
                "Brick One Curved Edge Block",
                "Brick Two Curved Edge Block",
                "Brick Cylinder",
                "Brick Cylinder Horizontal",
                "Brick Sphere",
                "Brick Element Straight",
                "Brick Element Edge",
                "Brick Element T",
                "Brick Element Cross",
                "Brick Element End")
-- SANDSTONE
------------
noncubic.register_slope_edge_etc("default:sandstone",
                {crumbly=2,cracky=2},
                {"default_sandstone.png"},
                "Sandstone Slope",
                "Sandstone Slope Lying",
                "Sandstone Slope Upside Down",
                "Sandstone Slope Edge",
                "Sandstone Slope Inner Edge",
                "Sandstone Slope Upside Down Edge",
                "Sandstone Slope Upside Down Inner Edge",
                "Sandstone Pyramid",
                "Sandstone Spike",
                "Sandstone One Curved Edge Block",
                "Sandstone Two Curved Edge Block",
                "Sandstone Cylinder",
                "Sandstone Cylinder Horizontal",
                "Sandstone Sphere",
                "Sandstone Element Straight",
                "Sandstone Element Edge",
                "Sandstone Element T",
                "Sandstone Element Cross",
                "Sandstone Element End")
-- LEAVES
---------
noncubic.register_slope_edge_etc("default:leaves",
                {snappy=2,choppy=2,oddly_breakable_by_hand=3},
                {"bucharest_tree.png"},
                "Leaves Slope",
                "Leaves Slope Lying",
                "Leaves Slope Upside Down",
                "Leaves Slope Edge",
                "Leaves Slope Inner Edge",
                "Leaves Slope Upside Down Edge",
                "Leaves Slope Upside Down Inner Edge",
                "Leaves Pyramid",
                "Leaves Spike",
                "Leaves One Curved Edge Block",
                "Leaves Two Curved Edge Block",
                "Leaves Cylinder",
                "Leaves Cylinder Horizontal",
                "Leaves Sphere",
                "Leaves Element Straight",
                "Leaves Element Edge",
                "Leaves Element T",
                "Leaves Element Cross",
                "Leaves Element End")
-- DIRT
-------
noncubic.register_slope_edge_etc("default:dirt",
                {snappy=2,choppy=2,oddly_breakable_by_hand=3},
                {"default_grass.png", "default_dirt.png", "default_grass.png"},
                "Dirt Slope",
                "Dirt Slope Lying",
                "Dirt Slope Upside Down",
                "Dirt Slope Edge",
                "Dirt Slope Inner Edge",
                "Dirt Slope Upside Down Edge",
                "Dirt Slope Upside Down Inner Edge",
                "Dirt Pyramid",
                "Dirt Spike",
                "Dirt One Curved Edge Block",
                "Dirt Two Curved Edge Block",
                "Dirt Cylinder",
                "Dirt Cylinder Horizontal",
                "Dirt Sphere",
                "Dirt Element Straight",
                "Dirt Element Edge",
                "Dirt Element T",
                "Dirt Element Cross",
                "Dirt Element End")
-- TREE
-------
noncubic.register_slope_edge_etc("default:tree",
                {snappy=1,choppy=2,oddly_breakable_by_hand=2,flammable=3},
                {"default_tree.png"},
                "Tree Slope",
                "Tree Slope Lying",
                "Tree Slope Upside Down",
                "Tree Slope Edge",
                "Tree Slope Inner Edge",
                "Tree Slope Upside Down Edge",
                "Tree Slope Upside Down Inner Edge",
                "Tree Pyramid",
                "Tree Spike",
                "Tree One Curved Edge Block",
                "Tree Two Curved Edge Block",
                "Tree Cylinder",
                "Tree Cylinder Horizontal",
                "Tree Sphere",
                "Tree Element Straight",
                "Tree Element Edge",
                "Tree Element T",
                "Tree Element Cross",
                "Tree Element End")
-- STEEL
--------
noncubic.register_slope_edge_etc("default:steelblock",
                {snappy=1,bendy=2,cracky=1,melty=2,level=2},
                {"default_steel_block.png"},
                "Steel Slope",
                "Steel Slope Lying",
                "Steel Slope Upside Down",
                "Steel Slope Edge",
                "Steel Slope Inner Edge",
                "Steel Slope Upside Down Edge",
                "Steel Slope Upside Down Inner Edge",
                "Steel Pyramid",
                "Steel Spike",
                "Steel One Curved Edge Block",
                "Steel Two Curved Edge Block",
                "Steel Cylinder",
                "Steel Cylinder Horizontal",
                "Steel Sphere",
                "Steel Element Straight",
                "Steel Element Edge",
                "Steel Element T",
                "Steel Element Cross",
                "Steel Element End")



-- REGISTER STICKS: noncubic.register_xyz(recipeitem, groups, images, desc_element_xyz)
------------------------------------------------------------------------------------------------------------
function noncubic.register_stick_etc(recipeitem, groups, images, desc_stick)
         noncubic.register_stick(recipeitem, groups, images, desc_stick)
end

-- REGISTER MATERIALS AND PROPERTIES FOR STICKS:
------------------------------------------------

-- WOOD
-------
noncubic.register_stick_etc("default:wood",
                {snappy=2,choppy=2,oddly_breakable_by_hand=2},
                {"default_wood.png"},
                "Wooden Stick")
-- STONE
--------
noncubic.register_stick_etc("default:stone",
                {cracky=3},
                {"default_stone.png"},
                "Stone Stick")
-- COBBLE
---------
noncubic.register_stick_etc("default:cobble",
                {cracky=3},
                {"default_cobble.png"},
                "Cobble Stick")
-- BRICK
--------
noncubic.register_stick_etc("default:brick",
                {cracky=3},
                {"default_brick.png"},
                "Brick Stick")
-- SANDSTONE
------------
noncubic.register_stick_etc("default:sandstone",
                {crumbly=2,cracky=2},
                {"default_sandstone.png"},
                "Sandstone Stick")
-- LEAVES
---------
noncubic.register_stick_etc("default:leaves",
                {snappy=2,choppy=2,oddly_breakable_by_hand=3},
                {"bucharest_tree.png"},
                "Leaves Stick")
-- TREE
-------
noncubic.register_stick_etc("default:tree",
                {snappy=1,choppy=2,oddly_breakable_by_hand=2,flammable=3,wood=1},
                {"default_tree.png"},
                "Tree Stick")
-- STEEL
--------
noncubic.register_stick_etc("default:steelblock",
                {snappy=1,bendy=2,cracky=1,melty=2,level=2},
                {"default_steel_block.png"},
                "Steel Stick")




-- REGISTER DOUBLE ELEMNTS: noncubic.register_xyz(recipeitem, groups, images, desc_element_xyz)
----------------------------------------------------------------------------------------------------
function noncubic.register_elements(recipeitem, groups, images, desc_element_straight_double, desc_element_edge_double, desc_element_t_double, desc_element_cross_double, desc_element_end_double)
         noncubic.register_element_straight_double(recipeitem, groups, images, desc_element_straight_double)
         noncubic.register_element_edge_double(recipeitem, groups, images, desc_element_edge_double)
         noncubic.register_element_t_double(recipeitem, groups, images, desc_element_t_double)
         noncubic.register_element_cross_double(recipeitem, groups, images, desc_element_cross_double)
         noncubic.register_element_end_double(recipeitem, groups, images, desc_element_end_double)
end

-- REGISTER MATERIALS AND PROPERTIES FOR HALF AND NORMAL HEIGHT ELEMENTS:
-------------------------------------------------------------------------

-- WOOD
-------
noncubic.register_elements("default:wood",
                {snappy=2,choppy=2,oddly_breakable_by_hand=2},
                {"default_wood.png"},
                "Wooden Element Straight Double",
                "Wooden Element Edge Double",
                "Wooden Element T Double",
                "Wooden Element Cross Double",
                "Wooden Element End Double")
-- STONE
--------
noncubic.register_elements("default:stone",
                {cracky=3},
                {"default_stone.png"},
                "Stone Element Straight Double",
                "Stone Element Edge Double",
                "Stone Element T Double",
                "Stone Element Cross Double",
                "Stone Element End Double")
-- COBBLE
---------
noncubic.register_elements("default:cobble",
                {cracky=3},
                {"default_cobble.png"},
                "Cobble Element Straight Double",
                "Cobble Element Edge Double",
                "Cobble Element T Double",
                "Cobble Element Cross Double",
                "Cobble Element End Double")
-- BRICK
--------
noncubic.register_elements("default:brick",
                {cracky=3},
                {"default_brick.png"},
                "Brick Element Straight Double",
                "Brick Element Edge Double",
                "Brick Element T Double",
                "Brick Element Cross Double",
                "Brick Element End Double")
-- SANDSTONE
------------
noncubic.register_elements("default:sandstone",
                {crumbly=2,cracky=2},
                {"default_sandstone.png"},
                "Sandstone Element Straight Double",
                "Sandstone Element Edge Double",
                "Sandstone Element T Double",
                "Sandstone Element Cross Double",
                "Sandstone Element End Double")
-- LEAVES
---------
noncubic.register_elements("default:leaves",
                {snappy=2,choppy=2,oddly_breakable_by_hand=3},
                {"bucharest_tree.png"},
                "Leaves Element Straight Double",
                "Leaves Element Edge Double",
                "Leaves Element T Double",
                "Leaves Element Cross Double",
                "Leaves Element End Double")
-- TREE
-------
noncubic.register_elements("default:tree",
                {snappy=1,choppy=2,oddly_breakable_by_hand=2,flammable=3,wood=1},
                {"default_tree.png"},
                "Tree Element Straight Double",
                "Tree Element Edge Double",
                "Tree Element T Double",
                "Tree Element Cross Double",
                "Tree Element End Double")
-- STEEL
--------
noncubic.register_elements("default:steel",
                {snappy=1,bendy=2,cracky=1,melty=2,level=2},
                {"default_steel_block.png"},
                "Steel Element Straight Double",
                "Steel Element Edge Double",
                "Steel Element T Double",
                "Steel Element Cross Double",
                "Steel Element End Double")
mill.lua:

Code: Select all

-- NonCubic Blocks MOD v1.4
------------by yves_de_beck
----------- modified by kpo to allow registering more materials
-----------     also optimized a lot of code away in te process.
shape = {}
size = "0"
produces = {}
showbackground = "--"
showlabelin = "label[0,5.5;In:]"
showlabelout = "label[4.5,5.5;Out:]"


minetest.register_node("noncubic:mill", {
        description = "Milling Machine",
        tiles = {"cnc_top.png", "cnc_bottom.png", "cnc_side.png",
                "cnc_side.png", "cnc_side.png", "cnc_front.png"},
        drawtype = "nodebox",
        paramtype = "light",
        paramtype2 = "facedir",
        node_box = {
        type = "fixed",
                fixed = {
                        {-0.5, -0.5, -0.5, 0.5, 0.5, 0.5},

                        },
        },
        selection_box = {
        type = "fixed",
                fixed = {-0.5, -0.5, -0.5, 0.5, 0.5, 0.5},
        },
        groups = {oddly_breakable_by_hand=2, cracky=3, dig_immediate=1},

can_dig = function(pos,player)
        local meta = minetest.env:get_meta(pos);
        local inv = meta:get_inventory()
        if not inv:is_empty("ingot") then
                return false
        elseif not inv:is_empty("res") then
                return false
        end
        return true
end,

on_construct = function(pos)
        local meta = minetest.env:get_meta(pos)
        if allow_menu_background == true or allow_menu_background == 1 then
                showbackground = "background[-0.15,-0.25;8.40,11.75;milling_background.png]"
        end

        meta:set_string("formspec", "invsize[8,11;]"..
                showlabelin..
                "list[current_name;ingot;1,5.5;1,1;]"..
                showlabelout..
                "list[current_name;res;6,5.5;1,1;]"..
                "label[0,0;Choose Milling Program:]"..
                "image_button[0,0.5;1,1;slope.png;slope; ]"..
                "image_button[1,0.5;1,1;slope_edge.png;slope_edge; ]"..
                "image_button[2,0.5;1,1;slope_inner_edge.png;slope_inner_edge; ]"..
                "image_button[3,0.5;1,1;pyramid.png;pyramid; ]"..
                "image_button[4,0.5;1,1;spike.png;spike; ]"..
                "image_button[5,0.5;1,1;cylinder.png;cylinder; ]"..
                "image_button[6,0.5;1,1;sphere.png;sphere; ]"..
                "image_button[0,1.5;1,1;slope_upsdwn.png;slope_upsdwn; ]"..
                "image_button[1,1.5;1,1;slope_edge_upsdwn.png;slope_edge_upsdwn; ]"..
                "image_button[2,1.5;1,1;slope_inner_edge_upsdwn.png;slope_inner_edge_upsdwn; ]"..
                "image_button[5,1.5;1,1;cylinder_horizontal.png;cylinder_hor; ]"..
                "image_button[0,2.5;1,1;slope_lying.png;slope_lying; ]"..
                "image_button[1,2.5;1,1;onecurvededge.png;onecurvededge; ]"..
                "image_button[2,2.5;1,1;twocurvededge.png;twocurvededge; ]"..
                "label[0,3.5;Slim Elements half / normal height:]"..
                "image_button[0,4;1,0.5;full.png;full; ]"..
                "image_button[0,4.5;1,0.5;half.png;half; ]"..
                "image_button[1,4;1,1;element_straight.png;element_straight; ]"..
                "image_button[2,4;1,1;element_end.png;element_end; ]"..
                "image_button[3,4;1,1;element_cross.png;element_cross; ]"..
                "image_button[4,4;1,1;element_t.png;element_t; ]"..
                "image_button[5,4;1,1;element_edge.png;element_edge; ]"..
                "image_button[7,0.5;1,1;stick.png;stick; ]"..
                "list[current_player;main;0,7;8,4;]"..
                showbackground)
        meta:set_string("infotext", "Milling Machine")
        local inv = meta:get_inventory()
        inv:set_size("ingot", 1)
        inv:set_size("res", 1)
end,

on_receive_fields = function(pos, formname, fields, sender)
-- REGISTER MILLING PROGRAMMS AND OUTPUTS:
------------------------------------------
        -- Program for half/full size
        if fields["full"] then
                size = "1"
                return
        end

        if fields["half"] then
                size = "0"
                return
        end

        local meta = minetest.env:get_meta(pos)
        local inv = meta:get_inventory()

        -- Do nothing if the machine is empty
        if inv:is_empty("ingot") then
                return
        end

        -- Select  program
        if fields["slope"] then
                produces = "2"
                shape = "_noncubic_slope"
        end

        if fields["slope_edge"] then
                produces = "2"
                shape = "_noncubic_slope_edge"
        end

        if fields["slope_inner_edge"] then
                produces = "1"
                shape = "_noncubic_slope_inner_edge"
        end

        if fields["pyramid"] then
                produces = "2"
                shape = "_noncubic_pyramid"
        end

        if fields["spike"] then
                produces = "1"
                shape = "_noncubic_spike"
        end

        if fields["cylinder"] then
                produces = "1"
                shape = "_noncubic_cylinder"
        end

        if fields["cylinder_hor"] then
                produces = "1"
                shape = "_noncubic_cylinder_horizontal"
        end

        if fields["sphere"] then
                produces = "1"
                shape = "_noncubic_cylinder_sphere"
        end

        if fields["slope_upsdwn"] then
                produces = "2"
                shape = "_noncubic_slope_upsdown"
        end

        if fields["slope_edge_upsdwn"] then
                produces = "2"
                shape = "_noncubic_slope_upsdown_edge"
        end

        if fields["slope_inner_edge_upsdwn"] then
                produces = "1"
                shape = "_noncubic_slope_upsdown_inner_edge"
        end

        if fields["slope_lying"] then
                produces = "1"
                shape = "_noncubic_slope_lying"
        end

        if fields["onecurvededge"] then
                produces = "1"
                shape = "_noncubic_onecurvededge"
        end

        if fields["twocurvededge"] then
                produces = "1"
                shape = "_noncubic_twocurvededge"
        end

        if fields["element_straight"] then
                produces = "4"
                shape = "_noncubic_element_straight"
                if size == "1" then
                        produces = "2"
                        shape = "_noncubic_element_straight_double"
                end
        end

        if fields["element_end"] then
                produces = "4"
                shape = "_noncubic_element_end"
                if size == "1" then
                        produces = "2"
                        shape = "_noncubic_element_end_double"
                end
        end

        if fields["element_cross"] then
                produces = "2"
                shape = "_noncubic_element_cross"
                if size == "1" then
                        produces = "1"
                        shape = "_noncubic_element_cross_double"
                end
        end

        if fields["element_t"] then
                produces = "2"
                shape = "_noncubic_element_t"
                if size == "1" then
                        produces = "1"
                        shape = "_noncubic_element_t_double"
                end
        end

        if fields["element_edge"] then
                produces = "2"
                shape = "_noncubic_element_edge"
                if size == "1" then
                        produces = "1"
                        shape = "_noncubic_element_edge_double"
                end
        end

        if fields["stick"] then
                produces = "8"
                shape = "_noncubic_stick"
        end

-----------------------------


-----------------------------------------------------            


-- Milling
----------
        local ingotstack = inv:get_stack("ingot", 1)
        local ingotname = ingotstack:get_name()
        if minetest.registered_nodes[ingotname .. shape] ~= nil then
                inv:add_item("res",ingotname .. shape .. " " .. produces)
                ingotstack:take_item()
                inv:set_stack("ingot",1,ingotstack)
        end
end, -- callback function
})
----------


-- Milling Machine Recipe
-------------------------
minetest.register_craft({
                output = 'noncubic:mill',
                recipe = {
                        {'default:cobble', 'default:stick', 'default:cobble'},
                        {'default:wood', 'default:wood', 'default:wood'},
                        {'default:stick', "", 'default:stick'},         
                },
})
-------------------------

User avatar
Bas080
Member
Posts: 398
Joined: Mon May 21, 2012 15:54
GitHub: bas080
IRC: bas080
In-game: bas080
Location: Netherlands

by Bas080 » Post

I'm continuing the development of this mod. The git is at https://github.com/bas080/noncubic.

I have already made several changes.:
- Less lines of code/definitions and renamed functions and restructured code.
- Has API capability. Other mods can make their own noncubic nodes
- Inner slope now also obeys the detail_level
- Added new materials including steel, tree and junglewood.

I am wondering if anyone knows how to implement 6 face direction nodeboxes? N E S W and Up and Down.

EDIT:
I know mesecons piston has this... Will check that out.

Screenshot of new nodes
Image
Last edited by Bas080 on Sun Apr 28, 2013 16:43, edited 1 time in total.

User avatar
LazyJ
Member
Posts: 603
Joined: Wed Sep 12, 2012 12:29
Location: Podunk, Nowhere, USA

by LazyJ » Post

Bas080 wrote:
I'm continuing the development of this mod. The git is at https://github.com/bas080/noncubic.
I tried the link but it is broken.

It would be nice if this mod could adapt it's shapes to any block type.

User avatar
kpo
Member
Posts: 38
Joined: Sun Mar 31, 2013 19:01

by kpo » Post

The technic mod now has a CNC machine implementing the functions of this mod.
It has an API where you supply the node to allow being shaped and the new shapes will be added in the same name space of the node.
For instance default:wood would get nodes like default:wood_technic_cnc_slope.
You need the "indev" branch on github until further.

User avatar
webdesigner97
Member
Posts: 1327
Joined: Mon Jul 30, 2012 19:16
GitHub: webD97
IRC: webdesigner97
In-game: webdesigner97
Location: Cologne, Germany
Contact:

by webdesigner97 » Post

Sokomine wrote:The texture was done by VanessaE and is based on the non-cubic block mod. Perhaps you ought to write some praise there as well :-) Here's the thread.
see this post

==> Awsome textures for the milling machine!!!! :D

User avatar
Bas080
Member
Posts: 398
Joined: Mon May 21, 2012 15:54
GitHub: bas080
IRC: bas080
In-game: bas080
Location: Netherlands

by Bas080 » Post

LazyJ wrote:Bas080 wrote:
I'm continuing the development of this mod. The git is at https://github.com/bas080/noncubic.
I tried the link but it is broken.

It would be nice if this mod could adapt it's shapes to any block type.
sorry i didn't reply sooner. It's in my simple modpack too together with stairsplus.

User avatar
qwrwed
Member
Posts: 325
Joined: Sun Jul 22, 2012 20:56
In-game: qwrwed or Nitro

by qwrwed » Post

Bas080 wrote:
LazyJ wrote:Bas080 wrote:
I'm continuing the development of this mod. The git is at https://github.com/bas080/noncubic.
I tried the link but it is broken.

It would be nice if this mod could adapt it's shapes to any block type.
sorry i didn't reply sooner. It's in my simple modpack too together with stairsplus.
I think the problem with the link is that there is a "." at the end.
https://github.com/bas080/noncubic This works.
Last edited by qwrwed on Wed Jul 24, 2013 09:36, edited 1 time in total.

User avatar
mimilus
Member
Posts: 75
Joined: Thu Mar 06, 2014 09:08
GitHub: mimilus
IRC: Mimilus
Location: France

by mimilus » Post

Is there a newer version

This version give me an error in init.lua, with minetest 0.4.9
Last edited by mimilus on Thu Mar 06, 2014 09:55, edited 1 time in total.
minetest 0.4.9
Ubuntu 12.04

User avatar
lordpyridine
New member
Posts: 9
Joined: Mon Mar 17, 2014 14:02

by lordpyridine » Post

The machine makes blocks when nothing is in the input square. Every time I exit the milling menu and go back in there's another block waiting for me.

jessiebessie
New member
Posts: 1
Joined: Sun Sep 28, 2014 17:50
IRC: jessiebessie
In-game: jessiebessie
Location: Wyoming

Re: [Mod] NonCubic Blocks Mod [1.4] [noncubic]

by jessiebessie » Post

How does it work? I made one and I can't seem to make it work
Jess

User avatar
Topywo
Member
Posts: 1721
Joined: Fri May 18, 2012 20:27

Re: [Mod] NonCubic Blocks Mod [1.4] [noncubic]

by Topywo » Post

jessiebessie wrote:How does it work? I made one and I can't seem to make it work
See the 1st post of this thread. Put the material in the 'in' part. Try out with cobble or normal wood. Then choose a shape in the upper part and a size in the lower part. The result you can take from the 'out' part. Just try it out a bit.

- Iirc it doesn't accept all blocks you put in it, just some basic (wood, cobble, stone, brick, sandstone, dirt, leaves, tree and steelblock), though you can off course add more by copy/pasting the code and filling in the blocks you prefer.

mr.street
New member
Posts: 2
Joined: Mon Feb 23, 2015 21:59
In-game: TheZutafly Richard

Re: [Mod] NonCubic Blocks Mod [1.4] [noncubic]

by mr.street » Post

-- edited --
Ignore this post wrong thread.

minetestcr
Member
Posts: 58
Joined: Fri Feb 13, 2015 21:31

Re:

by minetestcr » Post

Jeija wrote:An Octagon wouldn't actually be less polygons because the modding api only lets you create cuboids.
Hello, I'm curious about this cuboids because the home decor modpack has nodes with toilet shape, or bottle shape, etc., so, does that mod use other api that is not cuboid dependant? Maybe the question is idiotic, but I want to understand the difference....

User avatar
Nathan.S
Member
Posts: 990
Joined: Wed Sep 24, 2014 17:47
GitHub: NathanSalapat
IRC: NathanS21
In-game: NathanS21
Location: Bigsby Texas
Contact:

Re: [Mod] NonCubic Blocks Mod [1.4] [noncubic]

by Nathan.S » Post

Minetestcr the question isn't dumb at all, for making nodes there are two basic options. Use the nodebox editor(NBE) or create a mesh with a 3d program and export them in a format that minetest handles. The models in the home decor modpack are meshes created in Blender and exported as obj, meshes allow for rounded smooth shapes. Cuboids are made with the NBE, most of the time, you could create cubic meshes with Blender if you wanted
I record Minetest videos, Mod reviews, Modding tutorials, and Lets plays.
Check out my website, and brand new Minetest Modding Course

minetestcr
Member
Posts: 58
Joined: Fri Feb 13, 2015 21:31

Re: [Mod] NonCubic Blocks Mod [1.4] [noncubic]

by minetestcr » Post

Nathan.S wrote:Minetestcr the question isn't dumb at all, for making nodes there are two basic options. Use the nodebox editor(NBE) or create a mesh with a 3d program and export them in a format that minetest handles. The models in the home decor modpack are meshes created in Blender and exported as obj, meshes allow for rounded smooth shapes. Cuboids are made with the NBE, most of the time, you could create cubic meshes with Blender if you wanted
Thanks "Nathan.S", that makes it clear for me. So, is there a big difference in performance? Wich one is lighter or heavier for the game?

User avatar
Nathan.S
Member
Posts: 990
Joined: Wed Sep 24, 2014 17:47
GitHub: NathanSalapat
IRC: NathanS21
In-game: NathanS21
Location: Bigsby Texas
Contact:

Re: [Mod] NonCubic Blocks Mod [1.4] [noncubic]

by Nathan.S » Post

I personally have never noticed any difference. From what I recall all the nodebox stuff is turned into meshes by the engine when the game starts, so the only difference there should be in performance should be based on the level of detail. Nodebox things tend to be simpler, they have fewer faces and less data to them. A mesh on the other hand could have millions of faces, now there probably wouldn't me much reason to have something with that many faces in Minetest, but theoretically it would be possible with a powerful enough computer. I've been using meshes since they were available, and haven't ever noticed any lag in places where I have a lot of them. The mylandscaping mod uses meshnodes for all the wall parts and machines, and I've seen that on a server with giant walls and noticed no lag.
I record Minetest videos, Mod reviews, Modding tutorials, and Lets plays.
Check out my website, and brand new Minetest Modding Course

User avatar
jp
Member
Posts: 788
Joined: Wed Dec 18, 2013 09:03
GitHub: kilbith
Location: France

Re: [Mod] NonCubic Blocks Mod [1.4] [noncubic]

by jp » Post

Nathan.S wrote:Nodebox things tend to be simpler, they have fewer faces and less data to them.
Wrong, a nodebox model have the same amount of vertices per face than a native mesh model. But a nodebox model also have a lot of hidden faces since a nodebox is necessarily 6 faces. In a native mesh model you can optimize the amount of faces and their associated vertices for modelizing.

This is why we have been optimizing the default stairs to a mesh model for 0.4.13.
Last edited by jp on Sat Oct 10, 2015 09:04, edited 1 time in total.

User avatar
Nathan.S
Member
Posts: 990
Joined: Wed Sep 24, 2014 17:47
GitHub: NathanSalapat
IRC: NathanS21
In-game: NathanS21
Location: Bigsby Texas
Contact:

Re: [Mod] NonCubic Blocks Mod [1.4] [noncubic]

by Nathan.S » Post

Correct JP, I didn't clarify well enough, due to the nature of Nodeboxes they tend to be simpler than meshes, but if one were to create the same model in both formats the mesh would be smaller and more efficient.
I record Minetest videos, Mod reviews, Modding tutorials, and Lets plays.
Check out my website, and brand new Minetest Modding Course

HulkSmashRocks
New member
Posts: 5
Joined: Sun Sep 13, 2015 18:36

Re: [Mod] NonCubic Blocks Mod [1.4] [noncubic]

by HulkSmashRocks » Post

jp wrote: a nodebox is ... 4 faces
Nodeboxes are 6 faces, not 4 though? And aren't each of those faces made of two triangles? So each nodebox becomes a mesh of 12 polys?
Please correct me if wrong I am still learning about these things too :) Personally from what I've seen I'm not a fan of building models with nodeboxes; they seem horribly convoluted and leave lots of 'excess matter' in the model...

Post Reply

Who is online

Users browsing this forum: Majestic-12 [Bot], unaimillan and 7 guests