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

    Class Contour

    Inheritance
    System.Object
    Contour
    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.Geometry
    Syntax
    public class Contour

    Constructors

    Contour(IEnumerable<Vertex>)

    Initializes a new instance of the Contour class.

    Declaration
    public Contour(IEnumerable<Vertex> points)
    Parameters
    Type Name Description
    System.Collections.Generic.IEnumerable<Vertex> points

    The points that make up the contour.

    Contour(IEnumerable<Vertex>, Int32)

    Initializes a new instance of the Contour class.

    Declaration
    public Contour(IEnumerable<Vertex> points, int marker)
    Parameters
    Type Name Description
    System.Collections.Generic.IEnumerable<Vertex> points

    The points that make up the contour.

    System.Int32 marker

    Contour marker.

    Contour(IEnumerable<Vertex>, Int32, Boolean)

    Initializes a new instance of the Contour class.

    Declaration
    public Contour(IEnumerable<Vertex> points, int marker, bool convex)
    Parameters
    Type Name Description
    System.Collections.Generic.IEnumerable<Vertex> points

    The points that make up the contour.

    System.Int32 marker

    Contour marker.

    System.Boolean convex

    The hole is convex.

    Properties

    Points

    Gets or sets the list of points making up the contour.

    Declaration
    public List<Vertex> Points { get; set; }
    Property Value
    Type Description
    System.Collections.Generic.List<Vertex>

    Methods

    FindInteriorPoint(Int32, Double)

    Try to find a point inside the contour.

    Declaration
    public Point FindInteriorPoint(int limit = 5, double eps = 2E-05)
    Parameters
    Type Name Description
    System.Int32 limit

    The number of iterations on each segment (default = 5).

    System.Double eps

    Threshold for co-linear points (default = 2e-5).

    Returns
    Type Description
    Point

    Point inside the contour

    Remarks

    For each corner (index i) of the contour, the 3 points with indices i-1, i and i+1 are considered and a search on the line through the corner vertex is started (either on the bisecting line, or, if CounterClockwise(Point, Point, Point) is less than eps, on the perpendicular line. A given number of points will be tested (limit), while the distance to the contour boundary will be reduced in each iteration (with a factor 1 / 2^i, i = 1 ... limit).

    Exceptions
    Type Condition
    System.Exception

    Throws if no point could be found.

    GetSegments()

    Declaration
    public List<ISegment> GetSegments()
    Returns
    Type Description
    System.Collections.Generic.List<ISegment>
    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