FDynamicMesh3

[FDynamicMesh3](API\Plugins\DynamicMesh\FDynamicMesh3) is a dynamic triangle mesh class.

Windows
MacOS
Linux

References

Module

DynamicMesh

Header

/Engine/Plugins/Experimental/GeometryProcessing/Source/DynamicMesh/Public/DynamicMesh3.h

Include

#include "DynamicMesh3.h"

Syntax

class FDynamicMesh3

Remarks

FDynamicMesh3 is a dynamic triangle mesh class. The mesh has has connectivity, is an indexed mesh, and allows for gaps in the index space.

internally, all data is stored in POD-type buffers, except for the vertex->edge links, which are stored as List<int>'s. The arrays of POD data are stored in TDynamicVector 's, so they grow in chunks, which is relatively efficient. The actual blocks are arrays, so they can be efficiently mem-copied into larger buffers if necessary.

Reference counts for verts/tris/edges are stored as separate FRefCountVector instances.

Vertices are stored as doubles, although this should be easily changed if necessary, as the internal data structure is not exposed

Per-vertex Vertex Normals, Colors, and UVs are optional and stored as floats.

For each vertex, VertexEdgeLists[i] is the unordered list of connected edges. The elements of the list are indices into the edges list. This list is unsorted but can be traversed in-order (ie cw/ccw) at some additional cost.

Triangles are stored as 3 ints, with optionally a per-triangle integer group id.

The edges of a triangle are similarly stored as 3 ints, in triangle_edes. If the triangle is [v1,v2,v3], then the triangle edges [e1,e2,e3] are e1=edge(v1,v2), e2=edge(v2,v3), e3=edge(v3,v1), where the e# are indexes into edges.

Edges are stored as tuples of 4 ints. If the edge is between v1 and v2, with neighbour tris t1 and t2, then the edge is [min(v1,v2) , max(v1,v2) , t1, t2]. For a boundary edge, t2 is InvalidID. t1 is never InvalidID.

Most of the class assumes that the mesh is manifold. Many functions will work if the topology is non-manifold, but behavior of operators like Split/Flip/Collapse edge is untested.

The function CheckValidity() does extensive sanity checking on the mesh data structure. Use this to test your code, both for mesh construction and editing!!

TODO:

  • Many of the iterators depend on lambda functions, can we replace these with calls to internal/static functions that do the same thing?

  • efficient TriTrianglesItr() implementation?

  • additional Topology timestamp?

  • CompactInPlace() does not compact VertexEdgeLists ? TDynamicVector w/ 'stride' option, so that we can guarantee that tuples are in single block. The can have custom accessor that looks up entire tuple

Variables

Name Description

Protected variable

TUniquePtr < FDy ...

 

AttributeSet

Protected variable

bool

 

bIsClosedCached

Cached value of IsClosed()

Protected variable

FAxisAlignedBox ...

 

CachedBoundingBox

Cached vertex bounding box (includes unreferenced vertices)

Protected variable

int

 

CachedBoundingBoxTimestamp

Timestamp for CachedBoundingBox, if less than current timestamp, cache is invalid

Protected variable

int

 

CachedIsClosedTimestamp

Timestamp for bIsClosedCached, if less than current timestamp, cache is invalid

Protected variable

FRefCountVector

 

EdgeRefCounts

Reference counts of edge indices.

Protected variable

TDynamicVector <...

 

Edges

List of edge elements.

Protected variable

int

 

GroupIDCounter

Upper bound on the triangle group IDs used in the mesh (may be larger than the actual maximum if triangles have been deleted)

Protected variable

int

 

ShapeTimestamp

The shape timestamp is incremented any time a function that modifies the mesh shape or topology is called

Protected variable

int

 

Timestamp

The mesh timestamp is incremented any time a function that modifies the mesh is called

Protected variable

int

 

TopologyTimestamp

The topology timestamp is incremented any time a function that modifies the mesh topology is called

Protected variable

TDynamicVector <...

 

TriangleEdges

