ZLab.Discrete ZLab.Discrete
ZLab.Discrete ZLab.Discrete
Developed by Zeke Zhang

Search Results for

    Edit this page

    Class PolylineF

    Polyline defined by a sequence of 3D vertices that make up the line segments.

    Inheritance
    object
    LicensedBase
    PolylineF
    Inherited Members
    object.Equals(object)
    object.Equals(object, object)
    object.GetHashCode()
    object.GetType()
    object.ReferenceEquals(object, object)
    object.ToString()
    Namespace: ZLab.Discrete.Geometry
    Assembly: ZLab.Discrete.dll
    Syntax
    public sealed class PolylineF : LicensedBase

    Constructors

    Name Description
    PolylineF()

    Creates an empty polyline. (Invalid)

    PolylineF(Vector3[])

    Creates a polyline and automatically checks if it is closed.

    PolylineF(Vector3[], bool)

    Creates a polyline with the given vertices and explicit closedness.

    PolylineF(ReadOnlySpan<Vector3>)

    Creates a polyline and automatically checks if it is closed.

    PolylineF(ReadOnlySpan<Vector3>, bool)

    Creates a polyline with the given vertices and explicit closedness.

    Fields

    Name Description
    ClosedEpsilon

    Tolerance for determining if the polyline is closed (distance between first and last vertex).

    Properties

    Name Description
    Count

    Number of vertices.

    First

    First vertex of the polyline.

    IsClosed

    Indicates if the polyline is closed (the last vertex connects to the first).

    IsValid

    Valid if there are at least two vertices.

    this[int]

    Indexing into the polyline vertices.

    Last

    Last vertex of the polyline.

    Length

    Total length (perimeter if closed).

    Vertices

    Read-only view of the vertices.

    Methods

    Name Description
    Add(in Vector3)

    Appends a vertex to the end of the polyline, updating length and closedness.

    AddRange(ReadOnlySpan<Vector3>)

    Appends multiple vertices to the end of the polyline, updating length and closedness.

    AsReadOnlySpan()

    Returns the vertices as a ReadOnlySpan<T> for efficient access without allocations.

    AsSpan()

    Returns the vertices as a Span<T> for efficient access without allocations.

    Clear()

    Clears all vertices, resetting the polyline to an empty state.

    GetBounds()

    Computes the axis-aligned bounding box (AABB) of the polyline.

    InsertAt(int, in Vector3)

    Inserts a vertex at the specified index, updating length and closedness.

    Recompute()

    Recomputes the length and closedness of the polyline from its vertices.

    RemoveAt(int)

    Removes the vertex at the specified index, updating length and closedness.

    ToArray()

    Returns a copy of the vertices as a new array.