Navigation
API > API/Plugins > API/Plugins/DynamicMesh
Implementation of Garland & Heckbert Quadric Error Metric (QEM) Triangle Mesh Simplification
| Name | TMeshSimplification |
| Type | class |
| Header File | /Engine/Plugins/Runtime/GeometryProcessing/Source/DynamicMesh/Public/MeshSimplification.h |
| Include Path | #include "MeshSimplification.h" |
Syntax
template<typename QuadricErrorType>
class TMeshSimplification : public UE::Geometry::FMeshRefinerBase
Inheritance Hierarchy
- FMeshRefinerBaseFixLayout → FMeshRefinerBase → TMeshSimplification
Constructors
| Name | Remarks | Include Path | Unreal Specifiers |
|---|---|---|---|
| MeshSimplification.h | |||
TMeshSimplification
(
FDynamicMesh3* m |
MeshSimplification.h |
Structs
| Name | Remarks |
|---|---|
| FEdgeError | |
| QEdge | Internal class for priority queue |
Enums
Public
| Name | Remarks |
|---|---|
| EGeometricErrorCriteria | Ways to measure geometric error |
| ESimplificationCollapseModes |
Protected
| Name | Remarks |
|---|---|
| ETargetModes |
Typedefs
| Name | Type | Remarks | Include Path |
|---|---|---|---|
| FQuadricErrorType | QuadricErrorType | MeshSimplification.h | |
| FSeamQuadricType | TQuadricError< RealType > | MeshSimplification.h | |
| RealType | FQuadricErrorType::ScalarType | MeshSimplification.h |
Variables
Public
| Name | Type | Remarks | Include Path | Unreal Specifiers |
|---|---|---|---|---|
| bAllowSeamCollapse | bool | If true, we allow UV and Normal seams to collapse during simplification. | MeshSimplification.h | |
| bPreserveBoundaryShape | bool | If true, we try to keep boundary vertices on boundary. | MeshSimplification.h | |
| bPreventTinyTriangles | bool | Controls whether we disallow creation of triangles with small areas inside edge operations. | MeshSimplification.h | |
| bRetainQuadricMemory | bool | If false, face and vertex quadrics are recomputed in the neighborhood of each collapse, definitely slower but maybe higher quality | MeshSimplification.h | |
| CollapseMode | ESimplificationCollapseModes | Controls the method used when selecting the position the results from an edge collapse. | MeshSimplification.h | |
| GeometricErrorConstraint | EGeometricErrorCriteria | Geometric error measurement/check to perform before allowing an edge collapse | MeshSimplification.h | |
| GeometricErrorTolerance | double | Tolerance to use in geometric error checking | MeshSimplification.h | |
| GroupBoundaryConstraint | EEdgeRefineFlags | MeshSimplification.h | ||
| MaterialBoundaryConstraint | EEdgeRefineFlags | MeshSimplification.h | ||
| MeshBoundaryConstraint | EEdgeRefineFlags | When using the constraint system, these options will apply to the appropriate boundaries. | MeshSimplification.h |
Functions
Public
| Name | Remarks | Include Path | Unreal Specifiers |
|---|---|---|---|
virtual void FastCollapsePass
(
double MinEdgeLength, |
Does N rounds of collapsing edges longer than fMinEdgeLength. | MeshSimplification.h | |
virtual void SimplifyToEdgeLength
(
double MinEdgeLength |
Simplify mesh until no edges smaller than min length remain. This is not a great criteria. | MeshSimplification.h | |
virtual void SimplifyToMaxError
(
double MaxError |
Simplify mesh until the quadric error of an edge collapse exceeds the specified criteria. | MeshSimplification.h | |
virtual void SimplifyToMinimalPlanar
(
double CoplanarAngleTolDeg, |
Maximally collapse mesh in a way that does not change shape at all. | MeshSimplification.h | |
virtual void SimplifyToTriangleCount
(
int TriangleCount |
Simplify mesh until we reach a specific triangle count. | MeshSimplification.h | |
virtual void SimplifyToVertexCount
(
int VertexCount |
Simplify mesh until it has a specific vertex count | MeshSimplification.h |
Protected
| Name | Remarks | Include Path | Unreal Specifiers |
|---|---|---|---|
virtual void ApplyToProjectVertices
(
const TFunction< void(int)>& apply_f |
MeshSimplification.h | ||
FQuadricErrorType AssembleEdgeQuadric
(
const FDynamicMesh3::FEdge& edge |
Uses pre-computed vertex, face and seam quadrics to construct the edge quadric. | MeshSimplification.h | |
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. | MeshSimplification.h | |
bool CheckIfCollapseWithinGeometricTolerance
(
int vid, |
Check if edge collapse would violate geometric error criteria | MeshSimplification.h | |
ESimplificationResult CollapseEdge
(
int edgeID, |
Collapse given edge. | MeshSimplification.h | |
FQuadricErrorType ComputeFaceQuadric
(
const int tid, |
MeshSimplification.h | ||
virtual void DoSimplify() |
Top-level function that does the simplification | MeshSimplification.h | |
bool EnableInlineProjection() |
This just lets us write more concise code | MeshSimplification.h | |
virtual void FullProjectionPass() |
Project vertices onto projection target. | MeshSimplification.h | |
virtual int GetNextEdge
(
int CurEdgeID, |
MeshSimplification.h | ||
virtual FVector3d GetProjectedCollapsePosition
(
int vid, |
Used by collapse-edge to get projected position for new vertex | MeshSimplification.h | |
FVector3d GetProjectedPoint
(
const FVector3d& pos |
MeshSimplification.h | ||
virtual void InitializeQueue() |
MeshSimplification.h | ||
virtual void InitializeSeamQuadrics() |
MeshSimplification.h | ||
virtual void InitializeTriQuadrics() |
MeshSimplification.h | ||
virtual void InitializeVertexQuadrics() |
MeshSimplification.h | ||
bool IsBoundaryVertex
(
int vid |
MeshSimplification.h | ||
virtual void OnEdgeCollapse
(
int edgeID, |
Subclasses can override this to implement custom behavior... | MeshSimplification.h | |
virtual void OnRemoveIsolatedTriangle
(
int tId |
Subclasses can override this to implement custom behavior... | MeshSimplification.h | |
FVector3d OptimalPoint
(
int eid, |
Return point that minimizes quadric error for edge [ea,eb] | MeshSimplification.h | |
void Precompute
(
bool bMeshIsClosed |
MeshSimplification.h | ||
virtual void ProfileBeginCollapse() |
MeshSimplification.h | ||
virtual void ProfileBeginOps() |
MeshSimplification.h | ||
virtual void ProfileBeginPass() |
MeshSimplification.h | ||
virtual void ProfileBeginProject() |
MeshSimplification.h | ||
virtual void ProfileBeginSetup() |
MeshSimplification.h | ||
virtual void ProfileEndCollapse() |
MeshSimplification.h | ||
virtual void ProfileEndOps() |
MeshSimplification.h | ||
virtual void ProfileEndPass() |
MeshSimplification.h | ||
virtual void ProfileEndProject() |
MeshSimplification.h | ||
virtual void ProfileEndSetup() |
MeshSimplification.h | ||
virtual void ProjectVertex
(
int vID, |
MeshSimplification.h | ||
bool RemoveIsolatedTriangle
(
int tID |
Remove an isolated triangle. | MeshSimplification.h | |
virtual void Reproject() |
MeshSimplification.h | ||
virtual int StartEdges() |
MeshSimplification.h | ||
virtual void UpdateNeighborhood
(
const FDynamicMesh3::FEdgeCollapseInfo& collapseInfo |
Update queue weight for each edge in vertex one-ring and rebuild and quadrics necessary | MeshSimplification.h |