List of triangle edge triplets [Edge0 Edge1 Edge2]

Protected variable

TOptional < TDyn ...

 

TriangleGroups

(optional) List of per-triangle group identifiers

Protected variable

FRefCountVector

 

TriangleRefCounts

Reference counts of triangle indices.

Protected variable

TDynamicVector <...

 

Triangles

List of triangle vertex-index triplets [Vert0 Vert1 Vert2]

Protected variable

TOptional < TDyn ...

 

VertexColors

(optional) List of per-vertex colors

Protected variable

FSmallListSet

 

VertexEdgeLists

List of per-vertex edge one-rings

Protected variable

TOptional < TDyn ...

 

VertexNormals

(optional) List of per-vertex normals

Protected variable

FRefCountVector

 

VertexRefCounts

Reference counts of vertex indices.

Protected variable

TOptional < TDyn ...

 

VertexUVs

(optional) List of per-vertex uv's

Protected variable

TDynamicVector <...

 

Vertices

List of vertex positions

Constructors

Name Description

Public function

FDynamicMesh3()

Default constructor

Public function

FDynamicMesh3

(
    const FDynamicMesh3 & CopyMesh
)

Copy/Move construction

Public function

FDynamicMesh3

(
    FDynamicMesh3 && MoveMesh
)

Public function

FDynamicMesh3

(
    EMeshComponents flags
)

Default constructor

Public function

FDynamicMesh3

(
    const FMeshShapeGenerator * Gen...
)

Construction from Mesh Generator

Public function

FDynamicMesh3

(
    bool bWantNormals,
    bool bWantColors,
    bool bWantUVs,
    bool bWantTriGroups
)

Construct an empty mesh with specified attributes

Destructors

Name Description

Public function Virtual

~FDynamicMesh3()

Destructor

Functions

Name Description

Protected function

int

 

AddEdgeInternal

(
    int vA,
    int vB,
    int tA,
    int tB
)

Protected function

void

 

AddTriangleEdge

(
    int TriangleID,
    int v0,
    int v1,
    int j,
    int EdgeID
)

Protected function

int

 

AddTriangleInternal

(
    int a,
    int b,
    int c,
    int e0,
    int e1,
    int e2
)

Protected function

void

 

AllocateEdgesList

(
    int VertexID
)

Public function

int

 

AllocateTriangleGroup()

Public function

int

 

AppendTriangle

(
    int Vertex0,
    int Vertex1,
    int Vertex2,
    int GroupID
)

Public function

int

 

AppendTriangle

(
    const FIndex3i & TriVertices,
    int GroupID
)

Public function

int

 

AppendVertex

(
    const FVector3d & Position
)

Append vertex at position, returns vid

Public function

int

 

AppendVertex

(
    const FDynamicMesh3 & SourceMesh,
    int SourceVertexID
)

Copy vertex SourceVertexID from existing SourceMesh, returns new vertex id

Public function

int

 

AppendVertex

(
    const FVertexInfo& VertInfo
)

Mesh ConstructionAppend vertex at position and other fields, returns vid

Public function

FDynamicMesh ...

 

Attributes()

Public function Const

const FDynam ...

 

Attributes()

Public function Virtual

void

 

BeginUnsafeTrianglesInsert()

Call this before a set of unsafe InsertTriangle() calls

Public function Virtual

void

 

BeginUnsafeVerticesInsert()

Support for inserting vertex and triangle at specific IDs.

Public function Const

FRefCountVec ...

 

BoundaryEdgeIndicesItr()

Public function Const

double

 

CalculateWindingNumber

(
    const FVector3d & QueryPoint
)

Compute mesh winding number, from Jacobson et.

Public function Virtual Const

bool

 

CheckValidity

(
    FValidityOptions ValidityOptions,
    EValidityCheckFailMode FailMode
)

Checks that the mesh is well-formed, ie all internal data structures are consistent

Public function

void

 

Clear()

Discard all data

Public function Virtual

EMeshResult

 

CollapseEdge

