Navigation
API > API/Plugins > API/Plugins/DynamicMesh > API/Plugins/DynamicMesh/Operations
References
| Module | DynamicMesh |
| Header | /Engine/Plugins/Runtime/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
| Type | Name | Description | |
|---|---|---|---|
| bool | bCollapseDegenerateEdgesOnCut | ||
| bool | bSimplifyAlongNewEdges | Control whether we attempt to auto-simplify the small planar triangles that the plane cut operation tends to generate | |
| double | DegenerateEdgeTol | ||
| TUniqueFunction< bool(int32)> | EdgeFilterFunc | If set, only edges that pass this filter will be split | |
| TArray< TArray< int > > | HoleFillTriangles | Triangle IDs of hole fill triangles. Outer array is 1:1 with the OpenBoundaries array. | |
| FDynamicMesh3 * | Mesh | Inputs | |
| TArray< FOpenBoundary > | 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 | |
| FVector3d | PlaneNormal | ||
| FVector3d | PlaneOrigin | ||
| double | PlaneTolerance | Tolerance distance for considering a vertex to be 'on plane' | |
| TArray< FCutResultRegion > | ResultRegions | List of output cut regions (eg that have separate GroupIDs). | |
| FLocalPlanarSimplify | SimplifySettings | Settings to apply if bSimplifyAlongNewEdges == true | |
| float | UVScaleFactor | UVs on any hole fill surfaces are scaled by this amount |
Constructors
| Type | Name | Description | |
|---|---|---|---|
FMeshPlaneCut
(
FDynamicMesh3* Mesh, |
Cut mesh with plane. Assumption is that plane normal is Z value. |
Destructors
| Type | Name | Description | |
|---|---|---|---|
| PRAGMA_DISABLE_DEPRECATION_WARNINGS | Note: deprecation warnings disabled on destructor due to deprecated member variables. |
Functions
| Type | Name | Description | |
|---|---|---|---|
| void | CollapseDegenerateEdges
(
TSet< int >& Edges, |
Collapse degenerate edges | |
| 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. | |
| bool | CutWithoutDelete
(
bool bSplitVerticesAtPlane, |
Compute the plane cut by splitting mesh edges that cross the cut plane, but not deleting triangles on positive side. | |
| bool | ExtractBoundaryLoops
(
const TSet< int >& OnCutEdges, |
||
| bool | HoleFill
(
TFunction< TArray< FIndex3i >(const FGeneralPolygon2d&)> PlanarTriangulationFunc, |
Fill cut loops with FPlanarHoleFiller, using a caller-provided triangulation function | |
| bool | MinimalHoleFill
(
int ConstantGroupID |
||
| bool | SimpleHoleFill
(
int ConstantGroupID |
Fill cut loops with FSimpleHoleFiller | |
| void | |||
| void | SplitCrossingEdges
(
TArray< double >& Signs, |
||
| void | SplitCrossingEdges
(
TArray< double >& Signs, |
||
| bool | SplitEdgesOnly
(
bool bAssignNewGroups, |
Compute the plane cut by splitting mesh edges that cross the cut plane, and then optionally update groups | |
| void | TransferTriangleLabelsToHoleFillTriangles
(
TDynamicMeshScalarTriangleAttribute< int >* TriLabels |
||
| EOperationValidationResult | Validate () |
Classes
| Type | Name | Description | |
|---|---|---|---|
| FCutResultRegion | |||
| FOpenBoundary | TODO support optionally restricting plane cut to a mesh selection MeshFaceSelection CutFaceSet; Outputs |
Deprecated Variables
| Type | Name | Description | |
|---|---|---|---|
| TSet< int32 > | OnCutVertices | If needed, explicitly request the vertices on the cut plane the the OnPlaneVertices argument of SplitCrossingEdges | |
| PRAGMA_DISABLE_DEPRECATION_WARNINGSTArray< int32 > | ResultSeedTriangles | To preserve a triangle selection when using SplitEdgesOnly(), instead pass the selection as a pointer to that function. |
Deprecated Functions
| Type | Name | Description | |
|---|---|---|---|
| void | CollapseDegenerateEdges
(
const TSet< int >& OnCutEdges, |
Use the single-set CollapseDegenerateEdges instead | |
| bool | SplitEdgesOnly
(
bool bAssignNewGroups |
Instead use the two-parameter version of SplitEdgesOnly, which has direction selection tracking and does not populate the deprecated ResultSeedTriangles |