Navigation
API > API/Plugins > API/Plugins/DynamicMesh
Inheritance Hierarchy
- FMeshRefinerBase
- TMeshSimplification
References
| Module | DynamicMesh |
| Header | /Engine/Plugins/Runtime/GeometryProcessing/Source/DynamicMesh/Public/MeshSimplification.h |
| Include | #include "MeshSimplification.h" |
Syntax
template<typename QuadricErrorType>
class TMeshSimplification : public UE::Geometry::FMeshRefinerBase
Remarks
Implementation of Garland & Heckbert Quadric Error Metric (QEM) Triangle Mesh Simplification
Variables
| Type | Name | Description | |
|---|---|---|---|
| bool | bAllowSeamCollapse | If true, we allow UV and Normal seams to collapse during simplification. | |
| bool | bHaveBoundary | ||
| bool | bPreserveBoundaryShape | If true, we try to keep boundary vertices on boundary. | |
| bool | bPreventTinyTriangles | Controls whether we disallow creation of triangles with small areas inside edge operations. | |
| bool | bRetainQuadricMemory | If false, face and vertex quadrics are recomputed in the neighborhood of each collapse, definitely slower but maybe higher quality | |
| ESimplificationCollapseModes | CollapseMode | Controls the method used when selecting the position the results from an edge collapse. | |
| int | COUNT_COLLAPSES | Testing/debug/profiling stuff profiling functions, turn on ENABLE_PROFILING to see output in console | |
| int | COUNT_ITERATIONS | ||
| TArray< QEdge > | EdgeQuadrics | ||
| FIndexPriorityQueue | EdgeQueue | ||
| EGeometricErrorCriteria | GeometricErrorConstraint | Geometric error measurement/check to perform before allowing an edge collapse | |
| double | GeometricErrorTolerance | Tolerance to use in geometric error checking | |
| EEdgeRefineFlags | GroupBoundaryConstraint | ||
| TArray< bool > | IsBoundaryVtxCache | ||
| EEdgeRefineFlags | MaterialBoundaryConstraint | ||
| int | MaxEdgeID | ||
| float | MaxErrorAllowed | ||
| EEdgeRefineFlags | MeshBoundaryConstraint | When using the constraint system, these options will apply to the appropriate boundaries. | |
| double | MinEdgeLength | ||
| const int | ModuloPrime | We are using a modulo-index loop to break symmetry/pathological conditions. | |
| FDynamicMeshNormalOverlay * | NormalOverlay | ||
| double | SeamEdgeWeight | ||
| TMap< int, FSeamQuadricType > | seamQuadrics | ||
| ETargetModes | SimplifyMode | ||
| int | TargetCount | ||
| TArray< double > | triAreas | ||
| TArray< FQuadricErrorType > | triQuadrics | ||
| TArray< FQuadricErrorType > | vertQuadrics |
Constructors
| Type | Name | Description | |
|---|---|---|---|
TMeshSimplification
(
FDynamicMesh3* m |
Functions
| Type | Name | Description | |
|---|---|---|---|
| void | ApplyToProjectVertices
(
const TFunction< void(int)>& apply_f |
||
| FQuadricErrorType | AssembleEdgeQuadric
(
const FDynamicMesh3::FEdge& edge |
Uses pre-computed vertex, face and seam quadrics to construct the edge quadric. | |
| bool | CanCollapseEdge
(
int edgeID, |
Figure out if we can collapse edge eid=[a,b] under current constraint set This depends on the base class function FMeshRefinerBase::CanCollapseEdge, but includes additional restrictions specified by the CollapseMode of this simplifier. | |
| bool | CheckIfCollapseWithinGeometricTolerance
(
int vid, |
Check if edge collapse would violate geometric error criteria | |
| ESimplificationResult | CollapseEdge
(
int edgeID, |
Collapse given edge. | |
| FQuadricErrorType | ComputeFaceQuadric
(
const int tid, |
||
| void | DoSimplify () |
Top-level function that does the simplification | |
| bool | This just lets us write more concise code | ||
| void | FastCollapsePass
(
double MinEdgeLength, |
Does N rounds of collapsing edges longer than fMinEdgeLength. | |
| void | Project vertices onto projection target. | ||
| int | GetNextEdge
(
int CurEdgeID, |
||
| FVector3d | GetProjectedCollapsePosition
(
int vid, |
Used by collapse-edge to get projected position for new vertex | |
| FVector3d | GetProjectedPoint
(
const FVector3d& pos |
||
| void | |||
| void | |||
| void | |||
| void | |||
| bool | IsBoundaryVertex
(
int vid |
||
| void | OnEdgeCollapse
(
int edgeID, |
||
| void | OnEdgeCollapse
(
int edgeID, |
Subclasses can override these to implement custom behavior... | |
| void | OnRemoveIsolatedTriangle
(
int tId |
||
| FVector3d | OptimalPoint
(
int eid, |
Return point that minimizes quadric error for edge [ea,eb] | |
| void | Precompute
(
bool bMeshIsClosed |
||
| void | |||
| void | |||
| void | |||
| void | |||
| void | |||
| void | |||
| void | |||
| void | |||
| void | |||
| void | |||
| void | ProjectVertex
(
int vID, |
||
| bool | RemoveIsolatedTriangle
(
int tID |
Remove an isolated triangle. | |
| void | Reproject () |
||
| void | SimplifyToEdgeLength
(
double MinEdgeLength |
Simplify mesh until no edges smaller than min length remain. This is not a great criteria. | |
| void | SimplifyToMaxError
(
double MaxError |
Simplify mesh until the quadric error of an edge collapse exceeds the specified criteria. | |
| void | SimplifyToMinimalPlanar
(
double CoplanarAngleTolDeg, |
Maximally collapse mesh in a way that does not change shape at all. | |
| void | SimplifyToTriangleCount
(
int TriangleCount |
Simplify mesh until we reach a specific triangle count. | |
| void | SimplifyToVertexCount
(
int VertexCount |
Simplify mesh until it has a specific vertex count | |
| int | StartEdges () |
||
| void | UpdateNeighborhood
(
const FDynamicMesh3::FEdgeCollapseInfo& collapseInfo |
Update queue weight for each edge in vertex one-ring and rebuild and quadrics necessary |
Classes
| Type | Name | Description | |
|---|---|---|---|
| FEdgeError | |||
| QEdge | Internal class for priority queue |
Enums
| Type | Name | Description | |
|---|---|---|---|
| EGeometricErrorCriteria | Ways to measure geometric error | ||
| ESimplificationCollapseModes | |||
| ETargetModes |
Typedefs
| Name | Description |
|---|---|
| FQuadricErrorType | |
| FSeamQuadricType | |
| RealType |