Kukan Kogei -空間工芸-

Notes about my 3d printing artcrafts

Mesh Growth script for Blender Sverchok


f:id:asahidari:20211108181155p:plain

Overview

This entry shows some examples of Differential Mesh Growth, using a script in SNLite node in Blender Sverchok add-on.

Description

About a couple of month ago, I posted an entry to show an example of Differential Mesh Growth using Pulga Physics node and some other nodes.

However, the node tree became complex to make and it seemed difficult to manage the tree structure. So I decided to write a script to implement the algorithm and tried to reduce the task to make the node tree.

Luckily, Blender and Sverchok add-on already have useful APIs to achieve this attempt, such as relax_mesh and subdivision API. So it is not so difficult to write the growth algorithm. Just repeat some operations: relax mesh, subdivide mesh, and move vertices using forces between them.

In this entry, I will show some example of node trees to make growth simulation, not explain the details of the script. If you want to know about the script, please see my GitHub repository or visit links in the References at the bottom of this page.

Usage

Script for Differential mesh growth is in mesh_growth directory in my GitHub repository.
https://github.com/asahidari/differential_growth_snlite_b3d
mesh_growth/differential_mesh_growth.py

To use this, just load to the Script Node Lite node in Sverchok add-on. If you do not know how to load this script in Sverchok add-on, please see my previous entries.

SNLite node image is here. f:id:asahidari:20211108181252p:plain

  • steps: Total frame steps.
  • vertices_in: Mesh vertices
  • edges_in: Mesh edges
  • faces_in: Mesh polygons
  • weights_in: Vertex weights
  • random_seed: Random seed to make first velocities
  • relax_iterations: Iteration count to relax mesh
  • max_edge_length: Max distance between each vertices
  • framenum: Frame number of output datas

Parameters (inside the script): f:id:asahidari:20211108181341p:plain

  • SEPARATION_FORCE/DISTANCE: Separation parameters between each vertices. Ratio to the average edge length.
  • MAX_VELOCITY: Max velocity of the vertices. If edges become larger than this value, the edges will be subdivided.
  • COHESION_FORCE/DISTANCE: Cohesion parameters between each vertices.
  • RELAX_WEIGHTED_ONLY: Apply relax mesh only for vertices whose weight values are larger than zero.

These parameters inside the script often affects the shape of the growth, so adjusting these values are also important to control the growth shape.

Example

These images are some examples of the node trees to make growth simulation. It is possible to make more various shapes if you change the source object and the parameters.

Growth from a disc

f:id:asahidari:20211108182328p:plain f:id:asahidari:20211108223751g:plain

Growth from a torus

f:id:asahidari:20211108182347p:plain f:id:asahidari:20211108223817g:plain

Growth from a part of a torus

f:id:asahidari:20211108182406p:plain f:id:asahidari:20211108223839g:plain

References