Navigation
API > API/Runtime > API/Runtime/GeometryCore
References
| Module | GeometryCore |
| Header | /Engine/Source/Runtime/GeometryCore/Public/DynamicMeshEditor.h |
| Include | #include "DynamicMeshEditor.h" |
Syntax
class FDynamicMeshEditor
Remarks
FDynamicMeshEditor implements low-level mesh editing operations. These operations can be used to construct higher-level operations. For example an Extrude operation could be implemented via DuplicateTriangles() and StitchLoopMinimal().
Variables
| Type | Name | Description | |
|---|---|---|---|
| FDynamicMesh3 * | Mesh | The mesh we will be editing |
Constructors
| Type | Name | Description | |
|---|---|---|---|
FDynamicMeshEditor
(
FDynamicMesh3* MeshIn |
Functions
| Type | Name | Description | |
|---|---|---|---|
| bool | AddTriangleFan_OrderedVertexLoop
(
int CenterVertex, |
Fill hole with a triangle fan given an existing (unconnected) center vertex and an ordered loop of boundary vertices on the hole border. | |
| void | AppendColors
(
const FDynamicMesh3* AppendMesh, |
Append Colors from one attribute overlay to another. | |
| void | AppendElementSubset
(
const FDynamicMesh3* FromMesh, |
Append overlay elements in both ROIs from one overlay to another | |
| void | AppendMesh
(
const TTriangleMeshAdapter< double >* AppendMesh, |
Append input mesh to our internal Mesh. | |
| void | AppendMesh
(
const FDynamicMesh3* AppendMesh, |
Append input mesh to our internal mesh | |
| void | AppendNormals
(
const FDynamicMesh3* AppendMesh, |
Append normals from one attribute overlay to another. | |
| void | AppendTriangles
(
const FDynamicMesh3* SourceMesh, |
Append triangles of an existing mesh. | |
| void | AppendUVs
(
const FDynamicMesh3* AppendMesh, |
Append UVs from one attribute overlay to another. | |
| FVector3f | ComputeAndSetQuadNormal
(
const FIndex2i& QuadTris, |
Calculate and set the per-triangle normals of the two input quads. | |
| bool | Converts a loop to a sequence of edge identifiers that are both Vid and Eid independent. | ||
| void | CopyAttributes
(
int FromTriangleID, |
Copy all attribute-layer values from one triangle to another, using the IndexMaps to track and re-use shared attribute values. | |
| bool | CreateSeamsAtEdges
(
const TSet< int32 >& EidsToMakeIntoSeams, |
Cut existing 3D attribute overlay topology with a set of edges. | |
| bool | CreateSeamsAtEdges
(
const TSet< int32 >& EidsToMakeIntoSeams, |
Cut existing 2D attribute overlay topology with a set of edges. | |
| void | DisconnectTriangles
(
const TArray< int >& Triangles, |
Disconnects triangles (without constructing boundary loops) such that the input Triangles are not connected to any other triangles in the mesh | |
| bool | DisconnectTriangles
(
const TArray< int >& Triangles, |
Finds boundary loops of connected components of a set of triangles, and duplicates the vertices along the boundary, such that the triangles become disconnected. | |
| bool | DisconnectTriangles
(
const TSet< int >& TriangleSet, |
Variant of DisconnectTriangles that takes a precomputed set of BoundaryLoops of the triangles, and a TSet of Triangles. | |
| bool | DisconnectTrianglesAlongEdges
(
const TSet< int32 >& Edges, |
Disconnect triangles along the given Edges, so that all input edges become boundary edges. | |
| void | DuplicateTriangles
(
const TArray< int >& Triangles, |
Duplicate triangles of a mesh. | |
| int | FindOrCreateDuplicateColor
(
int ElementID, |
Find "new" color for input color element under Index mapping, or create new if missing | |
| int | FindOrCreateDuplicateGroup
(
int TriangleID, |
Find "new" group for input group under Index mapping, or create new if missing | |
| int | FindOrCreateDuplicateNormal
(
int ElementID, |
Find "new" normal for input normal element under Index mapping, or create new if missing | |
| int | FindOrCreateDuplicateUV
(
int ElementID, |
Find "new" UV for input UV element under Index mapping, or create new if missing | |
| int | FindOrCreateDuplicateVertex
(
int VertexID, |
Mesh element copying / duplication | |
| void | InvertTriangleNormals
(
const TArray< int >& Triangles |
Flip the normals of the given triangles. | |
| bool | ReinsertSubmesh
(
const FDynamicSubmesh3& Submesh, |
Update a Base Mesh from a Submesh; See FMeshRegionOperator::BackPropropagate for a usage example. | |
| bool | Remove any vertices that are not used by any triangles | ||
| bool | RemoveSeamsAtEdges
(
const TSet< int32 >& EidsToRemoveAsSeams, |
Merge any seams in the given (3D attribute) Overlay along the given mesh edge IDs | |
| bool | RemoveSeamsAtEdges
(
const TSet< int32 >& EidsToRemoveAsSeams, |
Merge any seams in the given 2D attribute Overlay along the given mesh edge IDs | |
| int | RemoveSmallComponents
(
double MinVolume, |
Remove any connected components with volume or area below the given thresholds | |
| bool | RemoveTriangles
(
const TArray< int >& Triangles, |
Remove a list of triangles from the mesh, and optionally any vertices that are now orphaned | |
| bool | RemoveTriangles
(
const TArray< int >& Triangles, |
Remove a list of triangles from the mesh, and optionally any vertices that are now orphaned | |
| void | RescaleAttributeUVs
(
float UVScale, |
Rescale UVs for the whole mesh, for the given UV attribute layer | |
| void | ReverseTriangleOrientations
(
const TArray< int >& Triangles, |
Normal utility functions. | |
| void | SetGeneralTubeUVs
(
const TArray< int >& Triangles, |
For triangles connecting loops of corresponded vertices, set UVs in a cylindrical pattern so that the U coordinate starts at 0 for the first corresponded pair of vertices, and cycles around to 1 Assumes Triangles array stores indices of triangles in progressively filling the tube, starting with VertexIDs*[0]. | |
| void | SetQuadNormals
(
const FIndex2i& QuadTris, |
Create and set new shared per-triangle normals for a pair of triangles that share one edge (ie a quad) | |
| void | SetQuadUVsFromProjection
(
const FIndex2i& QuadTris, |
UV utility functions. | |
| void | SetTriangleNormals
(
const TArray< int >& Triangles |
Create and set new shared per-triangle normals for a list of triangles. | |
| void | SetTriangleNormals
(
const TArray< int >& Triangles, |
Create and set new shared per-triangle normals for a list of triangles | |
| void | Project triangles onto a plane defined by the ProjectionFrame and use that to create/set new shared per-triangle UVs. | ||
| void | SetTriangleUVsFromProjection
(
const TArray< int >& Triangles, |
Project triangles onto a plane defined by the ProjectionFrame and use that to create/set new shared per-triangle UVs. | |
| void | For a 'tube' of triangles connecting loops of corresponded vertices, set smooth normals such that corresponding vertices have corresponding normals | ||
| void | SplitBowties
(
int VertexID, |
Splits any bowties specifically on the given vertex, and (if not null) updates (does not reset!) NewVertices with any added vertices | |
| void | SplitBowties
(
FDynamicMeshEditResult& ResultOut |
Splits all bowties across the whole mesh | |
| void | SplitBowties
(
int VertexID, |
Splits any bowties specifically on the given vertex, and updates (does not reset!) ResultOut with any added vertices | |
| void | SplitBowtiesAtTriangles
(
const TArray< int32 >& TriangleIDs, |
Splits bowties attached to any of the given triangles, and updates (does not reset!) ResultOut with any added vertices | |
| bool | SplitMesh
(
const FDynamicMesh3* SourceMesh, |
Create multiple meshes out of the source mesh by splitting triangles out. | |
| bool | StitchSparselyCorrespondedVertexLoops
(
const TArray< int >& VertexIDs1, |
Stitch together two loops of vertices where vertices are only sparsely corresponded | |
| bool | StitchVertexLoopsMinimal
(
const TArray< int >& VertexLoop1, |
Create and Remove Triangle Functions. | |
| bool | StitchVertexLoopToTriVidPairSequence
(
const TArray< TPair< int32, TPair< int8, int8 > > >& TriVidPairs1, |
Given a sequence of edges in the form given by ConvertLoopToTriVidPairSequence and a loop of vertices, stitch the two together. | |
| bool | WeldVertexLoops
(
const TArray< int32 >& VertexLoop1, |
Weld together two loops of vertices. Loops must be oriented (ordered) correctly for your use case. |
Classes
| Type | Name | Description | |
|---|---|---|---|
| FLoopPairSet | Pair of associated vertex and edge loops. |
Enums
| Type | Name | Description | |
|---|---|---|---|
| EDuplicateTriBehavior | In ReinsertSubmesh, a problem can arise where the mesh we are inserting has duplicate triangles of the base mesh. |