FMeshBoolean

MeshBoolean perform a boolean operation on two input meshes.

Windows
MacOS
Linux

References

Module

DynamicMesh

Header

/Engine/Plugins/Experimental/GeometryProcessing/Source/DynamicMesh/Public/Operations/MeshBoolean.h

Include

#include "Operations/MeshBoolean.h"

Syntax

class FMeshBoolean

Remarks

MeshBoolean perform a boolean operation on two input meshes.

Variables

Name Description

Public variable

TSet< int32 >

 

AllNewEdges

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

Public variable

bool

 

bCollapseDegenerateEdgesOnCut

Whether to do additional processing to try to remove degenerate edges

Public variable

bool

 

bPreserveOverlayUVs

Prevent simplification from distorting overlay UVs

Public variable

bool

 

bPreserveVertexUVs

Prevent simplification from distorting vertex UVs

Public variable

bool

 

bPutResultInInputSpace

Put the Result mesh in the same space as the input.

Public variable

bool

 

bSimplifyAlongNewEdges

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

Public variable

bool

 

bTrackAllNewEdges

Control whether new edges should be tracked

Public variable

bool

 

bWeldSharedEdges

Weld newly-created cut edges where the input meshes meet.

Public variable

TArray< int >

 

CreatedBoundaryEdges

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

Public variable

double

 

DegenerateEdgeTolFactor

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

Public variable

const FDynamicM...

 

Meshes

Inputs

Public variable

EBooleanOp

 

Operation

Public variable

int

 

PreserveUVsOnlyForMesh

If > -1, then only preserve the UVs of one of the input meshes.

Public variable

FProgressCancel...

 

Progress

Set this to be able to cancel running operation

Public variable

FDynamicMesh3 &...

 

Result

An existing mesh, to be filled with the boolean result.

Public variable

FTransform3d

 

ResultTransform

OutputTransform taking the result mesh back to the original space of the inputs

Public variable

double

 

SimplificationAngleTolerance

Simplification-specific settings (only relevant if bSimplifyAlongNewEdges==true):Degrees of deviation from coplanar that we will still simplify

Public variable

double

 

SnapTolerance

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

Public variable

const FTransfor...

 

Transforms

Public variable

double

 

TryToImproveTriQualityThreshold

If triangle quality (aspect ratio) is worse than this threshold, only simplify in ways that improve quality.

Public variable

float

 

UVDistortTolerance

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

Public variable

double

 

WindingThreshold

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

Constructors

Name Description

Public function

FMeshBoolean

(
    const FDynamicMesh3* MeshA,
    const FDynamicMesh3* MeshB,
    FDynamicMesh3* OutputMesh,
    EBooleanOp Operation
)

Public function

FMeshBoolean

(
    const FDynamicMesh3* MeshA,
    const FTransform3d& TransformA,
    const FDynamicMesh3* MeshB,
    const FTransform3d& TransformB,
    FDynamicMesh3* OutputMesh,
    EBooleanOp Operation
)

Perform a boolean operation to combine two meshes into a provided output mesh.

Destructors

Name Description

Public function Virtual

~FMeshBoolean()

Functions

Name Description

Protected function Virtual

bool

 

Cancelled()

If this returns true, abort computation.

Public function Static

bool

 

CollapseWouldChangeShapeOrUVs

(
    const FDynamicMesh3& Mesh,
    const TSet< int >& CutBoundaryEdge...,
    double DotTolerance,
    int SourceEID,
    int32 RemoveV,
    const FVector3d& RemoveVPos,
    int32 KeepV,
    const FVector3d& KeepVPos,
    const FVector3d& EdgeDir,
    bool bPreserveUVsForMesh,
    bool bPreserveVertexUVs,
    bool bPreserveOverlayUVs,
    float UVToleranceSq
)

Test if a given edge collapse would change the mesh shape or UVs unacceptably

Public function Static

bool

 

CollapseWouldHurtTriangleQuality

(
    const FDynamicMesh3& Mesh,
    const FVector3d& ExpectNormal,
    int32 RemoveV,
    const FVector3d& RemoveVPos,
    int32 KeepV,
    const FVector3d& KeepVPos,
    double TryToImproveTriQualityThresh...
)

Test if a given edge collapse would cause a triangle flip or other unacceptable decrease in mesh quality Specialized for collapsing at flat triangles TODO: Currently this only detects triangle flips; need to extend it to also detect other mesh quality issues

Public function

bool

 

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.

Public function Static

bool

 

IsFlat

(
    const FDynamicMesh3& Mesh,
    int VID,
    double DotTolerance,
    FVector3d& OutFirstNormal
)

Test if the triangles connected to a vertex are all coplanar

Public function

EOperationVa...

 

Validate()

Enums

Name

Description

Public enum

EBooleanOp

Help shape the future of Unreal Engine documentation! Tell us how we're doing so we can serve you better.
Take our survey
Dismiss