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

    Class Triangle

    The triangle data structure.

    Inheritance
    System.Object
    Triangle
    Inherited Members
    System.Object.Equals(System.Object)
    System.Object.Equals(System.Object, System.Object)
    System.Object.ReferenceEquals(System.Object, System.Object)
    System.Object.GetType()
    System.Object.MemberwiseClone()
    Namespace: UnityEngine.Experimental.U2D.TriangleNet.Topology
    Syntax
    public class Triangle : ITriangle

    Constructors

    Triangle()

    Initializes a new instance of the Triangle class.

    Declaration
    public Triangle()

    Properties

    Area

    Gets the triangle area constraint.

    Declaration
    public double Area { get; set; }
    Property Value
    Type Description
    System.Double
    Implements
    ITriangle.Area

    ID

    Gets or sets the triangle id.

    Declaration
    public int ID { get; set; }
    Property Value
    Type Description
    System.Int32
    Implements
    ITriangle.ID

    Label

    Region ID the triangle belongs to.

    Declaration
    public int Label { get; set; }
    Property Value
    Type Description
    System.Int32
    Implements
    ITriangle.Label

    Methods

    GetHashCode()

    Declaration
    public override int GetHashCode()
    Returns
    Type Description
    System.Int32
    Overrides
    System.Object.GetHashCode()

    GetNeighbor(Int32)

    Gets a triangles' neighbor.

    Declaration
    public ITriangle GetNeighbor(int index)
    Parameters
    Type Name Description
    System.Int32 index

    The neighbor index (0, 1 or 2).

    Returns
    Type Description
    ITriangle

    The neigbbor opposite of vertex with given index.

    Implements
    ITriangle.GetNeighbor(Int32)

    GetNeighborID(Int32)

    Gets the ID of the neighbor triangle at given index.

    Declaration
    public int GetNeighborID(int index)
    Parameters
    Type Name Description
    System.Int32 index

    The local index (0, 1 or 2).

    Returns
    Type Description
    System.Int32

    The neighbor triangle ID.

    Implements
    ITriangle.GetNeighborID(Int32)

    GetSegment(Int32)

    Gets a triangles segment.

    Declaration
    public ISegment GetSegment(int index)
    Parameters
    Type Name Description
    System.Int32 index

    The vertex index (0, 1 or 2).

    Returns
    Type Description
    ISegment

    The segment opposite of vertex with given index.

    Implements
    ITriangle.GetSegment(Int32)

    GetVertex(Int32)

    Gets the specified corners vertex.

    Declaration
    public Vertex GetVertex(int index)
    Parameters
    Type Name Description
    System.Int32 index
    Returns
    Type Description
    Vertex
    Implements
    ITriangle.GetVertex(Int32)

    GetVertexID(Int32)

    Declaration
    public int GetVertexID(int index)
    Parameters
    Type Name Description
    System.Int32 index
    Returns
    Type Description
    System.Int32
    Implements
    ITriangle.GetVertexID(Int32)

    ToString()

    Declaration
    public override string ToString()
    Returns
    Type Description
    System.String
    Overrides
    System.Object.ToString()
    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