Blender
V3.3
|
#include "MEM_guardedalloc.h"
#include "BLI_math.h"
#include "eigen_capi.h"
#include "bmesh.h"
#include "intern/bmesh_operators_private.h"
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 struct BLaplacianSystem | LaplacianSystem |
Functions | |
static bool | vert_is_boundary (BMVert *v) |
static LaplacianSystem * | init_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) |
Advanced smoothing.
Definition in file bmo_smooth_laplacian.c.
#define SMOOTH_LAPLACIAN_MAX_EDGE_PERCENTAGE 1.8f |
Definition at line 21 of file bmo_smooth_laplacian.c.
#define SMOOTH_LAPLACIAN_MIN_EDGE_PERCENTAGE 0.15f |
Definition at line 22 of file bmo_smooth_laplacian.c.
typedef struct BLaplacianSystem LaplacianSystem |
Definition at line 1 of file bmo_smooth_laplacian.c.
void bmo_smooth_laplacian_vert_exec | ( | BMesh * | bm, |
BMOperator * | op | ||
) |
Definition at line 411 of file bmo_smooth_laplacian.c.
References bm, BM_elem_index_get, BM_mesh_elem_index_ensure(), BM_VERT, BMO_ITER, BMO_slot_bool_get(), BMO_slot_float_get(), BMVert::co, LaplacianSystem::context, delete_laplacian_system(), EIG_linear_least_squares_solver_new(), EIG_linear_solver_matrix_add(), EIG_linear_solver_right_hand_side_add(), EIG_linear_solver_solve(), EIG_linear_solver_variable_lock(), EIG_linear_solver_variable_set(), EIG_linear_solver_variable_unlock(), fill_laplacian_matrix(), init_laplacian_matrix(), init_laplacian_system(), memset_laplacian_system(), BLaplacianSystem::op, BMOperator::slots_in, BMesh::totedge, BMesh::totface, BMesh::totloop, BMesh::totvert, v, validate_solution(), vert_is_boundary(), and w().
|
static |
Definition at line 64 of file bmo_smooth_laplacian.c.
References LaplacianSystem::context, delete_void_pointer(), EIG_linear_solver_delete(), LaplacianSystem::fweights, MEM_freeN, and NULL.
Referenced by bmo_smooth_laplacian_vert_exec(), and init_laplacian_system().
Definition at line 57 of file bmo_smooth_laplacian.c.
References data, and MEM_freeN.
Referenced by delete_laplacian_system().
|
static |
Definition at line 230 of file bmo_smooth_laplacian.c.
References 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, LaplacianSystem::context, e, EIG_linear_solver_matrix_add(), LaplacianSystem::fweights, BMFace::len, BMLoop::next, BMLoop::prev, BMLoop::v, and vert_is_boundary().
Referenced by bmo_smooth_laplacian_vert_exec().
|
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 153 of file bmo_smooth_laplacian.c.
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::fweights, BMFace::len, len_v3v3(), BLaplacianSystem::min_area, BMLoop::next, BMLoop::prev, BMLoop::v, v1, and v2.
Referenced by bmo_smooth_laplacian_vert_exec().
|
static |
Definition at line 90 of file bmo_smooth_laplacian.c.
References delete_laplacian_system(), LaplacianSystem::fweights, MEM_callocN, and NULL.
Referenced by bmo_smooth_laplacian_vert_exec().
|
static |
Definition at line 80 of file bmo_smooth_laplacian.c.
References LaplacianSystem::fweights.
Referenced by bmo_smooth_laplacian_vert_exec().
|
static |
Definition at line 355 of file bmo_smooth_laplacian.c.
References BM_EDGES_OF_MESH, BM_elem_index_get, BM_ITER_MESH, BM_mesh_calc_volume(), BM_VERT, BMO_ITER, BMVert::co, LaplacianSystem::context, e, EIG_linear_solver_variable_get(), len_v3v3(), SMOOTH_LAPLACIAN_MAX_EDGE_PERCENTAGE, SMOOTH_LAPLACIAN_MIN_EDGE_PERCENTAGE, v, and volume_preservation().
Referenced by bmo_smooth_laplacian_vert_exec().
Definition at line 313 of file bmo_smooth_laplacian.c.
References BM_edge_is_boundary(), BM_EDGES_OF_VERT, BM_elem_flag_test, BM_ELEM_SELECT, BM_FACES_OF_VERT, BM_ITER_ELEM, and v.
Referenced by bmo_smooth_laplacian_vert_exec(), and fill_laplacian_matrix().
|
static |
Definition at line 332 of file bmo_smooth_laplacian.c.
References beta(), BM_VERT, BMO_ITER, BMVert::co, BLaplacianSystem::op, pow(), BMOperator::slots_in, and v.
Referenced by validate_solution().