Blender V4.3
MOD_laplaciandeform.cc File Reference
#include "BLI_utildefines.h"
#include "BLI_math_geom.h"
#include "BLI_math_vector.h"
#include "BLI_string.h"
#include "BLI_utildefines_stack.h"
#include "MEM_guardedalloc.h"
#include "BLT_translation.hh"
#include "DNA_defaults.h"
#include "DNA_mesh_types.h"
#include "DNA_meshdata_types.h"
#include "DNA_screen_types.h"
#include "BKE_deform.hh"
#include "BKE_mesh_mapping.hh"
#include "UI_interface.hh"
#include "UI_resources.hh"
#include "BLO_read_write.hh"
#include "RNA_access.hh"
#include "RNA_prototypes.hh"
#include "MOD_ui_common.hh"
#include "MOD_util.hh"
#include "eigen_capi.h"

Go to the source code of this file.

Classes

struct  LaplacianSystem
 

Enumerations

enum  {
  LAPDEFORM_SYSTEM_NOT_CHANGE = 0 , LAPDEFORM_SYSTEM_IS_DIFFERENT , LAPDEFORM_SYSTEM_ONLY_CHANGE_ANCHORS , LAPDEFORM_SYSTEM_ONLY_CHANGE_GROUP ,
  LAPDEFORM_SYSTEM_ONLY_CHANGE_MESH , LAPDEFORM_SYSTEM_CHANGE_VERTEXES , LAPDEFORM_SYSTEM_CHANGE_EDGES , LAPDEFORM_SYSTEM_CHANGE_NOT_VALID_GROUP
}
 

Functions

static LaplacianSystemnewLaplacianSystem ()
 
static LaplacianSysteminitLaplacianSystem (int verts_num, int edges_num, int tris_num, int anchors_num, const char defgrpName[64], int iterations)
 
static void deleteLaplacianSystem (LaplacianSystem *sys)
 
static void createFaceRingMap (const int mvert_tot, blender::Span< blender::int3 > corner_tris, blender::Span< int > corner_verts, MeshElemMap **r_map, int **r_indices)
 
static void createVertRingMap (const int mvert_tot, const blender::Span< blender::int2 > edges, MeshElemMap **r_map, int **r_indices)
 
static void initLaplacianMatrix (LaplacianSystem *sys)
 
static void computeImplictRotations (LaplacianSystem *sys)
 
static void rotateDifferentialCoordinates (LaplacianSystem *sys)
 
static void laplacianDeformPreview (LaplacianSystem *sys, float(*vertexCos)[3])
 
static bool isValidVertexGroup (LaplacianDeformModifierData *lmd, Object *ob, Mesh *mesh)
 
static void initSystem (LaplacianDeformModifierData *lmd, Object *ob, Mesh *mesh, float(*vertexCos)[3], int verts_num)
 
static int isSystemDifferent (LaplacianDeformModifierData *lmd, Object *ob, Mesh *mesh, int verts_num)
 
static void LaplacianDeformModifier_do (LaplacianDeformModifierData *lmd, Object *ob, Mesh *mesh, float(*vertexCos)[3], int verts_num)
 
static void init_data (ModifierData *md)
 
static void copy_data (const ModifierData *md, ModifierData *target, const int flag)
 
static bool is_disabled (const Scene *, ModifierData *md, bool)
 
static void required_data_mask (ModifierData *md, CustomData_MeshMasks *r_cddata_masks)
 
static void deform_verts (ModifierData *md, const ModifierEvalContext *ctx, Mesh *mesh, blender::MutableSpan< blender::float3 > positions)
 
static void free_data (ModifierData *md)
 
static void panel_draw (const bContext *, Panel *panel)
 
static void panel_register (ARegionType *region_type)
 
static void blend_write (BlendWriter *writer, const ID *id_owner, const ModifierData *md)
 
static void blend_read (BlendDataReader *reader, ModifierData *md)
 

Variables

ModifierTypeInfo modifierType_LaplacianDeform
 

Enumeration Type Documentation

◆ anonymous enum

anonymous enum
Enumerator
LAPDEFORM_SYSTEM_NOT_CHANGE 
LAPDEFORM_SYSTEM_IS_DIFFERENT 
LAPDEFORM_SYSTEM_ONLY_CHANGE_ANCHORS 
LAPDEFORM_SYSTEM_ONLY_CHANGE_GROUP 
LAPDEFORM_SYSTEM_ONLY_CHANGE_MESH 
LAPDEFORM_SYSTEM_CHANGE_VERTEXES 
LAPDEFORM_SYSTEM_CHANGE_EDGES 
LAPDEFORM_SYSTEM_CHANGE_NOT_VALID_GROUP 

