diff options
author | Alexander Pinzon <apinzonf@gmail.com> | 2012-05-30 22:49:45 +0400 |
---|---|---|
committer | Alexander Pinzon <apinzonf@gmail.com> | 2012-05-30 22:49:45 +0400 |
commit | 94e8e2a96e612c2c99033b29feaceb60f1556fca (patch) | |
tree | 1b5607dbd2fbd882d5112650cbc73b156d8f9a42 /source/blender/editors/mesh/editmesh_tools.c | |
parent | d64eb8eac0bcf0c111aa8b8ff7428150c52d2d69 (diff) |
Ready methods to calculate the Laplacian Matrix.
The OpenNL was use for solve sparse syste,.
Ready method which constructs the system of equations.
Ready method to solve the sparse linear system.
Diffstat (limited to 'source/blender/editors/mesh/editmesh_tools.c')
-rw-r--r-- | source/blender/editors/mesh/editmesh_tools.c | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/source/blender/editors/mesh/editmesh_tools.c b/source/blender/editors/mesh/editmesh_tools.c index 14f2d50dca8..f08804f482e 100644 --- a/source/blender/editors/mesh/editmesh_tools.c +++ b/source/blender/editors/mesh/editmesh_tools.c @@ -1603,6 +1603,7 @@ static int edbm_do_smooth_laplacian_vertex_exec(bContext *C, wmOperator *op) int mirrx = FALSE, mirry = FALSE, mirrz = FALSE; int i, repeat; float clipdist = 0.0f; + float lambda = 0.1f; /* mirror before smooth */ if (((Mesh *)obedit->data)->editflag & ME_EDIT_MIRROR_X) { @@ -1630,13 +1631,14 @@ static int edbm_do_smooth_laplacian_vertex_exec(bContext *C, wmOperator *op) } repeat = RNA_int_get(op->ptr, "repeat"); + lambda = RNA_float_get(op->ptr, "lambda"); if (!repeat) repeat = 1; for (i = 0; i < repeat; i++) { if (!EDBM_op_callf(em, op, - "vertexsmoothlaplacian verts=%hv mirror_clip_x=%b mirror_clip_y=%b mirror_clip_z=%b clipdist=%f", - BM_ELEM_SELECT, mirrx, mirry, mirrz, clipdist)) + "vertexsmoothlaplacian verts=%hv lambda=%f mirror_clip_x=%b mirror_clip_y=%b mirror_clip_z=%b clipdist=%f", + BM_ELEM_SELECT, lambda, mirrx, mirry, mirrz, clipdist)) { return OPERATOR_CANCELLED; } @@ -1667,7 +1669,8 @@ void MESH_OT_vertices_smooth_laplacian(wmOperatorType *ot) /* flags */ ot->flag = OPTYPE_REGISTER | OPTYPE_UNDO; - RNA_def_int(ot->srna, "repeat", 1, 1, 100, "Number of iterations to smooth the mesh", "", 1, INT_MAX); + RNA_def_int(ot->srna, "repeat", 1, 1, 50, "Number of iterations to smooth the mesh", "", 1, 50); + RNA_def_float(ot->srna, "lambda", 0.1f, 0.001f, 100.0f, "Lambda factor", "", 0.001, 100.0f); } |