Halloween Costume ideas 2015

SVERCHOK / Revisiting Procedural Stacking



There is one pending problem in my mind that I did not quite solve it in the past:
http://blendersushi.blogspot.com.au/2012/08/procedural-question-of-brick-stacking.html

Object stacking is an interesting problem. Let's try to think about it in Sverchok.

PYRAMIDE

A simple stack of Pyramide is rather easy, right? You can do it manually using Array Modifier and use a Cube and slowly scale it down.


Why doing it the hard way using Sverchok? Because "the hard way" can be beneficial in long term.

Flying a kite is "easy", opening a coconut is "easy", making spaghetti is "easy", all "easy" until you give it a try :) and want to get it perfect.

Anyway, enough on that, let's make a pyramid using Sverchok.

There are many solutions for this. You can be fully procedural, create one solid pyramide, which is not made from many cubes. Or you can do the easy one first, by simply duplicating, scaling, a cube. Just "replicating" the Array Modifier.

EASY PYRAMIDE

1. Start with a Cube object. Put this object in different Layer to avoid accidental deletion (shortcut M, then press 2, to place it in Layer 2)


2. Power up the Sverchok, start with LINE node.
We do not really need a Line node, but it is handy and I want to show you something interesting. You can always use your own Series List to create Point that goes up to position our Cube.


Line is nice, but you see it does not have option on which axis it should be pointing when creating Points. It is pointing down the Positive X Axis by default. We want it to go up for our Pyramide positioning.


We want to rotate the line so that it is pointing up in Positive Z Axis. This is one way I could think of.


To confirm that Points, next, I use Matrix Apply node. Same result like above, just simplified.


Then, from those points, we want to use that as Template Position for our Cube duplications. We know how to do that, just use Matrix In node.



Next simply bring in our Cube object using Object In node.


We now need to resize the Cube Z so that it is in the shape of the most bottom Pyramide to stack.

You can do it manually (do Scale Z to the Cube in Edit Mode) or using Sverchok. Up to you.


So far, we should have 3 PARAMETERS to CONTROL our Stacking:
- Distance between Object
- Number of Stack
- The Z size of stack

I usually give the node some bright Yellow Color if these node is what user can change.




We have created the UTS (University of Technology Sydney) building....

But we want a pyramide. We need to be able to control the Scale in X and Y. That is easy, just plug in some Scale Vector into the Matrix In of our Template Duplication.

LIST SERIES => SCALE VECTOR => MATRIX IN

Remember that the total list number is actually depending on the number of stack.

Upside Down Pyramide:



The pyramide is of course upside down because LIST SERIES is always go from MIN to MAX value. We can reverse the list using List Reverse node.




We have a lot of Factors or Parameters here to control our Pyramide Stacking. In fact... too many parameters is not good, we need to simplify.

Remember how the Number of Stack will affect the List? We can create dependency of these two.

AVOID DIVISION BY ZERO (Blender will crash)

Just be careful some number cannot be ZERO if you create dependency. In formula like this:
x / n[0]

If there is a possibility the n[0] will be zero,  I use this instead:
x / (n[0] + 0.001)

Alexander also recommends:
x / max(abs(n[0]),0.000001) 
or
x / (n[0]+0.000001)

FULL MAP NODE-TREE FOR PYRAMIDE


You can now stack Pyramide procedurally:



Use Torus as BASE object.

Use Prism as BASE object.


Tower of Suzanne heads:


In fact Tower, Temple, Candi can give so many inspirations.

Tower of Babel

Candi is awesome. Have you been to one of those? 
Going further, if we "BREAK" the simple Base using Sverchok, maybe into Procedural Bricks, we will get a complex structure. That's probably next.

Creating Procedural Stair is also fun and similar, but I leave it to you.

See if you can find a way to randomize the stacking instead of having the Z Scale the same steps.

Post a Comment

MKRdezign

Contact Form

Name

Email *

Message *

Powered by Blogger.
Javascript DisablePlease Enable Javascript To See All Widget