Class ConvexHull2
Construct convex hull of a set of 2D points, with various accuracy levels.
HullIndices provides ordered indices of vertices of input points that form hull.
Inherited Members
Namespace: g3
Assembly: cs.temp.dll.dll
Syntax
public class ConvexHull2
Constructors
ConvexHull2(IList<Vector2d>, Double, QueryNumberType)
Compute convex hull of input points. epsilon is only used for check if points lie on a line (1d hull), not for rest of compute.
Declaration
public ConvexHull2(IList<Vector2d> vertices, double epsilon, QueryNumberType queryType)
Parameters
Type | Name | Description |
---|---|---|
IList<Vector2d> | vertices | |
Double | epsilon | |
QueryNumberType | queryType |
Properties
Dimension
Declaration
public int Dimension { get; }
Property Value
Type | Description |
---|---|
Int32 |
HullIndices
array of indices into V that represent the convex polygon edges (NumSimplices total elements) The i-th edge has vertices vertex[0] = V[I[i]] vertex[1] = V[I[(i+1) % SQ]]
Declaration
public int[] HullIndices { get; }
Property Value
Type | Description |
---|---|
Int32[] |
NumSimplices
Number of convex polygon edges
Declaration
public int NumSimplices { get; }
Property Value
Type | Description |
---|---|
Int32 |
Methods
Get1DHullInfo(out Vector2d, out Vector2d)
If the resulting Dimension == 1, then you can use this to get some info...
Declaration
public void Get1DHullInfo(out Vector2d origin, out Vector2d direction)
Parameters
Type | Name | Description |
---|---|---|
Vector2d | origin | |
Vector2d | direction |
GetHullPolygon()
Extract convex hull polygon from input points
Declaration
public Polygon2d GetHullPolygon()
Returns
Type | Description |
---|---|
Polygon2d |