diff --git a/technic/cnc_api.lua b/technic/cnc_api.lua index 2d5dcfe..aecfadb 100644 --- a/technic/cnc_api.lua +++ b/technic/cnc_api.lua @@ -6,10 +6,6 @@ technic_cnc_api = {} ---------------------------------------- technic_cnc_api.detail_level = 16 -- 16; 1-32 --- HERE YOU CAN DE/ACTIVATE BACKGROUND FOR CNC MENU: --------------------------------------------------------- -technic_cnc_api.allow_menu_background = false - -- REGISTER NONCUBIC FORMS, CREATE MODELS AND RECIPES: ------------------------------------------------------ @@ -146,6 +142,12 @@ end -- SLOPE INNER EDGE ------------------- function technic_cnc_api.register_slope_inner_edge(recipeitem, groups, images, description) + local slopeboxedge = {} + local detail = technic_cnc_api.detail_level + for i = 0, detail-1 do + slopeboxedge[i+1]={(i/detail)-0.5, -0.5, -0.5, 0.5, (i/detail)-0.5+(1/detail), 0.5} + slopeboxedge[i+detail+1]={-0.5, -0.5, (i/detail)-0.5, 0.5, (i/detail)-0.5+(1/detail), 0.5} + end minetest.register_node(":" .. recipeitem .. "_technic_cnc_slope_inner_edge", { description = description, @@ -159,51 +161,8 @@ minetest.register_node(":" .. recipeitem .. "_technic_cnc_slope_inner_edge", { 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}, - }, + type = "fixed", + fixed = slopeboxedge, }, groups = groups, }) @@ -251,6 +210,13 @@ if recipename == "default:dirt" then return end +local slopeboxedge = {} +local detail = technic_cnc_api.detail_level +for i = 0, detail-1 do + slopeboxedge[i+1]={0.5-(i/detail)-(1/detail), (i/detail)-0.5, -0.5, 0.5, (i/detail)-0.5+(1/detail), 0.5} + slopeboxedge[i+detail+1]={-0.5, (i/detail)-0.5, 0.5-(i/detail)-(1/detail), 0.5, (i/detail)-0.5+(1/detail), 0.5} +end + minetest.register_node(":" .. recipeitem .. "_technic_cnc_slope_inner_edge_upsdown", { description = description, drawtype = "nodebox", @@ -264,50 +230,7 @@ minetest.register_node(":" .. recipeitem .. "_technic_cnc_slope_inner_edge_upsdo }, 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}, - - }, + fixed = slopeboxedge, }, groups = groups, })