switch(DIM)
{
case 2:
- return false;
+ {
+ if(distance2<DIM>(A,D)<_Epsilon)
+ crossprod<DIM>(A,C,E,_Vdouble);//store the crossprod between vectors AC and AE (E=vertex preceding A)
+ return false;//case of paralell segments
+ }
case 3://beware AB and CD may belong to a vertical plane
det = determinant(&AB[1],&DC[1]);//determinant of the last two coefficients
if(fabs(det) > _Epsilon)
t1=(AC[0]*DC[2]-AC[2]*DC[0])*inv_det;
t2=(AB[0]*AC[2]-AB[2]*AC[0])*inv_det;
}
- else return false;//case of paralell segments
- }
+ else
+ {
+ if(distance2<DIM>(A,D)<_Epsilon)
+ crossprod<DIM>(A,C,E,_Vdouble);//store the crossprod between vectors AC and AE (E=vertex preceding A)
+ return false;//case of paralell segments
+ }
+ }
}
}
-
+
+ // std::cout<<"t1= " << t1 << " ; t2= " << t2<< std::endl;
if(t1>_Precision && t1<1-_Precision)
{
if( t2>_Precision && t2<1-_Precision)
}
}
else if(fabs(t2-1) <= _Precision)//vertex on a vertex (A=D), first run
- crossprod<DIM>(A,C,E,_Vdouble);//angle between vectors AC and AE (E=vertex preceding A)
+ crossprod<DIM>(A,C,E,_Vdouble);//store the angle between vectors AC and AE (E=vertex preceding A)
else if(fabs(t2) <= _Precision)//vertex on a vertex (A=C), second run
{
double Vdoublebis[DIM];
_Status.insert(std::make_pair(i_next_glob,std::make_pair(i_glob, false)));
_Status.insert(std::make_pair(i_prev_glob,std::make_pair(i_glob, false)));
mi1++;
- //std::cout<< "nb_prev= "<< 0 << " i_glob= " << i_glob << std::endl;
+ // std::cout<< "nb_prev= "<< 0 << " i_glob= " << i_glob << std::endl;
/******* Loop until the second polygon is reached *******/
while( !four_neighbours)
four_neighbours = true;
else /* Rare pothological case: */
{
- //std::cout<<"coucou" << std::endl;
const pair< const double *, int > next_pt= *mi2;
events.erase(mi2);
mi1=events.insert(mi1,next_pt);