mirror of
https://github.com/lucaspalomodevelop/meshlab.git
synced 2026-03-20 03:16:10 +00:00
some curvature fixes
This commit is contained in:
parent
740a54ce62
commit
04c4bee043
@ -56,7 +56,7 @@ namespace vcg {
|
||||
};
|
||||
|
||||
void ComputeCurvatureTensor() {
|
||||
vcg::tri::UpdateNormals<MESH_TYPE>::PerVertex(*mesh);
|
||||
vcg::tri::UpdateNormals<MESH_TYPE>::PerVertexNormalized(*mesh);
|
||||
|
||||
VertexIterator vi;
|
||||
|
||||
@ -67,7 +67,7 @@ namespace vcg {
|
||||
VertexType * central_vertex = &(*vi);
|
||||
|
||||
std::vector<float> weights;
|
||||
std::vector<float> curvatures;
|
||||
//std::vector<float> curvatures;
|
||||
std::vector<AdjVertex> vertices;
|
||||
|
||||
vcg::face::JumpingPos<FaceType> 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;
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@ -131,7 +131,7 @@ namespace vcg {
|
||||
Point3<float> Tij;
|
||||
|
||||
Point3<float> 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<FaceType*> 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;
|
||||
}
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user