(
    int KeepVertID,
    int RemoveVertID,
    double EdgeParameterT,
    FEdgeCollapseInfo & CollapseInfo
)

Collapse the edge between the two vertices, if topologically possible.

Public function Virtual

EMeshResult

 

CollapseEdge

(
    int KeepVertID,
    int RemoveVertID,
    FEdgeCollapseInfo & CollapseInfo
)

Public function

void

 

CompactCopy

(
    const FDynamicMesh3 & CopyMesh,
    bool bNormals,
    bool bColors,
    bool bUVs,
    bool bAttributes,
    FCompactMaps * CompactInfo
)

Copy input mesh while compacting, i.e. removing unused vertices/triangles/edges

Public function

void

 

CompactInPlace

(
    FCompactMaps * CompactInfo
)

Mesh Edit operations Compact mesh in-place, by moving vertices around and rewriting indices.

Public function Const

double

 

CompactMetric()

Returns measure of compactness in range [0,1], where 1 is fully compacted

Public function

void

 

Copy

(
    const FDynamicMesh3 & CopyMesh,
    bool bNormals,
    bool bColors,
    bool bUVs,
    bool bAttributes
)

Set internal data structures to be a copy of input mesh using the specified attributes

Public function

void

 

Copy

(
    const FMeshShapeGenerator * Gen...
)

Initialize mesh from the output of a MeshShapeGenerator (assumes Generate() was already called)

Public function

void

 

DiscardAttributes()

Public function

void

 

DiscardTriangleGroups()

Public function

void

 

DiscardVertexColors()

Public function

void

 

DiscardVertexNormals()

Public function

void

 

DiscardVertexUVs()

Public function Const

int

 

EdgeCount()

Protected function Const

bool

 

EdgeHasTriangle

(
    int EdgeID,
    int TriangleID
)

Protected function Const

bool

 

EdgeHasVertex

(
    int EdgeID,
    int VertexID
)

Public function Const

edge_iterato ...

 

EdgeIndicesItr()

Public function Const

value_iterat ...

 

EdgesItr()

Enumerate edges.

Public function

void

 

EnableAttributes()

Public function

void

 

EnableTriangleGroups

(
    int InitialGroupID
)

Public function

void

 

EnableVertexColors

(
    const FVector3f & InitialColor
)

Public function

void

 

EnableVertexNormals

(
    const FVector3f & InitialNormal
)

Vertex and Triangle attribute arrays

Public function

void

 

EnableVertexUVs

(
    const FVector2f & InitialUV
)

Public function Virtual

void

 

EndUnsafeTrianglesInsert()

Call after a set of unsafe InsertTriangle() calls to rebuild free list

Public function Virtual

void

 

EndUnsafeVerticesInsert()

Call after a set of unsafe InsertVertex() calls to rebuild free list

Public function Const

int

 

FindEdge

(
    int VertexA,
    int VertexB
)

Find id of edge connecting A and B

Public function Const

int

 

FindEdgeFromTri

(
    int VertexA,
    int VertexB,
    int TriangleID
)

Find edgeid for edge [a,b] from triangle that contains the edge.

Public function Const

int

 

FindEdgeFromTriPair

(
    int TriangleA,
    int TriangleB
)

Find edgeid for edge connecting two triangles

Public function Const

int

 

FindTriangle

(
    int A,
    int B,
    int C
)

Find triangle made up of any permutation of vertices [a,b,c]

Protected function Const

int

 

FindTriangleEdge

(
    int TriangleID,
    int vA,
    int vB
)

Returns edge ID

Public function Virtual

EMeshResult

 

FlipEdge

(
    int EdgeVertA,
    int EdgeVertB,
    FEdgeFlipInfo & FlipInfo
)

Calls FlipEdge() on the edge between two vertices, if it exists

Public function Virtual

EMeshResult

 

FlipEdge

(
    int EdgeAB,
    FEdgeFlipInfo & FlipInfo
)

Flip/Rotate an edge of the mesh.

Public function Const

bool

 

GetAllVertexGroups

