Navigation
API > API/Plugins > API/Plugins/DynamicMesh
An abstract class for writing tessellation patterns. You can subclass it and implement its virtual methods to specify a custom tessellation behavior. Original mesh edges and triangles are referred to as edge patches and triangle patches. The edge patch handles all the vertices we are adding along the edge. The triangle patch handles all the vertices we are adding inside of the patch (excluding the edges) and the new triangles we are splitting the patch into.
Patterns describe how individual patches are tessellated. Although you can access mesh data during the tessellation, the patches do not generate actual vertex coordinates or other attribute data. Instead, new vertices are generated in terms of linear or barycentric coefficients with respect to the edge or triangle vertices. The coefficient data can later be used to interpolate the actual mesh data (vertex positions, colors, normals, etc).
Patterns do not need to worry about generating the vertex IDs as those will be provided for each patch during the tessellation and need to simply be referred to when generating triangles.
The job of the tessellation pattern is: - Provide the number of new vertices introduced for an edge or a triangle patch.
-
Provide the number of new triangles introduced for a triangle patch.
-
Given a single edge patch with vertices [v1,v2], provide coordinates of the new vertices [a_i, a_(i+1), ...] inserted along the edge via a linear coeffcient [t_i, t_(i+1), ...] such that a_i = v1 + t_i*(v2-v1).
-
Given a triangle patch with vertices [v1,v2,v3], provide coordinates of the new vertices [b_i, b_(i+1), ...]
inserted inside the triangle patch via barycentric coordinates [(u_i, v_i, w_i), (u_(i+1), v_(i+1), w_(i+1)), ...] such that b_i = u_i*v1 + v_i*v2 + w_i*v3. -
Using the new vertices (along edges and inside the triangle), provide connectivity for a triangle patch by stitching those vertices together and creating triangles.
| Name | FTessellationPattern |
| Type | class |
| Header File | /Engine/Plugins/Runtime/GeometryProcessing/Source/DynamicMesh/Public/Operations/SelectiveTessellate.h |
| Include Path | #include "Operations/SelectiveTessellate.h" |
Syntax
class FTessellationPattern
Constructors
| Name | Remarks | Include Path | Unreal Specifiers |
|---|---|---|---|
FTessellationPattern
(
const FDynamicMesh3* InMesh |
Operations/SelectiveTessellate.h |
Destructors
| Name | Remarks | Include Path | Unreal Specifiers |
|---|---|---|---|
virtual ~FTessellationPattern() |
Operations/SelectiveTessellate.h |
Structs
| Name | Remarks |
|---|---|
| EdgePatch | Represents an abstract edge as a parameterized line segment with two endpoints [v1,v2]. |
| TrianglePatch | Represents an abstract triangle patch with corners [u,v,w], s.t. |
Constants
| Name | Type | Remarks | Include Path |
|---|---|---|---|
| InvalidIndex | int | Operations/SelectiveTessellate.h |
Functions
Public
| Name | Remarks | Include Path | Unreal Specifiers |
|---|---|---|---|
int GetNumberOfNewVerticesForEdgePatch
(
const int InEdgeID |
Operations/SelectiveTessellate.h | ||
int GetNumberOfNewVerticesForTrianglePatch
(
const int InTriangleID |
Operations/SelectiveTessellate.h | ||
int GetNumberOfPatchTriangles
(
const int InTriangleID |
Operations/SelectiveTessellate.h | ||
void TessellateEdgePatch
(
EdgePatch& EdgePatch |
Tessellate the edge patch by generating linear interpolation coefficients for each new vertex and storing the result in the EdgePatch.LinearCoord. | Operations/SelectiveTessellate.h | |
void TessellateTriPatch
(
TrianglePatch& TriPatch |
Tessellate the triangle patch by generating new vertices inside the triangle. | Operations/SelectiveTessellate.h | |
EOperationValidationResult Validate() |
Operations/SelectiveTessellate.h |
Protected
| Name | Remarks | Include Path | Unreal Specifiers |
|---|---|---|---|
void ComputeInnerConcentricTriangle
(
const FVector3d& U, |
Common helper methods used during tessellation of various patterns. | Operations/SelectiveTessellate.h |