Halloween Costume ideas 2015

SVERCHOK / Embracing The Art of Parametric Creation In Blender


Once again, I tune my brain to Sverchok set of mind and decided to use my brain a little bit more.

I downloaded the latest update of Sverchok Add-On and it has improved a lot since last time. Lots of new nodes and it helps to cover some complexity and making things much friendlier for artists to work. I recommend you to always do that. Sverchok is a lot faster now.

Without having to know how to write a  code, we can do some pretty amazing things processing the raw data. Quoting Nikita: The force of Sverchok is having access to process Low Level data while using High Level workflow with nodes.

And by thinking this way, we can really focus more on data structures and relationships. "Good programmers worry about data structures and their relationships".
http://interactivepython.org/runestone/static/pythonds/Introduction/introduction.html

I read some books written by John Maeda, one of my hero inspiration. I especially like his book titled "Design By Numbers" (DBN) (I have probably mentioned this a few times by now).

I was reading this book again the other day, at a slower pace, while thinking about Sverchok and Math. I quite like how John Maeda said something in the line of:

"Programming as an art of concealment."

Over time, the thing will get "easier", meaning someone may come up with "easy way" to get thing to work and hides the complexity. Kind of like a shortcuts.

[INPUT] => [CONCEALED PROCESSING] => [OUTPUT]


In fact, in many cases this is exactly what is happening. The artists who love to setup procedural or parametric node system can give a complete setup for other artists who only need to know the parameters and changing the value to get the result.

Blender Modifiers is similarly does lots of magical calculations. In fact, I think Sverchok can become Sverchok Modifier inside Blender. That is the best way I could think of.

Below is such example where a node called "Adaptive Polygons" doing the Art of Concealment. It does the "duplications" like magic.



This can be really useful!


However, sometimes, we like to be able to do more. To have more parametric control for every details. And for that reason, we also need to understand what is going on. How does the data get processed from INPUT and OUTPUT to get that RESULT?

THE ABSTRACTION PROCESS
Firstly, we create an ABSTRACTION of REAL OBJECT. Turning it into NUMBERS that we can possibly use at later stage. It does not always a number, but it is easier to think like that.

Thinking of ABSTRACTION is little bit like Object Oriented Programming (OOP) for Game Programming.

A GAME OF DICE, probably can be abstracted like this:
  • How many die(s)?
  • How many times the dice is thrown?
  • We know every die have only 6 numbers: 1,2,3,4,5,6
  • What are we going to count? Biggest total number? Smallest number? Pattern?
Next, we create some kind of VARIABLES, which become PARAMETERS and VALUES that we can then control or play with.

When working with Sverchok, similarly we are using similar kind thinking. We can bring in Mesh Object into Sverchok and it suddenly become list of numbers (Vertex, Edge, Matrix).


DESIGN BY NUMBER PROGRAM (JOHN MAEDA)
http://dbn.media.mit.edu/

A LINE in Design By Number can be created and drawn by placing MANY DOTS close together. It is very simple to understand. However, drawing many dots can be exhausting, so we CONCEAL the REPETITION of drawing dots into algorithm or function that just draws LINE or even CURVE.

From LINE and CURVE, we can then create RECTANGLE and CIRCLE or ELLIPSE. Perhaps continue on with shapes like STARS.

That is 2D creation. You can also use Processing
http://www.processing.org/

Or something that is more visual like Nodebox:
http://nodebox.net/

[Back to Sverchok and 3D environment....]

In the past, I keep thinking of term PROCEDURALISM, which is something that Maya and Houdini often coined. It is also called NODE-BASED SYSTEM.

※ Procedural in Maya
Procedural workflow in Maya is mostly working on Object Level. To go low level, you need plugin like SOuP by Peter Shipkov or you can use Python and go deep.

You can create your own plugins, but it requires a strong programming knowledge. However, Maya's procedural is out dated if it stays enclosed like that.

※ Procedural in Houdini
While with Houdini, we truly have a node based creation. Houdini uses lots of Expressions and Nodes Houdini is very powerful. Houdini allows you to go into POINT LEVEL, using VOP and VEX.

I would hope that Blender can have Interactive Node Based System that kind of work like Houdini, but simplified and simpler.

※ Procedural in Softimage ICE
I also look a bit into Softimage ICE, which comes to my surprised, actually more or less similar to Sverchok especially in how it LIST DATA.

I did a bit of study of one of CMIVFX video on ICE and I manage to translate the Spherize Deformer using Sverchok. It is half way working before I actually got stucked when it is dealing more and more with Vector and Matrix. But I think it is possible to connect Sverchok nodes to get a fully working Deformer. Need to take consideration of:
1. Object used as the PIVOT for Spherize deformer.
2. To have multiple Spherize deformers.

