UDocumentation UE5.7 10.02.2026 (Source)
API documentation for Unreal Engine 5.7
MeshMeshCut.h
Go to the documentation of this file.
1// Copyright Epic Games, Inc. All Rights Reserved.
2
3// Port of geometry3Sharp MeshMeshCut
4
5// Functionality to cut a mesh with itself (FMeshSelfCut) or with another mesh (FMeshMeshCut)
6
7#pragma once
8
9#include "MathUtil.h"
10#include "VectorTypes.h"
11#include "GeometryTypes.h"
13#include "Spatial/MeshAABBTree3.h" // for MeshIntersection::FIntersectionsQueryResult
14
16
17namespace UE
18{
19namespace Geometry
20{
21
23{
24public:
25 //
26 // Inputs
27 //
28
31
33 double SnapTolerance = FMathf::ZeroTolerance * 100.0;
34
36 bool bCutCoplanar = false;
37
40
53
57
62 {
63 // @todo validate inputs
65 }
66
72
74 {
76 }
77
78 // TODO: pull out all internal functionality from the private section of FMeshMeshCut, put as much of it as possible on FCutWorkingInfo, move all that to the cpp file!
79 // and then re-use the functionality for self-cutting
80};
81
86{
87public:
88
89 //
90 // Inputs
91 //
92
95
97 double SnapTolerance = FMathf::ZeroTolerance * 100.0;
98
100 bool bMutuallyCut = true;
101
103 bool bCutCoplanar = false;
104
107
120
128
129
133
138 {
139 // @todo validate inputs
141 }
142
148
149
151 {
152 for (int MeshIdx = 0; MeshIdx < 2; MeshIdx++) // reset both regardless of how many will be processed next
153 {
156 }
157 }
158};
159
160
161} // end namespace UE::Geometry
162} // end namespace UE
UE_FORCEINLINE_HINT TSharedRef< CastToType, Mode > StaticCastSharedRef(TSharedRef< CastFromType, Mode > const &InSharedRef)
Definition SharedPointer.h:127
Definition Array.h:670
void Reset(SizeType NewSize=0)
Definition Array.h:2246
Definition DynamicMesh3.h:108
Definition MeshMeshCut.h:86
void ResetOutputs()
Definition MeshMeshCut.h:150
double SnapTolerance
Definition MeshMeshCut.h:97
bool bTrackInsertedVertices
Definition MeshMeshCut.h:106
bool bMutuallyCut
Definition MeshMeshCut.h:100
FMeshMeshCut(FDynamicMesh3 *MeshA, FDynamicMesh3 *MeshB)
Definition MeshMeshCut.h:130
GEOMETRYCORE_API bool Cut(const MeshIntersection::FIntersectionsQueryResult &Intersections)
Definition MeshMeshCut.cpp:590
FDynamicMesh3 * Mesh[2]
Definition MeshMeshCut.h:94
bool bCutCoplanar
Definition MeshMeshCut.h:103
TArray< int > VertexChains[2]
Definition MeshMeshCut.h:119
TArray< int > SegmentToChain[2]
Definition MeshMeshCut.h:127
EOperationValidationResult Validate()
Definition MeshMeshCut.h:137
Definition MeshMeshCut.h:23
bool bCutCoplanar
Definition MeshMeshCut.h:36
FDynamicMesh3 * Mesh
Definition MeshMeshCut.h:30
GEOMETRYCORE_API bool Cut(const MeshIntersection::FIntersectionsQueryResult &Intersections)
Definition MeshMeshCut.cpp:575
TArray< int > VertexChains
Definition MeshMeshCut.h:52
double SnapTolerance
Definition MeshMeshCut.h:33
void ResetOutputs()
Definition MeshMeshCut.h:73
bool bTrackInsertedVertices
Definition MeshMeshCut.h:39
FMeshSelfCut(FDynamicMesh3 *Mesh)
Definition MeshMeshCut.h:54
EOperationValidationResult Validate()
Definition MeshMeshCut.h:61
EOperationValidationResult
Definition GeometryTypes.h:59
Definition AdvancedWidgetsModule.cpp:13
Definition MeshAABBTree3.h:40