(
    int VertexID,
    TArray < int >& GroupsOut
)

Returns all group IDs at vertex

Public function Const

int

 

GetAllVtxBoundaryEdges

(
    int VertexID,
    TArray < int >& EdgeListOut
)

Find edge ids of boundary edges connected to vertex.

Public function Const

FAxisAligned ...

 

GetBounds()

Geometric queriesReturns bounding box of all mesh vertices (including unreferenced vertices)

Public function

FAxisAligned ...

 

GetCachedBounds()

Returns GetBounds() and saves result, cache is invalidated and recomputed if topology has changed since last call

Public function

bool

 

GetCachedIsClosed()

Public function

const TDynam ...

 

GetColorsBuffer()

Public function Const

int

 

GetComponentsFlags()

Public function Const

FIndex4i

 

GetEdge

(
    int EdgeID
)

Get the vertices and triangles of an edge, returned as [v0,v1,t0,t1], where t1 may be InvalidID

Public function Const

FVector3d

 

GetEdgeNormal

(
    int EdgeID
)

Returns average normal of connected face normals

Public function Const

FIndex2i

 

GetEdgeOpposingV

(
    int EdgeID
)

If edge has vertices [a,b], and is connected two triangles [a,b,c] and [a,b,d], this returns [c,d], or [c,InvalidID] for a boundary edge

Public function Const

FVector3d

 

GetEdgePoint

(
    int EdgeID,
    double ParameterT
)

Get point along edge, t clamped to range [0,1]

Public function

const TDynam ...

 

GetEdgesBuffer()

Public function

const FRefCo ...

 

GetEdgesRefCounts()

Public function Const

FIndex2i

 

GetEdgeT

(
    int EdgeID
)

Get the triangle pair for an edge. The second triangle may be InvalidID

Public function Const

FIndex2i

 

GetEdgeV

(
    int EdgeID
)

Get the vertex pair for an edge

Public function Const

bool

 

GetEdgeV

(
    int EdgeID,
    FVector3d & a,
    FVector3d & b
)

Get the vertex positions of an edge

Public function Const

int

 

GetMaxVtxEdgeCount()

Public function

const TDynam ...

 

GetNormalsBuffer()

Protected function Const

FIndex2i

 

GetOrderedOneRingEdgeTris

(
    int VertexID,
    int EdgeID
)

Utility function that returns one or two triangles of edge, used to enumerate vertex one-ring triangles The logic is a bit tricky to follow without drawing it out on paper, but this will only return each triangle once, for the 'outgoing' edge from the vertex, and each triangle only has one such edge at any vertex (including boundary triangles)

Public function Const

FIndex2i

 

GetOrientedBoundaryEdgeV

(
    int EdgeID
)

Return edge vertex indices, but oriented based on attached triangle (rather than min-sorted)

Protected function Const

int

 

GetOtherEdgeTriangle

(
    int EdgeID,
    int TriangleID
)

Protected function Const

int

 

GetOtherEdgeVertex

(
    int EdgeID,
    int VertexID
)

Public function Const

int

 

GetShapeTimestamp()

ShapeTimestamp is incremented any time any vertex position is changed or the mesh topology is modified

Public function Const

int

 

GetTimestamp()

Timestamp is incremented any time any change is made to the mesh

Public function Const

int

 

GetTopologyTimestamp()

TopologyTimestamp is incremented any time any vertex position is changed or the mesh topology is modified

Public function Const

FIndex3i

 

GetTriangle

(
    int TriangleID
)

Get triangle vertices

Public function Const

int

 

GetTriangleGroup

(
    int tID
)

Public function

const TDynam ...

 

GetTriangleGroupsBuffer()

Public function

const TDynam ...

 

GetTrianglesBuffer()

Public function

const FRefCo ...

 

GetTrianglesRefCounts()

Public function Const

double

 

GetTriArea

(
    int TriangleID
)

Calculate area triangle

Public function Const

FVector3d

 

GetTriBaryNormal

