Back to top OpenSVG (c) Veridict AB, www.veridict.com
Edit this page

Class ConvexHull

Represents a convex hull of points. Provides specialized methods for manipulating and querying convex hulls.

Inheritance
object
PointList
ConvexHull
Implements
IReadOnlyList<Vector2>
IReadOnlyCollection<Vector2>
IEnumerable<Vector2>
IEnumerable
IEquatable<PointList>
IEquatable<ConvexHull>
Inherited Members
PointList.Points
PointList.Count
PointList.this[int]
PointList.Contains(Vector2)
PointList.PointAtDistance(float)
PointList.FromXmlString(string)
PointList.Equals(PointList)
PointList.ToXmlString()
PointList.ToString()
PointList.GetEnumerator()
object.Equals(object, object)
object.GetType()
object.MemberwiseClone()
object.ReferenceEquals(object, object)
Namespace: OpenSvg
Assembly: OpenSvg.dll
Syntax
public class ConvexHull : PointList, IReadOnlyList<Vector2>, IReadOnlyCollection<Vector2>, IEnumerable<Vector2>, IEnumerable, IEquatable<PointList>, IEquatable<ConvexHull>

Constructors

| Edit this page View Source

ConvexHull(IEnumerable<ConvexHull>)

Initializes a new instance of the ConvexHull class by merging multiple convex hulls.

Declaration
public ConvexHull(IEnumerable<ConvexHull> convexHulls)
Parameters
Type Name Description
IEnumerable<ConvexHull> convexHulls

The collection of convex hulls to merge.

| Edit this page View Source

ConvexHull(IEnumerable<Vector2>)

Initializes a new instance of the ConvexHull class with the specified collection of points.

Declaration
public ConvexHull(IEnumerable<Vector2> points)
Parameters
Type Name Description
IEnumerable<Vector2> points

The collection of points.

| Edit this page View Source

ConvexHull(ImmutableArray<Vector2>, SkipGrahamsScan)

Initializes a new instance of the ConvexHull class with a set of points known to form a convex hull.

Declaration
public ConvexHull(ImmutableArray<Vector2> points, ConvexHull.SkipGrahamsScan _)
Parameters
Type Name Description
ImmutableArray<Vector2> points

A collection of points that are already in the form of a convex hull.

ConvexHull.SkipGrahamsScan _

A non-used parameter to clarify that extraction of hull points is skipped.

Remarks

This specialized constructor bypasses the Graham's scan algorithm. It is used in cases where it is known that the input points comprise a convex hull already. For instance is used when transforming an existing ConvexHull using affine transformations, that preservs its convex nature.

Fields

| Edit this page View Source

BoundingBox

Declaration
public readonly BoundingBox BoundingBox
Field Value
Type Description
BoundingBox

Methods

| Edit this page View Source

Equals(ConvexHull?)

Determines whether the specified object is equal to the current object.

Declaration
public bool Equals(ConvexHull? other)
Parameters
Type Name Description
ConvexHull other

The object to compare with the current object.

Returns
Type Description
bool

true if the specified object is equal to the current object; otherwise, false.

| Edit this page View Source

Equals(object?)

Determines whether the specified object is equal to the current object.

Declaration
public override bool Equals(object? obj)
Parameters
Type Name Description
object obj

The object to compare with the current object.

Returns
Type Description
bool

true if the specified object is equal to the current object; otherwise, false.

Overrides
PointList.Equals(object?)
| Edit this page View Source

GetHashCode()

Serves as the default hash function.

Declaration
public override int GetHashCode()
Returns
Type Description
int

A hash code for the current object.

Overrides
PointList.GetHashCode()
| Edit this page View Source

IsConvexHull(IEnumerable<Vector2>)

Determines whether the specified collection of points forms a convex hull.

Declaration
public static bool IsConvexHull(IEnumerable<Vector2> points)
Parameters
Type Name Description
IEnumerable<Vector2> points

The collection of points to check.

Returns
Type Description
bool

True if the collection of points forms a convex hull, otherwise false.

| Edit this page View Source

ToSvgPolygon()

Declaration
public SvgPolygon ToSvgPolygon()
Returns
Type Description
SvgPolygon
| Edit this page View Source

Transform(Transform)

Transforms the convex hull by applying the specified transform.

Declaration
public ConvexHull Transform(Transform transform)
Parameters
Type Name Description
Transform transform

The transform to apply.

Returns
Type Description
ConvexHull

A new convex hull that is the result of applying the transform.

Implements

IReadOnlyList<T>
IReadOnlyCollection<T>
IEnumerable<T>
IEnumerable
IEquatable<T>
IEquatable<T>

Extension Methods

PointCollectionExtensions.Max(IEnumerable<Vector2>)
PointCollectionExtensions.Min(IEnumerable<Vector2>)