Show / Hide Table of Contents

    Class ConvexHull

    A utility class for calculating Convex Hulls from inputs

    Inheritance
    System.Object
    ConvexHull
    Inherited Members
    System.Object.Equals(System.Object)
    System.Object.Equals(System.Object, System.Object)
    System.Object.GetHashCode()
    System.Object.GetType()
    System.Object.MemberwiseClone()
    System.Object.ReferenceEquals(System.Object, System.Object)
    System.Object.ToString()
    Namespace: Elements.Geometry
    Assembly: Hypar.Elements.dll
    Syntax
    public static class ConvexHull

    Methods

    FromPoints(IEnumerable<Vector3>)

    Calculate a polygon from the 2d convex hull of a collection of points. Adapted from https://rosettacode.org/wiki/Convex_hull#C.23

    Declaration
    public static Polygon FromPoints(IEnumerable<Vector3> points)
    Parameters
    Type Name Description
    System.Collections.Generic.IEnumerable<Vector3> points

    A collection of points

    Returns
    Type Description
    Polygon

    A polygon representing the convex hull of the provided points.

    FromPointsInPlane(IEnumerable<Vector3>, Vector3)

    Compute the 2D convex hull of a set of 3D points in a plane.

    Declaration
    public static Polygon FromPointsInPlane(IEnumerable<Vector3> points, Vector3 planeNormal)
    Parameters
    Type Name Description
    System.Collections.Generic.IEnumerable<Vector3> points

    A collection of points

    Vector3 planeNormal

    The normal direction of the plane in which to compute the hull.

    Returns
    Type Description
    Polygon

    A polygon representing the convex hull, projected along the normal vector to the average depth of the provided points.

    FromPolyline(Polyline)

    Calculate a polygon from the 2d convex hull of a polyline or polygon's vertices.

    Declaration
    public static Polygon FromPolyline(Polyline p)
    Parameters
    Type Name Description
    Polyline p

    A polygon

    Returns
    Type Description
    Polygon

    A polygon representing the convex hull of the provided shape.

    FromPolylines(IEnumerable<Polyline>)

    Calculate a polygon from the 2d convex hull of the vertices of a collection of polylines or polygons.

    Declaration
    public static Polygon FromPolylines(IEnumerable<Polyline> polylines)
    Parameters
    Type Name Description
    System.Collections.Generic.IEnumerable<Polyline> polylines

    A collection of polygons

    Returns
    Type Description
    Polygon

    A polygon representing the convex hull of the provided shapes.

    FromProfile(Profile)

    Calculate a polygon from the 2d convex hull of a profile.

    Declaration
    public static Polygon FromProfile(Profile p)
    Parameters
    Type Name Description
    Profile p

    A profile

    Returns
    Type Description
    Polygon

    A polygon representing the convex hull of the provided shape.