Blender V5.3
meshlaplacian.cc File Reference
#include "MEM_guardedalloc.h"
#include "DNA_mesh_types.h"
#include "DNA_object_types.h"
#include "BLI_map.hh"
#include "BLI_math_geom_c.hh"
#include "BLI_math_matrix_c.hh"
#include "BLI_math_rotation_c.hh"
#include "BLI_math_vector_c.hh"
#include "BLI_memarena.hh"
#include "BLI_ordered_edge.hh"
#include "BLI_string_utf8.hh"
#include "BLT_translation.hh"
#include "BKE_attribute.hh"
#include "BKE_bvhutils.hh"
#include "BKE_mesh.hh"
#include "BKE_mesh_wrapper.hh"
#include "BKE_modifier.hh"
#include "ED_armature.hh"
#include "ED_mesh.hh"
#include "ED_object_vgroup.hh"
#include "eigen_capi.h"
#include "meshlaplacian.h"
#include <algorithm>

Go to the source code of this file.

Classes

struct  blender::LaplacianSystem
struct  blender::LaplacianSystem::HeatWeighting
struct  blender::BVHCallbackUserData
struct  blender::MDefBoundIsect
struct  blender::MDefBindInfluence
struct  blender::MeshDeformBind
struct  blender::MeshDeformIsect
struct  blender::MeshRayCallbackData

Namespaces

namespace  blender
 BMesh Iterators.

Macros

#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

Functions

static void blender::waitcursor (int)
static void blender::progress_bar (int, const char *)
static void blender::start_progress_bar ()
static void blender::end_progress_bar ()
static void blender::error (const char *str)
static void blender::laplacian_increase_edge_count (Map< OrderedEdge, int > &edgehash, int v1, int v2)
static int blender::laplacian_edge_count (const Map< OrderedEdge, int > &edgehash, int v1, int v2)
static void blender::laplacian_triangle_area (LaplacianSystem *sys, int i1, int i2, int i3)
static void blender::laplacian_triangle_weights (LaplacianSystem *sys, int f, int i1, int i2, int i3)
static LaplacianSystem * blender::laplacian_system_construct_begin (int verts_num, int faces_num, int lsq)
void blender::laplacian_add_vertex (LaplacianSystem *sys, float *co, int pinned)
void blender::laplacian_add_triangle (LaplacianSystem *sys, int v1, int v2, int v3)
static void blender::laplacian_system_construct_end (LaplacianSystem *sys)
static void blender::laplacian_system_delete (LaplacianSystem *sys)
void blender::laplacian_begin_solve (LaplacianSystem *sys, int index)
void blender::laplacian_add_right_hand_side (LaplacianSystem *sys, int v, float value)
int blender::laplacian_system_solve (LaplacianSystem *sys)
float blender::laplacian_system_get_solution (LaplacianSystem *sys, int v)
static void blender::bvh_callback (void *userdata, int index, const BVHTreeRay *ray, BVHTreeRayHit *hit)
static void blender::heat_ray_tree_create (LaplacianSystem *sys)
static int blender::heat_ray_source_visible (LaplacianSystem *sys, int vertex, int source)
static float blender::heat_source_distance (LaplacianSystem *sys, int vertex, int source)
static int blender::heat_source_closest (LaplacianSystem *sys, int vertex, int source)
static void blender::heat_set_H (LaplacianSystem *sys, int vertex)
static void blender::heat_calc_vnormals (LaplacianSystem *sys)
static void blender::heat_laplacian_create (LaplacianSystem *sys)
static void blender::heat_system_free (LaplacianSystem *sys)
static float blender::heat_limit_weight (float weight)
void blender::heat_bone_weighting (Object *ob, Mesh *mesh, float(*verts)[3], int numbones, bDeformGroup **dgrouplist, bDeformGroup **dgroupflip, float(*root)[3], float(*tip)[3], const bool *selected, const char **r_error_str)
static void blender::harmonic_ray_callback (void *userdata, int index, const BVHTreeRay *ray, BVHTreeRayHit *hit)
static MDefBoundIsect * blender::meshdeform_ray_tree_intersect (MeshDeformBind *mdb, const float co1[3], const float co2[3])
static int blender::meshdeform_inside_cage (MeshDeformBind *mdb, float *co)
BLI_INLINE int blender::meshdeform_index (MeshDeformBind *mdb, int x, int y, int z, int n)
BLI_INLINE void blender::meshdeform_cell_center (MeshDeformBind *mdb, int x, int y, int z, int n, float *center)
static void blender::meshdeform_add_intersections (MeshDeformBind *mdb, int x, int y, int z)
static void blender::meshdeform_bind_floodfill (MeshDeformBind *mdb)
static float blender::meshdeform_boundary_phi (const MeshDeformBind *mdb, const MDefBoundIsect *isect, int cagevert)
static float blender::meshdeform_interp_w (MeshDeformBind *mdb, const float *gridvec, float *, int)
static void blender::meshdeform_check_semibound (MeshDeformBind *mdb, int x, int y, int z)
static float blender::meshdeform_boundary_total_weight (MeshDeformBind *mdb, int x, int y, int z)
static void blender::meshdeform_matrix_add_cell (MeshDeformBind *mdb, LinearSolver *context, int x, int y, int z)
static void blender::meshdeform_matrix_add_rhs (MeshDeformBind *mdb, LinearSolver *context, int x, int y, int z, int cagevert)
static void blender::meshdeform_matrix_add_semibound_phi (MeshDeformBind *mdb, int x, int y, int z, int cagevert)
static void blender::meshdeform_matrix_add_exterior_phi (MeshDeformBind *mdb, int x, int y, int z, int)
static void blender::meshdeform_matrix_solve (MeshDeformModifierData *mmd, MeshDeformBind *mdb)
static void blender::harmonic_coordinates_bind (MeshDeformModifierData *mmd, MeshDeformBind *mdb)
void blender::ED_mesh_deform_bind_callback (Object *object, MeshDeformModifierData *mmd, Mesh *cagemesh, float *vertexcos, int verts_num, float cagemat[4][4])

