Commit b473797b authored by Pierre Kraemer's avatar Pierre Kraemer

surface deformation using topo laplacian

parent d584f1a5
...@@ -85,7 +85,8 @@ PerMapParameterSet::PerMapParameterSet(MapHandlerGen* mh) : ...@@ -85,7 +85,8 @@ PerMapParameterSet::PerMapParameterSet(MapHandlerGen* mh) :
Algo::Surface::Geometry::computeAnglesBetweenNormalsOnEdges<PFP2>(*map, positionAttribute, edgeAngle) ; Algo::Surface::Geometry::computeAnglesBetweenNormalsOnEdges<PFP2>(*map, positionAttribute, edgeAngle) ;
Algo::Surface::Geometry::computeCotanWeightEdges<PFP2>(*map, positionAttribute, edgeWeight) ; Algo::Surface::Geometry::computeCotanWeightEdges<PFP2>(*map, positionAttribute, edgeWeight) ;
Algo::Surface::Geometry::computeVoronoiAreaVertices<PFP2>(*map, positionAttribute, vertexArea) ; Algo::Surface::Geometry::computeVoronoiAreaVertices<PFP2>(*map, positionAttribute, vertexArea) ;
Algo::Surface::Geometry::computeLaplacianCotanVertices<PFP2>(*map, edgeWeight, vertexArea, positionAttribute, diffCoord) ; // Algo::Surface::Geometry::computeLaplacianCotanVertices<PFP2>(*map, edgeWeight, vertexArea, positionAttribute, diffCoord) ;
Algo::Surface::Geometry::computeLaplacianTopoVertices<PFP2>(*map, positionAttribute, diffCoord) ;
for(unsigned int i = vertexRotationMatrix.begin(); i != vertexRotationMatrix.end() ; vertexRotationMatrix.next(i)) for(unsigned int i = vertexRotationMatrix.begin(); i != vertexRotationMatrix.end() ; vertexRotationMatrix.next(i))
vertexRotationMatrix[i] = Eigen::Matrix3f::Identity(); vertexRotationMatrix[i] = Eigen::Matrix3f::Identity();
...@@ -557,7 +558,7 @@ void SurfaceDeformationPlugin::asRigidAsPossible(View* view, MapHandlerGen* mh) ...@@ -557,7 +558,7 @@ void SurfaceDeformationPlugin::asRigidAsPossible(View* view, MapHandlerGen* mh)
Eigen::Matrix3f cov = Eigen::Matrix3f::Zero() ; Eigen::Matrix3f cov = Eigen::Matrix3f::Zero() ;
PFP2::VEC3 p = perMap->positionAttribute[d] ; PFP2::VEC3 p = perMap->positionAttribute[d] ;
PFP2::VEC3 pInit = perMap->positionInit[d] ; PFP2::VEC3 pInit = perMap->positionInit[d] ;
PFP2::REAL area = perMap->vertexArea[d] ; // PFP2::REAL area = perMap->vertexArea[d] ;
Dart it = d ; Dart it = d ;
do do
{ {
...@@ -566,7 +567,7 @@ void SurfaceDeformationPlugin::asRigidAsPossible(View* view, MapHandlerGen* mh) ...@@ -566,7 +567,7 @@ void SurfaceDeformationPlugin::asRigidAsPossible(View* view, MapHandlerGen* mh)
PFP2::VEC3 vv = perMap->positionInit[neigh] - pInit ; PFP2::VEC3 vv = perMap->positionInit[neigh] - pInit ;
for(unsigned int i = 0; i < 3; ++i) for(unsigned int i = 0; i < 3; ++i)
for(unsigned int j = 0; j < 3; ++j) for(unsigned int j = 0; j < 3; ++j)
cov(i,j) += v[i] * vv[j] * perMap->edgeWeight[it] / area ; cov(i,j) += v[i] * vv[j];// * perMap->edgeWeight[it] / area ;
Dart dboundary = map->phi_1(it) ; Dart dboundary = map->phi_1(it) ;
if(map->phi2(dboundary) == dboundary) if(map->phi2(dboundary) == dboundary)
{ {
...@@ -574,7 +575,7 @@ void SurfaceDeformationPlugin::asRigidAsPossible(View* view, MapHandlerGen* mh) ...@@ -574,7 +575,7 @@ void SurfaceDeformationPlugin::asRigidAsPossible(View* view, MapHandlerGen* mh)
vv = perMap->positionInit[dboundary] - p ; vv = perMap->positionInit[dboundary] - p ;
for(unsigned int i = 0; i < 3; ++i) for(unsigned int i = 0; i < 3; ++i)
for(unsigned int j = 0; j < 3; ++j) for(unsigned int j = 0; j < 3; ++j)
cov(i,j) += v[i] * vv[j] * perMap->edgeWeight[dboundary] / area ; cov(i,j) += v[i] * vv[j];// * perMap->edgeWeight[dboundary] / area ;
} }
it = map->alpha1(it) ; it = map->alpha1(it) ;
} while(it != d) ; } while(it != d) ;
...@@ -660,7 +661,8 @@ void SurfaceDeformationPlugin::asRigidAsPossible(View* view, MapHandlerGen* mh) ...@@ -660,7 +661,8 @@ void SurfaceDeformationPlugin::asRigidAsPossible(View* view, MapHandlerGen* mh)
{ {
LinearSolving::setupVariables<PFP2>(*map, perMap->vIndex, *perMap->lockingMarker, perMap->positionAttribute, coord) ; LinearSolving::setupVariables<PFP2>(*map, perMap->vIndex, *perMap->lockingMarker, perMap->positionAttribute, coord) ;
nlBegin(NL_MATRIX) ; nlBegin(NL_MATRIX) ;
LinearSolving::addRowsRHS_Laplacian_Cotan<PFP2>(*map, perMap->vIndex, perMap->edgeWeight, perMap->vertexArea, perMap->rotatedDiffCoord, coord) ; // LinearSolving::addRowsRHS_Laplacian_Cotan<PFP2>(*map, perMap->vIndex, perMap->edgeWeight, perMap->vertexArea, perMap->rotatedDiffCoord, coord) ;
LinearSolving::addRowsRHS_Laplacian_Topo<PFP2>(*map, perMap->vIndex, perMap->rotatedDiffCoord, coord) ;
nlEnd(NL_MATRIX) ; nlEnd(NL_MATRIX) ;
nlEnd(NL_SYSTEM) ; nlEnd(NL_SYSTEM) ;
nlSolve() ; nlSolve() ;
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment