UE::MeshDeformation::ConstructConstrainedMeshDeformer

Solves the linear system for p_vec ( Transpose(L) * L + (0 0 ) ) p_vec = source_vec + ( 0 )

Windows
MacOS
Linux

References

Module

DynamicMesh

Header

/Engine/Plugins/Experimental/GeometryProcessing/Source/DynamicMesh/Public/Solvers/ConstrainedMeshDeformer.h

Include

#include "Solvers/ConstrainedMeshDeformer.h"

Source

/Engine/Plugins/Experimental/GeometryProcessing/Source/DynamicMesh/Private/Solvers/ConstrainedMeshDeformer.cpp

Syntax

namespace UE
{
    namespace MeshDeformation
    {
        TUniquePtr< UE::Solvers::IConstrainedMeshSolver > UE::MeshDeformation::ConstructConstrainedMeshDeformer
        (
            const ELaplacianWeightScheme WeightScheme,
            const FDynamicMesh3 & DynamicMesh
        )
    }
}

Remarks

Solves the linear system for p_vec ( Transpose(L) * L + (0 0 ) ) p_vec = source_vec + ( 0 ) ( (0 lambda^2) ) ( lambda^2 c_vec )

where: L := laplacian for the mesh, source_vec := Transpose(L)*L mesh_vertex_positions lambda := weights c_vec := constrained positions

Expected Use:

Create Deformation Solver from Mesh TUniquePtr MeshDeformer = ConstructConstrainedMeshDeformer(ELaplacianWeightScheme::ClampedCotangent, DynamicMesh);

Add constraints. for.. { int32 VtxId = ..; double Weight = ..; FVector3d TargetPos = ..; bool bPostFix = ...; MeshDeformer->AddConstraint(VtxId, Weight, TargetPos, bPostFix); }

Solve for new mesh vertex locations TArray PositionBuffer; MeshDeformer->Deform(PositionBuffer);

Update Mesh? for (int32 VtxId : DynamicMesh.VertexIndices()) DynamicMesh.SetVertex(VtxId, PositionBuffer[VtxId]); ...

Update constraint positions. for .. { int32 VtxId = ..; FVector3d TargetPos = ..; bool bPostFix = ...; MeshDeformer->UpdateConstraintPosition(VtxId, TargetPos, bPostFix); }

Solve for new vertex locations. MeshDeformer->Deform(PositionBuffer); Update Mesh?

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