Variables

static const int blender::MESHDEFORM_OFFSET [7][3]

Detailed Description

Algorithms using the mesh laplacian.

Definition in file meshlaplacian.cc.

Macro Definition Documentation

◆ C_WEIGHT

#define C_WEIGHT   1.0f

Definition at line 353 of file meshlaplacian.cc.

Referenced by blender::heat_set_H().

◆ DISTANCE_EPSILON

#define DISTANCE_EPSILON   1e-4f

Definition at line 356 of file meshlaplacian.cc.

Referenced by blender::heat_source_closest().

◆ EPSILON

#define EPSILON   0.0001f

Definition at line 840 of file meshlaplacian.cc.

◆ MESHDEFORM_LEN_THRESHOLD

#define MESHDEFORM_LEN_THRESHOLD   1e-6f

minimum length for #MDefBoundIsect.len

Definition at line 848 of file meshlaplacian.cc.

Referenced by blender::meshdeform_ray_tree_intersect().

◆ MESHDEFORM_MIN_INFLUENCE

#define MESHDEFORM_MIN_INFLUENCE   0.0005f

◆ MESHDEFORM_TAG_BOUNDARY

#define MESHDEFORM_TAG_BOUNDARY   1

◆ MESHDEFORM_TAG_EXTERIOR

◆ MESHDEFORM_TAG_INTERIOR

#define MESHDEFORM_TAG_INTERIOR   2

◆ MESHDEFORM_TAG_UNTYPED

#define MESHDEFORM_TAG_UNTYPED   0

◆ WEIGHT_LIMIT_END

#define WEIGHT_LIMIT_END   0.025f

Definition at line 355 of file meshlaplacian.cc.

Referenced by blender::heat_limit_weight().

◆ WEIGHT_LIMIT_START

#define WEIGHT_LIMIT_START   0.05f

Definition at line 354 of file meshlaplacian.cc.

Referenced by blender::heat_limit_weight().