Class VoronoiBase
The Voronoi diagram is the dual of a pointset triangulation.
Inherited Members
System.Object.ToString()
System.Object.Equals(System.Object)
System.Object.Equals(System.Object, System.Object)
System.Object.ReferenceEquals(System.Object, System.Object)
System.Object.GetHashCode()
System.Object.GetType()
System.Object.MemberwiseClone()
Namespace: UnityEngine.Experimental.U2D.TriangleNet.Voronoi
Syntax
public abstract class VoronoiBase : DcelMesh
Constructors
VoronoiBase(Mesh, IVoronoiFactory, IPredicates, Boolean)
Initializes a new instance of the VoronoiBase class.
Declaration
protected VoronoiBase(Mesh mesh, IVoronoiFactory factory, IPredicates predicates, bool generate)
Parameters
Type | Name | Description |
---|---|---|
Mesh | mesh | Triangle mesh. |
IVoronoiFactory | factory | Voronoi object factory. |
IPredicates | predicates | Geometric predicates implementation. |
System.Boolean | generate | If set to true, the constuctor will call the Generate method, which builds the Voronoi diagram. |
Fields
factory
Declaration
protected IVoronoiFactory factory
Field Value
Type | Description |
---|---|
IVoronoiFactory |
predicates
Declaration
protected IPredicates predicates
Field Value
Type | Description |
---|---|
IPredicates |
rays
Declaration
protected List<HalfEdge> rays
Field Value
Type | Description |
---|---|
System.Collections.Generic.List<HalfEdge> |
Methods
ComputeEdges(Mesh, Vertex[], Face[], List<HalfEdge>[])
Compute the edges of the Voronoi diagram.
Declaration
protected void ComputeEdges(Mesh mesh, Vertex[] vertices, Face[] faces, List<HalfEdge>[] map)
Parameters
Type | Name | Description |
---|---|---|
Mesh | mesh | |
Vertex[] | vertices | |
Face[] | faces | |
System.Collections.Generic.List<HalfEdge>[] | map | Empty vertex map. |
ComputeVertices(Mesh, Vertex[])
Compute the Voronoi vertices (the circumcenters of the triangles).
Declaration
protected List<HalfEdge>[] ComputeVertices(Mesh mesh, Vertex[] vertices)
Parameters
Type | Name | Description |
---|---|---|
Mesh | mesh | |
Vertex[] | vertices |
Returns
Type | Description |
---|---|
System.Collections.Generic.List<HalfEdge>[] | An empty map, which will map all vertices to a list of leaving edges. |
ConnectEdges(List<HalfEdge>[])
Connect all edges of the Voronoi diagram.
Declaration
protected virtual void ConnectEdges(List<HalfEdge>[] map)
Parameters
Type | Name | Description |
---|---|---|
System.Collections.Generic.List<HalfEdge>[] | map | Maps all vertices to a list of leaving edges. |
EnumerateEdges()
Declaration
protected override IEnumerable<IEdge> EnumerateEdges()
Returns
Type | Description |
---|---|
System.Collections.Generic.IEnumerable<IEdge> |
Overrides
Generate(Mesh)
Generate the Voronoi diagram from given triangle mesh..
Declaration
protected void Generate(Mesh mesh)
Parameters
Type | Name | Description |
---|---|---|
Mesh | mesh |