[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [58322] branches/soc-2013-sketch_mesh: Test files were removed.
Alexander Pinzon
apinzonf at gmail.com
Wed Jul 17 01:32:23 CEST 2013
Revision: 58322
http://projects.blender.org/scm/viewvc.php?view=rev&root=bf-blender&revision=58322
Author: apinzonf
Date: 2013-07-16 23:32:23 +0000 (Tue, 16 Jul 2013)
Log Message:
-----------
Test files were removed.
I remove the computation of implicit rotations because not improve the solution.
I eliminate the use of the library Eigen3 in my system because SuperLU library has better performance.
Modified Paths:
--------------
branches/soc-2013-sketch_mesh/release/scripts/startup/bl_ui/space_view3d.py
branches/soc-2013-sketch_mesh/source/blender/bmesh/CMakeLists.txt
branches/soc-2013-sketch_mesh/source/blender/bmesh/intern/bmesh_opdefines.c
branches/soc-2013-sketch_mesh/source/blender/bmesh/intern/bmesh_operators_private.h
branches/soc-2013-sketch_mesh/source/blender/editors/mesh/CMakeLists.txt
branches/soc-2013-sketch_mesh/source/blender/editors/mesh/editmesh_deform_laplacian.c
branches/soc-2013-sketch_mesh/source/blender/editors/mesh/editmesh_tools.c
branches/soc-2013-sketch_mesh/source/blender/editors/mesh/mesh_intern.h
branches/soc-2013-sketch_mesh/source/blender/editors/mesh/mesh_ops.c
Removed Paths:
-------------
branches/soc-2013-sketch_mesh/source/blender/bmesh/operators/bmo_deform_laplacian.c
branches/soc-2013-sketch_mesh/source/blender/bmesh/operators/bmo_deform_utils.cpp
branches/soc-2013-sketch_mesh/source/blender/bmesh/operators/bmo_deform_utils.h
branches/soc-2013-sketch_mesh/source/blender/editors/mesh/editmesh_deform_utils.cpp
branches/soc-2013-sketch_mesh/source/blender/editors/mesh/editmesh_deform_utils.h
Modified: branches/soc-2013-sketch_mesh/release/scripts/startup/bl_ui/space_view3d.py
===================================================================
--- branches/soc-2013-sketch_mesh/release/scripts/startup/bl_ui/space_view3d.py 2013-07-16 23:31:25 UTC (rev 58321)
+++ branches/soc-2013-sketch_mesh/release/scripts/startup/bl_ui/space_view3d.py 2013-07-16 23:32:23 UTC (rev 58322)
@@ -1858,7 +1858,6 @@
layout.operator("mesh.flip_normals")
layout.operator("mesh.vertices_smooth", text="Smooth")
layout.operator("mesh.vertices_smooth_laplacian", text="Laplacian Smooth")
- layout.operator("mesh.vertices_deform_laplacian", text="Old Laplacian Deform")
layout.operator("mesh.vertices_laplacian_deform", text="Laplacian Deform")
layout.separator()
Modified: branches/soc-2013-sketch_mesh/source/blender/bmesh/CMakeLists.txt
===================================================================
--- branches/soc-2013-sketch_mesh/source/blender/bmesh/CMakeLists.txt 2013-07-16 23:31:25 UTC (rev 58321)
+++ branches/soc-2013-sketch_mesh/source/blender/bmesh/CMakeLists.txt 2013-07-16 23:32:23 UTC (rev 58322)
@@ -29,7 +29,6 @@
../blenkernel
../blenlib
../makesdna
- ../../../extern/Eigen3
../../../intern/guardedalloc
../../../extern/rangetree
../../../intern/opennl/extern
@@ -46,9 +45,6 @@
operators/bmo_connect.c
operators/bmo_connect_pair.c
operators/bmo_create.c
- operators/bmo_deform_laplacian.c
- operators/bmo_deform_utils.cpp
- operators/bmo_deform_utils.h
operators/bmo_dissolve.c
operators/bmo_dupe.c
operators/bmo_edgenet.c
Modified: branches/soc-2013-sketch_mesh/source/blender/bmesh/intern/bmesh_opdefines.c
===================================================================
--- branches/soc-2013-sketch_mesh/source/blender/bmesh/intern/bmesh_opdefines.c 2013-07-16 23:31:25 UTC (rev 58321)
+++ branches/soc-2013-sketch_mesh/source/blender/bmesh/intern/bmesh_opdefines.c 2013-07-16 23:32:23 UTC (rev 58322)
@@ -142,29 +142,6 @@
};
/*
- * Vertext deform Laplacian.
- *
- * Deform vertices by using Laplacian coordinates.
- * bmo_deform_laplacian_vert_exec
- */
-static BMOpDefine bmo_deform_laplacian_vert_def = {
- "deform_laplacian_vert",
- /* slots_in */
- {{"verts", BMO_OP_SLOT_ELEMENT_BUF, {BM_VERT}}, /* input vertices */
- {"lambda_factor", BMO_OP_SLOT_FLT}, /* lambda param */
- {"lambda_border", BMO_OP_SLOT_FLT}, /* lambda param in border */
- {"use_x", BMO_OP_SLOT_BOOL}, /* Smooth object along X axis */
- {"use_y", BMO_OP_SLOT_BOOL}, /* Smooth object along Y axis */
- {"use_z", BMO_OP_SLOT_BOOL}, /* Smooth object along Z axis */
- {"preserve_volume", BMO_OP_SLOT_BOOL}, /* Apply volume preservation after smooth */
- {{'\0'}},
- },
- {{{'\0'}}}, /* no output */
- bmo_deform_laplacian_vert_exec,
- BMO_OPTYPE_FLAG_NORMALS_CALC,
-};
-
-/*
* Right-Hand Faces.
*
* Computes an "outside" normal for the specified input faces.
@@ -1740,7 +1717,6 @@
&bmo_create_monkey_def,
&bmo_create_uvsphere_def,
&bmo_create_vert_def,
- &bmo_deform_laplacian_vert_def,
&bmo_delete_def,
&bmo_dissolve_edges_def,
&bmo_dissolve_faces_def,
Modified: branches/soc-2013-sketch_mesh/source/blender/bmesh/intern/bmesh_operators_private.h
===================================================================
--- branches/soc-2013-sketch_mesh/source/blender/bmesh/intern/bmesh_operators_private.h 2013-07-16 23:31:25 UTC (rev 58321)
+++ branches/soc-2013-sketch_mesh/source/blender/bmesh/intern/bmesh_operators_private.h 2013-07-16 23:32:23 UTC (rev 58322)
@@ -51,7 +51,6 @@
void bmo_create_monkey_exec(BMesh *bm, BMOperator *op);
void bmo_create_uvsphere_exec(BMesh *bm, BMOperator *op);
void bmo_create_vert_exec(BMesh *bm, BMOperator *op);
-void bmo_deform_laplacian_vert_exec(BMesh *bm, BMOperator *op);
void bmo_delete_exec(BMesh *bm, BMOperator *op);
void bmo_dissolve_edges_exec(BMesh *bm, BMOperator *op);
void bmo_dissolve_faces_exec(BMesh *bm, BMOperator *op);
Deleted: branches/soc-2013-sketch_mesh/source/blender/bmesh/operators/bmo_deform_laplacian.c
===================================================================
--- branches/soc-2013-sketch_mesh/source/blender/bmesh/operators/bmo_deform_laplacian.c 2013-07-16 23:31:25 UTC (rev 58321)
+++ branches/soc-2013-sketch_mesh/source/blender/bmesh/operators/bmo_deform_laplacian.c 2013-07-16 23:32:23 UTC (rev 58322)
@@ -1,633 +0,0 @@
-/*
- * ***** BEGIN GPL LICENSE BLOCK *****
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License
- * as published by the Free Software Foundation; either version 2
- * of the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
- *
- * Contributor(s): Alexander Pinzon
- *
- * ***** END GPL LICENSE BLOCK *****
- */
-
-/** \file blender/bmesh/operators/bmo_deform_laplacian.c
- * \ingroup bmesh
- *
- * Deform Laplacian.
- */
-#include "MEM_guardedalloc.h"
-#include "BLI_math.h"
-#include "BLI_array.h"
-#include "bmesh.h"
-#include "ONL_opennl.h"
-#include "intern/bmesh_operators_private.h" /* own include */
-#include "bmo_deform_utils.h"
-
-struct BLaplacianSystem {
- float *vweights; /* Total sum of weights per vertice*/
- float (*delta)[3]; /* Differential Coordinates*/
- BMVert **uverts; /* Unit vectors of projected edges onto the plane orthogonal to n*/
- int numVerts; /* Number of verts*/
- /* Pointers to data*/
- BMesh *bm;
- BMOperator *op;
- NLContext *context; /* System for solve general implicit rotations*/
- NLContext *contextrot; /* System for solve general Laplacian with rotated differential coordinates*/
- vptrSpMatrixD spLapMatrix; /* Sparse Laplacian Matrix*/
- vptrVectorD VectorB; /* Array to store vertex positions of handlers*/
- vptrVectorD VectorX; /* Array to store solution */
- vptrTripletD tripletList; /* List of triplets in Laplacian Matrix*/
-};
-typedef struct BLaplacianSystem LaplacianSystem;
-
-static void compute_mesh_laplacian();
-static void delete_laplacian_system(LaplacianSystem *sys);
-static void delete_void_pointer(void *data);
-
-static float cotan_weight(float *v1, float *v2, float *v3)
-{
- float a[3], b[3], c[3], clen;
-
- sub_v3_v3v3(a, v2, v1);
- sub_v3_v3v3(b, v3, v1);
- cross_v3_v3v3(c, a, b);
-
- clen = len_v3(c);
-
- if (clen < FLT_EPSILON)
- return 0.0f;
-
- return dot_v3v3(a, b) / clen;
-}
-
-static void delete_void_pointer(void *data)
-{
- if (data) {
- MEM_freeN(data);
- }
-}
-
-static void delete_laplacian_system(LaplacianSystem *sys)
-{
- if(!sys) return;
- delete_void_pointer(sys->vweights);
- delete_void_pointer(sys->delta);
- delete_void_pointer(sys->uverts);
- if (sys->context) {
- nlDeleteContext(sys->context);
- }
- if (sys->contextrot) {
- nlDeleteContext(sys->contextrot);
- }
- if (sys->spLapMatrix) {
- delete_spmatrix(sys->spLapMatrix);
- }
- if (sys->VectorB) {
- delete_vectord(sys->VectorB);
- }
- if (sys->VectorX) {
- delete_vectord(sys->VectorX);
- }
- if (sys->tripletList) {
- delete_triplet(sys->tripletList);
- }
- sys->bm = NULL;
- sys->op = NULL;
- MEM_freeN(sys);
-}
-
-static void memset_laplacian_system(LaplacianSystem *sys, int val)
-{
- memset(sys->vweights, val, sizeof(float) * sys->numVerts);
- memset(sys->delta, val, sizeof(float) * sys->numVerts);
-}
-
-static LaplacianSystem *init_laplacian_system(int a_numVerts, int rows, int cols)
-{
- LaplacianSystem *sys;
- sys = (LaplacianSystem *)MEM_callocN(sizeof(LaplacianSystem), "bmoLaplDeformSystem");
- if (!sys) {
- return NULL;
- }
- sys->numVerts = a_numVerts;
-
- sys->spLapMatrix = new_spmatrix(rows, cols);
- if (!sys->spLapMatrix) {
- delete_laplacian_system(sys);
- return NULL;
- }
-
- sys->VectorB = new_vectord(rows);
- if (!sys->VectorB) {
- delete_laplacian_system(sys);
- return NULL;
- }
-
- sys->VectorX = new_vectord(cols);
- if (!sys->VectorX) {
- delete_laplacian_system(sys);
- return NULL;
- }
-
- sys->tripletList = new_triplet(a_numVerts*18);
- if (!sys->tripletList) {
- delete_laplacian_system(sys);
- return NULL;
- }
-
- sys->vweights = (float *)MEM_callocN(sizeof(float) * sys->numVerts, "bmoLaplDeformVweights");
- if (!sys->vweights) {
- delete_laplacian_system(sys);
- return NULL;
- }
-
- sys->uverts = (BMVert **)MEM_callocN(sizeof(BMVert *) * sys->numVerts, "bmoLaplDeformuverts");
- if (!sys->uverts) {
- delete_laplacian_system(sys);
- return NULL;
- }
-
- sys->delta = (float (*)[3])MEM_callocN(sizeof(float) * sys->numVerts * 3, "bmoLaplDeformDelta");
- if (!sys->delta) {
- delete_laplacian_system(sys);
- return NULL;
- }
-
- return sys;
-}
-
-static void init_laplacian_matrix(LaplacianSystem *sys)
-{
- float *v1, *v2, *v3, *v4;
- float w2, w3, w4;
- int i, j;
- bool has_4_vert;
- unsigned int idv1, idv2, idv3, idv4, idv[4];
- BMFace *f;
- BMIter fiter;
- BMIter vi;
- BMVert *vn;
- BMVert *vf[4];
-
- BM_ITER_MESH (f, &fiter, sys->bm, BM_FACES_OF_MESH) {
- if (BM_elem_flag_test(f, BM_ELEM_SELECT)) {
-
- BM_ITER_ELEM_INDEX (vn, &vi, f, BM_VERTS_OF_FACE, i) {
- vf[i] = vn;
- }
- has_4_vert = (i == 4) ? 1 : 0;
- idv1 = BM_elem_index_get(vf[0]);
- idv2 = BM_elem_index_get(vf[1]);
- idv3 = BM_elem_index_get(vf[2]);
- idv4 = has_4_vert ? BM_elem_index_get(vf[3]) : 0;
-
- v1 = vf[0]->co;
- v2 = vf[1]->co;
- v3 = vf[2]->co;
- v4 = has_4_vert ? vf[3]->co : 0;
-
- idv[0] = idv1;
- idv[1] = idv2;
- idv[2] = idv3;
- idv[3] = idv4;
-
- nlMakeCurrent(sys->context);
- nlRightHandSideAdd(0, idv1 , 0.0f);
- nlRightHandSideAdd(0, sys->numVerts + idv1 , 0.0f);
- nlRightHandSideAdd(0, 2*sys->numVerts + idv1 , 0.0f);
-
- for (j = 0; j < i; j++) {
- idv1 = idv[j];
- idv2 = idv[(j + 1) % i];
- idv3 = idv[(j + 2) % i];
- idv4 = idv[(j + 3) % i];
-
- v1 = vf[j]->co;
- v2 = vf[(j + 1) % i]->co;
- v3 = vf[(j + 2) % i]->co;
- v4 = has_4_vert ? vf[(j + 3) % i]->co : 0;
-
- if (has_4_vert) {
-
- w2 = (cotan_weight(v4, v1, v2) + cotan_weight(v3, v1, v2)) ;
@@ Diff output truncated at 10240 characters. @@
More information about the Bf-blender-cvs
mailing list