Voronoi Field¶
Functionality¶
This node generates a Vector Field and a Scalar Field, which are defined according to the Voronoi diagram for the specified set of points (“voronoi sites”):
The scalar field value for some point is calculated as the difference between distances from this point to two nearest Voronoi sites;
The vector field vector for some point points from this point towards the nearest Voronoi site. The absolute value of this vector is equal to the value of Voronoi scalar field in this point.
So, the set of points (planar areas), where scalar field equals to zero, is exactly the Voronoi diagram for the specified set of sites.
Generator-> NGon
Inputs¶
This node has the following input:
Vertices. The set of points (sites) to form Voronoi field for. This input is mandatory.
Parameters¶
This node has the following parameters:
Metric. The metric to be used for creating Voronoi field. The available options are:
Euclidean
Manhattan
Chebyshev
Custom. A generic Minkowski metric defined by formula
sum(abs(dx_i)**P)**(1.0/P)
, where P is defined in the Exponent parameter.
The default value is Euclidean.
Exponent. This parameter is available only when Metric parameter is set to Custom. Exponent for generic Minkowski distance. The available values are from 1.0 to infinity. The default value is 2.0, which defines Euclidean metric.
Outputs¶
This node has the following outputs:
SField. Voronoi scalar field.
VField. Voronoi vector field.
Examples of usage¶
Generator-> NGon
Generator-> Plane
Generator-> Box
Surfaces-> Evaluate Surface
Matrix-> Matrix In
Viz-> Viewer Draw
Generator-> Line
Generator-> Plane
Generator-> NGon
Generator-> Box
Fields-> Evaluate Scalar Field
Fields-> Evaluate Vector Field
Spacial-> Vector P Field
Transform-> Noise Displace
Number-> Map Range
Matrix-> Matrix In
Color-> Color Input
Color-> Color Out
Color-> Color In
Viz-> Viewer Draw
Use Voronoi scalar field of three points (marked with red spheres) to scale blue spheres:
Generator-> NGon
Generator-> IcoSphere
Spacial-> Vector P Field
Fields-> Scalar Field Math
Fields-> Evaluate Scalar Field
Number-> A Number
Viz-> Viewer Draw
Visualize the lines of corresponding vector field:
Generator-> NGon
Generator-> IcoSphere
Fields-> Vector Field Lines
Spacial-> Vector P Field
Number-> A Number
Viz-> Viewer Draw
Apply the vector field to some box:
Generator-> NGon
Generator-> Box
Generator-> IcoSphere
Fields-> Apply Vector Field
Viz-> Viewer Draw