Interface IPolygon | Package Manager UI website
docs.unity3d.com
    Show / Hide Table of Contents

    Interface IPolygon

    Polygon interface.

    Namespace: UnityEngine.Experimental.U2D.TriangleNet.Geometry
    Syntax
    public interface IPolygon

    Properties

    HasPointMarkers

    Gets or sets a value indicating whether the vertices have marks or not.

    Declaration
    bool HasPointMarkers { get; set; }
    Property Value
    Type Description
    System.Boolean

    HasSegmentMarkers

    Gets or sets a value indicating whether the segments have marks or not.

    Declaration
    bool HasSegmentMarkers { get; set; }
    Property Value
    Type Description
    System.Boolean

    Holes

    Gets a list of points defining the holes of the polygon.

    Declaration
    List<Point> Holes { get; }
    Property Value
    Type Description
    System.Collections.Generic.List<Point>

    Points

    Gets the vertices of the polygon.

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

    Regions

    Gets a list of pointers defining the regions of the polygon.

    Declaration
    List<RegionPointer> Regions { get; }
    Property Value
    Type Description
    System.Collections.Generic.List<RegionPointer>

    Segments

    Gets the segments of the polygon.

    Declaration
    List<ISegment> Segments { get; }
    Property Value
    Type Description
    System.Collections.Generic.List<ISegment>

    Methods

    Add(Contour, Boolean)

    Add a contour to the polygon.

    Declaration
    void Add(Contour contour, bool hole = false)
    Parameters
    Type Name Description
    Contour contour

    The contour to insert.

    System.Boolean hole

    Treat contour as a hole.

    Add(Contour, Point)

    Add a contour to the polygon.

    Declaration
    void Add(Contour contour, Point hole)
    Parameters
    Type Name Description
    Contour contour

    The contour to insert.

    Point hole

    Point inside the contour, making it a hole.

    Add(ISegment, Boolean)

    Add a segment to the polygon.

    Declaration
    void Add(ISegment segment, bool insert = false)
    Parameters
    Type Name Description
    ISegment segment

    The segment to insert.

    System.Boolean insert

    If true, both endpoints will be added to the points list.

    Add(ISegment, Int32)

    Add a segment to the polygon.

    Declaration
    void Add(ISegment segment, int index)
    Parameters
    Type Name Description
    ISegment segment

    The segment to insert.

    System.Int32 index

    The index of the segment endpoint to add to the points list (must be 0 or 1).

    Add(Vertex)

    Add a vertex to the polygon.

    Declaration
    void Add(Vertex vertex)
    Parameters
    Type Name Description
    Vertex vertex

    The vertex to insert.

    AddContour(IEnumerable<Vertex>, Int32, Boolean, Boolean)

    Declaration
    [Obsolete("Use polygon.Add(contour) method instead.")]
    void AddContour(IEnumerable<Vertex> points, int marker, bool hole, bool convex)
    Parameters
    Type Name Description
    System.Collections.Generic.IEnumerable<Vertex> points
    System.Int32 marker
    System.Boolean hole
    System.Boolean convex

    AddContour(IEnumerable<Vertex>, Int32, Point)

    Declaration
    [Obsolete("Use polygon.Add(contour) method instead.")]
    void AddContour(IEnumerable<Vertex> points, int marker, Point hole)
    Parameters
    Type Name Description
    System.Collections.Generic.IEnumerable<Vertex> points
    System.Int32 marker
    Point hole

    Bounds()

    Compute the bounds of the polygon.

    Declaration
    Rectangle Bounds()
    Returns
    Type Description
    Rectangle

    Rectangle defining an axis-aligned bounding box.

    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