Add Nodebox type="scaled"
My suggestion is that - like the "leveled" type of nodebox - "scaled" nodeboxes would use param2 to store the "level" of the nodebox, and all other dimensions would be interpreted as fractions (technically multiples) of param2. This introduces a method to parametrically define a series of nodeboxes using only a single node type. Potential applications include - plants, fungi, crystals, bubbles, baloons... anything that grows, shrinks, or varies in size.
EDIT: Grammar.
Your phone or window isn't wide enough to display the code box. If it's a phone, try rotating it to landscape mode.
- Code: Select all
-- Example 1 : a simple, centre-aligned cube
nodebox = {
type = "scaled",
scaled = {
-0.5 , -0.5 , -0.5 , 0.5 , 0.5 , 0.5
}
}
-- Example 2 : an OCD-style flower node
nodebox = {
type = "scaled",
scaled = {
--{ x1 , y1 , z1 , x2 , y2 , z2 }
{ -0.1 , -0.5 , -0.1 , 0.1 , 0.1 , 0.1 }, -- stem
{ -0.3 , 0.1 , -0.3 , -0.1 , 0.3 , -0.1 }, -- petals
{ -0.3 , 0.1 , 0.1 , -0.1 , 0.3 , 0.3 },
{ 0.1 , 0.1 , 0.1 , 0.3 , 0.3 , 0.3 },
{ -0.3 , 0.1 , 0.1 , 0.3 , 0.3 , -0.1 }
}
}
EDIT: Grammar.