#include <LocalPlanarSimplify.h>
|
| static GEOMETRYCORE_API void | CollapseDegenerateEdges (FDynamicMesh3 &Mesh, TSet< int32 > &InOutEdges, bool bRemoveAllDegenerateFromInputSet=false, double DegenerateEdgeLenTol=UE_DOUBLE_SMALL_NUMBER, TSet< int > *TriangleSelection=nullptr) |
| |
| static GEOMETRYCORE_API bool | IsFlat (const FDynamicMesh3 &Mesh, int VID, double DotTolerance, FVector3d &OutFirstNormal) |
| |
| static GEOMETRYCORE_API bool | IsDevelopableAlongEdge (const FDynamicMesh3 &Mesh, int EID, int VID, double DotTolerance, FVector3d &NormalA, bool &bIsFlat) |
| |
| 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) |
| |
| 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) |
| |
◆ CollapseDegenerateEdges()
Collapse degenerate edges. Note that SimplifyAlongEdges currently assumes that this (or a similar pass) is run beforehand
- Parameters
-
| Mesh | Mesh to repair |
| InOutEdges | Set of edges to consider for collapse; optionally updated by removing edges at they are collapsed |
| bRemoveAllDegenerateFromInputSet | Whether we should also check whether the neighbor edges removed by collapse were also in the set. Note: Often not needed, and has additional processing cost. |
| DegenerateEdgeLenTol | Tolerance length at which we collapse edges |
| TriangleSelection | Optional set tracking an active selection. Any triangles removed by collapse will also be removed from the set. |
◆ CollapseWouldChangeShapeOrUVs()
| bool FLocalPlanarSimplify::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 |
UVEqualThresholdSq, |
|
|
bool |
bPreserveVertexNormals, |
|
|
float |
NormalEqualCosThreshold |
|
) |
| |
|
static |
Test if a given edge collapse would change the mesh shape, mesh triangle group shape, or UVs unacceptably
Test if a given edge collapse would change the mesh shape or UVs unacceptably
◆ CollapseWouldHurtTriangleQuality()
Test if a given edge collapse would cause a triangle flip or other unacceptable decrease in mesh quality Specialized for collapsing at flat triangles
- Parameters
-
| Mesh | The mesh to query |
| RemoveVNormal | Only used if bHasMultipleNormals==false, i.e. if the surface is locally flat, to avoid recomputing the normal. The normal for all triangles surrounding RemoveV. |
| RemoveV | The vertex to consider removing by an edge collapse |
| RemoveVPos | The position of the vertex RemoveV |
| KeepV | The vertex that is not being removed in the edge collapse |
| KeepVPos | The position of vertex KeepV |
| TryToImproveTriQualityThreshold | Threshold for triangle quality (see comment for class member, above) |
| bHasMultipleNormals | If false, assume the triangulation is locally flat, so we can use ExpectNormal instead of recomputing the expected normal |
Test if a given edge collapse would cause a triangle flip or other unacceptable decrease in mesh quality
◆ IsDevelopableAlongEdge()
Test if the triangles connected to a vertex could be flattened by folding along the given edge
- Parameters
-
| Mesh | The mesh to query |
| EID | The edge around which the triangles are allowed to fold |
| VID | The vertex to query |
| DotTolerance | If the dot product of two normals are >= this tolerance, the normals are considered equivalent |
| The | normal of the first triangle attached to the vertex. |
- Returns
- Whether all the triangles were coplanar
◆ IsFlat()
Test if the triangles connected to a vertex are all coplanar
- Parameters
-
| Mesh | The mesh to query |
| VID | The vertex to query |
| DotTolerance | If the dot product of two normals are >= this tolerance, the normals are considered equivalent |
| The | normal of the first triangle attached to the vertex. |
- Returns
- Whether all the triangles were coplanar
◆ SimplifyAlongEdges()
Simplify Mesh along the given edges, and update the edge set accordingly
- Parameters
-
| Mesh | Mesh to simplify |
| InOutEdges | Edges to simplify along – will be updated to remove any edges that have been collapsed by simplification |
| ProcessCollapse | Optional function to be called whenever the simplification collapses an edge |
◆ bPreserveOverlayUVs
| bool UE::Geometry::FLocalPlanarSimplify::bPreserveOverlayUVs = true |
Prevent simplification from distorting overlay UVs
◆ bPreserveTriangleGroups
| bool UE::Geometry::FLocalPlanarSimplify::bPreserveTriangleGroups = true |
Prevent simplification from distorting triangle groups
◆ bPreserveVertexNormals
| bool UE::Geometry::FLocalPlanarSimplify::bPreserveVertexNormals = true |
Prevent simplification from distorting vertex normals
◆ bPreserveVertexUVs
| bool UE::Geometry::FLocalPlanarSimplify::bPreserveVertexUVs = true |
Prevent simplification from distorting vertex UVs
◆ NormalDistortTolerance
| float UE::Geometry::FLocalPlanarSimplify::NormalDistortTolerance = .01f |
When preserving normals, sets maximum allowed change in normals from collapsing an edge, measured at the removed vertex in degrees
◆ SimplificationAngleTolerance
| double UE::Geometry::FLocalPlanarSimplify::SimplificationAngleTolerance = .1 |
Degrees of deviation from coplanar that we will still simplify
◆ TryToImproveTriQualityThreshold
| double UE::Geometry::FLocalPlanarSimplify::TryToImproveTriQualityThreshold = .25 |
If triangle quality (aspect ratio) is worse than this threshold, only simplify in ways that improve quality. If <= 0, triangle quality is ignored. Note: For aspect ratio we use definition: 4*TriArea / (sqrt(3)*MaxEdgeLen^2), ref: https://people.eecs.berkeley.edu/~jrs/papers/elemj.pdf p.53 Equilateral triangles have value 1; Smaller values -> lower quality
◆ UVDistortTolerance
| float UE::Geometry::FLocalPlanarSimplify::UVDistortTolerance = FMathf::ZeroTolerance |
When preserving UVs, sets maximum allowed change in UV coordinates from collapsing an edge, measured at the removed vertex
The documentation for this class was generated from the following files: