Method ConvexHull
ConvexHull(Geometry)
Calculates the minimum bounding geometry (convex hull) that completely encloses the given geometry.
Declaration
public static Geometry ConvexHull(this Geometry geometry)
Parameters
Type | Name | Description |
---|---|---|
Geometry | geometry | The input geometry. |
Returns
Type | Description |
---|---|
Geometry | The minimum bounding geometry that completely encloses the given geometry. |
Remarks
The convex hull is the minimal bounding geometry, consisting of straight segments, that encloses the input geometry, such that all outer angles are convex. If you imagine a rubber band stretched around the input geometry, the rubber band takes the shape of the convex hull.
When a geometry contains curves, the computed convex hull will still consist of straight segments, not curves, so may not fit tightly to the geometry.
Exceptions
Type | Condition |
---|---|
System. |
A true curve geometry was used as input when it is not supported by this operation. |
Applies to
Platforms and versions
Target | Versions |
---|---|
.NET Standard 2.0 | 100.3 - 200.7 |
.NET | 100.13 - 200.7 |
.NET Windows | 100.13 - 200.7 |
.NET Android | 200.0 - 200.7 |
.NET iOS | 200.0 - 200.7 |
.NET Framework | 100.0 - 200.7 |
Xamarin.Android | 100.0 - 100.15 |
Xamarin.iOS | 100.0 - 100.15 |
UWP | 100.0 - 200.7 |
Relevant samples
ConvexHull(IEnumerable<Geometry>, Boolean)
Calculates the minimum bounding straight-edged geometry (convex hull) for the geometries in the given collection.
Declaration
public static IEnumerable<Geometry> ConvexHull(this IEnumerable<Geometry> geometries, bool merge)
Parameters
Type | Name | Description |
---|---|---|
System. |
geometries | A collection of geometries. |
System. |
merge |
|
Returns
Type | Description |
---|---|
System. |
The minimum bounding straight-edged geometry that completely encloses the geometries in the given
collection.
If |
Remarks
When input geometries contain curves, the computed convex hull will still consist of straight segments, not curves, so may not fit tightly to the geometry.
Applies to
Platforms and versions
Target | Versions |
---|---|
.NET Standard 2.0 | 100.3 - 200.7 |
.NET | 100.13 - 200.7 |
.NET Windows | 100.13 - 200.7 |
.NET Android | 200.2 - 200.7 |
.NET iOS | 200.0 - 200.7 |
.NET Framework | 100.1 - 200.7 |
Xamarin.Android | 100.1 - 100.14 |
Xamarin.iOS | 100.1 - 100.15 |
UWP | 100.1 - 200.7 |