Commit 6bba6520 authored by Kenneth Vanhoey's avatar Kenneth Vanhoey

correction sur vector.normalize() --> division par zero

parent 68dfe535
...@@ -166,12 +166,6 @@ void Approximator_QEMhalfEdge<PFP>::approximate(Dart d) ...@@ -166,12 +166,6 @@ void Approximator_QEMhalfEdge<PFP>::approximate(Dart d)
this->m_approx[d] = this->m_attrV[d] ; this->m_approx[d] = this->m_attrV[d] ;
else else
this->m_approx[d] = res ; this->m_approx[d] = res ;
if (isnan((res[0]))) {
std::cout << "res(" << opt << ") = " << this->m_approx[d] << std::endl ;
std::cout << q1 << std::endl ;
std::cout << q2 << std::endl ;
}
} }
/************************************************************************************ /************************************************************************************
......
...@@ -242,10 +242,9 @@ template <unsigned int DIM, typename T> ...@@ -242,10 +242,9 @@ template <unsigned int DIM, typename T>
inline double Vector<DIM,T>::normalize() inline double Vector<DIM,T>::normalize()
{ {
double n = norm() ; double n = norm() ;
if(n==T(0.0)) if(n != T(0.0))
n = T(0.0001) ; for(unsigned int i = 0; i < DIM; ++i)
for(unsigned int i = 0; i < DIM; ++i) m_data[i] /= T(n) ;
m_data[i] /= T(n) ;
return n ; return n ;
} }
......
...@@ -358,8 +358,8 @@ void QuadricRGBfunctions<REAL>::buildRotateMatrix(MATRIX66 &N, const REAL gamma) ...@@ -358,8 +358,8 @@ void QuadricRGBfunctions<REAL>::buildRotateMatrix(MATRIX66 &N, const REAL gamma)
N(3,1) = REAL(0); N(3,1) = REAL(0);
N(3,2) = REAL(0); N(3,2) = REAL(0);
N(3,3) = cosinus; N(3,3) = cosinus;
N(3,5) = REAL(0);
N(3,4) = sinus; N(3,4) = sinus;
N(3,5) = REAL(0);
N(4,0) = REAL(0); N(4,0) = REAL(0);
N(4,1) = REAL(0); N(4,1) = REAL(0);
......
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