Class VoronoiBase | Package Manager UI website
docs.unity3d.com
    Show / Hide Table of Contents

    Class VoronoiBase

    The Voronoi diagram is the dual of a pointset triangulation.

    Inheritance
    System.Object
    DcelMesh
    VoronoiBase
    BoundedVoronoi
    StandardVoronoi
    Inherited Members
    DcelMesh.vertices
    DcelMesh.edges
    DcelMesh.faces
    DcelMesh.Vertices
    DcelMesh.HalfEdges
    DcelMesh.Faces
    DcelMesh.Edges
    DcelMesh.IsConsistent(Boolean, Int32)
    DcelMesh.ResolveBoundaryEdges()
    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
    DcelMesh.EnumerateEdges()

    Generate(Mesh)

    Generate the Voronoi diagram from given triangle mesh..

    Declaration
    protected void Generate(Mesh mesh)
    Parameters
    Type Name Description
    Mesh mesh
    Back to top
    Copyright © 2023 Unity Technologies — Terms of use
    • Legal
    • Privacy Policy
    • Cookies
    • Do Not Sell or Share My Personal Information
    • Your Privacy Choices (Cookie Settings)
    "Unity", Unity logos, and other Unity trademarks are trademarks or registered trademarks of Unity Technologies or its affiliates in the U.S. and elsewhere (more info here). Other names or brands are trademarks of their respective owners.
    Generated by DocFX on 18 October 2023