Voronoi on Mesh#
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.
Addition#
The number of resulting objects can differ from the number of sites you set, both smaller and larger. Example of smaller number:
Example of bigger number:
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.
Matrices of Meshes. Matrices of input objects.
Used in complex multi-object scenarios. If you have several input objects and set postprocess property “Join Mode” to “Split (disconnect)” then you mess up the corresponding matrices for the resulting objects
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.
Matrices of meshes. Matrices of input meshes if meshes placed not in the zero. For example: if you using “Get Objects Data” with “Apply matrices” parameter off then real coords can be calculated with “Get Objects Data” Matrices output
Voronoi Sites. Points of Voronoi. If using Source Join Mode as “Merge” then sites merged only what in input “Voronoi Sites”. For example: if objects are 3 and sites are 2 then sites will not recalculate for object number 3.
If mode is split then every unconnected object will get sites of original mesh:
Mask of sites. List of True/False or indexes. What Sites will be show in result.
invert Invert list Mask of Sites.
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.
The list of values per object - one value per site:
Parameters#
This node has the following parameters:
Voronoi Mode. The available options are:
Volume. Split closed-volume mesh into smaller closed-volume mesh regions.
Surface. Split the surface of a mesh into smaller flat meshes.
The default value is Volume.
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.
Pre processing. This define preprocessing original objects, sites, matrices and masks.
Post processing. This defines nesting structure of result meshes. The available options are:
Split (disconnect). Separate the result meshes into individual unconnected meshes. Every unconnected part get matrix of original meshes. Be careful when evaluating the outcome. Some settings may produce similar results but with different structure. For example, the “Split (disconnect)”” operation with “Outer Polygons” in “Volume” Mode gives one object, although it seems that the objects are two, and “Split (disconnect)” in “Surface Mode” gives as a result 2 objects. This is because “Split (disconnect)” with “Outer Polygons” in “Volume Mode” is the same object as external Polygons.
Split (sites). Separate the result meshes into meshes of original sites (can keep several unconnected objects). Every part get matrix of original meshes.
Keep. Keep parts of preprocessed meshes. Also keep matrices of original objects unchanged.
Merge. Join all results meshes into a single 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.
Outputs#
This node has the following outputs:
Vertices. Vertices of generated mesh.
Outer Vertices.
Inner Vertices.
Border Vertices.
Outer Indexes Vertices.
Inner Indexes Vertices.
Border Indexes Vertices.
Edges. Edges of generated mesh.
Outer Edges.
Inner Edges.
Border Edges.
Outer Indexes Edges.
Inner Indexes Edges.
Border Indexes Edges.
Polygons. Faces of generated mesh.
Outer Inner Mask Polygons.
Outer Polygons.
Inner Polygons.
Border Polygons.
Outer Indexes Polygons.
Inner Indexes Polygons.
Border Indexes Polygons.
Additionally for voronoi on volume if you connect socket “Outer polygon” then you can see this result:
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)
Text-> Stethoscope
Matrices. Matrices or results meshes by join mode.
Voronoi Sites Matrices. These Matrices is used in multi-objects sources. If you have several meshes and split results on individual meshes with “Split (disconnect)” or “Split (sites)” then this socket out matrices for every results objects as Translate matrix to Voronoi Site position from source object origin.
To get real world position of objects you have to use both matrices:
Using only “Matrices” socket will get next result:
Examples of using matrices sockets in split mode.
Additionally: if results join mode is not split then “Voronoi Sites Matrices” has no sence so this socket will has only identity Matrices in Keep or Merge mode.
Addition info#
From version of sverchok 1.3.0-alpha sites can be any configurations: Line, Plane, Circle, Sphere
Generator-> Plane
Generator-> Line
Matrix-> Matrix In
Viz-> Viewer Draw
Generator-> Plane
Generator-> Cylinder
Viz-> Viewer Draw
Generator-> NGon
Generator-> Cylinder
Transform-> Rotate
Viz-> Viewer Draw
Generator-> Cylinder
Generator-> IcoSphere
Transform-> Rotate
Viz-> Viewer Draw
Example of usage#
Generator-> Box
Spatial-> Populate Mesh
Modifiers->Modifier Change-> Inset Faces
Modifiers->Modifier Make-> Subdivide
Matrix-> Matrix In
Viz-> Viewer Draw
Inspired by https://www.youtube.com/watch?v=Ip6JI6Qiiwg
Generator-> Plane
Modifiers->Modifier Change-> Inset Faces
Number-> Curve Mapper
LEN, DIV, MUL: Number-> Scalar Math
List->List Struct-> List Item
Viz-> Viewer Draw
Scene-> Particles MK2
Like the previous example but node “Particle System” replaced by node “Spiral”:
Generator-> Plane
Generator->Generatots Extended-> Spiral
Curves-> Cubic Spline
Curves-> Reparametrize Curve
Curves-> Evaluate Curve
Modifiers->Modifier Change-> Inset Faces
Number-> A Number
Number-> A Number
Number-> Map Range
Number-> Curve Mapper
LEN, DIV, MUL: Number-> Scalar Math
List->List Struct-> List Item
Viz-> Viewer Draw
Scene-> Frame Info
blend file: nortikin/sverchok
Show external surface as frame:
See also example#
Pulga Physics-> Pulga Springs Force