Blender V4.3
bmo_smooth_laplacian.cc File Reference
#include "MEM_guardedalloc.h"
#include "BLI_math_geom.h"
#include "BLI_math_vector.h"
#include "eigen_capi.h"
#include "bmesh.hh"
#include "intern/bmesh_operators_private.hh"

Go to the source code of this file.

Classes

struct  BLaplacianSystem
 

Macros

#define SMOOTH_LAPLACIAN_MAX_EDGE_PERCENTAGE   1.8f
 
#define SMOOTH_LAPLACIAN_MIN_EDGE_PERCENTAGE   0.15f
 

Typedefs

typedef BLaplacianSystem LaplacianSystem
 

Functions

static bool vert_is_boundary (BMVert *v)
 
static LaplacianSysteminit_laplacian_system (int a_numEdges, int a_numLoops, int a_numVerts)
 
static void init_laplacian_matrix (LaplacianSystem *sys)
 
static void delete_laplacian_system (LaplacianSystem *sys)
 
static void delete_void_pointer (void *data)
 
static void fill_laplacian_matrix (LaplacianSystem *sys)
 
static void memset_laplacian_system (LaplacianSystem *sys, int val)
 
static void validate_solution (LaplacianSystem *sys, int usex, int usey, int usez, int preserve_volume)
 
static void volume_preservation (BMOperator *op, float vini, float vend, int usex, int usey, int usez)
 
void bmo_smooth_laplacian_vert_exec (BMesh *bm, BMOperator *op)
 

Detailed Description

Advanced smoothing.

Definition in file bmo_smooth_laplacian.cc.

Macro Definition Documentation

◆ SMOOTH_LAPLACIAN_MAX_EDGE_PERCENTAGE

#define SMOOTH_LAPLACIAN_MAX_EDGE_PERCENTAGE   1.8f

Definition at line 24 of file bmo_smooth_laplacian.cc.

Referenced by validate_solution().

◆ SMOOTH_LAPLACIAN_MIN_EDGE_PERCENTAGE

#define SMOOTH_LAPLACIAN_MIN_EDGE_PERCENTAGE   0.15f

Definition at line 25 of file bmo_smooth_laplacian.cc.

Referenced by validate_solution().

Typedef Documentation

◆ LaplacianSystem

typedef BLaplacianSystem LaplacianSystem

Definition at line 46 of file bmo_smooth_laplacian.cc.

Function Documentation

◆ bmo_smooth_laplacian_vert_exec()

◆ delete_laplacian_system()

◆ delete_void_pointer()

static void delete_void_pointer ( void * data)
static

Definition at line 60 of file bmo_smooth_laplacian.cc.

References MEM_freeN().

Referenced by delete_laplacian_system().

◆ fill_laplacian_matrix()

◆ init_laplacian_matrix()

static void init_laplacian_matrix ( LaplacianSystem * sys)
static

Compute weight between vertex v_i and all your neighbors weight between v_i and v_neighbor

Wij = cot(alpha) + cot(beta) / (4.0 * total area of all faces  * sum all weight)

       v_i *
         / | \
        /  |  \
 v_beta*   |   * v_alpha
        \  |  /
         \ | /
           * v_neighbor

Definition at line 163 of file bmo_smooth_laplacian.cc.

References area_tri_v3(), BM_edge_is_boundary(), BM_EDGES_OF_MESH, BM_elem_flag_test, BM_elem_index_get, BM_ELEM_SELECT, BM_FACE_FIRST_LOOP, BM_FACES_OF_MESH, BM_ITER_MESH, BM_ITER_MESH_INDEX, BMVert::co, cotangent_tri_weight_v3(), e, LaplacianSystem::eweights, LaplacianSystem::fweights, BMFace::len, len_v3v3(), LaplacianSystem::min_area, BMLoop::next, BMLoop::prev, LaplacianSystem::ring_areas, BMLoop::v, v2, LaplacianSystem::vlengths, LaplacianSystem::vweights, and LaplacianSystem::zerola.

Referenced by bmo_smooth_laplacian_vert_exec().

◆ init_laplacian_system()

◆ memset_laplacian_system()

◆ validate_solution()

◆ vert_is_boundary()

static bool vert_is_boundary ( BMVert * v)
static

◆ volume_preservation()

static void volume_preservation ( BMOperator * op,
float vini,
float vend,
int usex,
int usey,
int usez )
static

Definition at line 342 of file bmo_smooth_laplacian.cc.

References beta(), BM_VERT, BMO_ITER, BMVert::co, pow(), BMOperator::slots_in, and v.

Referenced by validate_solution().