Softimage is dead, however, Autodesk killed it.


This is similar to Sculpt Deformer in Maya or "To Sphere" function in Blender.

Suzanne to Sphere.

Cube To Sphere.

if we go the opposite, we get something like this.

PROCEDURAL TO PARAMETRIC

Now, apparently a better way to understand Sverchok is actually to think and study PARAMETRIC DESIGN AND PATTERN.

Obviously, because Sverchok was based on Grasshopper for Rhino, which is a visual generative tool to create complex parametric creations.

Organic object MUST have Parametric STRUCTURE underneath it.

Now, if we are searching that term in Google Search or if we go to library and find books titled PARAMETRIC, suddenly we will be exposed to a lot of useful information that can be used to work in Sverchok and Blender!

PARAMETRIC CREATION

I found some useful books in the library: (currently reading it)
  • "Parametric Design for Architecture" by Wassim Jabi
  • "Parametric Building Design Using Autodesk Maya" by Ming Tang
There are a lot more books, of course and I try to filter the good ones.

If you search for "PDF Parametric Design" or "PDF Parametric Architecture", you will get some wealth of information, presentation and research in regards to parametric. You can start from there if you don't have library access. It should give you some inspirations.







I gather some of TERMINOLOGY related to PARAMETRIC, and all these sound really interesting:
  • Versioning
  • Iteration
  • Mass customization
  • Pattern
  • Attractor and Force Field
  • Repetition
  • Tiling
  • Recursion
  • Fractal
  • Subdivision
  • Packing
  • Weaving
  • Branching
  • Contouring
  • Tesselation
  • Triangulation
  • Unfolding
  • etc
There are LOTS of them! Hopefully, I can kind of touch each one of them.

We can get inspiration of parametric design from Nature as well as Man-Made Objects that are already created (which of course was inspired by nature).



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

A BIT OF HISTORY OF PARAMETRIKA by Nikitron

If you want really study parametrism, you have first of all grounded to 1930 years and to the name of http://en.wikipedia.org/wiki/Yakov_Chernikhov <<Якова Чернихова>>.

SEE ALSO:
http://en.wikipedia.org/wiki/Yakov_Chernikhov

He is the first architect that proposed to start the architecture process not from order or antablement, but from POINT and LINE and FACE.

His foundation here:
http://icif.ru/o-fonde/istoriya-fonda/

and works:
http://icif.ru/category/cycles/

Zaha Hadid was inspired by his works and thinked of first her works as about lines and so on. Then she met people, proposed to make mathematical architecture, so was born new movement in beginning of 2000.

Only now, BLENDER achieves this such of tool (in the name of SVERCHOK), Grasshopper was already has it from 2005 (plugin for Rhino), so you can see, we lost 9 years, many things already happened between then and present.

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

THE PARAMETRIC SECRET OF BLENDER CURVE
I have to mention this, but I think Blender Curve does has some kind of built-in procedurality or parametric. Check what you can do with Bevel, Extrude, Twist, Scale, etc, using Blender Curve alone. It is quite amazing Object.

So, Curve and Surface is usually what associated with Parametric. We are mostly working using Polygon these days. People almost forgot there is NURBS. Unless you work using 3D package that is more like NURBS based. 

In Sverchok, we are working with Polygon, actually mostly POINTS. Just think POINTS (Vector) and how you can manipulate those values.

PARAMETRIC CREATION IN SVERCHOK

I am always questioning how far we can go with this Sverchok. I am no a Math guru per se, I seriously have a limited brain for that area! 

We should not be afraid, because "the art of concealment" will happen. It is going to be like magic, and you don't even need to know how it works and will find it fun and useful.

In fact, where is the FUN, if everything is so easy and already pre-made? What good is when things are presented in such a way that is understand-able, not too complicated.


Of course, it would be nicer to understand everything, however, think of below analogy:
It is MUCH MORE IMPORTANT to understand how to cook egg (what type of egg, how long, boiled or oiled? salted? do we need to place it in soup overnight, etc) to make a nice serving of egg to eat, rather than understanding the chemical ingredient eggs or how oven works.

Remember how we create LINE in Sverchok?

We can do that just by supplying our own LIST of NUMBERS that define the POSITION of POINTS and EDGE DATA PAIR, we can end up with LINE.

However, Sverchok also gives LINE node that really create line and we can use the EDGE DATA from LINE node to connect the dots, all we need to do is just to worry about the POINTS positions. Which is a lot simpler. Obviously, there will be time when we want to provide our own RAW data and the sequence and pairing pattern. 

