Navigation
API > API/Runtime > API/Runtime/GeometryCore > API/Runtime/GeometryCore/CompGeom
References
| Module | GeometryCore |
| Header | /Engine/Source/Runtime/GeometryCore/Public/CompGeom/ConvexDecomposition3.h |
| Include | #include "CompGeom/ConvexDecomposition3.h" |
Syntax
class FConvexDecomposition3
Variables
| Type | Name | Description | |
|---|---|---|---|
| double | BiasToRemoveTooThinParts | A bias term to favor merging away 'too thin' parts before merging other parts, expressed as a volume in units s.t. | |
| double | ConnectedComponentTolerance | Threshold for considering two components to be touching. | |
| double | ConvexEdgeAngleMoreSamplesThreshold | Angle at edge above which we take 5 sample planes instead of 3, to better cover the wider range (expressed in degrees) | |
| double | ConvexEdgeAngleThreshold | Angle at edge above which we don't sample it as a convex edge (expressed in degrees) | |
| double | CutLargestAxisErrorScale | Scale factor for error on the largest axis; slightly favoring cutting on the largest axis helps get more consistent result when no initial cut will reduce error (e.g. a torus) | |
| TIndirectArray< FConvexPart > | Decomposition | All convex hulls parts in the convex decomposition Note this must be an indirect array, not a TArray, because FConvexPart holds an FDynamicMesh3 mesh, which is not trivially movable | |
| TMultiMap< int32, int32 > | DecompositionToProximity | Mapping from Decomposition indices to Proximity indices. | |
| int32 | MaxConvexEdgePlanes | Maximum number of convex edges to sample for possible cutting planes when calling SplitWorst() to generate an initial convex decomposition Larger values will cost more to run but can let the algorithm find a cleaner decomposition | |
| double | OnPlaneTolerance | Maximum 'on plane' distance for points during planar cuts. | |
| TArray< FProximity > | Proximities | All potential merge edges between Decomposition FConvexParts. | |
| double | ProximityTolerance | Threshold for considering two convex parts close enough to consider merging. | |
| FTransformSRT3d | ResultTransform | Transform taking the result hull vertices back to the original space of the inputs; automatically applied by GetVertices() |
Constructors
| Type | Name | Description | |
|---|---|---|---|
FConvexDecomposition3
(
const FDynamicMesh3& SourceMesh, |
Functions
| Type | Name | Description | |
|---|---|---|---|
| void | Compact () |
Compact the decomposition representation to the minimal needed for output: Just the hull vertices and triangles, no internal geometry This will prevent some further processing on the representation; to ensure it is called only when the geometry is no longer needed, instead of calling this directly, call MergeBest with bAllowCompact=true | |
| void | Compute
(
int32 NumOutputHulls, |
Compute a decomposition with the desired number of hulls Note: A future version of this function may replace NumOutputHulls with MaxOutputHulls, but this version keeps both parameters for compatibility / consistent behavior. | |
| double | ConvertDistanceToleranceToLocalSpace
(
double DistTolerance |
Simple helper to convert an error tolerance expressed in world space to local space | |
| double | ConvertDistanceToleranceToLocalVolumeTolerance
(
double DistTolerance |
Simple helper to convert an error tolerance expressed in world space to a local-space volume tolerance | |
| void | DeleteProximity
(
int32 ProxIdx, |
Helper function to delete a proximity relationship, and fix index references to account for the new array ordering | |
| FDynamicMesh3 | GetHullMesh
(
int32 HullIdx |
||
| const FDynamicMesh3 & | GetInternalMesh
(
int32 HullIdx |
Get the non-hull geometry underlying a part of the convex decomposition. | |
| TArray< FIndex3i > const & | GetTriangles
(
int32 HullIdx |
||
| TArray< TVector< RealType > > | GetVertices
(
int32 HullIdx, |
||
| void | InitializeFromHulls
(
int32 NumHulls, |
Initialize from convex hulls allows the caller to only use the hull merging phase of the algorithm | |
| void | InitializeFromIndexMesh
(
TArrayView< const FVector3f > Vertices, |
Initialize convex decomposition with a triangle index mesh | |
| void | InitializeFromMesh
(
const FDynamicMesh3& SourceMesh, |
||
| int32 | MergeBest
(
int32 TargetNumParts, |
Merge the pairs of convex hulls in the decomposition that will least increase the error. | |
| int32 | NumHulls () |
Results | |
| int32 | SplitWorst
(
bool bCanSkipUnreliableGeoVolumes, |
Split the worst convex part, and return the increase in the total number of convex parts after splitting (can be more than 1 if result has multiple separate connected components) Note: could return 0 if no splits were possible | |
| void | UpdateProximitiesAfterSplit
(
int32 SplitIdx, |
Helper function to update all proximity data after splitting an FConvexPart apart |
Classes
| Type | Name | Description | |
|---|---|---|---|
| FConvexPart | Representation of a convex hull in the decomposition + associated information to help further split or merge. | ||
| FProximity | Edge in a graph of merge candidates, indicating which Decomposition parts could be merged together Note a proximity link does not guarantee that the geometry (or convex hulls) are touching |