Blender V2.61 - r43446
|
#include <math.h>
#include <string.h>
#include "MEM_guardedalloc.h"
#include "DNA_object_types.h"
#include "DNA_mesh_types.h"
#include "DNA_meshdata_types.h"
#include "DNA_scene_types.h"
#include "BLI_math.h"
#include "BLI_edgehash.h"
#include "BLI_memarena.h"
#include "BLI_utildefines.h"
#include "BLI_string.h"
#include "BKE_DerivedMesh.h"
#include "BKE_modifier.h"
#include "ONL_opennl.h"
#include "BLO_sys_types.h"
#include "ED_mesh.h"
#include "ED_armature.h"
#include "meshlaplacian.h"
Go to the source code of this file.
Classes | |
struct | LaplacianSystem |
struct | LaplacianSystem::HeatWeighting |
struct | BVHCallbackUserData |
struct | MDefBoundIsect |
struct | MDefBindInfluence |
struct | MeshDeformBind |
struct | MeshDeformIsect |
Defines | |
#define | C_WEIGHT 1.0f |
#define | WEIGHT_LIMIT_START 0.05f |
#define | WEIGHT_LIMIT_END 0.025f |
#define | DISTANCE_EPSILON 1e-4f |
#define | EPSILON 0.0001f |
#define | MESHDEFORM_TAG_UNTYPED 0 |
#define | MESHDEFORM_TAG_BOUNDARY 1 |
#define | MESHDEFORM_TAG_INTERIOR 2 |
#define | MESHDEFORM_TAG_EXTERIOR 3 |
#define | MESHDEFORM_LEN_THRESHOLD 1e-6f |
#define | MESHDEFORM_MIN_INFLUENCE 0.0005f |
Typedefs | |
typedef struct BVHCallbackUserData | BVHCallbackUserData |
typedef struct MDefBoundIsect | MDefBoundIsect |
typedef struct MDefBindInfluence | MDefBindInfluence |
typedef struct MeshDeformBind | MeshDeformBind |
typedef struct MeshDeformIsect | MeshDeformIsect |
Functions | |
static void | waitcursor (int UNUSED(val)) |
static void | progress_bar (int UNUSED(dummy_val), const char *UNUSED(dummy)) |
static void | start_progress_bar (void) |
static void | end_progress_bar (void) |
static void | error (const char *str) |
static void | laplacian_increase_edge_count (EdgeHash *edgehash, int v1, int v2) |
static int | laplacian_edge_count (EdgeHash *edgehash, int v1, int v2) |
static float | cotan_weight (float *v1, float *v2, float *v3) |
static void | laplacian_triangle_area (LaplacianSystem *sys, int i1, int i2, int i3) |
static void | laplacian_triangle_weights (LaplacianSystem *sys, int f, int i1, int i2, int i3) |
static LaplacianSystem * | laplacian_system_construct_begin (int totvert, int totface, int lsq) |
void | laplacian_add_vertex (LaplacianSystem *sys, float *co, int pinned) |
void | laplacian_add_triangle (LaplacianSystem *sys, int v1, int v2, int v3) |
static void | laplacian_system_construct_end (LaplacianSystem *sys) |
static void | laplacian_system_delete (LaplacianSystem *sys) |
void | laplacian_begin_solve (LaplacianSystem *sys, int index) |
void | laplacian_add_right_hand_side (LaplacianSystem *UNUSED(sys), int v, float value) |
int | laplacian_system_solve (LaplacianSystem *sys) |
float | laplacian_system_get_solution (int v) |
static void | bvh_callback (void *userdata, int index, const BVHTreeRay *UNUSED(ray), BVHTreeRayHit *hit) |
static void | heat_ray_tree_create (LaplacianSystem *sys) |
static int | heat_ray_source_visible (LaplacianSystem *sys, int vertex, int source) |
static float | heat_source_distance (LaplacianSystem *sys, int vertex, int source) |
static int | heat_source_closest (LaplacianSystem *sys, int vertex, int source) |
static void | heat_set_H (LaplacianSystem *sys, int vertex) |
static void | heat_calc_vnormals (LaplacianSystem *sys) |
static void | heat_laplacian_create (LaplacianSystem *sys) |
static void | heat_system_free (LaplacianSystem *sys) |
static float | heat_limit_weight (float weight) |
void | heat_bone_weighting (Object *ob, Mesh *me, float(*verts)[3], int numsource, bDeformGroup **dgrouplist, bDeformGroup **dgroupflip, float(*root)[3], float(*tip)[3], int *selected, const char **err_str) |
static int | meshdeform_tri_intersect (float orig[3], float end[3], float vert0[3], float vert1[3], float vert2[3], float *isectco, float *uvw) |
static int | meshdeform_intersect (MeshDeformBind *mdb, MeshDeformIsect *isec) |
static MDefBoundIsect * | meshdeform_ray_tree_intersect (MeshDeformBind *mdb, float *co1, float *co2) |
static int | meshdeform_inside_cage (MeshDeformBind *mdb, float *co) |
static int | meshdeform_index (MeshDeformBind *mdb, int x, int y, int z, int n) |
static void | meshdeform_cell_center (MeshDeformBind *mdb, int x, int y, int z, int n, float *center) |
static void | meshdeform_add_intersections (MeshDeformBind *mdb, int x, int y, int z) |
static void | meshdeform_bind_floodfill (MeshDeformBind *mdb) |
static float | meshdeform_boundary_phi (MeshDeformBind *UNUSED(mdb), MDefBoundIsect *isect, int cagevert) |
static float | meshdeform_interp_w (MeshDeformBind *mdb, float *gridvec, float *UNUSED(vec), int UNUSED(cagevert)) |
static void | meshdeform_check_semibound (MeshDeformBind *mdb, int x, int y, int z) |
static float | meshdeform_boundary_total_weight (MeshDeformBind *mdb, int x, int y, int z) |
static void | meshdeform_matrix_add_cell (MeshDeformBind *mdb, int x, int y, int z) |
static void | meshdeform_matrix_add_rhs (MeshDeformBind *mdb, int x, int y, int z, int cagevert) |
static void | meshdeform_matrix_add_semibound_phi (MeshDeformBind *mdb, int x, int y, int z, int cagevert) |
static void | meshdeform_matrix_add_exterior_phi (MeshDeformBind *mdb, int x, int y, int z, int UNUSED(cagevert)) |
static void | meshdeform_matrix_solve (MeshDeformModifierData *mmd, MeshDeformBind *mdb) |
static void | harmonic_coordinates_bind (Scene *UNUSED(scene), MeshDeformModifierData *mmd, MeshDeformBind *mdb) |
void | mesh_deform_bind (Scene *scene, MeshDeformModifierData *mmd, float *vertexcos, int totvert, float cagemat[][4]) |
Variables | |
static int | MESHDEFORM_OFFSET [7][3] |
Definition in file meshlaplacian.c.
#define C_WEIGHT 1.0f |
Definition at line 396 of file meshlaplacian.c.
Referenced by heat_set_H().
#define DISTANCE_EPSILON 1e-4f |
Definition at line 399 of file meshlaplacian.c.
Referenced by heat_source_closest().
#define EPSILON 0.0001f |
Definition at line 1055 of file meshlaplacian.c.
Referenced by meshdeform_tri_intersect().
#define MESHDEFORM_LEN_THRESHOLD 1e-6f |
Definition at line 1062 of file meshlaplacian.c.
Referenced by meshdeform_ray_tree_intersect().
#define MESHDEFORM_MIN_INFLUENCE 0.0005f |
Definition at line 1064 of file meshlaplacian.c.
Referenced by meshdeform_matrix_solve().
#define MESHDEFORM_TAG_BOUNDARY 1 |
Definition at line 1058 of file meshlaplacian.c.
Referenced by meshdeform_add_intersections(), and meshdeform_bind_floodfill().
#define MESHDEFORM_TAG_EXTERIOR 3 |
Definition at line 1060 of file meshlaplacian.c.
Referenced by meshdeform_bind_floodfill(), meshdeform_check_semibound(), meshdeform_matrix_add_cell(), meshdeform_matrix_add_exterior_phi(), meshdeform_matrix_add_rhs(), and meshdeform_matrix_solve().
#define MESHDEFORM_TAG_INTERIOR 2 |
Definition at line 1059 of file meshlaplacian.c.
Referenced by meshdeform_bind_floodfill(), and meshdeform_matrix_solve().
#define MESHDEFORM_TAG_UNTYPED 0 |
Definition at line 1057 of file meshlaplacian.c.
Referenced by harmonic_coordinates_bind(), and meshdeform_bind_floodfill().
#define WEIGHT_LIMIT_END 0.025f |
Definition at line 398 of file meshlaplacian.c.
Referenced by heat_limit_weight().
#define WEIGHT_LIMIT_START 0.05f |
Definition at line 397 of file meshlaplacian.c.
Referenced by heat_limit_weight().
typedef struct BVHCallbackUserData BVHCallbackUserData |
typedef struct MDefBindInfluence MDefBindInfluence |
typedef struct MDefBoundIsect MDefBoundIsect |
typedef struct MeshDeformBind MeshDeformBind |
typedef struct MeshDeformIsect MeshDeformIsect |
static void bvh_callback | ( | void * | userdata, |
int | index, | ||
const BVHTreeRay * | UNUSEDray, | ||
BVHTreeRayHit * | hit | ||
) | [static] |
Definition at line 407 of file meshlaplacian.c.
References data, BVHTreeRayHit::dist, dot_v3v3(), credits_svn_gen::e, LaplacianSystem::heat, BVHTreeRayHit::index, isect_ray_tri_v3(), LaplacianSystem::HeatWeighting::mface, mul_v3_v3fl(), normal_tri_v3(), BVHCallbackUserData::start, BVHCallbackUserData::sys, MFace::v1, MFace::v2, MFace::v3, MFace::v4, BVHCallbackUserData::vec, and LaplacianSystem::HeatWeighting::verts.
Referenced by heat_ray_source_visible().
static float cotan_weight | ( | float * | v1, |
float * | v2, | ||
float * | v3 | ||
) | [static] |
Definition at line 154 of file meshlaplacian.c.
References cross_v3_v3v3(), dot_v3v3(), len_v3(), and sub_v3_v3v3().
Referenced by laplacian_triangle_area(), and laplacian_triangle_weights().
static void end_progress_bar | ( | void | ) | [static] |
Definition at line 73 of file meshlaplacian.c.
Referenced by mesh_deform_bind().
static void error | ( | const char * | str | ) | [static] |
Definition at line 74 of file meshlaplacian.c.
Referenced by meshdeform_matrix_solve().
static void harmonic_coordinates_bind | ( | Scene * | UNUSEDscene, |
MeshDeformModifierData * | mmd, | ||
MeshDeformBind * | mdb | ||
) | [static] |
Definition at line 1738 of file meshlaplacian.c.
References MeshDeformModifierData::bindweights, BLI_memarena_free(), BLI_memarena_new(), BLI_MEMARENA_STD_BUFSIZE, BLI_memarena_use_calloc(), MeshDeformBind::boundisect, MeshDeformBind::cagecos, copy_v3_v3(), DO_MINMAX, MeshDeformModifierData::dyncellmin, MeshDeformModifierData::dyncellwidth, MeshDeformBind::dyngrid, MeshDeformModifierData::dyngrid, MeshDeformModifierData::dyngridsize, MeshDeformModifierData::dyninfluences, MeshDeformModifierData::dynverts, MeshDeformModifierData::flag, MeshDeformModifierData::gridsize, MeshDeformBind::halfwidth, INIT_MINMAX, MeshDeformBind::inside, MeshDeformBind::max, MEM_callocN(), MEM_freeN(), MeshDeformBind::memarena, meshdeform_add_intersections(), meshdeform_bind_floodfill(), meshdeform_check_semibound(), meshdeform_inside_cage(), meshdeform_matrix_solve(), MESHDEFORM_TAG_UNTYPED, MeshDeformBind::min, MOD_MDEF_DYNAMIC_BIND, MDefBindInfluence::next, MDefCell::offset, MeshDeformBind::phi, progress_bar(), MeshDeformBind::semibound, size(), MeshDeformBind::size, MeshDeformBind::size3, MeshDeformBind::tag, MeshDeformBind::totalphi, MeshDeformBind::totcagevert, MDefCell::totinfluence, MeshDeformModifierData::totinfluence, MeshDeformBind::totvert, MDefBindInfluence::vertex, MDefInfluence::vertex, MeshDeformBind::vertexcos, MDefBindInfluence::weight, MDefInfluence::weight, MeshDeformBind::weights, and MeshDeformBind::width.
Referenced by mesh_deform_bind().
void heat_bone_weighting | ( | Object * | ob, |
Mesh * | me, | ||
float(*) | verts[3], | ||
int | numsource, | ||
bDeformGroup ** | dgrouplist, | ||
bDeformGroup ** | dgroupflip, | ||
float(*) | root[3], | ||
float(*) | tip[3], | ||
int * | selected, | ||
const char ** | err_str | ||
) |
Definition at line 651 of file meshlaplacian.c.
References ED_vgroup_vert_add(), ED_vgroup_vert_remove(), ED_vgroup_vert_weight(), Mesh::editflag, FALSE, MVert::flag, LaplacianSystem::HeatWeighting::H, LaplacianSystem::heat, heat_laplacian_create(), heat_limit_weight(), heat_ray_tree_create(), heat_source_closest(), heat_system_free(), laplacian_add_right_hand_side(), laplacian_begin_solve(), laplacian_system_construct_begin(), laplacian_system_construct_end(), laplacian_system_delete(), laplacian_system_get_solution(), laplacian_system_solve(), ME_EDIT_PAINT_MASK, ME_EDIT_VERT_SEL, MEM_callocN(), MEM_freeN(), mesh_get_x_mirror_vert(), LaplacianSystem::HeatWeighting::mface, Mesh::mface, Mesh::mvert, NULL, LaplacianSystem::HeatWeighting::numsource, LaplacianSystem::HeatWeighting::p, LaplacianSystem::HeatWeighting::root, MakeCursor::root, SELECT, BVHCallbackUserData::sys, LaplacianSystem::HeatWeighting::tip, LaplacianSystem::HeatWeighting::totface, Mesh::totface, Mesh::totvert, LaplacianSystem::HeatWeighting::totvert, MFace::v1, MFace::v2, MFace::v3, MFace::v4, LaplacianSystem::HeatWeighting::verts, WEIGHT_ADD, and WEIGHT_REPLACE.
Referenced by add_verts_to_dgroups().
static void heat_calc_vnormals | ( | LaplacianSystem * | sys | ) | [static] |
Definition at line 573 of file meshlaplacian.c.
References add_v3_v3(), LaplacianSystem::faces, LaplacianSystem::heat, MEM_callocN(), normal_tri_v3(), normalize_v3(), LaplacianSystem::totvert, LaplacianSystem::verts, and LaplacianSystem::HeatWeighting::vnors.
Referenced by heat_laplacian_create().
static void heat_laplacian_create | ( | LaplacianSystem * | sys | ) | [static] |
Definition at line 596 of file meshlaplacian.c.
References LaplacianSystem::HeatWeighting::H, LaplacianSystem::heat, heat_calc_vnormals(), heat_set_H(), laplacian_add_triangle(), laplacian_add_vertex(), MEM_callocN(), LaplacianSystem::HeatWeighting::mface, LaplacianSystem::HeatWeighting::mindist, LaplacianSystem::HeatWeighting::p, LaplacianSystem::HeatWeighting::totface, LaplacianSystem::HeatWeighting::totvert, and LaplacianSystem::HeatWeighting::verts.
Referenced by heat_bone_weighting().
static float heat_limit_weight | ( | float | weight | ) | [static] |
Definition at line 636 of file meshlaplacian.c.
References WEIGHT_LIMIT_END, and WEIGHT_LIMIT_START.
Referenced by heat_bone_weighting().
static int heat_ray_source_visible | ( | LaplacianSystem * | sys, |
int | vertex, | ||
int | source | ||
) | [static] |
Definition at line 471 of file meshlaplacian.c.
References BLI_bvhtree_ray_cast(), bvh_callback(), LaplacianSystem::HeatWeighting::bvhtree, closest_to_line_segment_v3(), copy_v3_v3(), data, BVHTreeRayHit::dist, credits_svn_gen::e, LaplacianSystem::heat, BVHTreeRayHit::index, madd_v3_v3v3fl(), mul_v3_fl(), normalize_v3(), LaplacianSystem::HeatWeighting::root, LaplacianSystem::HeatWeighting::source, BVHCallbackUserData::start, sub_v3_v3v3(), BVHCallbackUserData::sys, LaplacianSystem::HeatWeighting::tip, BVHCallbackUserData::vec, LaplacianSystem::HeatWeighting::verts, and LaplacianSystem::HeatWeighting::vface.
Referenced by heat_source_closest().
static void heat_ray_tree_create | ( | LaplacianSystem * | sys | ) | [static] |
Definition at line 436 of file meshlaplacian.c.
References BLI_bvhtree_balance(), BLI_bvhtree_insert(), BLI_bvhtree_new(), LaplacianSystem::HeatWeighting::bvhtree, DO_MINMAX, LaplacianSystem::heat, INIT_MINMAX, MEM_callocN(), LaplacianSystem::HeatWeighting::mface, LaplacianSystem::HeatWeighting::totface, LaplacianSystem::HeatWeighting::totvert, MFace::v1, MFace::v2, MFace::v3, MFace::v4, LaplacianSystem::HeatWeighting::verts, and LaplacianSystem::HeatWeighting::vface.
Referenced by heat_bone_weighting().
static void heat_set_H | ( | LaplacianSystem * | sys, |
int | vertex | ||
) | [static] |
Definition at line 538 of file meshlaplacian.c.
References C_WEIGHT, credits_svn_gen::e, LaplacianSystem::HeatWeighting::H, LaplacianSystem::heat, heat_source_closest(), heat_source_distance(), maxf(), LaplacianSystem::HeatWeighting::mindist, LaplacianSystem::HeatWeighting::numsource, and LaplacianSystem::HeatWeighting::p.
Referenced by heat_laplacian_create().
static int heat_source_closest | ( | LaplacianSystem * | sys, |
int | vertex, | ||
int | source | ||
) | [static] |
Definition at line 525 of file meshlaplacian.c.
References DISTANCE_EPSILON, heat_ray_source_visible(), and heat_source_distance().
Referenced by heat_bone_weighting(), and heat_set_H().
static float heat_source_distance | ( | LaplacianSystem * | sys, |
int | vertex, | ||
int | source | ||
) | [static] |
Definition at line 505 of file meshlaplacian.c.
References closest_to_line_segment_v3(), copy_v3_v3(), simple_enum_gen::d, dot_v3v3(), LaplacianSystem::heat, normalize_v3(), LaplacianSystem::HeatWeighting::root, LaplacianSystem::HeatWeighting::source, sub_v3_v3v3(), LaplacianSystem::HeatWeighting::tip, LaplacianSystem::HeatWeighting::verts, and LaplacianSystem::HeatWeighting::vnors.
Referenced by heat_set_H(), and heat_source_closest().
static void heat_system_free | ( | LaplacianSystem * | sys | ) | [static] |
Definition at line 625 of file meshlaplacian.c.
References BLI_bvhtree_free(), LaplacianSystem::HeatWeighting::bvhtree, LaplacianSystem::HeatWeighting::H, LaplacianSystem::heat, MEM_freeN(), LaplacianSystem::HeatWeighting::mindist, LaplacianSystem::HeatWeighting::p, LaplacianSystem::HeatWeighting::vface, and LaplacianSystem::HeatWeighting::vnors.
Referenced by heat_bone_weighting().
void laplacian_add_right_hand_side | ( | LaplacianSystem * | UNUSEDsys, |
int | v, | ||
float | value | ||
) |
Definition at line 371 of file meshlaplacian.c.
References nlRightHandSideAdd().
Referenced by heat_bone_weighting().
void laplacian_add_triangle | ( | LaplacianSystem * | sys, |
int | v1, | ||
int | v2, | ||
int | v3 | ||
) |
Definition at line 279 of file meshlaplacian.c.
References LaplacianSystem::faces, and LaplacianSystem::totface.
Referenced by heat_laplacian_create().
void laplacian_add_vertex | ( | LaplacianSystem * | sys, |
float * | co, | ||
int | pinned | ||
) |
Definition at line 272 of file meshlaplacian.c.
References co, LaplacianSystem::totvert, LaplacianSystem::verts, and LaplacianSystem::vpinned.
Referenced by heat_laplacian_create().
void laplacian_begin_solve | ( | LaplacianSystem * | sys, |
int | index | ||
) |
Definition at line 350 of file meshlaplacian.c.
References NL_MATRIX, NL_SYSTEM, nlBegin(), LaplacianSystem::nlbegun, nlLockVariable(), nlSetVariable(), LaplacianSystem::totvert, LaplacianSystem::verts, and LaplacianSystem::vpinned.
Referenced by heat_bone_weighting(), and laplacian_system_construct_end().
static int laplacian_edge_count | ( | EdgeHash * | edgehash, |
int | v1, | ||
int | v2 | ||
) | [static] |
Definition at line 149 of file meshlaplacian.c.
References BLI_edgehash_lookup().
Referenced by laplacian_triangle_weights().
static void laplacian_increase_edge_count | ( | EdgeHash * | edgehash, |
int | v1, | ||
int | v2 | ||
) | [static] |
Definition at line 139 of file meshlaplacian.c.
References BLI_edgehash_insert(), BLI_edgehash_lookup_p(), and p.
Referenced by laplacian_system_construct_end().
static LaplacianSystem* laplacian_system_construct_begin | ( | int | totvert, |
int | totface, | ||
int | lsq | ||
) | [static] |
Definition at line 245 of file meshlaplacian.c.
References LaplacianSystem::areaweights, LaplacianSystem::context, LaplacianSystem::faces, MEM_callocN(), NL_LEAST_SQUARES, NL_NB_VARIABLES, NL_TRUE, nlGetCurrent(), nlNewContext(), nlSolverParameteri(), LaplacianSystem::storeweights, LaplacianSystem::totface, LaplacianSystem::totvert, LaplacianSystem::verts, and LaplacianSystem::vpinned.
Referenced by heat_bone_weighting().
static void laplacian_system_construct_end | ( | LaplacianSystem * | sys | ) | [static] |
Definition at line 287 of file meshlaplacian.c.
References LaplacianSystem::areaweights, BLI_edgehash_free(), BLI_edgehash_new(), LaplacianSystem::edgehash, LaplacianSystem::faces, LaplacianSystem::fweights, LaplacianSystem::HeatWeighting::H, LaplacianSystem::heat, laplacian_begin_solve(), laplacian_increase_edge_count(), laplacian_triangle_area(), laplacian_triangle_weights(), MEM_callocN(), MEM_freeN(), nlMatrixAdd(), NULL, LaplacianSystem::storeweights, LaplacianSystem::totface, LaplacianSystem::totvert, and LaplacianSystem::varea.
Referenced by heat_bone_weighting().
static void laplacian_system_delete | ( | LaplacianSystem * | sys | ) | [static] |
Definition at line 338 of file meshlaplacian.c.
References LaplacianSystem::context, LaplacianSystem::faces, LaplacianSystem::fweights, MEM_freeN(), nlDeleteContext(), LaplacianSystem::varea, LaplacianSystem::verts, and LaplacianSystem::vpinned.
Referenced by heat_bone_weighting().
float laplacian_system_get_solution | ( | int | v | ) |
Definition at line 387 of file meshlaplacian.c.
References nlGetVariable().
Referenced by heat_bone_weighting().
int laplacian_system_solve | ( | LaplacianSystem * | sys | ) |
Definition at line 376 of file meshlaplacian.c.
References NL_MATRIX, NL_SYSTEM, NL_TRUE, LaplacianSystem::nlbegun, nlEnd(), nlSolveAdvanced(), and NULL.
Referenced by heat_bone_weighting().
static void laplacian_triangle_area | ( | LaplacianSystem * | sys, |
int | i1, | ||
int | i2, | ||
int | i3 | ||
) | [static] |
Definition at line 170 of file meshlaplacian.c.
References angle_v3v3v3(), area_tri_v3(), cotan_weight(), len_v3v3(), RAD2DEGF, LaplacianSystem::varea, and LaplacianSystem::verts.
Referenced by laplacian_system_construct_end().
static void laplacian_triangle_weights | ( | LaplacianSystem * | sys, |
int | f, | ||
int | i1, | ||
int | i2, | ||
int | i3 | ||
) | [static] |
Definition at line 210 of file meshlaplacian.c.
References cotan_weight(), LaplacianSystem::edgehash, LaplacianSystem::fweights, laplacian_edge_count(), nlMatrixAdd(), LaplacianSystem::storeweights, LaplacianSystem::varea, and LaplacianSystem::verts.
Referenced by laplacian_system_construct_end().
void mesh_deform_bind | ( | Scene * | scene, |
MeshDeformModifierData * | mmd, | ||
float * | vertexcos, | ||
int | totvert, | ||
float | cagemat[][4] | ||
) |
Definition at line 1948 of file meshlaplacian.c.
References MeshDeformModifierData::bindcagecos, MeshDeformModifierData::bindmat, MeshDeformBind::cagecos, MeshDeformBind::cagedm, MeshDeformBind::cagemat, CD_MASK_BAREMESH, MVert::co, copy_m4_m4(), copy_v3_v3(), end_progress_bar(), DerivedMesh::getNumVerts, DerivedMesh::getVertArray, harmonic_coordinates_bind(), MEM_callocN(), MEM_freeN(), mesh_create_derived_no_deform(), MOD_MDEF_VOLUME, MeshDeformModifierData::mode, modifier_mdef_compact_influences(), mul_m4_v3(), mul_v3_m4v3(), NULL, MeshDeformModifierData::object, Object::obmat, DerivedMesh::release, start_progress_bar(), MeshDeformModifierData::totcagevert, MeshDeformBind::totcagevert, MeshDeformBind::totvert, MeshDeformModifierData::totvert, MeshDeformBind::vertexcos, and waitcursor().
Referenced by meshdeform_bind_exec().
static void meshdeform_add_intersections | ( | MeshDeformBind * | mdb, |
int | x, | ||
int | y, | ||
int | z | ||
) | [static] |
Definition at line 1341 of file meshlaplacian.c.
References MeshDeformBind::boundisect, i, meshdeform_cell_center(), meshdeform_index(), meshdeform_ray_tree_intersect(), MESHDEFORM_TAG_BOUNDARY, and MeshDeformBind::tag.
Referenced by harmonic_coordinates_bind().
static void meshdeform_bind_floodfill | ( | MeshDeformBind * | mdb | ) | [static] |
Definition at line 1365 of file meshlaplacian.c.
References MeshDeformBind::boundisect, i, MEM_callocN(), MEM_freeN(), meshdeform_index(), MESHDEFORM_TAG_BOUNDARY, MESHDEFORM_TAG_EXTERIOR, MESHDEFORM_TAG_INTERIOR, MESHDEFORM_TAG_UNTYPED, MeshDeformBind::semibound, size(), MeshDeformBind::size, MeshDeformBind::size3, stack, and MeshDeformBind::tag.
Referenced by harmonic_coordinates_bind().
static float meshdeform_boundary_phi | ( | MeshDeformBind * | UNUSEDmdb, |
MDefBoundIsect * | isect, | ||
int | cagevert | ||
) | [static] |
Definition at line 1426 of file meshlaplacian.c.
References MDefBoundIsect::nvert, MDefBoundIsect::uvw, and MDefBoundIsect::v.
Referenced by meshdeform_matrix_add_rhs(), and meshdeform_matrix_add_semibound_phi().
static float meshdeform_boundary_total_weight | ( | MeshDeformBind * | mdb, |
int | x, | ||
int | y, | ||
int | z | ||
) | [static] |
Definition at line 1487 of file meshlaplacian.c.
References MeshDeformBind::boundisect, i, MDefBoundIsect::len, meshdeform_index(), MeshDeformBind::semibound, and MeshDeformBind::width.
Referenced by meshdeform_matrix_add_cell(), meshdeform_matrix_add_rhs(), and meshdeform_matrix_add_semibound_phi().
static void meshdeform_cell_center | ( | MeshDeformBind * | mdb, |
int | x, | ||
int | y, | ||
int | z, | ||
int | n, | ||
float * | center | ||
) | [static] |
Definition at line 1330 of file meshlaplacian.c.
References MeshDeformBind::halfwidth, MeshDeformBind::min, and MeshDeformBind::width.
Referenced by meshdeform_add_intersections().
static void meshdeform_check_semibound | ( | MeshDeformBind * | mdb, |
int | x, | ||
int | y, | ||
int | z | ||
) | [static] |
Definition at line 1474 of file meshlaplacian.c.
References MeshDeformBind::boundisect, i, meshdeform_index(), MESHDEFORM_TAG_EXTERIOR, MeshDeformBind::semibound, and MeshDeformBind::tag.
Referenced by harmonic_coordinates_bind().
static int meshdeform_index | ( | MeshDeformBind * | mdb, |
int | x, | ||
int | y, | ||
int | z, | ||
int | n | ||
) | [static] |
Definition at line 1312 of file meshlaplacian.c.
References size(), and MeshDeformBind::size.
Referenced by meshdeform_add_intersections(), meshdeform_bind_floodfill(), meshdeform_boundary_total_weight(), meshdeform_check_semibound(), meshdeform_interp_w(), meshdeform_matrix_add_cell(), meshdeform_matrix_add_exterior_phi(), meshdeform_matrix_add_rhs(), and meshdeform_matrix_add_semibound_phi().
static int meshdeform_inside_cage | ( | MeshDeformBind * | mdb, |
float * | co | ||
) | [static] |
Definition at line 1287 of file meshlaplacian.c.
References copy_v3_v3(), MDefBoundIsect::facing, i, MeshDeformBind::max, meshdeform_ray_tree_intersect(), MeshDeformBind::min, normalize_v3(), and sub_v3_v3v3().
Referenced by harmonic_coordinates_bind().
static float meshdeform_interp_w | ( | MeshDeformBind * | mdb, |
float * | gridvec, | ||
float * | UNUSEDvec, | ||
int | UNUSEDcagevert | ||
) | [static] |
Definition at line 1437 of file meshlaplacian.c.
References CLAMP(), i, meshdeform_index(), MeshDeformBind::phi, and MeshDeformBind::size.
Referenced by meshdeform_matrix_solve().
static int meshdeform_intersect | ( | MeshDeformBind * | mdb, |
MeshDeformIsect * | isec | ||
) | [static] |
Definition at line 1183 of file meshlaplacian.c.
References add_v3_v3v3(), MeshDeformBind::cagecos, MeshDeformBind::cagedm, co, copy_v3_v3(), dot_v3v3(), MeshDeformIsect::face, DerivedMesh::getFaceArray, DerivedMesh::getNumFaces, MeshDeformIsect::isect, MeshDeformIsect::labda, len(), len_v3v3(), meshdeform_tri_intersect(), normal_tri_v3(), MeshDeformIsect::start, MFace::v1, MFace::v2, MFace::v3, MFace::v4, and MeshDeformIsect::vec.
Referenced by meshdeform_ray_tree_intersect().
static void meshdeform_matrix_add_cell | ( | MeshDeformBind * | mdb, |
int | x, | ||
int | y, | ||
int | z | ||
) | [static] |
Definition at line 1512 of file meshlaplacian.c.
References MeshDeformBind::boundisect, i, meshdeform_boundary_total_weight(), meshdeform_index(), MESHDEFORM_TAG_EXTERIOR, nlMatrixAdd(), MeshDeformBind::tag, MeshDeformBind::varidx, and MeshDeformBind::width.
Referenced by meshdeform_matrix_solve().
static void meshdeform_matrix_add_exterior_phi | ( | MeshDeformBind * | mdb, |
int | x, | ||
int | y, | ||
int | z, | ||
int | UNUSEDcagevert | ||
) | [static] |
Definition at line 1588 of file meshlaplacian.c.
References i, meshdeform_index(), MESHDEFORM_TAG_EXTERIOR, MeshDeformBind::phi, MeshDeformBind::semibound, and MeshDeformBind::tag.
Referenced by meshdeform_matrix_solve().
static void meshdeform_matrix_add_rhs | ( | MeshDeformBind * | mdb, |
int | x, | ||
int | y, | ||
int | z, | ||
int | cagevert | ||
) | [static] |
Definition at line 1538 of file meshlaplacian.c.
References MeshDeformBind::boundisect, i, MDefBoundIsect::len, meshdeform_boundary_phi(), meshdeform_boundary_total_weight(), meshdeform_index(), MESHDEFORM_TAG_EXTERIOR, nlRightHandSideAdd(), MeshDeformBind::tag, and MeshDeformBind::varidx.
Referenced by meshdeform_matrix_solve().
static void meshdeform_matrix_add_semibound_phi | ( | MeshDeformBind * | mdb, |
int | x, | ||
int | y, | ||
int | z, | ||
int | cagevert | ||
) | [static] |
Definition at line 1564 of file meshlaplacian.c.
References MeshDeformBind::boundisect, i, MDefBoundIsect::len, meshdeform_boundary_phi(), meshdeform_boundary_total_weight(), meshdeform_index(), MeshDeformBind::phi, and MeshDeformBind::semibound.
Referenced by meshdeform_matrix_solve().
static void meshdeform_matrix_solve | ( | MeshDeformModifierData * | mmd, |
MeshDeformBind * | mdb | ||
) | [static] |
Definition at line 1612 of file meshlaplacian.c.
References BLI_memarena_alloc(), BLI_snprintf(), copy_v3_v3(), MeshDeformBind::dyngrid, error(), fabs(), MeshDeformBind::halfwidth, MeshDeformBind::inside, MEM_callocN(), MEM_freeN(), MeshDeformBind::memarena, meshdeform_interp_w(), meshdeform_matrix_add_cell(), meshdeform_matrix_add_exterior_phi(), meshdeform_matrix_add_rhs(), meshdeform_matrix_add_semibound_phi(), MESHDEFORM_MIN_INFLUENCE, MESHDEFORM_TAG_EXTERIOR, MESHDEFORM_TAG_INTERIOR, MeshDeformBind::min, MeshDeformModifierData::modifier, modifier_setError(), MDefBindInfluence::next, NL_MATRIX, NL_NB_RIGHT_HAND_SIDES, NL_NB_ROWS, NL_NB_VARIABLES, NL_SYSTEM, NL_TRUE, nlBegin(), nlDeleteContext(), nlEnd(), nlGetCurrent(), nlGetVariable(), nlNewContext(), nlPrintMatrix(), nlSolveAdvanced(), nlSolverParameteri(), NULL, MeshDeformBind::phi, progress_bar(), MeshDeformBind::semibound, MeshDeformBind::size, MeshDeformBind::size3, MeshDeformBind::tag, MeshDeformBind::totalphi, MeshDeformBind::totcagevert, MeshDeformBind::totvert, MeshDeformBind::varidx, MDefBindInfluence::vertex, MeshDeformBind::vertexcos, MDefBindInfluence::weight, MeshDeformBind::weights, and MeshDeformBind::width.
Referenced by harmonic_coordinates_bind().
static MDefBoundIsect* meshdeform_ray_tree_intersect | ( | MeshDeformBind * | mdb, |
float * | co1, | ||
float * | co2 | ||
) | [static] |
Definition at line 1232 of file meshlaplacian.c.
References add_v3_v3v3(), BLI_memarena_alloc(), MeshDeformBind::cagecos, MDefBoundIsect::co, copy_v3_v3(), KDL::epsilon, MeshDeformIsect::face, MDefBoundIsect::facing, interp_weights_poly_v3(), MeshDeformIsect::isect, MeshDeformIsect::labda, len(), MDefBoundIsect::len, len_v3v3(), MeshDeformBind::memarena, meshdeform_intersect(), MESHDEFORM_LEN_THRESHOLD, NULL, MDefBoundIsect::nvert, MeshDeformIsect::start, sub_v3_v3v3(), MDefBoundIsect::uvw, MDefBoundIsect::v, MFace::v1, MFace::v2, MFace::v3, MFace::v4, and MeshDeformIsect::vec.
Referenced by meshdeform_add_intersections(), and meshdeform_inside_cage().
static int meshdeform_tri_intersect | ( | float | orig[3], |
float | end[3], | ||
float | vert0[3], | ||
float | vert1[3], | ||
float | vert2[3], | ||
float * | isectco, | ||
float * | uvw | ||
) | [static] |
Definition at line 1125 of file meshlaplacian.c.
References cross_v3_v3v3(), dot_v3v3(), EPSILON, and sub_v3_v3v3().
Referenced by meshdeform_intersect().
static void progress_bar | ( | int | UNUSEDdummy_val, |
const char * | UNUSEDdummy | ||
) | [static] |
Definition at line 71 of file meshlaplacian.c.
Referenced by harmonic_coordinates_bind(), and meshdeform_matrix_solve().
static void start_progress_bar | ( | void | ) | [static] |
Definition at line 72 of file meshlaplacian.c.
Referenced by mesh_deform_bind().
static void waitcursor | ( | int | UNUSEDval | ) | [static] |
Definition at line 70 of file meshlaplacian.c.
Referenced by mesh_deform_bind().
int MESHDEFORM_OFFSET[7][3] [static] |
{{0,0,0}, {1,0,0}, {-1,0,0}, {0,1,0}, {0,-1,0}, {0,0,1}, {0,0,-1}}
Definition at line 1066 of file meshlaplacian.c.