Navigation
API > API/Plugins > API/Plugins/DynamicMesh
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)
| Name | FMeshPlaneCut |
| Type | class |
| Header File | /Engine/Plugins/Runtime/GeometryProcessing/Source/DynamicMesh/Public/Operations/MeshPlaneCut.h |
| Include Path | #include "Operations/MeshPlaneCut.h" |
Syntax
class FMeshPlaneCut : public UE::Geometry::FMeshPlaneCutFixLayout
Inheritance Hierarchy
- FMeshPlaneCutFixLayout → FMeshPlaneCut
Constructors
| Name | Remarks | Include Path | Unreal Specifiers |
|---|---|---|---|
FMeshPlaneCut
(
FDynamicMesh3* Mesh, |
Cut mesh with plane. Assumption is that plane normal is Z value. | Operations/MeshPlaneCut.h |
Destructors
| Name | Remarks | Include Path | Unreal Specifiers |
|---|---|---|---|
virtual PRAGMA_DISABLE_DEPRECATION_WARNINGS ~FMeshPlaneCut() |
Note: deprecation warnings disabled on destructor due to deprecated member variables. | Operations/MeshPlaneCut.h |
Structs
| Name | Remarks |
|---|---|
| FCutResultRegion | |
| FOpenBoundary | TODO support optionally restricting plane cut to a mesh selection MeshFaceSelection CutFaceSet; Outputs |
Variables
Public
| Name | Type | Remarks | Include Path | Unreal Specifiers |
|---|---|---|---|---|
| bCollapseDegenerateEdgesOnCut | bool | Operations/MeshPlaneCut.h | ||
| bSimplifyAlongNewEdges | bool | Control whether we attempt to auto-simplify the small planar triangles that the plane cut operation tends to generate | Operations/MeshPlaneCut.h | |
| DegenerateEdgeTol | double | Operations/MeshPlaneCut.h | ||
| EdgeFilterFunc | TUniqueFunction< bool(int32)> | If set, only edges that pass this filter will be split | Operations/MeshPlaneCut.h | |
| HoleFillTriangles | TArray< TArray< int > > | Triangle IDs of hole fill triangles. Outer array is 1:1 with the OpenBoundaries array. | Operations/MeshPlaneCut.h | |
| Mesh | FDynamicMesh3 * | Inputs | Operations/MeshPlaneCut.h | |
| OpenBoundaries | TArray< FOpenBoundary > | 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 | Operations/MeshPlaneCut.h | |
| PlaneNormal | FVector3d | Operations/MeshPlaneCut.h | ||
| PlaneOrigin | FVector3d | Operations/MeshPlaneCut.h | ||
| PlaneTolerance | double | Tolerance distance for considering a vertex to be 'on plane' | Operations/MeshPlaneCut.h | |
| ResultRegions | TArray< FCutResultRegion > | List of output cut regions (eg that have separate GroupIDs). | Operations/MeshPlaneCut.h | |
| ResultSeedTriangles | PRAGMA_DISABLE_DEPRECATION_WARNINGSTArray< int32 > | List of output cut triangles representing the seed triangles along the cut. | Operations/MeshPlaneCut.h | |
| SimplifySettings | FLocalPlanarSimplify | Settings to apply if bSimplifyAlongNewEdges == true | Operations/MeshPlaneCut.h | |
| UVScaleFactor | float | UVs on any hole fill surfaces are scaled by this amount | Operations/MeshPlaneCut.h |
Functions
Public
| Name | Remarks | Include Path | Unreal Specifiers |
|---|---|---|---|
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. | Operations/MeshPlaneCut.h | |
virtual bool CutWithoutDelete
(
bool bSplitVerticesAtPlane, |
Compute the plane cut by splitting mesh edges that cross the cut plane, but not deleting triangles on positive side. | Operations/MeshPlaneCut.h | |
| Fill cut loops with FPlanarHoleFiller, using a caller-provided triangulation function | Operations/MeshPlaneCut.h | ||
virtual bool MinimalHoleFill
(
int ConstantGroupID |
Operations/MeshPlaneCut.h | ||
virtual bool SimpleHoleFill
(
int ConstantGroupID |
Fill cut loops with FSimpleHoleFiller | Operations/MeshPlaneCut.h | |
virtual bool SplitEdgesOnly
(
bool bAssignNewGroups, |
Compute the plane cut by splitting mesh edges that cross the cut plane, and then optionally update groups | Operations/MeshPlaneCut.h | |
virtual bool SplitEdgesOnly
(
bool bAssignNewGroups |
Operations/MeshPlaneCut.h | ||
virtual void TransferTriangleLabelsToHoleFillTriangles
(
TDynamicMeshScalarTriangleAttribute< int >* TriLabels |
Operations/MeshPlaneCut.h | ||
virtual EOperationValidationResult Validate() |
Operations/MeshPlaneCut.h |
Protected
| Name | Remarks | Include Path | Unreal Specifiers |
|---|---|---|---|
void CollapseDegenerateEdges
(
const TSet< int >& OnCutEdges, |
Operations/MeshPlaneCut.h | ||
void CollapseDegenerateEdges
(
TSet< int >& Edges, |
Collapse degenerate edges | Operations/MeshPlaneCut.h | |
bool ExtractBoundaryLoops
(
const TSet< int >& OnCutEdges, |
Operations/MeshPlaneCut.h | ||
| Operations/MeshPlaneCut.h | |||
void SplitCrossingEdges
(
TArray< double >& Signs, |
Operations/MeshPlaneCut.h | ||
void SplitCrossingEdges
(
TArray< double >& Signs, |
Operations/MeshPlaneCut.h |