Navigation
API > API/Runtime > API/Runtime/GeometryCore > API/Runtime/GeometryCore/CompGeom
References
| Module | GeometryCore |
| Header | /Engine/Source/Runtime/GeometryCore/Public/CompGeom/ConvexHull3.h |
| Include | #include "CompGeom/ConvexHull3.h" |
Syntax
template<typename RealType>
class TConvexHull3
Remarks
Calculate the Convex Hull of a 3D point set as a Triangle Mesh
Variables
| Type | Name | Description | |
|---|---|---|---|
| bool | bSaveTriangleNeighbors | Whether neighbors for the hull triangles should be computed/saved. | |
| int32 | Dimension | ||
| TArray< FIndex3i > | Hull | ||
| TArray< FIndex3i > | HullNeighbors | We can optionally also return the hull triangle adjacencies. | |
| TLine3< RealType > | Line | ||
| int | NumHullPoints | ||
| TPlane3< RealType > | Plane | ||
| FProgressCancel * | Progress | Set this to be able to cancel running operation | |
| TConvexHullSimplificationSettings< RealType > | SimplificationSettings | Settings controlling whether and how to generate a simpler hull. |
Functions
| Type | Name | Description | |
|---|---|---|---|
| double | ComputeVolume
(
const TArrayView< const TVector< RealType > > Vertices |
Helper to compute the a convex hull and return only its volume. If the hull cannot be constructed, a volume of 0 will be returned. | |
| void | Empty () |
Empty any previously-computed convex hull data. | |
| TArray< THalfspace3< RealType > > | GetAsHalfspaces
(
TFunctionRef< VectorType(int32)> GetPointFunc |
Convert an already-computed convex hull into a halfspace representation Following the logic of ContainmentQueries3.h, all halfspaces are oriented "outwards," so a point is inside the convex hull if it is outside of all halfspaces in the array | |
| TArray< THalfspace3< RealType > > | GetAsHalfspaces
(
TArrayView< const VectorType > Points |
Convert an already-computed convex hull into a halfspace representation Following the logic of ContainmentQueries3.h, all halfspaces are oriented "outwards," so a point is inside the convex hull if it is outside of all halfspaces in the array | |
| int | GetDimension () |
Number of dimensions spanned by the input points. | |
| void | GetFaces
(
TFunctionRef< void(TArray< int32 >&, TVector< RealType >)> PolygonFunc, |
Get faces of the convex hull as convex polygons, merging faces that are exactly coplanar | |
| TLine3< RealType > const & | GetLine () |
||
| int | |||
| TPlane3< RealType > const & | GetPlane () |
||
| void | GetSimplifiedFaces
(
TArray< FPolygonFace >& OutPolygons, |
Get faces of the convex hull as convex polygons, simplifying the hull by merging near-coplanar faces and only keeping vertices that are on the corner of at least three merged faces | |
| void | GetSimplifiedFaces
(
TFunctionRef< void(TArray< int32 >&, TVector< RealType >)> PolygonFunc, |
Get faces of the convex hull as convex polygons, simplifying the hull by merging near-coplanar faces and only keeping vertices that are on the corner of at least three merged faces | |
| TArray< FIndex3i > const & | Only valid if bSaveTriangleNeighbors was true when Solve() was called | ||
| void | GetTriangles
(
TFunctionRef< void(FIndex3i)> TriangleFunc |
Call TriangleFunc for each triangle of the Convex Hull. | |
| TArray< FIndex3i > const & | GetTriangles () |
||
| bool | |||
| TArray< FIndex3i > && | |||
| bool | Solve
(
int32 NumPoints, |
||
| bool | Solve
(
int32 NumPoints, |
Generate convex hull as long as input is not degenerate If input is degenerate, this will return false, and caller can call GetDimension() to determine whether the points were coplanar, collinear, or all the same point | |
| bool | Solve
(
TArrayView< const VectorType > Points, |
Generate convex hull as long as input is not degenerate If input is degenerate, this will return false, and caller can call GetDimension() to determine whether the points were collinear, or all the same point | |
| bool | Solve
(
TArrayView< const VectorType > Points |
Default FilterFunc version of the above Solve(); workaround for clang bug https://bugs.llvm.org/show_bug.cgi?id=25333 | |
| void | WalkBorder
(
const TArray< FIndex3i >& Triangles, |
Useful helper for walking the border of a convex region, or of a QHull horizon. |
Typedefs
| Name | Description |
|---|---|
| FPolygonFace | Polygon face array type: A nested array with inline allocator per face, optimizing for the case where most faces have less than 8 vertices. |