Class DcelMesh
Inheritance
Inherited Members
Namespace: UnityEngine.Experimental.U2D.TriangleNet.Topology.DCEL
Syntax
public class DcelMesh
Constructors
DcelMesh()
Initializes a new instance of the DcelMesh class.
Declaration
public DcelMesh()
DcelMesh(Boolean)
Initializes a new instance of the
Declaration
protected DcelMesh(bool initialize)
Parameters
Type | Name | Description |
---|---|---|
System.Boolean | initialize | If false, lists will not be initialized. |
Fields
edges
Declaration
protected List<HalfEdge> edges
Field Value
Type | Description |
---|---|
System.Collections.Generic.List<HalfEdge> |
faces
Declaration
protected List<Face> faces
Field Value
Type | Description |
---|---|
System.Collections.Generic.List<Face> |
vertices
Declaration
protected List<Vertex> vertices
Field Value
Type | Description |
---|---|
System.Collections.Generic.List<Vertex> |
Properties
Edges
Gets the collection of edges of the Voronoi diagram.
Declaration
public IEnumerable<IEdge> Edges { get; }
Property Value
Type | Description |
---|---|
System.Collections.Generic.IEnumerable<IEdge> |
Faces
Gets the faces of the Voronoi diagram.
Declaration
public List<Face> Faces { get; }
Property Value
Type | Description |
---|---|
System.Collections.Generic.List<Face> |
HalfEdges
Gets the list of half-edges specify the Voronoi diagram topology.
Declaration
public List<HalfEdge> HalfEdges { get; }
Property Value
Type | Description |
---|---|
System.Collections.Generic.List<HalfEdge> |
Vertices
Gets the vertices of the Voronoi diagram.
Declaration
public List<Vertex> Vertices { get; }
Property Value
Type | Description |
---|---|
System.Collections.Generic.List<Vertex> |
Methods
EnumerateEdges()
Enumerates all edges of the DCEL.
Declaration
protected virtual IEnumerable<IEdge> EnumerateEdges()
Returns
Type | Description |
---|---|
System.Collections.Generic.IEnumerable<IEdge> |
Remarks
This method assumes that each half-edge has a twin (i.e. NOT null).
IsConsistent(Boolean, Int32)
Check if the DCEL is consistend.
Declaration
public virtual bool IsConsistent(bool closed = true, int depth = 0)
Parameters
Type | Name | Description |
---|---|---|
System.Boolean | closed | If true, faces are assumed to be closed (i.e. all edges must have a valid next pointer). |
System.Int32 | depth | Maximum edge count of faces (default = 0 means skip check). |
Returns
Type | Description |
---|---|
System.Boolean |
ResolveBoundaryEdges()
Search for half-edge without twin and add a twin. Connect twins to form connected boundary contours.
Declaration
public void ResolveBoundaryEdges()
Remarks
This method assumes that all faces are closed (i.e. no edge.next pointers are null).