Blender V4.3
meshlaplacian.h
Go to the documentation of this file.
1/* SPDX-FileCopyrightText: 2023 Blender Authors
2 *
3 * SPDX-License-Identifier: GPL-2.0-or-later */
4
10#pragma once
11
12#ifdef __cplusplus
13extern "C" {
14#endif
15
16// #define RIGID_DEFORM
17
18struct Mesh;
19struct Object;
20struct bDeformGroup;
21
22#ifdef RIGID_DEFORM
23struct EditMesh;
24#endif
25
26/* Laplacian System */
27
28struct LaplacianSystem;
30
31void laplacian_add_vertex(LaplacianSystem *sys, float *co, int pinned);
32void laplacian_add_triangle(LaplacianSystem *sys, int v1, int v2, int v3);
33
34void laplacian_begin_solve(LaplacianSystem *sys, int index);
35void laplacian_add_right_hand_side(LaplacianSystem *sys, int v, float value);
38
39/* Heat Weighting */
40
41void heat_bone_weighting(struct Object *ob,
42 struct Mesh *mesh,
43 float (*verts)[3],
44 int numbones,
45 struct bDeformGroup **dgrouplist,
46 struct bDeformGroup **dgroupflip,
47 float (*root)[3],
48 float (*tip)[3],
49 const bool *selected,
50 const char **r_error_str);
51
52#ifdef RIGID_DEFORM
53/* As-Rigid-As-Possible Deformation */
54
55void rigid_deform_begin(struct EditMesh *em);
56void rigid_deform_iteration(void);
57void rigid_deform_end(int cancel);
58#endif
59
60#ifdef __cplusplus
61}
62#endif
63
64/* Harmonic Coordinates */
65
66/* ED_mesh_deform_bind_callback(...) defined in ED_armature.hh */
ATTR_WARN_UNUSED_RESULT const BMVert * v2
ATTR_WARN_UNUSED_RESULT const BMVert * v
static float verts[][3]
float laplacian_system_get_solution(LaplacianSystem *sys, int v)
void laplacian_add_right_hand_side(LaplacianSystem *sys, int v, float value)
int laplacian_system_solve(LaplacianSystem *sys)
void laplacian_add_triangle(LaplacianSystem *sys, int v1, int v2, int v3)
void laplacian_add_vertex(LaplacianSystem *sys, float *co, int pinned)
void heat_bone_weighting(struct Object *ob, struct Mesh *mesh, float(*verts)[3], int numbones, struct bDeformGroup **dgrouplist, struct bDeformGroup **dgroupflip, float(*root)[3], float(*tip)[3], const bool *selected, const char **r_error_str)
void laplacian_begin_solve(LaplacianSystem *sys, int index)