#include <ConvexDecomposition3.h>
|
| | FConvexDecomposition3 () |
| |
| | FConvexDecomposition3 (const FDynamicMesh3 &SourceMesh, bool bMergeEdges=true) |
| |
| | FConvexDecomposition3 (const FDynamicMesh3 &SourceMesh, const FPreprocessMeshOptions &Options) |
| |
| bool | IsInputSolid () |
| |
| GEOMETRYCORE_API void | InitializeFromHulls (int32 NumHulls, TFunctionRef< double(int32)> HullVolumes, TFunctionRef< int32(int32)> HullNumVertices, TFunctionRef< FVector3d(int32, int32)> HullVertices, TArrayView< const TPair< int32, int32 > > Proximity) |
| |
| GEOMETRYCORE_API void | InitializeProximityFromDecompositionBoundingBoxOverlaps (double BoundsExpandByMinDimFactor, double BoundsExpandByMaxDimFactor, double MinBoundsExpand) |
| |
| GEOMETRYCORE_API void | InitializeFromMesh (const FDynamicMesh3 &SourceMesh, bool bMergeEdges) |
| |
| GEOMETRYCORE_API void | InitializeFromMesh (const FDynamicMesh3 &SourceMesh, const FPreprocessMeshOptions &Options) |
| |
| GEOMETRYCORE_API void | InitializeFromIndexMesh (TArrayView< const FVector3f > Vertices, TArrayView< const FIntVector > Faces, bool bMergeEdges, int32 FaceVertexOffset=0) |
| |
| GEOMETRYCORE_API void | InitializeFromIndexMesh (TArrayView< const FVector3f > Vertices, TArrayView< const FIntVector > Faces, const FPreprocessMeshOptions &Options, int32 FaceVertexOffset=0) |
| |
| GEOMETRYCORE_API bool | InitializeNegativeSpace (const FNegativeSpaceSampleSettings &Settings, TArrayView< const FVector3d > RequestedSamples=TArrayView< const FVector3d >()) |
| |
| GEOMETRYCORE_API void | Compute (int32 NumOutputHulls, int32 NumAdditionalSplits=10, double ErrorTolerance=0.0, double MinThicknessTolerance=0, int32 MaxOutputHulls=-1, bool bOnlySplitIfNegativeSpaceCovered=false) |
| |
| GEOMETRYCORE_API int32 | SplitWorst (bool bCanSkipUnreliableGeoVolumes=false, double ErrorTolerance=0.0, bool bOnlySplitIfNegativeSpaceCovered=false, double MinSplitSizeInWorldSpace=-1) |
| |
| GEOMETRYCORE_API int32 | MergeBest (int32 TargetNumParts, double ErrorTolerance=0, double MinThicknessTolerance=0, bool bAllowCompact=true, bool bRequireHullTriangles=false, int32 MaxOutputHulls=-1, const FSphereCovering *OptionalNegativeSpace=nullptr, const FTransform *OptionalTransformIntoNegativeSpace=nullptr) |
| |
| GEOMETRYCORE_API int32 | MergeBest (const FMergeSettings &Settings) |
| |
| double | ConvertDistanceToleranceToLocalVolumeTolerance (double DistTolerance) const |
| |
| double | ConvertDistanceToleranceToLocalSpace (double DistTolerance) const |
| |
| void | Compact () |
| |
| int32 | NumHulls () const |
| |
| TArray< FIndex3i > const & | GetTriangles (int32 HullIdx) const |
| |
| template<typename RealType > |
| TArray< TVector< RealType > > | GetVertices (int32 HullIdx, bool bTransformedToOutput=true) const |
| |
| FDynamicMesh3 | GetHullMesh (int32 HullIdx) const |
| |
| const FDynamicMesh3 & | GetInternalMesh (int32 HullIdx) const |
| |
| const int32 | GetHullSourceID (int32 HullIdx) const |
| |
| const int32 | CountMergedParts () const |
| |
| GEOMETRYCORE_API void | DeleteProximity (TArray< int32 > &&ToRemove, bool bDeleteMapReferences) |
| |
| GEOMETRYCORE_API void | UpdateProximitiesAfterSplit (int32 SplitIdx, int32 NewIdxStart, FPlane3d CutPlane, int32 SecondSideIdxStart, double OrigHullVolume) |
| |
| GEOMETRYCORE_API void | FixHullOverlapsInNegativeSpace (double NegativeSpaceTolerance=UE_DOUBLE_KINDA_SMALL_NUMBER, double NegativeSpaceMinRadius=UE_DOUBLE_KINDA_SMALL_NUMBER) |
| |
| const FSphereCovering & | GetNegativeSpace () const |
| |
◆ FConvexDecomposition3() [1/3]
| UE::Geometry::FConvexDecomposition3::FConvexDecomposition3 |
( |
| ) |
|
|
inline |
◆ FConvexDecomposition3() [2/3]
| UE::Geometry::FConvexDecomposition3::FConvexDecomposition3 |
( |
const FDynamicMesh3 & |
SourceMesh, |
|
|
bool |
bMergeEdges = true |
|
) |
| |
|
inline |
◆ FConvexDecomposition3() [3/3]
◆ Compact()
| void UE::Geometry::FConvexDecomposition3::Compact |
( |
| ) |
|
|
inline |
◆ Compute()
| void UE::Geometry::FConvexDecomposition3::Compute |
( |
int32 |
NumOutputHulls, |
|
|
int32 |
NumAdditionalSplits = 10, |
|
|
double |
ErrorTolerance = 0.0, |
|
|
double |
MinThicknessTolerance = 0, |
|
|
int32 |
MaxOutputHulls = -1, |
|
|
bool |
bOnlySplitIfNegativeSpaceCovered = false |
|
) |
| |
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.
- Parameters
-
| NumOutputHulls | Number of convex hulls to use in the final convex decomposition |
| NumAdditionalSplits | How far to go beyond the target number of hulls when initially the mesh into pieces – larger values will require more computation but can find better convex decompositions |
| ErrorTolerance | Stop splitting when hulls have error less than this (expressed in cm; will be cubed for volumetric error). Overrides NumOutputHulls if specified |
| MinThicknessTolerance | Optionally specify a minimum thickness (in cm) for convex parts; parts below this thickness will always be merged away. Overrides NumOutputHulls and ErrorTolerance when needed |
| MaxOutputHulls | If > 0, maximum number of convex hulls to generate. Overrides ErrorTolerance and TargetNumParts when needed |
| bOnlySplitIfOverlapNegativeSpace | If true, use NegativeSpace to guide splits, and only split parts that overlap negative space |
◆ ConvertDistanceToleranceToLocalSpace()
| double UE::Geometry::FConvexDecomposition3::ConvertDistanceToleranceToLocalSpace |
( |
double |
DistTolerance | ) |
const |
|
inline |
◆ ConvertDistanceToleranceToLocalVolumeTolerance()
| double UE::Geometry::FConvexDecomposition3::ConvertDistanceToleranceToLocalVolumeTolerance |
( |
double |
DistTolerance | ) |
const |
|
inline |
◆ ConvexPartVsSphereOverlap()
◆ CountMergedParts()
| const int32 UE::Geometry::FConvexDecomposition3::CountMergedParts |
( |
| ) |
const |
|
inline |
◆ DeleteProximity()
| void UE::Geometry::FConvexDecomposition3::DeleteProximity |
( |
TArray< int32 > && |
ToRemove, |
|
|
bool |
bDeleteMapReferences |
|
) |
| |
◆ FixHullOverlapsInNegativeSpace()
◆ GetHullMesh()
◆ GetHullSourceID()
| const int32 UE::Geometry::FConvexDecomposition3::GetHullSourceID |
( |
int32 |
HullIdx | ) |
const |
|
inline |
◆ GetInternalMesh()
| const FDynamicMesh3 & UE::Geometry::FConvexDecomposition3::GetInternalMesh |
( |
int32 |
HullIdx | ) |
const |
|
inline |
◆ GetNegativeSpace()
| const FSphereCovering & UE::Geometry::FConvexDecomposition3::GetNegativeSpace |
( |
| ) |
const |
|
inline |
◆ GetTriangles()
| TArray< FIndex3i > const & UE::Geometry::FConvexDecomposition3::GetTriangles |
( |
int32 |
HullIdx | ) |
const |
|
inline |
- Returns
- convex hull triangles
◆ GetVertices()
| TArray< TVector< RealType > > UE::Geometry::FConvexDecomposition3::GetVertices |
( |
int32 |
HullIdx, |
|
|
bool |
bTransformedToOutput = true |
|
) |
| const |
|
inline |
◆ InitializeFromHulls()
Initialize from convex hulls allows the caller to only use the hull merging phase of the algorithm
- Parameters
-
| NumHulls | Number of convex hulls in the initial decomposition |
| HullVolumes | Function from Hull Index -> Hull Volume |
| HullNumVertices | Function from Hull Index -> Hull Vertex Count |
| HullVertices | Function from Hull Index, Vertex Index -> Hull Vertex Position |
| Proximity | All the local proximities for the hulls. Hulls will not be merged unless they are connected by this proximity graph. |
◆ InitializeFromIndexMesh() [1/2]
Initialize convex decomposition with a triangle index mesh
- Parameters
-
| Vertices | Vertex buffer for mesh to decompose |
| Faces | Triangle buffer for mesh to decompose |
| bMergeEdges | Whether to attempt to weld matching edges before computing the convex hull; this can help the convex decomposition find better cutting planes for meshes that have boundaries e.g. due to seams |
| FaceVertexOffset | Indices from the Faces array are optionally offset by this value. Useful e.g. to take slices of the multi-geometry vertex and face buffers of FGeometryCollection. |
◆ InitializeFromIndexMesh() [2/2]
Initialize convex decomposition with a triangle index mesh
- Parameters
-
| Vertices | Vertex buffer for mesh to decompose |
| Faces | Triangle buffer for mesh to decompose |
| Options | Options for pre-processing the mesh before decomposition (e.g., to weld matching edges, thicken degenerate inputs, or to run a general pre-process lambda function) |
| FaceVertexOffset | Indices from the Faces array are optionally offset by this value. Useful e.g. to take slices of the multi-geometry vertex and face buffers of FGeometryCollection. |
◆ InitializeFromMesh() [1/2]
| void UE::Geometry::FConvexDecomposition3::InitializeFromMesh |
( |
const FDynamicMesh3 & |
SourceMesh, |
|
|
bool |
bMergeEdges |
|
) |
| |
◆ InitializeFromMesh() [2/2]
◆ InitializeNegativeSpace()
Find negative space that should be protected. Uses the mesh passed on construction or to InitializeFromMesh or InitializeFromIndexMesh
- Parameters
-
| Settings | Settings to use to find the negative space |
- Returns
- False on failure – e.g., if there was no mesh available
◆ InitializeProximityFromDecompositionBoundingBoxOverlaps()
| void UE::Geometry::FConvexDecomposition3::InitializeProximityFromDecompositionBoundingBoxOverlaps |
( |
double |
BoundsExpandByMinDimFactor, |
|
|
double |
BoundsExpandByMaxDimFactor, |
|
|
double |
MinBoundsExpand |
|
) |
| |
Create the proximity graph from the current decomposition, using bounding box overlaps. To consider non-overlapping proximity, the bounding boxes can be expanded by a factor of their own size or by an absolute amount.
- Parameters
-
| BoundsExpandByMinDimFactor | Part bounds will be expanded by at least this factor of their own min dimension, before finding overlaps |
| BoundsExpandByMaxDimFactor | Part bounds will be expanded by at least this factor of their own max dimension, before finding overlaps |
| MinBoundsExpand | Part bounds will be expanded by at least this fixed amount, before finding overlaps |
◆ IsInputSolid()
| bool UE::Geometry::FConvexDecomposition3::IsInputSolid |
( |
| ) |
|
|
inline |
Test whether the input mesh (after preprocessing) is solid. Must be called after initialization, but before decomposition is computed.
◆ MergeBest() [1/2]
◆ MergeBest() [2/2]
| int32 UE::Geometry::FConvexDecomposition3::MergeBest |
( |
int32 |
TargetNumParts, |
|
|
double |
ErrorTolerance = 0, |
|
|
double |
MinThicknessTolerance = 0, |
|
|
bool |
bAllowCompact = true, |
|
|
bool |
bRequireHullTriangles = false, |
|
|
int32 |
MaxOutputHulls = -1, |
|
|
const FSphereCovering * |
OptionalNegativeSpace = nullptr, |
|
|
const FTransform * |
OptionalTransformIntoNegativeSpace = nullptr |
|
) |
| |
◆ NumHulls()
| int32 UE::Geometry::FConvexDecomposition3::NumHulls |
( |
| ) |
const |
|
inline |
◆ SplitWorst()
| int32 UE::Geometry::FConvexDecomposition3::SplitWorst |
( |
bool |
bCanSkipUnreliableGeoVolumes = false, |
|
|
double |
ErrorTolerance = 0.0, |
|
|
bool |
bOnlySplitIfNegativeSpaceCovered = false, |
|
|
double |
MinSplitSizeInWorldSpace = -1 |
|
) |
| |
◆ UpdateProximitiesAfterSplit()
| void UE::Geometry::FConvexDecomposition3::UpdateProximitiesAfterSplit |
( |
int32 |
SplitIdx, |
|
|
int32 |
NewIdxStart, |
|
|
FPlane3d |
CutPlane, |
|
|
int32 |
SecondSideIdxStart, |
|
|
double |
OrigHullVolume |
|
) |
| |
◆ BiasToRemoveTooThinParts
| double UE::Geometry::FConvexDecomposition3::BiasToRemoveTooThinParts = .1 |
◆ bSplitDisconnectedComponents
| bool UE::Geometry::FConvexDecomposition3::bSplitDisconnectedComponents = true |
◆ bTreatAsSolid
| bool UE::Geometry::FConvexDecomposition3::bTreatAsSolid = true |
◆ ConnectedComponentTolerance
| double UE::Geometry::FConvexDecomposition3::ConnectedComponentTolerance = 1e-3 |
◆ ConvexEdgeAngleMoreSamplesThreshold
| double UE::Geometry::FConvexDecomposition3::ConvexEdgeAngleMoreSamplesThreshold = 30 |
◆ ConvexEdgeAngleThreshold
| double UE::Geometry::FConvexDecomposition3::ConvexEdgeAngleThreshold = 170 |
◆ CutLargestAxisErrorScale
| double UE::Geometry::FConvexDecomposition3::CutLargestAxisErrorScale = .99 |
◆ Decomposition
◆ DecompositionToProximity
| TMultiMap<int32, int32> UE::Geometry::FConvexDecomposition3::DecompositionToProximity |
◆ MaxConvexEdgePlanes
| int32 UE::Geometry::FConvexDecomposition3::MaxConvexEdgePlanes = 50 |
◆ OnPlaneTolerance
| double UE::Geometry::FConvexDecomposition3::OnPlaneTolerance = 1e-7 |
◆ Proximities
◆ ProximityTolerance
| double UE::Geometry::FConvexDecomposition3::ProximityTolerance = 1e-3 |
◆ RestrictMergeSearchToLocalAfterTestNumConnections
| int32 UE::Geometry::FConvexDecomposition3::RestrictMergeSearchToLocalAfterTestNumConnections = -1 |
◆ ResultTransform
Transform taking the result hull vertices back to the original space of the inputs; automatically applied by GetVertices()
◆ ThickenAfterHullFailure
| double UE::Geometry::FConvexDecomposition3::ThickenAfterHullFailure = 0 |
The documentation for this class was generated from the following files: