Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'source/blender/src/meshlaplacian.c')
-rw-r--r--source/blender/src/meshlaplacian.c10
1 files changed, 6 insertions, 4 deletions
diff --git a/source/blender/src/meshlaplacian.c b/source/blender/src/meshlaplacian.c
index 2de6367c9ad..96349e8fb98 100644
--- a/source/blender/src/meshlaplacian.c
+++ b/source/blender/src/meshlaplacian.c
@@ -204,7 +204,7 @@ static void laplacian_triangle_weights(LaplacianSystem *sys, int f, int i1, int
v3= sys->verts[i3];
/* instead of *0.5 we divided by the number of faces of the edge, it still
- needs to be varified that this is indeed the correct thing to do! */
+ needs to be verified that this is indeed the correct thing to do! */
t1= cotan_weight(v1, v2, v3)/laplacian_edge_count(sys->edgehash, i2, i3);
t2= cotan_weight(v2, v3, v1)/laplacian_edge_count(sys->edgehash, i3, i1);
t3= cotan_weight(v3, v1, v2)/laplacian_edge_count(sys->edgehash, i1, i2);
@@ -229,7 +229,7 @@ static void laplacian_triangle_weights(LaplacianSystem *sys, int f, int i1, int
}
}
-LaplacianSystem *laplacian_system_construct_begin(int totvert, int totface)
+LaplacianSystem *laplacian_system_construct_begin(int totvert, int totface, int lsq)
{
LaplacianSystem *sys;
@@ -248,6 +248,8 @@ LaplacianSystem *laplacian_system_construct_begin(int totvert, int totface)
/* create opennl context */
nlNewContext();
nlSolverParameteri(NL_NB_VARIABLES, totvert);
+ if(lsq)
+ nlSolverParameteri(NL_LEAST_SQUARES, NL_TRUE);
sys->context= nlGetCurrent();
@@ -631,7 +633,7 @@ void heat_bone_weighting(Object *ob, Mesh *me, float (*verts)[3], int numbones,
}
/* create laplacian */
- sys = laplacian_system_construct_begin(me->totvert, totface);
+ sys = laplacian_system_construct_begin(me->totvert, totface, 1);
sys->heat.mesh= me;
sys->heat.verts= verts;
@@ -933,7 +935,7 @@ void rigid_deform_begin(EditMesh *em)
}
/* create laplacian */
- sys = laplacian_system_construct_begin(totvert, totface);
+ sys = laplacian_system_construct_begin(totvert, totface, 0);
sys->rigid.mesh= em;
sys->rigid.R = MEM_callocN(sizeof(float)*3*3*totvert, "RigidDeformR");