FFFDLattice

Free-form deformation lattice.

Windows
MacOS
Linux

References

Module

DynamicMesh

Header

/Engine/Plugins/Experimental/GeometryProcessing/Source/DynamicMesh/Public/Operations/FFDLattice.h

Include

#include "Operations/FFDLattice.h"

Syntax

class FFFDLattice

Remarks

Free-form deformation lattice. Initialize it with a mesh and desired resolution, get the initial lattice points out. Then pass in deformed lattice points and it will compute deformed mesh vertex positions.

Variables

Name Description

Protected variable

FVector3d

 

CellSize

3D size of a lattice cell

Protected variable

FVector3i

 

Dims

Number of lattice points in each dimension.

Protected variable

FAxisAlignedBox...

 

InitialBounds

Extents of the lattice before it is deformed.

Protected variable

TArray< FEmbedd...

 

VertexEmbeddings

Interpolation weights and cell indices per vertex of the input FDynamicMesh3.

Constructors

Name Description

Public function

FFFDLattice

(
    const FVector3i& InDims,
    const FDynamicMesh3& InMesh,
    float Padding
)

Create a lattice that fits the given mesh and has the given resolution along each dimension.

Functions

Name Description

Protected function Const

FVector3d

 

ClosestLatticePosition

(
    const FVector3i& VirtualControlPoi...,
    const TArray< FVector3d >& Lattice...
)

Clamp the given index to [0, Dims] and return the current lattice point position at the clamped index.

Protected function

void

 

ComputeInitialEmbedding

(
    const FDynamicMesh3& Mesh,
    FLatticeExecutionInfo ExecutionInfo
)

For each vertex in Mesh, compute the lattice cell it resides in and its weighting.

Protected function Const

FVector3d

 

ComputeTrilinearWeights

(
    const FVector3d& Pt,
    FVector3i& GridCoordinates
)

Compute cell index and linear interpolation weights for a given point.

Protected function Const

int

 

ControlPointIndexFromCoordinates

(
    const FVector3i& Index
)

Protected function Const

int

 

ControlPointIndexFromCoordinates

(
    int i,
    int j,
    int k
)

Get the index into the flat TArray of positions given the (i,j,k) coordinates in the lattice.

Protected function Const

FVector3d

 

ExtrapolatedLatticePosition

(
    const FVector3i& VirtualPointIndex,
    const TArray< FVector3d >& Lattice...
)

Compute the extrapolated position for a "virtual" lattice control point outside of the actual lattice.

Public function Const

void

 

GenerateInitialLatticePositions

(
    TArray< FVector3d >& OutLatticePos...
)

Public function Const

void

 

GenerateLatticeEdges

(
    TArray< FVector2i >& OutLatticeEdg...
)

Public function Const

void

 

GetDeformedMeshVertexPositions

(
    const TArray< FVector3d >& Lattice...,
    TArray< FVector3d >& OutVertexPosi...,
    ELatticeInterpolation Interpolation,
    FLatticeExecutionInfo ExecutionInfo,
    FProgressCancel* Progress
)

Using the Lattice's current control point positions and the original embedding information, compute the deformed mesh vertex positions.

Protected function Const

void

 

GetValuePair

(
    int I,
    int J,
    int K,
    FVector3d& A,
    FVector3d& B,
    const TArray< FVector3d >& Lattice...
)

Helper for linear interpolation. Returns lattice points at (I,J,K) and (I+1,J,K).

Protected function

void

 

InitializeLatticePositions()

Protected function Const

FVector3d

 

InterpolatedPosition

(
    const FEmbedding& VertexEmbedding,
    const TArray< FVector3d >& Lattice...
)

Use the given cell index and weights to compute the interpolated position.

Protected function Const

FVector3d

 

InterpolatedPositionCubic

(
    const FEmbedding& VertexEmbedding,
    const TArray< FVector3d >& Lattice...
)

Use the given cell index and weights to compute the interpolated position.

Classes

Name

Description

Public struct

FEmbedding

Linear interpolation information. There should be one of these per mesh vertex.

Help shape the future of Unreal Engine documentation! Tell us how we're doing so we can serve you better.
Take our survey
Dismiss