public final class PGS_Voronoi extends Object
Modifier and Type | Method and Description |
---|---|
static processing.core.PShape |
compoundVoronoi(processing.core.PShape shape)
Generates a Voronoi diagram for a set of disjoint shapes.
|
static processing.core.PShape |
compoundVoronoi(processing.core.PShape shape,
double[] bounds)
Generates a Voronoi diagram for a set of disjoint shapes.
|
static processing.core.PShape |
innerVoronoi(Collection<processing.core.PVector> points)
Generates a Voronoi diagram for a set of points.
|
static processing.core.PShape |
innerVoronoi(Collection<processing.core.PVector> points,
double[] bounds)
Generates a Voronoi diagram for a set of points.
|
static processing.core.PShape |
innerVoronoi(Collection<processing.core.PVector> points,
double[] bounds,
int relaxations)
Generates a boundary-constrained Voronoi diagram for a set of points, with
relaxation.
|
static processing.core.PShape |
innerVoronoi(Collection<processing.core.PVector> points,
int relaxations)
Generates a Voronoi diagram for a set of points, with relaxation.
|
static processing.core.PShape |
innerVoronoi(processing.core.PShape shape,
boolean constrain)
Generates a Voronoi diagram for a single shape, where shape vertices are
voronoi point sites.
|
static processing.core.PShape |
innerVoronoi(processing.core.PShape shape,
boolean constrain,
double[] bounds,
Collection<processing.core.PVector> steinerPoints,
int relaxations)
Generates a Voronoi diagram of a given shape, where shape vertices are
voronoi point sites.
|
static processing.core.PShape |
innerVoronoi(processing.core.PShape shape,
Collection<processing.core.PVector> additionalSites)
Generates an inner Voronoi diagram of a given shape with additional sites.
|
static processing.core.PShape |
innerVoronoi(processing.core.PShape shape,
Collection<processing.core.PVector> additionalSites,
int relaxations)
Generates an inner Voronoi diagram of a given shape with additional sites and
relaxation.
|
static processing.core.PShape |
innerVoronoi(processing.core.PShape shape,
int relaxations)
Generates an inner Voronoi diagram of a given shape with a specified number
of relaxations.
|
public static processing.core.PShape innerVoronoi(processing.core.PShape shape, boolean constrain)
Note: If the input shape is polygonal, the output is sensitive to how densely
populated lines are in the input. Consider processing a shape with
densify(density=~10)
method first before using this method on a polygon.
shape
- A shape whose vertices to use as Voronoi sitesconstrain
- A flag indicating whether or not to constrain the resulting
diagram to the original shape (if it is polygonal).innerVoronoi(Collection)
,
innerVoronoi(PShape, boolean, double[], Collection, int)
public static processing.core.PShape innerVoronoi(processing.core.PShape shape, int relaxations)
shape
- The shape to generate the inner Voronoi diagram for.relaxations
- The number of times to relax the diagram.public static processing.core.PShape innerVoronoi(processing.core.PShape shape, Collection<processing.core.PVector> additionalSites)
shape
- The shape to generate the inner Voronoi diagram for.additionalSites
- A collection of PVector points representing additional
sites to be used in the diagram.innerVoronoi(PShape, boolean, double[], Collection, int)
public static processing.core.PShape innerVoronoi(processing.core.PShape shape, Collection<processing.core.PVector> additionalSites, int relaxations)
shape
- The shape to generate the inner Voronoi diagram for.additionalSites
- A collection of PVector points representing additional
sites to be used in the diagram.relaxations
- The number of times to relax the diagram.innerVoronoi(PShape, boolean, double[], Collection, int)
public static processing.core.PShape innerVoronoi(processing.core.PShape shape, boolean constrain, @Nullable double[] bounds, @Nullable Collection<processing.core.PVector> steinerPoints, int relaxations)
Note: If the input shape is polygonal, the output is sensitive to how densely
populated lines are in the input. It may be desirable to first process a
polygonal shape with
densify(density=~10)
before using this method.
The diagram may be "relaxed" into a Centroidal Voronoi Diagram. The
relaxation process is a technique used to improve the quality of the Voronoi
diagram. It involves moving the vertices of the diagram slightly to reduce
the maximum distance between a vertex and the centroid of its associated
cell. The process is repeated for a specified number of
relaxations
iterations. This process aims to reduce the number
of irregular shaped polygons in the Voronoi diagram and produce a smoother
and more evenly distributed diagram.
shape
- The shape to generate the inner Voronoi diagram for
(using its vertices for Voronoi sites).constrain
- A flag indicating whether or not to constrain the
resulting diagram to the original shape (if it is
polygonal).bounds
- an optional array of the form [minX, minY, maxX, maxY]
representing the bounds of the diagram. The boundary
must fully contain the shape (but needn't contain all
steiner points).steinerPoints
- an optional collection of PVector points representing
Steiner points to be used as additional sites in the
diagram.relaxations
- the number of times to relax the diagram. 0 or greater..name
value of each cell is set to the integer index of
its vertex site.innerVoronoi(Collection)
public static processing.core.PShape innerVoronoi(Collection<processing.core.PVector> points)
points
- the set of points to use as Voronoi sites#innerVoronoi(PShape)
,
innerVoronoi(PShape, boolean, double[], Collection, int)
public static processing.core.PShape innerVoronoi(Collection<processing.core.PVector> points, int relaxations)
points
- the set of points to use as Voronoi sitesrelaxations
- the number of times to relax the diagram. 0 or greater.#innerVoronoi(PShape)
,
innerVoronoi(PShape, boolean, double[], Collection, int)
public static processing.core.PShape innerVoronoi(Collection<processing.core.PVector> points, double[] bounds, int relaxations)
points
- the set of points to use as Voronoi sitesbounds
- an array of the form [minX, minY, maxX, maxY] representing
the bounds of the diagram. The boundary must fully contain
the shape.relaxations
- the number of times to relax the diagram. 0 or greater.#innerVoronoi(PShape)
,
innerVoronoi(PShape, boolean, double[], Collection, int)
public static processing.core.PShape innerVoronoi(Collection<processing.core.PVector> points, double[] bounds)
points
- the set of points to use as Voronoi sitesbounds
- an array of the form [minX, minY, maxX, maxY] defining the
boundary of the voronoi diagram. the boundary must fully
contain the points.#innerVoronoi(PShape)
public static processing.core.PShape compoundVoronoi(processing.core.PShape shape)
Note: Each geometry primitive in a POINTS
or LINES
shape is treated as a distinct voronoi site (rather than a singular site
representing the full mass of points or lines).
shape
- a GROUP PShape consisting of any number of non-intersecting
polygonal, lineal, or points child shapespublic static processing.core.PShape compoundVoronoi(processing.core.PShape shape, double[] bounds)
Note: Each geometry primitive in a POINTS
or LINES
shape is treated as a distinct voronoi site (rather than a singular site
representing the full mass of points or lines).
shape
- a GROUP PShape consisting of any number of non-intersecting
polygonal, lineal, or points child shapesbounds
- an array of the form [minX, minY, maxX, maxY] defining the
boundary of the voronoi diagram. the boundary must fully
contain the shape.Copyright © 2023. All rights reserved.