FMeshPlaneCut

Cut the Mesh with the Plane.

Windows
MacOS
Linux

References

Module

DynamicMesh

Header

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

Include

#include "Operations/MeshPlaneCut.h"

Syntax

class FMeshPlaneCut

Remarks

Cut the Mesh with the Plane. The positive side, ie (p-o).n > 0, is removed. If possible, returns boundary loop(s) along cut (this will fail if cut intersected with holes in mesh). Also FillHoles() for a topological fill. Or use CutLoops and fill yourself.

Algorithm is: 1) find all edge crossings 2) optionally discard any triangles with all vertex distances < epsilon. 3) Do edge splits at crossings 4 option a) (optionally) delete all vertices on positive side 4 option b) (OR optionally) disconnect all triangles w/ vertices on positive side (if keeping both sides) 4 option c) do nothing (if keeping both sides and not disconnecting them) 5) (optionally) collapse any degenerate boundary edges 6) (optionally) change an attribute tag for all triangles on positive side 7) find loops through valid boundary edges (ie connected to splits, or on-plane edges) (if second half was kept, do this separately for each separate mesh ID label)

Variables

Name Description

Public variable

bool

 

bCollapseDegenerateEdgesOnCut

Public variable

double

 

DegenerateEdgeTol

Public variable

TUniqueFunction...

 

EdgeFilterFunc

If set, only edges that pass this filter will be split

Public variable

TArray< TArray<...

 

HoleFillTriangles

Triangle IDs of hole fill triangles. Outer array is 1:1 with the OpenBoundaries array.

Public variable

FDynamicMesh3 &...

 

Mesh

Inputs

Protected variable

TSet< int32 >

 

OnCutVertices

Set of vertices lying on plane after calling SplitCrossingEdges

Public variable

TArray< FOpenBo...

 

OpenBoundaries

Note: loops and spans within a single FOpenBoundary could be part of the same hole-fill triangulation separate open boundary structs will be considered separately and will not share hole fill triangles

Public variable

FVector3d

 

PlaneNormal

Public variable

FVector3d

 

PlaneOrigin

Public variable

double

 

PlaneTolerance

Tolerance distance for considering a vertex to be 'on plane'

Public variable

TArray< FCutRes...

 

ResultRegions

List of output cut regions (eg that have separate GroupIDs).

Public variable

float

 

UVScaleFactor

UVs on any hole fill surfaces are scaled by this amount

Constructors

Name Description

Public function

FMeshPlaneCut

(
    FDynamicMesh3* Mesh,
    FVector3d Origin,
    FVector3d Normal
)

Cut mesh with plane. Assumption is that plane normal is Z value.

Destructors

Name Description

Public function Virtual

~FMeshPlaneCut()

Functions

Name Description

Protected function

void

 

CollapseDegenerateEdges

(
    const TSet< int >& OnCutEdges,
    const TSet< int >& ZeroEdges
)

Public function Virtual

bool

 

Cut()

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 Virtual

bool

 

CutWithoutDelete

(
    bool bSplitVerticesAtPlane,
    float OffsetSeparatedPortion,
    TDynamicMeshScalarTriangleAttribute...,
    int NewLabelStartID,
    bool bAddBoundariesFirstHalf,
    bool bAddBoundariesSecondHalf
)

Compute the plane cut by splitting mesh edges that cross the cut plane, but not deleting triangles on positive side.

Protected function

bool

 

ExtractBoundaryLoops

(
    const TSet< int >& OnCutEdges,
    const TSet< int >& ZeroEdges,
    FMeshPlaneCut::FOpenBoundary& Boun...
)

Public function Virtual

bool

 

HoleFill

(
    TFunction< TArray< FIndex3i >(const...,
    bool bFillSpans,
    int ConstantGroupID
)

Fill cut loops with FPlanarHoleFiller, using a caller-provided triangulation function

Public function Virtual

bool

 

SimpleHoleFill

(
    int ConstantGroupID
)

Fill cut loops with FSimpleHoleFiller

Protected function

void

 

SplitCrossingEdges

(
    TArray< double >& Signs,
    TSet< int >& ZeroEdges,
    TSet< int >& OnCutEdges,
    bool bDeleteTrisOnPlane
)

Public function Virtual

bool

 

SplitEdgesOnly

(
    bool bAssignNewGroups
)

Compute the plane cut by splitting mesh edges that cross the cut plane, and then optionally update groups

Public function Virtual

void

 

TransferTriangleLabelsToHoleFillTriangles

Public function Virtual

EOperationVa...

 

Validate()

Classes

Name

Description

Public struct

FCutResultRegion

Public struct

FOpenBoundary

TODO support optionally restricting plane cut to a mesh selection MeshFaceSelection CutFaceSet; Outputs

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