(
    int TriangleID,
    double Bary0,
    double Bary1,
    double Bary2
)

Interpolate vertex normals of triangle using barycentric coordinates

Public function Const

FVector3d

 

GetTriBaryPoint

(
    int TriangleID,
    double Bary0,
    double Bary1,
    double Bary2
)

Interpolate vertex positions of triangle using barycentric coordinates

Public function Const

void

 

GetTriBaryPoint

(
    int TriangleID,
    double Bary0,
    double Bary1,
    double Bary2,
    FVertexInfo& VertInfo
)

Compute interpolated vertex attributes at point of triangle

Public function Const

FAxisAligned ...

 

GetTriBounds

(
    int TriangleID
)

Construct bounding box of triangle as efficiently as possible

Public function Const

FVector3d

 

GetTriCentroid

(
    int TriangleID
)

Compute centroid of triangle

Public function Const

int

 

GetTriEdge

(
    int TriangleID,
    int j
)

Get one of the edges of a triangle

Public function Const

FIndex3i

 

GetTriEdges

(
    int TriangleID
)

Get triangle edges

Public function Const

FFrame3d

 

GetTriFrame

(
    int TriangleID,
    int Edge
)

Construct stable frame at triangle centroid, where frame.Z is face normal, and frame.X is aligned with edge nEdge of triangle.

Public function Const

void

 

GetTriInfo

(
    int TriangleID,
    FVector3d & Normal,
    double& Area,
    FVector3d & Centroid
)

Compute triangle normal, area, and centroid all at once.

Public function Const

double

 

GetTriInternalAngleR

(
    int TriangleID,
    int i
)

Compute internal angle at vertex i of triangle (where i is 0,1,2);

Public function Const

FVector3d

 

GetTriInternalAnglesR

(
    int TriangleID
)

Compute internal angles at all vertices of triangle

Public function Const

FIndex3i

 

GetTriNeighbourTris

(
    int TriangleID
)

Find the neighbour triangles of a triangle (any of them might be InvalidID)

Public function Const

FVector3d

 

GetTriNormal

(
    int TriangleID
)

Calculate face normal of triangle

Public function Const

double

 

GetTriSolidAngle

(
    int TriangleID,
    const FVector3d & p
)

Compute solid angle of oriented triangle tID relative to point p - see WindingNumber()

Public function Const

FVector3d

 

GetTriVertex

(
    int TriangleID,
    int j
)

Get the position of one of the vertices of a triangle

Public function Const

void

 

GetTriVertices

(
    int TriangleID,
    FVector3d & v0,
    FVector3d & v1,
    FVector3d & v2
)

Get the three vertex positions of a triangle

Public function

const TDynam ...

 

GetUVBuffer()

Public function Const

FVector3d

 

GetVertex

(
    int VertexID
)

Vertex/Tri/Edge accessors

Public function Const

bool

 

GetVertex

(
    int VertexID,
    FVertexInfo& VertInfo,
    bool bWantNormals,
    bool bWantColors,
    bool bWantUVs
)

Get extended vertex information

Public function Const

FVector3f

 

GetVertexColor

(
    int vID
)

Public function

const FSmall ...

 

GetVertexEdges()

Protected function Const

void

 

GetVertexEdgesList

(
    int VertexID,
    TArray < int >& EdgesOut
)

Public function Const

FFrame3d

 

GetVertexFrame

(
    int VertexID,
    bool bFrameNormalY
)

Compute a normal/tangent frame at vertex that is "stable" as long as the mesh topology doesn't change, meaning that one axis of the frame will be computed from projection of outgoing edge.

Public function Const

bool

 

GetVertexGroups

(
    int VertexID,
    FIndex4i & GroupsOut
)

Returns up to 4 group IDs at vertex. Returns false if > 4 encountered

Public function Const

FVertexInfo

 

GetVertexInfo

(
    int VertexID
)

Get all vertex information available

Public function Const

FVector3f

 

GetVertexNormal

(
    int vID
)

Public function Const

void

 

GetVertexOneRingTriangles