It is of course good to have some basic understanding of this stuff:
1. MATH ALGEBRA
2. MATH TRIGONOMETRY
3. VECTOR
http://www.macaronikazoo.com/?page_id=413
    Am I good at Math? Well, I think I have a decent Math skill until around High School. I don't go learning Math at University. This Sverchok really brings back some of my love for Math, which is nice.

    You can go quite far even though you don't fully understand the Math. I found that what we need to know is thing like this:
    • Matrix can be extracted into Vector Position, Scale, Rotation
    • We can use Vector as data input for Matrix, which is really useful for DUPLICATION
    • Vector can become 3 Numbers
    • Number and Data is very flexible
    Experiment with Sverchok node and always check the RESULT time to time. Whether using Viewer Text or Viewer Draw node.

    GREASE PENCIL => MOUNTAIN SILHOUETTE

    Let's create something and learn along the way.

    STEP 001 - Prepare Data

    In FRONT camera, XZ plane, I draw a 2D silhouette of "Three Sisters" mountain using Grease Pencil.

    You can draw Mount Fuji, Mount Himalaya, Mount Bromo, or your own imaginary mountain.
    NOTE:
    You can also supply your own RAW DATA (text format like CSV) that can be brought into Sverchok.

    EXAMPLE OF DATA INPUT VIA CSV, JSON, ETC.

    This is actually EASIEST to do in 3D! In Houdini we have Table Import SOP that can read CSV, however, they way it setup is not simple. In Maya, out of the box, it cannot really do it. You need Python or MEL.

    It is MUCH simpler using Blender Sverchok to have INPUT data and just to get visualization right away. This is simply very neat. Not long ago, we need to use Python to do this.


    NOTE: Above, if you see the Matrix node does the job of Copying the Sphere, good for Position and Scale, however, if I use Rotation as well, I get "scale shearing". I need to look up documentation or ask at Sverchok forum first. This is something to do with Matrix. The Rotation affect Scaling.

    STEP 002 - Data Conversion

    I convert the Grease Pencil stroke into Curve. You should know how to do this.

    Our RAW data is going to be this CURVE. What can we get from curve? Vector Positions.

    However, if you examine the Curve from Grease Pencil, it is ultra dense. We don't like it.


    I always think Blender needs "Curve Resampling" modifier of some sort. Anyway, we know how to do this stuff using many hacks:

    I don't care too much about nicely sampled or evenly spaced curve, I just want to simplify the curve, so I use "Simplify Curves" Add-On, and just simplify the curve as below:

    Output should be POLY Curve. Because soon after this, we want to convert it to Polygon (edge). Sverchok only takes Polygon mesh at the moment.
    Grease Pencil => Dense Curve => Simplified Curve Poly => Polygon Edge

    Are we good so far? Let's continue.


    STEP 003 - Going into Sverchok

    Let's bring the mesh into Sverchok. Use "Object In" node.


    I actually want to create something that might become:
    • Just a boring Bar diagram
    • Roller Coaster
    • Bridge
    • etc
    It could also be the Procedural Fence thing.

    Anyways, from the Curve that is originally drawn using Grease pencil, we can now observe the data. It has been abstracted into numbers. 

    You see, we can observe just the "height" the Z position like above.

    STEP 004 - Projection to the ground
    Let's do something magical using Sverchok. Vector Projection node.

    Inside Vector Math node, there is "Project" option. I take my guess, I think I can project those points into the ground using this node.



    With those 2 DATA: POINTS from CURVE and projected POINTS on the GROUND, we can already connect the dots right? Look at my previous note on SVERCHOK CONNECT THE DOTS.

    However, I want to do something that is a bit different. 

    I want to instead DUPLICATE some LINES and then SCALE the LINES. This is when you see the power and magic of Sverchok or Parameteric thinking.

    STEP 005 - Duplications and Normalizations
    I will use LINE generator node.

    By default LINE is pointing along X axis. I want it in Z axis, so I just switch the data around.


    I use the Matrix In node and pipe in the Vector from projected POINTS as its position. That is where we want to have the DUPLICATIONS of LINES.


    Cool! Almost there, all we need is to scale each of those Lines to the HEIGHT, using the Z data that we have from original curve.



    Magically, we have those DUPLICATED LINES with HEIGHT VARIATIONS that we specify!


    STEP 006 - Different Object for Duplications
    The advantage of doing it like this is that we now can use our own Object as "Object In" and we can have something like below.



    You notice that our tower is a bit too height? Now, I thought that I should use VECTOR NORMALIZE, but it does not seem to work.

    So, for this case, my solution is to MATH: Multiply the height. I can now starting to have some CONTROLS or PARAMETER to control the design.



    Let see if user is specifying CONE as the Duplicate object:


    You see how elegant the design is.

    STEP 007 - More Parametric
    Let say, we also want to give user more control, we want them to be able to just use the BUILT-IN Sverchok Cylinder generator. Of course you can.

    BIG MAP VIEW

    Our Grease Mountain has come into shape. 

    You know further on, you can also do something like this:

    Mesh via Plane Generator

    Here is another interesting thing we can do. Remember how we have Matrix data supplying the Transformation data for duplicating Lines?

    We can use those data, MERGE it into just a Vertices data (using Apply Matrix for vector and List Join), and then further on use that data with something like Plane node and we get something like below.




    Sverchok Solidify and Wireframe 
    Sverchok also has the Blender style Solidify and Wireframe. It is very intuitive, works the same like Solidify and Wireframe modifier.







    Here is the end result after baking.


    Still pretty crude, it can be a Roller Coaster or Bridge, I am sure. We just need to think more. This is almost like a bridge like.

    ART OF CONCEALING...
    The "Projection" part is not perfect. It does not work with every curve. I think the current version will  "flatten" the curve being projected.

    However, we can skip it altogether and use Blender Projection (ShrinkWrap deformer).




    What if the Grease Pencil Line is going in a loop? That will be more like Roller Coaster.



    I know, it is still a long way to have procedural bridge or roller coaster. But we are definitely on the right track.

    You see the things supporting the roller coaster? That is quite simple actually. The Rail? That is also can be designed parametrically. The TWIST can be interesting to think about in Sverchok. We need to deal with Vector stuff.

    HOTKEYS INSIDE NODE EDITOR
    Inside Node Editor, you probably want to use these hotkeys:
    L = select linked nodes, tap it few times to go further up in the node stream
    F = connect nodes (Blender will guess the slot to be connected)

    Be inspired, read some PDF about PARAMETRIC.





    See the unseen world. In fact if you zoomed in at Butterfly eggs, every type of butterfly have a parametric looking design eggs!



    http://museumvictoria.com.au/discoverycentre/websites-mini/art-of-science/butterflies-of-victoria/

    http://petapixel.com/2014/04/09/captivating-ted-talk-unseen-worlds-time-lapse-microscopic-imagery-slow-motion-reveal/

    THOUGHT OF THE DAY

    All and all, I think what makes PROCEDURAL or PARAMETRIC thinking and workflow quite powerful is that every step by step can be REPLICATED and REUSED.

    I know we are far away from understanding whole thing about parametric (I am). But this thing is certainly interesting and very open ended.

    We are not going to design Sagrada Familia anytime soon! Learn this slowly. Make a Parametric Furniture before making Parametric Building. Make simple parametric object first. For those already familiar with Vector and Matrix, I think Sverchok should be an eye-opener.

    It is AMAZING to be able to do this, even at the very basic level:




    Feel free to scroll this page ups and downs to see the Suzanne tower spinning....
    Start simple, slowly building complexity.

    Just like Blender Default Cube, can be magically modified using combos of Blender Modifiers stack, you could do the same thing using Sverchok.
    http://blog.mikepan.com/post/80514193911/default-cubism-rules

    HOT UPDATE 2014.04.19 !!!

    Linusy, Alex and Nikita are working super hard!

    I was asking few questions regarding how to do hexagonal grid like honeycomb pattern, and also I was wondering how "remove doubles" can be performed inside Sverchok network. Within just few days, we have new nodea.

    Below is a setup for Hexagonal Grid template, thanks for example from Alexander! You can download the BLEND from the Sverchok thread at Blender Artist Forum.

    I am taking snapshot from the example BLEND.

    I usually don't want to just give the BLEND. Myself prefers a step by step manual re-creation, taking through the node. Because very often the final node network is a bit hard to understand.

    However when broken down, and if we actually try to get our hand dirty and recreate the node ourselves we can understand better what is happening.




    NEW: Index Viewer Draw (Viewer INDX node)
    In the latest version of Sverchok, we finally have the ability to see Index number inside Sverchok! Hopefully we can also see other list of values or Vector, etc.


    NEW: Remove Doubles MESH node
    Now, on Alexander example of hexagonal template point, we can then instance Circle with 6 vertices (hexagon) to get a honeycomb grids.

    Previously, we will only end up with duplicates of hexagons. But now as you see in the network below, we can JOIN and REMOVE DOUBLES.

    NEW: List Match node
    There is "List Match" node used here, which is interesting (first time I see it used and sort of understand what it does). List Match seems to be a very clever node that can do ITERATION (FOR LOOP?), kind of like repeatedly creating data, if it is finding a matching pattern.

    For what have been doing here, the process is like this:

    1. Create duplication object. Prepare Template Grid.
    2. "Matrix In" and "Apply Matrix" will mix the data for Points only. They are still a separate data, we don't really need to use "List Join" unless you want to merge and flatten the list. We want to keep the data coming in separate, and we can use List Match to fill the gaps.
    3. Now, we often needs Edges data to match the original pattern. So we use the "List Match" to loop and iterate and create data on the fly for each points to match the original edge pattern.
    4. Then, we can use Mesh Joint and Remove Doubles (for vertex and edge) to have a single object.

    List Match is very cool.

    DATA BEFORE LIST MATCH (separate list of vertices positions)


    AFTER LIST MATCH (now it has the vertices position and matching edges)


    Remove doubles work for vertices and also edges.


    Once you have all connected nicely and baked, you get something like below.



    I think it is very elegant the way Sverchok works. Much easier than anyone would thought.

    Tried my own:



    NEW: Text Input and Text Output
    I decided to quickly cover this as well, because it might be useful for some users, even beginners can find this way of Data Input and Output = easy to understand.

    Like we already know, Sverchok magically processes pure data using its nodes. With Text Input and Text Output (Text In and Text Out node), we are able to bring in data from tables, in format of CSV, Sverchok Python or JSON.

    This is fairly intuitive, but I will give you an example:

    1. Prepare CSV data.
    Let say, I have CSV (Comma Separated Value) data like this:

    Load CSV data into Blender Text Editor panel.

    2. Read data.
    You can load the text using Text Input node. Make sure you name the text data as something.csv.

    3. Vectorize and visualize the data.
    By doing so and then set the Text Input node to point into the data, we can now "Load" it and it is now a data that Sverchok can process. I usually check it using Viewer Text or visually check the point  using the Viewer Draw. The CSV data comes in as "list of values" in Float, we can pipe it it as list of Vector (3 values):


    Check how the Points will match the data you plot.

    It is totally up to you how you like to turn the data into what can be seen on 3D View. I usually like to go to Front View, I pipe in the data for Z and X axis (plane for Front View in Blender).

    You should get something like above. The axis without data will simply be zero or list of ZERO. We already have the Points that can be baked for Blender. However we don't stop there.

    4. Many ways to Visualize the data.
    >> Line Graph


    We can also take advantage of Lines Connection node, but the above method is also good to know.

    >>  Bar Graph


    Or you can also do something like below, which you should already know the drill.

    Suzanne PEZ Bon Bon.

    DONATION TIME: BLENDER x SVERCHOK

    Firstly, you need to install Blender.

    Download Blender here:
    http://www.blender.org/download/

    I am 100% support for Gooseberry project, hopefully their campaign reaches the level enough to add the funding. If I have more money, I would donate more.
    https://cloud.blender.org/gooseberry/

    On the other hand, I am also very excited to see how Sverchok would continue to version 1.0 onwards.
    http://nikitron.cc.ua/blend_scripts.html

    Sverchok Basics examples just got updated:
    http://nikitron.cc.ua/sverch/Sverchok_basics.blend.7z

    NOTE: I think Basic Example BLEND file has a bug that making "Object In" node does not work and we cannot GET the mesh properly. A way around it is to re-create the node yourself while following the notes inside Sverchok Examples.

    Install Sverchok Add-On here:
    https://github.com/nortikin/sverchok

    Those two are very exciting development to follow, apart from Blender Cycles and Open Shading Language (OSL) implementation.

    Every now and then, I would donate to them, happy to give few dollars to help the developers.

    SOME COOL PDF AND LINKS ABOUT PARAMETRIC

    http://mypages.iit.edu/~krawczyk/spctbuh04.pdf
    http://digitalprocess.files.wordpress.com/2012/02/parametricdesign.pdf
    http://grasshopperresources.blogspot.com.au/

    Actually too many to list here, please Google Search yourself.

    SOMETHING TO WATCH FOR:

    There will probably be many similar add-on for Blenders that uses the concept of procedurality and node-based... In the end it will be a matter of juggling complexity x simplicity in implementation.

    CODENAME: Flakes
    http://blenderartists.org/forum/showthread.php?327950-Flakes-%96-nodular-everything

    Post a Comment

    MKRdezign

    Contact Form

    Name

    Email *

    Message *

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