Voronoi on Mesh

https://github.com/nortikin/sverchok/assets/14288520/ecff1142-de97-438f-a3be-f609d0816b96

Dependencies

This node requires SciPy library to work.

Functionality

This node creates Voronoi diagram on a given mesh, from specified set of initial points (sites). More specifically, it subdivides the mesh into regions of such Voronoi diagram. It is possible to subdivide:

  • either surface of the mesh, generating a series of flat meshes,

  • or the volume of the mesh, generating a series of closed-body meshes. In this mode, it is required that the mesh represents a closed volume.

Inputs

This node has the following inputs:

  • Vertices. Vertices of the mesh to generate Voronoi diagram on. This input is mandatory.

  • Polygons. Faces of the mesh to generate Voronoi diagram on. This input is mandatory.

https://github.com/nortikin/sverchok/assets/14288520/5a6ecd49-9ae1-4422-98b6-211060a22420
  • Voronoi Sites. The points to generate Voronoi diagram for. Usually you want for this points to lie either inside the mesh or on it’s surface, but this is not necessary. This input is mandatory. If list of Voronoi sites is Zero length then source object will not processed and transfer it params to output sockets.

https://github.com/nortikin/sverchok/assets/14288520/4353aec1-e4f5-4cb4-a9ec-f3e8c6435c0b
  • Mask of sites. List of True/False or indexes. What Sites will be show in result.

https://github.com/nortikin/sverchok/assets/14288520/61bd23e3-3a8e-47e2-b18f-1c7272b71679
  • invert Invert list Mask of Sites.

https://github.com/nortikin/sverchok/assets/14288520/b8360826-c678-4b47-b783-3e05a71f1275
  • Spacing. Percent of space to leave between generated fragment meshes. Zero means do not leave any space, i.e. regions will fully cover initial mesh. The default value is 0. This input can consume either a single value per object, or a list of values per object - one value per site. In the later case, each value will be used for corresponding cell.

https://user-images.githubusercontent.com/14288520/202571726-e7ecbf0a-72ad-48bd-b3c5-cd800b86b524.gif

The list of values per object - one value per site:

https://user-images.githubusercontent.com/14288520/202572900-c82edfd3-6634-4425-b33a-b4f09f87ecc9.png

Parameters

This node has the following parameters:

  • Mode. The available options are:

    • Split Volume. Split closed-volume mesh into smaller closed-volume mesh regions.

    • Split Surface. Split the surface of a mesh into smaller flat meshes.

    The default value is Split Volume.

https://user-images.githubusercontent.com/14288520/202573307-cd8f42e1-6909-47d0-bf37-9211dbafb69a.png
  • Correct normals. This parameter is available only when Mode parameter is set to Volume. If checked, then the node will make sure that all normals of generated meshes point outside. Otherwise, this is not guaranteed. Checked by default.

https://user-images.githubusercontent.com/14288520/202575356-5ece8f0e-4787-4d85-846e-c8fb525e732b.png https://user-images.githubusercontent.com/14288520/202574847-5343b0d1-61f3-4313-a8a1-7efce49f1405.gif
  • Post processing. This defines nesting structure of result meshes. The available options are:

    • Separate All Meshes. Separate the result meshes into individual meshes.

    • Keep Source Meshes. Keep parts of the source meshes as source meshes.

    • Join All Meshes. Join all results meshes into a single mesh.

https://github.com/nortikin/sverchok/assets/14288520/afa0b637-b0cb-4813-9f10-3e05cd607e02
  • Accuracy. This parameter is available in the N panel only. This defines the precision of mesh calculation (number of digits after decimal point). The default value is 6.

https://user-images.githubusercontent.com/14288520/202577600-9f0e8eb6-2782-4a3b-9e58-f915823c9dfa.png

Outputs

This node has the following outputs:

  • Vertices. Vertices of generated mesh.

  • Edges. Edges of generated mesh.

  • Faces. Faces of generated mesh.

  • Used Sites idx. Indices of sources sites for further using (after apply Mask of sites). (from sverchok 1.3-alpha-master)

  • Used Sites Verts. Values of used sites. Keep of source struct of input socket “Voronoi sites” lists (after apply Mask of sites). (from sverchok 1.3-alpha-master)

    https://github.com/nortikin/sverchok/assets/14288520/91ccb203-e0bb-49a0-a626-e403ee30be3c

Addition info

From version of sverchok 1.3.0-alpha sites can be any configurations: Line, Plane, Circle, Sphere

https://github.com/nortikin/sverchok/assets/14288520/20df452e-be1e-47b2-acda-f2b7a1a8553e
https://github.com/nortikin/sverchok/assets/14288520/22ab225c-a8b5-4596-bee1-85a6412c8bb1
https://github.com/nortikin/sverchok/assets/14288520/8fa05903-0244-441a-87a3-aa42415e6b30
https://github.com/nortikin/sverchok/assets/14288520/27e4c0a4-e56d-4f4f-9db5-04a92c0c7180

Example of usage

https://user-images.githubusercontent.com/14288520/202578440-c713aac3-c787-456a-b796-190204bf297a.png

Inspired by https://www.youtube.com/watch?v=Ip6JI6Qiiwg

https://github.com/nortikin/sverchok/assets/14288520/5d01e61f-9743-4a07-a2c8-2866a7191e73 https://github.com/nortikin/sverchok/assets/14288520/c4153ae0-ca18-4f29-968c-ede4d2197008

Like the previous example but node “Particle System” replaced by node “Spiral”:

https://github.com/nortikin/sverchok/assets/14288520/b5704476-fbc4-4c0a-a116-d7a1738567fe https://github.com/nortikin/sverchok/assets/14288520/2ad77100-6630-4a27-aa36-a88a7b2d7f5b https://github.com/nortikin/sverchok/assets/14288520/4e963254-251d-441d-808f-f30c9af55d62

blend file: https://github.com/nortikin/sverchok/files/12342712/Voronoi.Tower.006.blend.zip

See also example