Voronoi on Mesh

https://github.com/nortikin/sverchok/assets/14288520/c907cc2d-7493-4117-a20f-b5e760a47d28

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.

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

  • Mask. List of True/False. What Sites will visible.

https://github.com/nortikin/sverchok/assets/14288520/cc788894-acc7-4b1f-a1c0-fb5756e42eb2
  • 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.

https://user-images.githubusercontent.com/14288520/202571362-7f047b5b-64a9-489c-8167-5fcb125f7fdf.png
  • 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
  • Output nesting. This defines nesting structure of output sockets. The available options are:

    • Flat list. Output a single flat list of mesh objects (Voronoi diagram ridges / regions) for all input meshes.

    • Separate lists. Output a separate list of mesh objects (Voronoi diagram ridges / regions) for each input mesh.

    • Join meshes. Output one mesh, joined from ridges / edges of Voronoi diagram, for each input mesh.

  • 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.

  • Sites_idx. Indices of sources sites for further using. (from sverchok 1.3-alpha-master)

    https://github.com/nortikin/sverchok/assets/14288520/4d60e90e-19af-4600-88dc-92b67896967a

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