UDocumentation UE5.7 10.02.2026 (Source)
API documentation for Unreal Engine 5.7
UE::Geometry::FMeshSelfUnion Class Reference

#include <MeshSelfUnion.h>

Public Member Functions

 FMeshSelfUnion (FDynamicMesh3 *MeshIn)
 
virtual ~FMeshSelfUnion ()
 
EOperationValidationResult Validate ()
 
GEOMETRYCORE_API bool Compute ()
 

Public Attributes

bool bCollapseDegenerateEdgesOnCut = true
 
double DegenerateEdgeTolFactor = 1.5
 
double SnapTolerance = FMathf::ZeroTolerance * 1.0
 
double NormalOffset = FMathf::ZeroTolerance * 1.0
 
double WindingThreshold = .5
 
bool bTrimFlaps = false
 
bool bWeldSharedEdges = true
 
bool bTrackAllNewEdges = false
 
FProgressCancelProgress = nullptr
 
bool bSimplifyAlongNewEdges = false
 
double SimplificationAngleTolerance = .1
 
double TryToImproveTriQualityThreshold = .25
 
bool bPreserveTriangleGroups = true
 
bool bPreserveVertexUVs = true
 
bool bPreserveOverlayUVs = true
 
float UVDistortTolerance = FMathf::ZeroTolerance
 
bool bPreserveVertexNormals = true
 
float NormalDistortTolerance = .01f
 
FDynamicMesh3Mesh
 
TArray< int > CreatedBoundaryEdges
 
TSet< int32AllNewEdges
 

Protected Member Functions

virtual bool Cancelled ()
 

Detailed Description

MeshSelfUnion – perform a "Mesh Boolean" style union of a mesh on itself, resolving any self intersections and welding the new boundaries as needed

Constructor & Destructor Documentation

◆ FMeshSelfUnion()

UE::Geometry::FMeshSelfUnion::FMeshSelfUnion ( FDynamicMesh3 MeshIn)
inline

◆ ~FMeshSelfUnion()

virtual UE::Geometry::FMeshSelfUnion::~FMeshSelfUnion ( )
inlinevirtual

Member Function Documentation

◆ Cancelled()

virtual bool UE::Geometry::FMeshSelfUnion::Cancelled ( )
inlineprotectedvirtual

If this returns true, abort computation.

◆ Compute()

bool FMeshSelfUnion::Compute ( )

Compute the plane cut by splitting mesh edges that cross the cut plane, and then deleting any triangles on the positive side of the cutting plane.

Returns
true if operation succeeds

◆ Validate()

EOperationValidationResult UE::Geometry::FMeshSelfUnion::Validate ( )
inline
Returns
EOperationValidationResult::Ok if we can apply operation, or error code if we cannot

Member Data Documentation

◆ AllNewEdges

TSet<int32> UE::Geometry::FMeshSelfUnion::AllNewEdges

All edges created by mesh boolean algorithm. Only populated if bTrackAllNewEdges = true

◆ bCollapseDegenerateEdgesOnCut

bool UE::Geometry::FMeshSelfUnion::bCollapseDegenerateEdgesOnCut = true

Whether to do additional processing to try to remove degenerate edges

◆ bPreserveOverlayUVs

bool UE::Geometry::FMeshSelfUnion::bPreserveOverlayUVs = true

Prevent simplification from distorting overlay UVs

◆ bPreserveTriangleGroups

bool UE::Geometry::FMeshSelfUnion::bPreserveTriangleGroups = true

Prevent simplification from distorting triangle groups

◆ bPreserveVertexNormals

bool UE::Geometry::FMeshSelfUnion::bPreserveVertexNormals = true

Prevent simplification from distorting vertex normals

◆ bPreserveVertexUVs

bool UE::Geometry::FMeshSelfUnion::bPreserveVertexUVs = true

Prevent simplification from distorting vertex UVs

◆ bSimplifyAlongNewEdges

bool UE::Geometry::FMeshSelfUnion::bSimplifyAlongNewEdges = false

Control whether we attempt to auto-simplify the small planar triangles that the boolean operation tends to generate

◆ bTrackAllNewEdges

bool UE::Geometry::FMeshSelfUnion::bTrackAllNewEdges = false

Control whether new edges should be tracked

◆ bTrimFlaps

bool UE::Geometry::FMeshSelfUnion::bTrimFlaps = false

Whether to remove visible "open" geometry

◆ bWeldSharedEdges

bool UE::Geometry::FMeshSelfUnion::bWeldSharedEdges = true

Weld newly-created cut edges where the mesh is unioned with itself. If false, newly joined surfaces remain topologically disconnected.

◆ CreatedBoundaryEdges

TArray<int> UE::Geometry::FMeshSelfUnion::CreatedBoundaryEdges

Boundary edges created by the mesh boolean algorithm failing to cleanly weld (doesn't include boundaries that already existed in source mesh)

◆ DegenerateEdgeTolFactor

double UE::Geometry::FMeshSelfUnion::DegenerateEdgeTolFactor = 1.5

Tolerance factor (multiplied by SnapTolerance) for removing short edges created by the cutting process; should be no more than 2

◆ Mesh

FDynamicMesh3* UE::Geometry::FMeshSelfUnion::Mesh

◆ NormalDistortTolerance

float UE::Geometry::FMeshSelfUnion::NormalDistortTolerance = .01f

When preserving normals, sets maximum allowed change in normals from collapsing an edge, measured at the removed vertex in degrees

◆ NormalOffset

double UE::Geometry::FMeshSelfUnion::NormalOffset = FMathf::ZeroTolerance * 1.0

Amount we nudge samples off the surface when evaluating winding number, to avoid numerical issues

◆ Progress

FProgressCancel* UE::Geometry::FMeshSelfUnion::Progress = nullptr

Set this to be able to cancel running operation

◆ SimplificationAngleTolerance

double UE::Geometry::FMeshSelfUnion::SimplificationAngleTolerance = .1

Degrees of deviation from coplanar that we will still simplify

◆ SnapTolerance

double UE::Geometry::FMeshSelfUnion::SnapTolerance = FMathf::ZeroTolerance * 1.0

Tolerance distance for considering a point to be on a vertex or edge, especially during mesh-mesh cutting

◆ TryToImproveTriQualityThreshold

double UE::Geometry::FMeshSelfUnion::TryToImproveTriQualityThreshold = .25

If triangle quality (aspect ratio) is worse than this threshold, only simplify in ways that improve quality. If <= 0, triangle quality is ignored. Note: For aspect ratio we use definition: 4*TriArea / (sqrt(3)*MaxEdgeLen^2), ref: https://people.eecs.berkeley.edu/~jrs/papers/elemj.pdf p.53 Equilateral triangles have value 1; Smaller values -> lower quality

◆ UVDistortTolerance

float UE::Geometry::FMeshSelfUnion::UVDistortTolerance = FMathf::ZeroTolerance

When preserving UVs, sets maximum allowed change in UV coordinates from collapsing an edge, measured at the removed vertex

◆ WindingThreshold

double UE::Geometry::FMeshSelfUnion::WindingThreshold = .5

Threshold to determine whether triangle in one mesh is inside or outside of the other


The documentation for this class was generated from the following files: