diff --git a/src/meshlabplugins/editsegment/curvaturetensor.h b/src/meshlabplugins/editsegment/curvaturetensor.h index 4031f275a..779b9a19a 100644 --- a/src/meshlabplugins/editsegment/curvaturetensor.h +++ b/src/meshlabplugins/editsegment/curvaturetensor.h @@ -56,7 +56,7 @@ namespace vcg { }; void ComputeCurvatureTensor() { - vcg::tri::UpdateNormals::PerVertex(*mesh); + vcg::tri::UpdateNormals::PerVertexNormalized(*mesh); VertexIterator vi; @@ -67,7 +67,7 @@ namespace vcg { VertexType * central_vertex = &(*vi); std::vector weights; - std::vector curvatures; + //std::vector curvatures; std::vector vertices; vcg::face::JumpingPos pos((*vi).VFp(), central_vertex); @@ -121,11 +121,11 @@ namespace vcg { M.SetZero(); for (int i = 0; i < vertices.size(); ++i) { Point3f edge = (central_vertex->P() - vertices[i].vert->P()); - curvatures.push_back(2.0f * ((central_vertex->N() * edge) / edge.SquaredNorm() ) ); - + //curvatures.push_back(2.0f * ((central_vertex->N() * edge) / edge.SquaredNorm() ) ); + float curvature = (2.0f * (central_vertex->N() * edge) ) / edge.SquaredNorm(); Point3f T = (Tp*edge).Normalize(); tempMatrix.ExternalProduct(T,T); - M += tempMatrix * weights[i] * curvatures[i] ; + M += tempMatrix * weights[i] * curvature ; } Point3f W; @@ -217,8 +217,8 @@ namespace vcg { (*TDCurvPtr)[*vi].T1 = Principal_Direction1; (*TDCurvPtr)[*vi].T2 = Principal_Direction2; - (*TDCurvPtr)[*vi].k1 = Principal_Curvature1; - (*TDCurvPtr)[*vi].k2 = Principal_Curvature2; + (*TDCurvPtr)[*vi].k1 = -Principal_Curvature1; + (*TDCurvPtr)[*vi].k2 = -Principal_Curvature2; } } diff --git a/src/meshlabplugins/editsegment/cutting.h b/src/meshlabplugins/editsegment/cutting.h index 844acbdee..eff8ca9c8 100644 --- a/src/meshlabplugins/editsegment/cutting.h +++ b/src/meshlabplugins/editsegment/cutting.h @@ -131,7 +131,7 @@ namespace vcg { Point3 Tij; Point3 n = p->N(); - n = n.Normalize(); + //n = n.Normalize(); n_nMatrix.ExternalProduct(n, n); Tij = (n_nMatrix * ViVj).Normalize(); @@ -324,8 +324,8 @@ namespace vcg { queue edgeFaceQueue; for (vi = mesh->vert.begin(); vi != mesh->vert.end(); ++vi) { - if ( vi->IMark() == F ) vi->C() = Color4b::Yellow; - if ( vi->IMark() == B ) vi->C() = Color4b::White; + if ( vi->IMark() == F ) vi->C() = Color4b::Magenta; + if ( vi->IMark() == B ) vi->C() = Color4b::Yellow; if ( vi->IMark() == U ) vi->C() = Color4b::Green; }