Definition at line 41 of file MOD_laplaciandeform.cc.

Function Documentation

◆ blend_read()

◆ blend_write()

◆ computeImplictRotations()

◆ copy_data()

static void copy_data ( const ModifierData * md,
ModifierData * target,
const int flag )
static

◆ createFaceRingMap()

static void createFaceRingMap ( const int mvert_tot,
blender::Span< blender::int3 > corner_tris,
blender::Span< int > corner_verts,
MeshElemMap ** r_map,
int ** r_indices )
static

◆ createVertRingMap()

static void createVertRingMap ( const int mvert_tot,
const blender::Span< blender::int2 > edges,
MeshElemMap ** r_map,
int ** r_indices )
static

Definition at line 188 of file MOD_laplaciandeform.cc.

References indices.

Referenced by initSystem().

◆ deform_verts()

static void deform_verts ( ModifierData * md,
const ModifierEvalContext * ctx,
Mesh * mesh,
blender::MutableSpan< blender::float3 > positions )
static

◆ deleteLaplacianSystem()

◆ free_data()

◆ init_data()

static void init_data ( ModifierData * md)
static

◆ initLaplacianMatrix()

static void initLaplacianMatrix ( LaplacianSystem * sys)
static

This method computes the Laplacian Matrix and Differential Coordinates for all vertex in the mesh. The Linear system is LV = d Where L is Laplacian Matrix, V as the vertices in Mesh, d is the differential coordinates The Laplacian Matrix is computes as a: Lij = sum(Wij) (if i == j) Lij = Wij (if i != j) Wij is weight between vertex Vi and vertex Vj, we use cotangent weight

The Differential Coordinate is computes as a: di = Vi * sum(Wij) - sum(Wij * Vj) Where: di is the Differential Coordinate i sum (Wij) is the sum of all weights between vertex Vi and its vertices neighbors (Vj). sum (Wij * Vj) is the sum of the product between vertex neighbor Vj and weight Wij for all neighborhood.

This Laplacian Matrix is described in the paper: Desbrun M. et.al, Implicit fairing of irregular meshes using diffusion and curvature flow, SIGGRAPH '99, page 317-324, New York, USA

The computation of Laplace Beltrami operator on Hybrid Triangle/Quad Meshes is described in the paper: Pinzon A., Romero E., Shape Inflation With an Adapted Laplacian Operator For Hybrid Quad/Triangle Meshes, Conference on Graphics Patterns and Images, SIBGRAPI, 2013

The computation of Differential Coordinates is described in the paper: Sorkine, O. Laplacian Surface Editing. Proceedings of the EUROGRAPHICS/ACM SIGGRAPH Symposium on Geometry Processing,

  1. p. 179-188.

Definition at line 255 of file MOD_laplaciandeform.cc.

References add_v3_v3(), LaplacianSystem::co, LaplacianSystem::context, cotangent_tri_weight_v3(), LaplacianSystem::delta, EIG_linear_solver_matrix_add(), LaplacianSystem::no, normal_tri_v3(), LaplacianSystem::tris, LaplacianSystem::tris_num, UNPACK3, and v2.

Referenced by laplacianDeformPreview().

◆ initLaplacianSystem()

◆ initSystem()

◆ is_disabled()

static bool is_disabled ( const Scene * ,
ModifierData * md,
bool  )
static

◆ isSystemDifferent()

◆ isValidVertexGroup()

static bool isValidVertexGroup ( LaplacianDeformModifierData * lmd,
Object * ob,
Mesh * mesh )
static

◆ LaplacianDeformModifier_do()

◆ laplacianDeformPreview()

◆ newLaplacianSystem()

◆ panel_draw()

◆ panel_register()

static void panel_register ( ARegionType * region_type)
static

◆ required_data_mask()

static void required_data_mask ( ModifierData * md,
CustomData_MeshMasks * r_cddata_masks )
static

◆ rotateDifferentialCoordinates()

Variable Documentation

◆ modifierType_LaplacianDeform

ModifierTypeInfo modifierType_LaplacianDeform

Definition at line 848 of file MOD_laplaciandeform.cc.