(
    int VertexID,
    TArray < int >& TrianglesOut
)

Adds triangles touching VertexID to the TrianglesOut list

Public function Const

FVector2f

 

GetVertexUV

(
    int vID
)

Public function

const TDynam ...

 

GetVerticesBuffer()

Direct buffer access

Public function

const FRefCo ...

 

GetVerticesRefCounts()

Public function Const

int

 

GetVtxBoundaryEdges

(
    int VertexID,
    int& Edge0Out,
    int& Edge1Out
)

Returns count of boundary edges at vertex, and the first two boundary edges if found.

Public function Const

EMeshResult

 

GetVtxContiguousTriangles

(
    int VertexID,
    TArray < int >& TrianglesOut,
    TArray < int >& ContiguousGroupLeng...,
    TArray < bool >& GroupIsLoop
)

Get triangles connected to vertex in contiguous order, with multiple groups if vertex is a bowtie.

Public function Const

int

 

GetVtxEdgeCount

(
    int VertexID
)

Public function Const

void

 

GetVtxNbrhood

(
    int EdgeID,
    int VertexID,
    int& OtherVertOut,
    int& OppVert1Out,
    int& OppVert2Out,
    int& Tri1Out,
    int& Tri2Out
)

Given an edge and vertex on that edge, returns other vertex of edge, the two opposing verts, and the two connected triangles (OppVert2Out and Tri2Out are be InvalidID for boundary edge)

Public function Const

void

 

GetVtxOneRingCentroid

(
    int VertexID,
    FVector3d & CentroidOut
)

Fastest possible one-ring centroid.

Public function Const

int

 

GetVtxTriangleCount

(
    int VertexID,
    bool bBruteForce
)

Return # of triangles attached to vID, or -1 if invalid vertex if bBruteForce = true, explicitly checks, which creates a list and is expensive default is false, uses orientation, no memory allocation

Public function Const

EMeshResult

 

GetVtxTriangles

(
    int VertexID,
    TArray < int >& TrianglesOut,
    bool bUseOrientation
)

Get triangle one-ring at vertex.

Public function Const

bool

 

HasAttributes()

Public function Const

bool

 

HasTriangleGroups()

Public function Const

bool

 

HasVertexColors()

Public function Const

bool

 

HasVertexNormals()

Public function Const

bool

 

HasVertexUVs()

Public function

EMeshResult

 

InsertTriangle

(
    int TriangleID,
    const FIndex3i & TriVertices,
    int GroupID,
    bool bUnsafe
)

Insert triangle at given index, assuming it is unused.

Public function

EMeshResult

 

InsertVertex

(
    int VertexID,
    const FVertexInfo& VertInfo,
    bool bUnsafe
)

Insert vertex at given index, assuming it is unused.

Public function Const

bool

 

IsBoundaryEdge

(
    int EdgeID
)

Topological queriesReturns true if edge is on the mesh boundary, ie only connected to one triangle

Public function Const

bool

 

IsBoundaryTriangle

(
    int TriangleID
)

Returns true if any edge of triangle is a boundary edge

Public function Const

bool

 

IsBoundaryVertex

(
    int VertexID
)

Returns true if the vertex is part of any boundary edges

Public function Const

bool

 

IsBowtieVertex

(
    int VertexID
)

Returns true if vID is a "bowtie" vertex, ie multiple disjoint triangle sets in one-ring

Public function Const

bool

 

IsClosed()

Public function Const

bool

 

IsCompact()

Returns true if vertices, edges, and triangles are all dense (Count == MaxID)

Public function Const

bool

 

IsCompactT()

Public function Const

bool

 

IsCompactV()

Public function Const

bool

 

IsEdge

(
    int EdgeID
)

Public function Const

bool

 

IsGroupBoundaryEdge

(
    int EdgeID
)

Returns true if the two triangles connected to edge have different group IDs

Public function Const

bool

 

IsGroupBoundaryVertex

(
    int VertexID
)

Returns true if vertex has more than one tri group in its tri nbrhood

