Kukan Kogei -空間工芸-

Notes about my 3d printing artcrafts

Creating tree growth animation with sverchok

f:id:asahidari:20190918162145p:plain

motivation

When I read the following article (about elfnor's tree generator), I wonder if I can make 3d-printable trees with this Blender's sverchok node. And I also wanted to make tree-growth animation to show the tree generation.

https://elfnor.com/sverchok-tree-generator.html

In this post, I wrote down the way to make 3d-printable trees and growth animations using the elfnor's scripted node. 

 

Generating a tree along a surface

 At first, I use the 'tree generator' scripted node for a surface. The node requires the start point and end points to generate a tree along the source surface. I set the vertices of a surface to the end points, and put a vertex around the center of the surface to the start point. However, it did not work for the first time and I could not get any outputs. After some trial and error, I found the solution. When I moved the location of the start point, an output tree was finally generated. (I think the scripted node may be originally for closed meshes (cubes, spheres and other convex-hull meshes).)

f:id:asahidari:20190918214049p:plain

Creating 3d printable tree meshes

After finding the way to generate a tree along a surface, I wanted to give thickness to the tree. When I read the first article, I found the way to get the thickness by using the 'branch radius' output from the scripted node. This output can be useful when you only show the output as real tree. However, the output mesh is not good for 3d printing, because the mesh has many self-intersections, manifold edges and other issues to be modified for 3d printing.

 

f:id:asahidari:20190918164035p:plain

Therefore, I have to find the another way to give thickness to the output branches. After some research, I found that it seems good to use metaballs. When you use Blender's metaball, each balls are connected smoothly when they get close to one another. So I tried to implement the following method, and it made good results for 3d-printing.

* Get the vertices from the elfnor's tree generator node

* Generate metaballs at the each locations of the vertices using the sverchok's metaball node

* Adjust parameters of the node until you get the best result.

* Convert the metaballs into a mesh

 

f:id:asahidari:20190918205355p:plain

Creating tree-growth animation

After Finding the way to create 3d-printable tree, I wanted to make animations to show the tree in some attractive way, and I wanted to show the tree growth animation if possible. When I was using the elfnor's tree generator node, I found that changing the node's parameter, 'maximum branches', generates the different branch-length output, without changing the shape. When you use the number, 2 or 3, you get a smallest tree around the center of the surface. And as you increase the number, you can get larger tree (and the more branches of the tree) output.

f:id:asahidari:20190918212118p:plain

When you generates all trees to make animation, you need to create images of each trees at the same render position. When you save the images, you have to name the each files with sequential numbers, like 'xxx_001.png', for the next step. After generating the images, you can create GIF animation with the image fies using the following command in your terminal (before this step, you have to install 'imagemagick' command line tool in advance).

convert -layers optimize -loop 0 -delay 5 *.png catenoid_tree_animation.gif

 

Finally you can get the tree growth animation like this.

f:id:asahidari:20190918213237g:plain

References

 

Environment