MeshDeformingOperators::ConstructConstrainedMeshDeformer

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

Windows
MacOS
Linux

References

Module

MeshSolverUtilities

Header

/Engine/Plugins/Experimental/GeometryProcessing/Source/MeshSolverUtilities/Public/MeshSmoothingUtilities.h

Include

#include "MeshSmoothingUtilities.h"

Source

/Engine/Plugins/Experimental/GeometryProcessing/Source/MeshSolverUtilities/Private/LaplacianMeshSmoother.cpp

Syntax

namespace MeshDeformingOperators
{
    TUniquePtr< IConstrainedMeshOperator > MeshDeformingOperators::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? 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