Navigation
API > API/Runtime > API/Runtime/GeometryCore
Calculate the Convex Hull of a 3D point set as a Triangle Mesh
| Name | TConvexHull3 |
| Type | class |
| Header File | /Engine/Source/Runtime/GeometryCore/Public/CompGeom/ConvexHull3.h |
| Include Path | #include "CompGeom/ConvexHull3.h" |
Syntax
template<typename RealType>
class TConvexHull3
Typedefs
| Name | Type | Remarks | Include Path |
|---|---|---|---|
| FPolygonFace | TArray< int32, TInlineAllocator< 8 > > | Polygon face array type: A nested array with inline allocator per face, optimizing for the case where most faces have less than 8 vertices. | CompGeom/ConvexHull3.h |
Variables
Public
| Name | Type | Remarks | Include Path | Unreal Specifiers |
|---|---|---|---|---|
| bSaveTriangleNeighbors | bool | Whether neighbors for the hull triangles should be computed/saved. | CompGeom/ConvexHull3.h | |
| Progress | FProgressCancel * | Set this to be able to cancel running operation | CompGeom/ConvexHull3.h | |
| SimplificationSettings | TConvexHullSimplificationSettings< RealType > | Settings controlling whether and how to generate a simpler hull. | CompGeom/ConvexHull3.h |
Functions
Public
| Name | Remarks | Include Path | Unreal Specifiers |
|---|---|---|---|
void Empty () |
Empty any previously-computed convex hull data. | CompGeom/ConvexHull3.h | |
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 | CompGeom/ConvexHull3.h | |
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 | CompGeom/ConvexHull3.h | |
int GetDimension() |
Number of dimensions spanned by the input points. | CompGeom/ConvexHull3.h | |
void GetFaces
(
TFunctionRef< void(TArray< int32 >&, TVector< RealType >)> PolygonFunc, |
Get faces of the convex hull as convex polygons, merging faces that are exactly coplanar | CompGeom/ConvexHull3.h | |
TLine3< RealType > const & GetLine() |
CompGeom/ConvexHull3.h | ||
int GetNumHullPoints() |
CompGeom/ConvexHull3.h | ||
TPlane3< RealType > const & GetPlane() |
CompGeom/ConvexHull3.h | ||
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 | CompGeom/ConvexHull3.h | |
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 | CompGeom/ConvexHull3.h | |
| Only valid if bSaveTriangleNeighbors was true when Solve() was called | CompGeom/ConvexHull3.h | ||
void GetTriangles
(
TFunctionRef< void(FIndex3i)> TriangleFunc |
Call TriangleFunc for each triangle of the Convex Hull. | CompGeom/ConvexHull3.h | |
TArray< FIndex3i > const & GetTriangles () |
CompGeom/ConvexHull3.h | ||
bool IsSolutionAvailable() |
CompGeom/ConvexHull3.h | ||
| CompGeom/ConvexHull3.h | |||
bool Solve
(
int32 NumPoints, |
CompGeom/ConvexHull3.h | ||
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 | CompGeom/ConvexHull3.h | |
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 | CompGeom/ConvexHull3.h | |
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 | CompGeom/ConvexHull3.h |
Static
| Name | Remarks | Include Path | Unreal Specifiers |
|---|---|---|---|
static 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. | CompGeom/ConvexHull3.h | |
static void WalkBorder
(
const TArray< FIndex3i >& Triangles, |
Useful helper for walking the border of a convex region, or of a QHull horizon. | CompGeom/ConvexHull3.h |