Commit c8b7f315 by Sauvage

### Normal cycles : calcul du tenseur déplacé dans le collecteur

parent 2aaa9d77
 ... ... @@ -27,6 +27,8 @@ #include "Geometry/basic.h" #include "Utils/convertType.h" #include "OpenNL/linear_solver.h" #include "OpenNL/sparse_matrix.h" #include "OpenNL/full_vector.h" ... ...
 ... ... @@ -310,43 +310,23 @@ void computeCurvatureVertex_NormalCycles( VertexAttribute& Kmin, VertexAttribute& Knormal, unsigned int thread) { typedef typename PFP::VEC3 VEC3 ; typedef typename PFP::REAL REAL ; typedef typename PFP::VEC3 VEC3 ; typedef Geom::Matrix<3,3,REAL> MATRIX; typedef Eigen::Matrix E_VEC3; typedef Eigen::Matrix E_MATRIX; // collect the normal cycle tensor Algo::Selection::Collector_WithinSphere neigh(map, position, radius, thread) ; neigh.collectAll(dart) ; neigh.computeArea() ; VEC3 center = position[dart] ; typename PFP::MATRIX33 tensor(0) ; // collect edges inside the neighborhood const std::vector& vd1 = neigh.getInsideEdges() ; for (std::vector::const_iterator it = vd1.begin(); it != vd1.end(); ++it) { const VEC3 e = Algo::Geometry::vectorOutOfDart(map, *it, position) ; tensor += Geom::transposed_vectors_mult(e,e) * edgeangle[*it] * (1 / e.norm()) ; } // collect edges crossing the neighborhood's border const std::vector& vd2 = neigh.getBorder() ; for (std::vector::const_iterator it = vd2.begin(); it != vd2.end(); ++it) { const VEC3 e = Algo::Geometry::vectorOutOfDart(map, *it, position) ; REAL alpha ; Algo::Geometry::intersectionSphereEdge(map, center, radius, *it, position, alpha) ; tensor += Geom::transposed_vectors_mult(e,e) * edgeangle[*it] * (1 / e.norm()) * alpha ; } tensor /= neigh.getArea() ; MATRIX tensor(0) ; neigh.computeNormalCyclesTensor(edgeangle,tensor); // solve eigen problem Eigen::Matrix3f m3 ; m3 << tensor(0,0) , tensor(0,1) , tensor(0,2) , tensor(1,0) , tensor(1,1) , tensor(1,2) , tensor(2,0) , tensor(2,1) , tensor(2,2) ; Eigen::SelfAdjointEigenSolver solver (m3); Eigen::Vector3f ev = solver.eigenvalues(); Eigen::Matrix3f evec = solver.eigenvectors(); Eigen::SelfAdjointEigenSolver solver (Utils::convertRef(tensor)); const VEC3& ev = Utils::convertRef(solver.eigenvalues()); const MATRIX& evec = Utils::convertRef(solver.eigenvectors()); // sort eigen components : ev[s[0]] has minimal absolute value ; kmin = ev[s[1]] <= ev[s[2]] = kmax int s[3] = {0, 1, 2} ; ... ...