Navigation
API > API/Plugins > API/Plugins/DynamicMesh
FQuadGridPatch represents a set of quads, formed by pairs of triangles, arranged in a 2D grid pattern. U is the "across"/column direction and "V" is the "up"/row direction, and if you were thinking about it in terms of a piece of graph paper, (U=0,V=0) would be in the bottom-left.
Each row of Vertices is stored, as well as each row of Quads. In the case of a Quad grid that is a loop, the last vertex in each row is a duplicate of the first. Note, however, that there is currently no explicit tracking of whether or not there is a Loop in U or V - this must be tracked externally.
Generally the quad triangles will not be assumed to form any consistent pattern. This complicates some of the functions however, and perhaps this assumption could be optionally provided in the future
| Name | FQuadGridPatch |
| Type | class |
| Header File | /Engine/Plugins/Runtime/GeometryProcessing/Source/DynamicMesh/Public/Selections/QuadGridPatch.h |
| Include Path | #include "Selections/QuadGridPatch.h" |
Syntax
class FQuadGridPatch
Variables
Public
| Name | Type | Remarks | Include Path | Unreal Specifiers |
|---|---|---|---|---|
| NumVertexColsU | int | Selections/QuadGridPatch.h | ||
| NumVertexRowsV | int | Selections/QuadGridPatch.h | ||
| QuadTriangles | TArray< TArray< FIndex2i > > | Quads stored as pairs of triangle indices, (NumVertexRowsV-1) rows of (NumVertexColsU-1) | Selections/QuadGridPatch.h | |
| VertexSpans | TArray< TArray< int32 > > | NumVertexRowsV rows of NumVertexColsU VertexIDs, may contain repeated element if the patch forms a loop | Selections/QuadGridPatch.h |
Functions
Public
| Name | Remarks | Include Path | Unreal Specifiers |
|---|---|---|---|
bool AppendQuadPatchRows
(
FQuadGridPatch&& NextPatch, |
Append the rows of NextPatch to the rows of the current QuadGrid. | Selections/QuadGridPatch.h | |
FIndex2i DecodeRowColumnIndex
(
int32 Encoded |
Recover row and column indices from an int32 encoded via EncodeRowColumnIndex | Selections/QuadGridPatch.h | |
int32 EncodeRowColumnIndex
(
int32 Row, |
Map a row and column index pair into a single int32. | Selections/QuadGridPatch.h | |
int32 FindColumnIndex
(
int32 VertexID |
Find column that contains vertex, or InvalidID | Selections/QuadGridPatch.h | |
void ForEachQuad
(
TFunctionRef< void(int32 QuadRow, int32 QuadCol, FIndex2i QuadTris)> ApplyFunc |
Call ApplyFunc for each quad, passing it's grid index and triangle pair | Selections/QuadGridPatch.h | |
void GetAllTriangles
(
TArray< int32 >& AllTrianglesOut |
Selections/QuadGridPatch.h | ||
int32 GetNumQuads() |
Selections/QuadGridPatch.h | ||
double GetQuadOpeningAngleDeg
(
const FDynamicMesh3& Mesh, |
Compute the opening angle between the two quads in Column0 and Column1 of the given Row. | Selections/QuadGridPatch.h | |
FIndex3i GetQuadTriMappedToSpanIndices
(
const FDynamicMesh3& Mesh, |
In cases like assigning UVs or Normals to a QuadGridPatch, we want to assign a unique element to each of the vertices in the grid, and then generate "element triangles" that index into those new elements. | Selections/QuadGridPatch.h | |
void GetSubPatchByQuadRange
(
int StartQuadRow, |
Construct a new QuadGridPatch that is a subset of the current QuadGridPatch The values (Start|End)Quad(Row|Col) define the sub-patch, the values are inclusive, so passing (1,2,1,2) defines a 2x2 quad patch | Selections/QuadGridPatch.h | |
bool GetVertexColumn
(
int32 ColumnIndex, |
Return vertices in specified Column | Selections/QuadGridPatch.h | |
bool InitializeFromQuadPatch
(
const FDynamicMesh3& Mesh, |
Initialize an NxM grid from a list of quads (represented as a pair of triangles) and corresponding rows of vertices. | Selections/QuadGridPatch.h | |
void InitializeFromQuadStrip
(
const FDynamicMesh3& Mesh, |
Initialize an Nx1 grid from a list of quads (represented as a pair of triangles) and the row of vertices on the "bottom" (ie first span) | Selections/QuadGridPatch.h | |
bool IsEmpty() |
Selections/QuadGridPatch.h | ||
int NumQuadCols() |
Selections/QuadGridPatch.h | ||
int NumQuadRows() |
Selections/QuadGridPatch.h | ||
int NumVertexCols() |
Selections/QuadGridPatch.h | ||
int NumVertexRows() |
Selections/QuadGridPatch.h | ||
void ReverseRows() |
Reverse the order of the vertex/quad rows, ie "flip" vertically | Selections/QuadGridPatch.h | |
void SplitColumnsByPredicate
(
TFunctionRef< bool(int32 QuadColumn0, int32 QuadColumn1)> PredicateFunc, |
Split the Columns of the QuadGridPatch into new QuadGridPatches where the columns are grouped via the PredicateFunc. | Selections/QuadGridPatch.h |