UDocumentation UE5.7 10.02.2026 (Source)
API documentation for Unreal Engine 5.7
LocalPlanarSimplify.h
Go to the documentation of this file.
1// Copyright Epic Games, Inc. All Rights Reserved.
2
3// Port of geometry3Sharp MeshPlaneCut
4
5#pragma once
6
7#include "MathUtil.h"
8#include "VectorTypes.h"
9#include "GeometryTypes.h"
11
12
13namespace UE
14{
15namespace Geometry
16{
17
18class FDynamicMesh3;
19
20
21//
22// Class to support local planar simplification, to reduce excess edges created by plane cuts, edge loop insertions, and similar operations
23// (Note a custom version of this logic also exists on the FMeshBoolean class)
24//
26{
27public:
28 // Simplification settings
29
41 bool bPreserveVertexUVs = true;
45 float UVDistortTolerance = FMathf::ZeroTolerance;
50
51
59
69
70
71 //
72 // The below helper functions are used by SimplifyAlongEdges, but also the similar customized versions of the same algorithm in FMeshBoolean and FMeshSelfUnion as well
73 //
74
83 static GEOMETRYCORE_API bool IsFlat(const FDynamicMesh3& Mesh, int VID, double DotTolerance, FVector3d& OutFirstNormal);
84
94 static GEOMETRYCORE_API bool IsDevelopableAlongEdge(const FDynamicMesh3& Mesh, int EID, int VID, double DotTolerance, FVector3d& NormalA, bool& bIsFlat);
95
112 );
113
118 const FDynamicMesh3& Mesh, const TSet<int>& PathEdgeSet, double DotTolerance, int SourceEID,
123
124};
125
126} // end namespace UE::Geometry
127} // end namespace UE
FPlatformTypes::int32 int32
A 32-bit signed integer.
Definition Platform.h:1125
UE_FORCEINLINE_HINT TSharedRef< CastToType, Mode > StaticCastSharedRef(TSharedRef< CastFromType, Mode > const &InSharedRef)
Definition SharedPointer.h:127
#define UE_DOUBLE_SMALL_NUMBER
Definition UnrealMathUtility.h:139
Definition FunctionFwd.h:19
Definition DynamicMesh3.h:108
Definition LocalPlanarSimplify.h:26
float NormalDistortTolerance
Definition LocalPlanarSimplify.h:49
float UVDistortTolerance
Definition LocalPlanarSimplify.h:45
bool bPreserveVertexNormals
Definition LocalPlanarSimplify.h:47
static GEOMETRYCORE_API bool IsDevelopableAlongEdge(const FDynamicMesh3 &Mesh, int EID, int VID, double DotTolerance, FVector3d &NormalA, bool &bIsFlat)
Definition LocalPlanarSimplify.cpp:36
double SimplificationAngleTolerance
Definition LocalPlanarSimplify.h:31
bool bPreserveVertexUVs
Definition LocalPlanarSimplify.h:41
bool bPreserveTriangleGroups
Definition LocalPlanarSimplify.h:39
static GEOMETRYCORE_API bool CollapseWouldChangeShapeOrUVs(const FDynamicMesh3 &Mesh, const TSet< int > &PathEdgeSet, double DotTolerance, int SourceEID, int32 RemoveV, const FVector3d &RemoveVPos, int32 KeepV, const FVector3d &KeepVPos, const FVector3d &EdgeDir, bool bPreserveTriangleGroups, bool bPreserveUVsForMesh, bool bPreserveVertexUVs, bool bPreserveOverlayUVs, float UVToleranceSq, bool bPreserveVertexNormals, float NormalEqualCosThreshold)
Definition LocalPlanarSimplify.cpp:164
static GEOMETRYCORE_API bool CollapseWouldHurtTriangleQuality(const FDynamicMesh3 &Mesh, const FVector3d &RemoveVNormal, int32 RemoveV, const FVector3d &RemoveVPos, int32 KeepV, const FVector3d &KeepVPos, double TryToImproveTriQualityThreshold, bool bHasMultipleNormals=false)
Definition LocalPlanarSimplify.cpp:73
static GEOMETRYCORE_API bool IsFlat(const FDynamicMesh3 &Mesh, int VID, double DotTolerance, FVector3d &OutFirstNormal)
Definition LocalPlanarSimplify.cpp:12
double TryToImproveTriQualityThreshold
Definition LocalPlanarSimplify.h:37
GEOMETRYCORE_API void SimplifyAlongEdges(FDynamicMesh3 &Mesh, TSet< int32 > &InOutEdges, TUniqueFunction< void(const DynamicMeshInfo::FEdgeCollapseInfo &)> ProcessCollapse=nullptr) const
Definition LocalPlanarSimplify.cpp:391
bool bPreserveOverlayUVs
Definition LocalPlanarSimplify.h:43
static GEOMETRYCORE_API void CollapseDegenerateEdges(FDynamicMesh3 &Mesh, TSet< int32 > &InOutEdges, bool bRemoveAllDegenerateFromInputSet=false, double DegenerateEdgeLenTol=UE_DOUBLE_SMALL_NUMBER, TSet< int > *TriangleSelection=nullptr)
Definition LocalPlanarSimplify.cpp:517
Definition AdvancedWidgetsModule.cpp:13
Definition InfoTypes.h:181