Blender  V2.93
BKE_kelvinlet.h
Go to the documentation of this file.
1 /*
2  * This program is free software; you can redistribute it and/or
3  * modify it under the terms of the GNU General Public License
4  * as published by the Free Software Foundation; either version 2
5  * of the License, or (at your option) any later version.
6  *
7  * This program is distributed in the hope that it will be useful,
8  * but WITHOUT ANY WARRANTY; without even the implied warranty of
9  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
10  * GNU General Public License for more details.
11  *
12  * You should have received a copy of the GNU General Public License
13  * along with this program; if not, write to the Free Software Foundation,
14  * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
15  *
16  * The Original Code is Copyright (C) Blender Foundation.
17  * All rights reserved.
18  */
19 #pragma once
20 
25 #include "BLI_math.h"
26 
27 #ifdef __cplusplus
28 extern "C" {
29 #endif
30 
31 /* Regularized Kelvinlets: Sculpting Brushes based on Fundamental Solutions of Elasticity
32  * Pixar Technical Memo #17-03 */
33 
34 #define KELVINLET_MAX_ITERATIONS 3
35 
36 typedef struct KelvinletParams {
37  float a;
38  float b;
39  float c;
40 
41  float f;
42 
45 
46 /* Initialize KelvinletParams to store the parameters that will affect the deformation produced by
47  * a Kelvinlet */
49  KelvinletParams *params, float radius, float force, float shear_modulus, float poisson_ratio);
50 
51 /* Regularized Kelvinlets */
52 /* All these functions output the displacement that should be applied to each element. */
53 /* The initial coordinates of that element should not be modified during the transformation */
54 void BKE_kelvinlet_grab(float radius_elem_disp[3],
55  const KelvinletParams *params,
56  const float elem_orig_co[3],
57  const float brush_location[3],
58  const float brush_delta[3]);
59 void BKE_kelvinlet_grab_biscale(float radius_elem_disp[3],
60  const KelvinletParams *params,
61  const float elem_orig_co[3],
62  const float brush_location[3],
63  const float brush_delta[3]);
64 void BKE_kelvinlet_grab_triscale(float radius_elem_disp[3],
65  const KelvinletParams *params,
66  const float elem_orig_co[3],
67  const float brush_location[3],
68  const float brush_delta[3]);
69 void BKE_kelvinlet_scale(float radius_elem_disp[3],
70  const KelvinletParams *params,
71  const float elem_orig_co[3],
72  const float brush_location[3],
73  const float surface_normal[3]);
74 void BKE_kelvinlet_twist(float radius_elem_disp[3],
75  const KelvinletParams *params,
76  const float elem_orig_co[3],
77  const float brush_location[3],
78  const float surface_normal[3]);
79 
80 #ifdef __cplusplus
81 }
82 #endif
struct KelvinletParams KelvinletParams
#define KELVINLET_MAX_ITERATIONS
Definition: BKE_kelvinlet.h:34
void BKE_kelvinlet_grab(float radius_elem_disp[3], const KelvinletParams *params, const float elem_orig_co[3], const float brush_location[3], const float brush_delta[3])
Definition: kelvinlet.c:67
void BKE_kelvinlet_grab_triscale(float radius_elem_disp[3], const KelvinletParams *params, const float elem_orig_co[3], const float brush_location[3], const float brush_delta[3])
Definition: kelvinlet.c:103
void BKE_kelvinlet_init_params(KelvinletParams *params, float radius, float force, float shear_modulus, float poisson_ratio)
Definition: kelvinlet.c:29
void BKE_kelvinlet_grab_biscale(float radius_elem_disp[3], const KelvinletParams *params, const float elem_orig_co[3], const float brush_location[3], const float brush_delta[3])
Definition: kelvinlet.c:84
void BKE_kelvinlet_scale(float radius_elem_disp[3], const KelvinletParams *params, const float elem_orig_co[3], const float brush_location[3], const float surface_normal[3])
Definition: kelvinlet.c:179
void BKE_kelvinlet_twist(float radius_elem_disp[3], const KelvinletParams *params, const float elem_orig_co[3], const float brush_location[3], const float surface_normal[3])
Definition: kelvinlet.c:207
uiWidgetBaseParameters params[MAX_WIDGET_BASE_BATCH]
float radius_scaled[KELVINLET_MAX_ITERATIONS]
Definition: BKE_kelvinlet.h:43