I cannot seem to get enough of Sverchok, so I decided to continue and spend few more hours before this Sunday is over.
I am still very green with this Add-On and super curious about what this Add-On can do, cannot do and potentially do if Sverchok continues being developed. There are a lot more unknowns that I need to study than what I know. Anyway, I try to slowly build up from what I know.
Apart from needing to understand the Sverchok nodes, we really need to understand how DATA (Vector, Vertex, Matrix) can work with one another to output a complete geometry/mesh that we are familiar with.
EXAMPLE 1: CREATING COMPONENT DATA
In this post, I will not get too details with Sverchok, but will attempt to walk through a simple creation that hopefully helps both you and me to see how COMPONENTS DATA create a normal 3D mesh.Let say we create a simple row of square grid 1 x 7 (2 x 8 number of vertices) using Sverchok.
Plane.vertices => ViewerData.vertices
Above, I am only passing the Vertices data from Plane generator and we are getting Points. These guys cannot be baked, unfortunately it spits out error message.
Using Viewer Text node, we can see the actual DATA it outputs.
vertices:
(1) object(s)
=0= (16)
(0.0, 0.0, 0.0)
(1.0, 0.0, 0.0)
(0.0, 1.0, 0.0)
(1.0, 1.0, 0.0)
(0.0, 2.0, 0.0)
(1.0, 2.0, 0.0)
(0.0, 3.0, 0.0)
(1.0, 3.0, 0.0)
(0.0, 4.0, 0.0)
(1.0, 4.0, 0.0)
(0.0, 5.0, 0.0)
(1.0, 5.0, 0.0)
(0.0, 6.0, 0.0)
(1.0, 6.0, 0.0)
(0.0, 7.0, 0.0)
(1.0, 7.0, 0.0)
unknown data:
None
matrixes:
None
Getting used to utilize both Viewer Draw and Viewer Text nodes, these two nodes are very useful to track the data.
I now plug either Edges or Polygons data to Viewer Draw. This will create a complete Mesh data. We can have either Grid mesh that is made of Vertices data and Edges data OR Grid mesh that actually has Faces.
Knowing and understand how to inspect Data from Object is important.
GRID OF EDGES DATA
vertices:
(1) object(s)
=0= (16)
(0.0, 0.0, 0.0)
(1.0, 0.0, 0.0)
(0.0, 1.0, 0.0)
(1.0, 1.0, 0.0)
(0.0, 2.0, 0.0)
(1.0, 2.0, 0.0)
(0.0, 3.0, 0.0)
(1.0, 3.0, 0.0)
(0.0, 4.0, 0.0)
(1.0, 4.0, 0.0)
(0.0, 5.0, 0.0)
(1.0, 5.0, 0.0)
(0.0, 6.0, 0.0)
(1.0, 6.0, 0.0)
(0.0, 7.0, 0.0)
(1.0, 7.0, 0.0)
data:(1) object(s)
=0= (22)
(0, 1)
(2, 3)
(4, 5)
(6, 7)
(8, 9)
(10, 11)
(12, 13)
(14, 15)
(0, 2)
(2, 4)
(4, 6)
(6, 8)
(8, 10)
(10, 12)
(12, 14)
(1, 3)
(3, 5)
(5, 7)
(7, 9)
(9, 11)
(11, 13)
(13, 15)
matrixes:
None
GRID OF POLYGONS (has FACES) DATA
vertices:
(1) object(s)
=0= (16)
(0.0, 0.0, 0.0)
(1.0, 0.0, 0.0)
(0.0, 1.0, 0.0)
(1.0, 1.0, 0.0)
(0.0, 2.0, 0.0)
(1.0, 2.0, 0.0)
(0.0, 3.0, 0.0)
(1.0, 3.0, 0.0)
(0.0, 4.0, 0.0)
(1.0, 4.0, 0.0)
(0.0, 5.0, 0.0)
(1.0, 5.0, 0.0)
(0.0, 6.0, 0.0)
(1.0, 6.0, 0.0)
(0.0, 7.0, 0.0)
(1.0, 7.0, 0.0)
data:(1) object(s)
=0= (7)
(0, 1, 3, 2)
(2, 3, 5, 4)
(4, 5, 7, 6)
(6, 7, 9, 8)
(8, 9, 11, 10)
(10, 11, 13, 12)
(12, 13, 15, 14)
matrixes:
None
YELLOW = First Index Number Polygon / Face (index zero)
BLUR = Last Index Number Polygon / Face
Gradation of color from yellow to blue is showing the direction of index from first to last.
Noticed we ALWAYS need Vertices DATA in order to have a complete mesh.
We have not really supply the Matrix Transformation DATA for this mesh yet. But that is alright, it will default at the center of world if you actually BAKE out the mesh.
LADDERS
Ok, let say, I want to create something like a LADDER procedurally and I want to separate the LADDER STEPS, how would we go about doing that?I will first bake out our GRID EDGES and will pay attention to the Vertices Indices (index numbers):
TIPS: bpy.app.debug = True
Depending on how you create the grid, you might end up with numbering that like above, where the indices number of vertices is like below:
TOP LINE = 0,2,4,6,8,10,12,14
BOTTOM LINE = 1,3,5,7,9,11,13,15
You might also get something like this:
TOP LINE = 0,1,2,3,4,5,6,7,8
BOTTOM LINE = 9,10,11,12,13,14,15,16
Which one is preferable? I think either one is something you need to know how to deal with.
Anyway, our task here is simply to tell Blender Sverchok to connect and create EDGES that pairs up the the indices number. Very simple right?
We need to create DATA that is actually a LIST of PAIR. Below is how you would do that using Sverchok.
TOP LINE NUMBERS
BOTTOM LINE NUMBERS
You can check if you are creating the right data by checking the data output using Viewer Text.
LIST OF TOP LINE NUMBERS
vertices:
None
polygons:
(1) object(s)
=0= (8)
1
3
5
7
9
11
13
15
matrixes:
None
LIST OF BOTTOM LINE NUMBERS
vertices:
None
polygons:
(1) object(s)
=0= (8)
1
3
5
7
9
11
13
15
matrixes:
None
MIXING DATA (SVERCHOK LIST NODES)
Now that we have 2 LIST, how do we make PAIR OF DATA? Luckily Sverchok provides us with node that does that on the fly.It is probably a good idea to understand what each LIST X NODES does. I leave that to you. Each of that nodes really need some documentation. Eventually I promise to cover each and every one of those! :)
Those LIST has their own similarity to Python Methods to work with LIST (sort, zip, length, reverse, etc):
http://docs.python.org/2/tutorial/datastructures.html
For our task, we just need to use LIST ZIP, it will pair up our data and create one list of pair.
TIPS: Remember to click on Sverchok big UPDATE button time to time to refresh the data and so that we can see the actual result.
Next, we simply need to pass on those PAIR of NUMBERS as our EDGES data for our final mesh.
Hopefully you understand this part. That is kind of DATA required in order to create mesh that is "complete" and can be baked. Blender + Sverchok will be smart enough to ignore weird data and output a geometry. Unless we did not supply enough data.
EXAMPLE 2: COMBINING DATA / LIST JOIN
Continue on.Let say I want to have Mesh that is made up of 2 Circles, but I just want the EDGE RINGS.
I will start with 2 Sverchok Circle nodes, let's call them Circle A and Circle B. I know that I only need to care about the Vertices for now. Noticed that for each Sverchok Circle, when we specify the TOTAL NUMBER of Vertices, it will always have 1 more extra vertice in the center of circle.
Then I use LIST JOIN node to combine the Vertices data of Circle A and Circle B. Combined together, there should be total of 2 * (8+1) = 18 vertices.
When combining data like this, you need to watch the DATA OUTPUT in Text Editor, sometimes the data is more like collection of 2 objects, instead of 1 big list.
Next, we just need to connect the dots just like the previous LADDER example.
It should be simple, we will connect vertices as edge using the pair list.
You could further tidy up this network so that you can modify the Circle and the Connected Dots will always give a correct result. Also if you know how to do Node Grouping and Framing, I think you can start doing that. I will do that too soon.
http://www.youtube.com/watch?v=IuGJ_PDwOPI
http://www.youtube.com/watch?v=57YjX3nfb8Q
Blender Wiki:
http://wiki.blender.org/index.php/Doc:2.6/Manual/Composite_Nodes/Node_Groups
UPDATE 20140106: Simple Duplication
Here it seems complicated, but actually similar to previous example of Duplications using Face Center and Face Matrix. Here, we are converting Vector to Matrix and use that as template for our own parametric creation. We can get something like Christmas tree maybe. Or centipede, something that repeats.
Above, I am using LINE as the template for our 2D ASTERISK.
This is really similar to Duplication or Instancing of Objects on Particles... however here, I am using the default Transformation Matrix for each duplication. With further tinkering with Sverchok, we could probably do something with Scale or Rotation axis of each duplicated objects. Example below:
MORE: 3D Asterisk
Using the same concept and idea, we can have something like below using 2 x Spheres. Or Sphere and Line, whichever you prefer.NOTE: Each lines created are separate from each other and we need to merge and "Remove Double". It is probably possible to do this clean up using Sverchok, but I don't know how yet.
PROCEDURAL SPIDER WEB
I think, using the same idea, we can create Spider webbing!After tinkering with Sverchok, I realized that thing like Spider web is really just a flattened Cone.
So that is probably if I were to do it manually by hand. But that is is still too "perfect" and not very natural like real spider web.
So, we probably need to add "imperfection", here I use Build Modifier.
Now, how would we create something like that in Sverchok? Then the web even better and more robust?
It certainly needs details, such as below: (albeit cartoony)
Do more research ... (on Sverchok and tangled web)
Since it is the silly spider Summer season in Australia, it is worth looking closely at the web of our friendly neighbours the spiders:
Closer inspection reveal that the spider web is more VORONOI like, although it has MULTI-LAYERS and some RANDOM VARIATIONS, including ROUNDING. In some parts, it is as if the Voronoi has a child of another Voronoi.
Probably the cartoony spider web that we always draw in our mind is more for bigger spider or like a really large type of webbing. There must be many different type of spider web.
Voronoi is perfect to recreate using Sverchok, I guess, and it is alright to think in 2D first.
Well, I guess something like this needs some times to solve, I guess I will come back to it.
I think Spider web also has this kind of feature like random LADDER:
http://askakorean.blogspot.com.au/2010/12/how-do-you-climb-ladder.html
TRIVIA: My favourite superhero is Spiderman.
I am also still confused and unsure on how to do below stuff in Sverchok:
- SWEEP
- DUPLICATE MESH (like Array Modifier)
- VORONOI
- Many more...
I will have to do more research and write some more. All these are still basics, but important I guess. Then I have to start Grouping Network and organizing large node-tree.
@Nikita, if you read this, I have some Sverchok questions to ask. Thanks. I will try Blender Artist Forum first.
LINKS
http://yorik.uncreated.net/guestblog2013.htmlhttp://jag-himamshu.blogspot.com.au/p/procedural-fun.html
Post a Comment