Blender
V3.3
|
#include "BLI_utildefines.h"
#include "BLI_math.h"
#include "BLI_string.h"
#include "BLI_utildefines_stack.h"
#include "MEM_guardedalloc.h"
#include "BLT_translation.h"
#include "DNA_defaults.h"
#include "DNA_mesh_types.h"
#include "DNA_meshdata_types.h"
#include "DNA_screen_types.h"
#include "BKE_context.h"
#include "BKE_deform.h"
#include "BKE_editmesh.h"
#include "BKE_lib_id.h"
#include "BKE_mesh.h"
#include "BKE_mesh_mapping.h"
#include "BKE_mesh_runtime.h"
#include "BKE_mesh_wrapper.h"
#include "BKE_particle.h"
#include "BKE_screen.h"
#include "UI_interface.h"
#include "UI_resources.h"
#include "BLO_read_write.h"
#include "RNA_access.h"
#include "RNA_prototypes.h"
#include "MOD_ui_common.h"
#include "MOD_util.h"
#include "eigen_capi.h"
Go to the source code of this file.
Classes | |
struct | LaplacianSystem |
Typedefs | |
typedef struct LaplacianSystem | LaplacianSystem |
Variables | |
ModifierTypeInfo | modifierType_LaplacianDeform |
typedef struct LaplacianSystem LaplacianSystem |
anonymous enum |
Definition at line 47 of file MOD_laplaciandeform.c.
|
static |
Definition at line 869 of file MOD_laplaciandeform.c.
References BLO_read_float3_array(), LaplacianDeformModifierData::cache_system, NULL, LaplacianDeformModifierData::vertexco, and LaplacianDeformModifierData::verts_num.
|
static |
Definition at line 846 of file MOD_laplaciandeform.c.
References BLI_assert, BLO_write_float3_array(), BLO_write_is_undo(), BLO_write_struct_at_address, eModifierFlag_OverrideLibrary_Local, ModifierData::flag, ID_IS_LINKED, ID_IS_OVERRIDE_LIBRARY, NULL, LaplacianDeformModifierData::vertexco, and LaplacianDeformModifierData::verts_num.
|
static |
Definition at line 302 of file MOD_laplaciandeform.c.
References LaplacianSystem::co, copy_v3_v3(), MeshElemMap::count, dot_v3v3(), fabsf, MeshElemMap::indices, LaplacianSystem::no, normalize_v3(), NULL, LaplacianSystem::ringv_map, sub_v3_v3v3(), LaplacianSystem::unit_verts, and LaplacianSystem::verts_num.
Referenced by laplacianDeformPreview().
|
static |
Definition at line 728 of file MOD_laplaciandeform.c.
References BKE_modifier_copydata_generic(), LaplacianDeformModifierData::cache_system, MEM_dupallocN, NULL, and LaplacianDeformModifierData::vertexco.
|
static |
Definition at line 142 of file MOD_laplaciandeform.c.
References indices, map, MEM_calloc_arrayN, MLoopTri::tri, and MLoop::v.
Referenced by initSystem().
|
static |
Definition at line 180 of file MOD_laplaciandeform.c.
References indices, map, MEM_calloc_arrayN, MEdge::v1, and MEdge::v2.
Referenced by initSystem().
|
static |
Definition at line 761 of file MOD_laplaciandeform.c.
References BKE_id_free(), ELEM, LaplacianDeformModifier_do(), mesh, MOD_deform_mesh_eval_get(), NULL, and ModifierEvalContext::object.
|
static |
Definition at line 778 of file MOD_laplaciandeform.c.
References BKE_id_free(), BKE_mesh_wrapper_ensure_mdata(), ELEM, LaplacianDeformModifier_do(), mesh, MOD_deform_mesh_eval_get(), NULL, and ModifierEvalContext::object.
|
static |
Definition at line 123 of file MOD_laplaciandeform.c.
References LaplacianSystem::co, LaplacianSystem::context, LaplacianSystem::delta, EIG_linear_solver_delete(), LaplacianSystem::index_anchors, MEM_SAFE_FREE, LaplacianSystem::no, LaplacianSystem::ringf_indices, LaplacianSystem::ringf_map, LaplacianSystem::ringv_indices, LaplacianSystem::ringv_map, LaplacianSystem::tris, and LaplacianSystem::unit_verts.
Referenced by freeData(), and LaplacianDeformModifier_do().
|
static |
Definition at line 801 of file MOD_laplaciandeform.c.
References LaplacianDeformModifierData::cache_system, deleteLaplacianSystem(), if(), MEM_SAFE_FREE, LaplacianDeformModifierData::vertexco, and LaplacianDeformModifierData::verts_num.
|
static |
Definition at line 719 of file MOD_laplaciandeform.c.
References BLI_assert, DNA_struct_default_get, MEMCMP_STRUCT_AFTER_IS_ZERO, and MEMCPY_STRUCT_AFTER.
|
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,
Definition at line 249 of file MOD_laplaciandeform.c.
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, v1, and v2.
Referenced by laplacianDeformPreview().
|
static |
Definition at line 97 of file MOD_laplaciandeform.c.
References LaplacianSystem::anchor_grp_name, LaplacianSystem::anchors_num, BLI_strncpy(), LaplacianSystem::co, LaplacianSystem::delta, LaplacianSystem::edges_num, LaplacianSystem::has_solution, LaplacianSystem::index_anchors, LaplacianSystem::is_matrix_computed, MEM_calloc_arrayN, MEM_malloc_arrayN, newLaplacianSystem(), LaplacianSystem::no, LaplacianSystem::repeat, LaplacianSystem::tris, LaplacianSystem::tris_num, LaplacianSystem::unit_verts, and LaplacianSystem::verts_num.
Referenced by initSystem().
|
static |
Definition at line 522 of file MOD_laplaciandeform.c.
References LaplacianDeformModifierData::anchor_grp_name, BKE_defvert_find_weight(), BKE_mesh_runtime_looptri_ensure(), BKE_mesh_runtime_looptri_len(), BLI_assert, LaplacianDeformModifierData::cache_system, LaplacianSystem::co, createFaceRingMap(), createVertRingMap(), LaplacianDeformModifierData::flag, LaplacianSystem::index_anchors, initLaplacianSystem(), isValidVertexGroup(), Mesh::medge, MEM_freeN, MEM_malloc_arrayN, mesh, Mesh::mloop, MOD_get_vgroup(), MOD_LAPLACIANDEFORM_INVERT_VGROUP, NULL, LaplacianDeformModifierData::repeat, LaplacianSystem::ringf_indices, LaplacianSystem::ringf_map, LaplacianSystem::ringv_indices, LaplacianSystem::ringv_map, STACK_DECLARE, STACK_INIT, STACK_PUSH, STACK_SIZE, Mesh::totedge, Mesh::totvert, MLoopTri::tri, LaplacianSystem::tris, LaplacianSystem::tris_num, MLoop::v, LaplacianDeformModifierData::vertexco, and LaplacianDeformModifierData::verts_num.
Referenced by LaplacianDeformModifier_do().
|
static |
Definition at line 739 of file MOD_laplaciandeform.c.
References LaplacianDeformModifierData::anchor_grp_name.
|
static |
Definition at line 590 of file MOD_laplaciandeform.c.
References LaplacianDeformModifierData::anchor_grp_name, LaplacianSystem::anchor_grp_name, LaplacianSystem::anchors_num, BKE_defvert_find_weight(), LaplacianDeformModifierData::cache_system, LaplacianSystem::edges_num, LaplacianDeformModifierData::flag, LAPDEFORM_SYSTEM_CHANGE_EDGES, LAPDEFORM_SYSTEM_CHANGE_NOT_VALID_GROUP, LAPDEFORM_SYSTEM_CHANGE_VERTEXES, LAPDEFORM_SYSTEM_NOT_CHANGE, LAPDEFORM_SYSTEM_ONLY_CHANGE_ANCHORS, LAPDEFORM_SYSTEM_ONLY_CHANGE_GROUP, mesh, MOD_get_vgroup(), MOD_LAPLACIANDEFORM_INVERT_VGROUP, NULL, STREQ, Mesh::totedge, and LaplacianSystem::verts_num.
Referenced by LaplacianDeformModifier_do().
|
static |
Definition at line 512 of file MOD_laplaciandeform.c.
References LaplacianDeformModifierData::anchor_grp_name, mesh, MOD_get_vgroup(), and NULL.
Referenced by initSystem(), and LaplacianDeformModifier_do().
|
static |
Definition at line 633 of file MOD_laplaciandeform.c.
References LaplacianDeformModifierData::anchor_grp_name, LaplacianSystem::anchor_grp_name, BKE_modifier_set_error(), LaplacianDeformModifierData::cache_system, deleteLaplacianSystem(), LaplacianSystem::edges_num, ELEM, LaplacianDeformModifierData::flag, float(), LaplacianSystem::has_solution, initSystem(), LaplacianSystem::is_matrix_computed, isSystemDifferent(), isValidVertexGroup(), LAPDEFORM_SYSTEM_CHANGE_EDGES, LAPDEFORM_SYSTEM_CHANGE_NOT_VALID_GROUP, LAPDEFORM_SYSTEM_CHANGE_VERTEXES, LAPDEFORM_SYSTEM_ONLY_CHANGE_ANCHORS, LAPDEFORM_SYSTEM_ONLY_CHANGE_GROUP, laplacianDeformPreview(), MEM_malloc_arrayN, MEM_SAFE_FREE, mesh, MOD_LAPLACIANDEFORM_BIND, LaplacianDeformModifierData::modifier, NULL, LaplacianDeformModifierData::repeat, LaplacianSystem::repeat, Mesh::totedge, LaplacianDeformModifierData::vertexco, and LaplacianDeformModifierData::verts_num.
Referenced by deformVerts(), and deformVertsEM().
|
static |
Definition at line 395 of file MOD_laplaciandeform.c.
References LaplacianSystem::anchors_num, LaplacianSystem::co, computeImplictRotations(), LaplacianSystem::context, LaplacianSystem::delta, 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_get(), EIG_linear_solver_variable_set(), LaplacianSystem::has_solution, LaplacianSystem::index_anchors, initLaplacianMatrix(), LaplacianSystem::is_matrix_computed, LaplacianSystem::repeat, rotateDifferentialCoordinates(), and LaplacianSystem::verts_num.
Referenced by LaplacianDeformModifier_do().
|
static |
Definition at line 80 of file MOD_laplaciandeform.c.
References LaplacianSystem::anchor_grp_name, LaplacianSystem::anchors_num, LaplacianSystem::edges_num, LaplacianSystem::has_solution, LaplacianSystem::is_matrix_computed, MEM_callocN, LaplacianSystem::repeat, LaplacianSystem::tris_num, and LaplacianSystem::verts_num.
Referenced by initLaplacianSystem().
Definition at line 812 of file MOD_laplaciandeform.c.
References IFACE_, Panel::layout, modifier_panel_end(), modifier_panel_get_property_pointers(), modifier_vgroup_ui(), NULL, ptr, RNA_boolean_get(), RNA_string_length(), uiItemO(), uiItemR(), uiItemS(), uiLayoutRow(), uiLayoutSetEnabled(), and uiLayoutSetPropSep().
Referenced by panelRegister().
|
static |
Definition at line 841 of file MOD_laplaciandeform.c.
References eModifierType_LaplacianDeform, modifier_panel_register(), and panel_draw().
|
static |
Definition at line 750 of file MOD_laplaciandeform.c.
References LaplacianDeformModifierData::anchor_grp_name, CD_MASK_MDEFORMVERT, and CustomData_MeshMasks::vmask.
|
static |
Definition at line 327 of file MOD_laplaciandeform.c.
References add_v3_v3(), beta(), LaplacianSystem::co, LaplacianSystem::context, copy_v3_v3(), MeshElemMap::count, cross_v3_v3v3(), LaplacianSystem::delta, dot_v3v3(), EIG_linear_solver_right_hand_side_add(), EIG_linear_solver_variable_get(), MeshElemMap::indices, len_squared_v3(), mul_v3_v3fl(), LaplacianSystem::no, normal_tri_v3(), normalize_v3(), LaplacianSystem::ringf_map, sub_v3_v3(), sub_v3_v3v3(), LaplacianSystem::tris, LaplacianSystem::unit_verts, UNPACK3, LaplacianSystem::verts_num, vn, and zero_v3().
Referenced by laplacianDeformPreview().
ModifierTypeInfo modifierType_LaplacianDeform |
Definition at line 877 of file MOD_laplaciandeform.c.