Happy Feet Two of Matryoshka Dolls |
The other day, I was laying on bed and imagining: I think Matryoshka Dolls can be made procedurally in Sverchok using just 2 Grease Pencil strokes. And that happens!
There is a bit of research going on regarding the techniques and concepts to create the mesh for the dolls. It is really super simple, however if you actually try to make such setup, you still will learn some interesting things in this simple exercise.
01 GOOGLE SEARCH RESEARCH
There is one Matryoshka Dolls shop in Sydney, located at Darling Harbour Shopping Center. I might go there to have a look and study some of the design.For our convenience, we can always start by looking at some images on the Internet, I use Google Search for that. Overall, we understand the shape it is really simple.
I also found this Nested Pigs made of glass the other day, very cool:
Nested Pigs, |
02 THE TECHNIQUES
Like I said, it is actually a very simple procedure to create this. When I mean 2 Grease Strokes, I really mean it. One stroke for the smallest doll and another stroke for the biggest doll. That is it.We can then do some kind of:
- Resampling
- Interpolation
- Lathe
- Distribution
- Alignment
What interesting is the simplicity of the whole setup.
Let's create the dolls!
03 PREPARE THE DATA
Our Data is a 2 x Grease Pencil (GP) Strokes.GP strokes is always a heavy type of data, even 2 strokes can give back around 2000 points. Just to let you know. Unless you have "Simplify" turned on in GP Preferences.
In our case, it does not really matter much, 2000 points data is still pretty light to handle in Sverchok.
From our research, we know that the smallest doll is more like an egg or baby wrapped and the tallest doll has a bit of double curve for the head and body.
NOTE:
- Grease Pencil Strokes often are connected stroke when converted into Curve, you want to F6 and get rid of the ugly connected curve.
- Careful when drawing GP strokes with nothing in 3D scene (if you happened to delete everything, including Active Camera). GP needs to always be linked to an object, at least an empty or a camera. Otherwise you may not be able to get Curve that you expected.
04. ENTER THE MATRYOSKA
(Pardon my reference to The Matrix, I just need to do it.)After converting the GP into Curves, simply brought the curve into Sverchok environment via the node-tree. We can manipulate, edit as we need to.
05. SEPARATE AND RESAMPLE
We know that we made 2 strokes as a single Curve object, we need to separate them first using SV Separate Loose.Once we have 2 data now, we simply use SV Vector Interpolation to "resample" each of the curve.I just use 10 points sample for now. You can use different Count.
You should see something like below.
At the moment, you only see Vertices. You cannot bake the Vertices points. If you want to bake it, you can do that after you use UV Connection and connect the edges. But save that for later.
06. More Interpolation
Using SV Evaluate Line we can further "interpolate" between the 2 curves. Before that we need to specifically filter the 2 Curves using 2 x SV List Item nodes, one for each curve.We know that with node that has "Factor" we can actually do some "in betweener" magic.
07. SPIDER WEB SITUATION
You are starting to see where this one is going. The next step is probably the trickiest bit, but you need to take a leap of faith.The SV Evaluate Line actually convert all the data back into 1 array of data. Just points, but still has a nice arrangements or sortings.
[ SV List Split + SV UV Connect ] combo will split those "Points Data" every-N points. By doing so, we have Points data once again ready to be converted into Points and Edge, aka Lines. This will become something that you may encounter in the future. I am not the Oracle, but you can trust me on that.
08. CLONES
We are nearly there in our journey to make the M Dolls.What I often did not show you in my blog writing when explaining about Sverchok is that I actually check the data a lot of time using SV Viewer Text. Especially important when we are dealing Array of Data or Vectorized Input.
Matryoshka Dolls case is a perfect example to explain this. It is very Pythonic too.
We are slicing Lines into parts. We connect them again using UV Connect node, with that node we can again take advantage of SV Separate Loose, this time, it checks if Points are connected by Edge and then it can "group" or "nest" the data back.
Sverchok is very good for this kind of Separating and Combining data. Normally if you were to model this using Blender normal environment, you might go back and forth of Object and Edit mode.
Of course, Blender has Array Modifier, Curve Modifier, Particle Instancing, DupliCloning, however, using Sverchok, we have an additional workflow that we can use to streamline the process.
Next node to use is SV Lathe Node. And we are pretty much done!
All we need to do is to present it better.
09. ARRANGE AND DISTRIBUTE
Nicely arranging the Doll and distribute them from the shortest to tallest is a fun Math task.In our case, we do not really need to worry about sorting them from shortest to tallest. That could be another tutorial. It would also be fun if we are to "Shuffle" these dolls. That is also another different puzzle. What you may not know is that SV Objects In node has a new feature added "Sort Objects Components By Objects Name". Thanks to Nikita for this.
Even Distribution of Dolls
Originally, I arrange the dolls using evenly spaced distribution:
However, a friend suggested me to distribute it more nicely, which takes consideration of the Dolls Radius and also an option to have "gap" or "spacing" in between the dolls.
Nicely Distribution of Dolls with Extra Gap
For this, you probably remember my previous post on SN Accumulator node? We can use that.
If we measure the Bounding Box of each Dolls, and Accumulate the WIDTH of each doll, we can arrange the dolls side by side in a nice way.
A more sophisticated solution is probably to use Radius of each doll and use Math formula to measure the position of each doll center. However, we probably don't need to go there, but you can certainly do that if you like to.
That is the story how the Matryoshka Dolls was made using 2 Grease Pencil strokes.
The nested dolls. |
MATRYOSHKA DOLLS SV NODE TREE
Version 1:
Version 2:
Post a Comment