Public function Const

bool

 

IsGroupJunctionVertex

(
    int VertexID
)

Returns true if more than two group boundary edges meet at vertex (ie 3+ groups meet at this vertex)

Public function Const

bool

 

IsReferencedVertex

(
    int VertexID
)

Public function Virtual

bool

 

IsSameMesh

(
    const FDynamicMesh3 & OtherMesh,
    bool bCheckConnectivity,
    bool bCheckEdgeIDs,
    bool bCheckNormals,
    bool bCheckColors,
    bool bCheckUVs,
    bool bCheckGroups,
    float Epsilon
)

Check if another mesh is the same as this mesh.

Public function Const

bool

 

IsTriangle

(
    int TriangleID
)

Public function Const

bool

 

IsVertex

(
    int VertexID
)

Public function Const

int

 

MaxEdgeID()

Public function Const

int

 

MaxGroupID()

Public function Const

int

 

MaxTriangleID()

Public function Const

int

 

MaxVertexID()

Public function Virtual

EMeshResult

 

MergeEdges

(
    int KeepEdgeID,
    int DiscardEdgeID,
    FMergeEdgesInfo & MergeInfo
)

Given two edges of the mesh, weld both their vertices, so that one edge is removed.

Public function Virtual

FString

 

MeshInfoString()

Debug utility functions Returns a debug string that contains mesh statistics and other information

Public function Virtual

EMeshResult

 

PokeTriangle

(
    int TriangleID,
    const FVector3d & BaryCoordinates,
    FPokeTriangleInfo & PokeInfo
)

Insert a new vertex inside a triangle, ie do a 1 to 3 triangle split

Public function Virtual

EMeshResult

 

PokeTriangle

(
    int TriangleID,
    FPokeTriangleInfo & PokeInfo
)

Call PokeTriangle at the centroid of the triangle

Public function

EMeshResult

 

RemoveTriangle

(
    int TriangleID,
    bool bRemoveIsolatedVertices,
    bool bPreserveManifold
)

Remove a triangle from the mesh.

Public function

EMeshResult

 

RemoveVertex

(
    int VertexID,
    bool bRemoveAllTriangles,
    bool bPreserveManifold
)

Remove vertex vID, and all connected triangles if bRemoveAllTriangles = true Returns Failed_VertexStillReferenced if vertex is still referenced by triangles.

Protected function

int

 

ReplaceEdgeTriangle

(
    int EdgeID,
    int tOld,
    int tNew
)

Protected function

int

 

ReplaceEdgeVertex

(
    int EdgeID,
    int vOld,
    int vNew
)

Protected function

int

 

ReplaceTriangleEdge

(
    int EdgeID,
    int eOld,
    int eNew
)

Protected function

int

 

ReplaceTriangleVertex

(
    int TriangleID,
    int vOld,
    int vNew
)

Public function

void

 

ReverseOrientation

(
    bool bFlipNormals
)

Reverse the ccw/cw orientation of all triangles in the mesh, and optionally flip the vertex normals if they exist

Public function

EMeshResult

 

ReverseTriOrientation

(
    int TriangleID
)

Reverse the ccw/cw orientation of a triangle

Protected function

void

 

ReverseTriOrientationInternal

(
    int TriangleID
)

Protected function

void

 

SetEdgeTrianglesInternal

(
    int EdgeID,
    int t0,
    int t1
)

Protected function

void

 

SetEdgeVerticesInternal

(
    int EdgeID,
    int a,
    int b
)

Public function Virtual

EMeshResult

 

SetTriangle

(
    int TriangleID,
    const FIndex3i & NewVertices,
    bool bRemoveIsolatedVertices
)

Rewrite the triangle to reference the new tuple of vertices.

Protected function

void

 

SetTriangleEdgesInternal

(
    int TriangleID,
    int e0,
    int e1,
    int e2
)

Public function

void

 

SetTriangleGroup

(
    int tid,
    int group_id
)

Protected function

void

 

SetTriangleInternal

(
    int TriangleID,
    int v0,
    int v1,
    int v2
)

Internal functions

Public function

void

 

SetVertex

(
    int VertexID,
    const FVector3d & vNewPos
)

Set vertex position

Public function

void

 

SetVertexColor

(
    int vID,
    const FVector3f & vNewColor
)

Public function

void

 

SetVertexNormal

(
    int vID,
    const FVector3f & vNewNormal
)

Public function

void

 

SetVertexUV

(
    int vID,
    const FVector2f & vNewUV
)

Public function Virtual

EMeshResult

 

SplitEdge

(
    int EdgeAB,
    FEdgeSplitInfo & SplitInfo,
    double SplitParameterT
)

Split an edge of the mesh by inserting a vertex.

Public function

EMeshResult

 

SplitEdge

(
    int EdgeVertA,
    int EdgeVertB,
    FEdgeSplitInfo & SplitInfo
)

Splits the edge between two vertices at the midpoint, if this edge exists

Public function Virtual

EMeshResult

 

SplitVertex

(
    int VertexID,
    const TArrayView < const int >& Tri...,
    FVertexSplitInfo & SplitInfo
)

Clones the given vertex and updates any provided triangles to use the new vertex if/where they used the old one.

Public function Virtual

bool

 

SplitVertexWouldLeaveIsolated

(
    int VertexID,
    const TArrayView < const int >& Tri...
)

Tests whether splitting the given vertex with the given triangles would leave no triangles attached to the original vertex (creating an isolated vertex)

Public function Const

int

 

TriangleCount()

Protected function Const

bool

 

TriangleHasVertex

(
    int TriangleID,
    int VertexID
)

Public function Const

triangle_ite ...

 

TriangleIndicesItr()

Public function Const

value_iterat ...

 

TrianglesItr()

Enumerate all triangles in the mesh

Protected function Const

bool

 

TriHasNeighbourTri

(
    int CheckTriID,
    int NbrTriID
)

Protected function Const

bool

 

TriHasSequentialVertices

(
    int TriangleID,
    int vA,
    int vB
)

Protected function

void

 

UpdateTimeStamp

(
    bool bShapeChange,
    bool bTopologyChange
)

Public function Const

int

 

VertexCount()

Public function Const

vertex_itera ...

 

VertexIndicesItr()

Public function Const

value_iterat ...

 

VerticesItr()

Enumerate positions of all vertices in mesh

Public function Const

FSmallListSe ...

 

VtxEdgesItr

(
    int VertexID
)

Public function Const

vtx_triangle ...

 

VtxTrianglesItr

(
    int VertexID
)

Public function Const

FSmallListSe ...

 

VtxVerticesItr

(
    int VertexID
)

Operators

Name Description

Public function

const FDynam ...

 

operator=

(
    FDynamicMesh3 && MoveMesh
)

Public function

const FDynam ...

 

operator=

(
    const FDynamicMesh3 & CopyMesh
)

Copy and move assignment

Classes

Name

Description

Public struct

FValidityOptions

Options for what the validity check will permit

Typedefs

Constants

Name

Description

DuplicateTriangleID

DuplicateTriangleID is returned by AppendTriangle() to indicate that the added triangle already exists in the mesh, and was ignored because we do not support duplicate triangles

InvalidEdge

InvalidGroupID

InvalidGroupID indicates that a group ID is invalid

InvalidID

InvalidID indicates that a vertex/edge/triangle ID is invalid

InvalidTriangle

InvalidVertex

NonManifoldID

NonManifoldID is returned by AppendTriangle() to indicate that the added triangle would result in nonmanifold geometry and hence was ignored

Select Skin
Light
Dark

Welcome to the new Unreal Engine 4 Documentation site!

We're working on lots of new features including a feedback system so you can tell us how we are doing. It's not quite ready for use in the wild yet, so head over to the Documentation Feedback forum to tell us about this page or call out any issues you are encountering in the meantime.

We'll be sure to let you know when the new system is up and running.

Post Feedback