{
gp_Vec edge( xyz[i-1], xyz[i] );
gp_Vec n1p ( xyz[i-1], point );
- // double dist = ( edge ^ n1p ).Magnitude() / edge.Magnitude();
- // if ( dist > tol )
- // continue;
- // gp_Vec n2p( xyz[i], point );
- // if ( fabs( edge.Magnitude() - n1p.Magnitude() - n2p.Magnitude()) > tol )
- // continue;
double u = ( edge * n1p ) / edge.SquareMagnitude(); // param [0,1] on the edge
- if ( u < 0. ) {
+ if ( u <= 0. ) {
if ( n1p.SquareMagnitude() < tol * tol )
return false;
continue;
}
- if ( u > 1. ) {
+ if ( u >= 1. ) {
if ( point.SquareDistance( xyz[i] ) < tol * tol )
return false;
continue;
int* n2ind)
{
- int i1, i2;
+ int i1 = 0, i2 = 0;
const SMDS_MeshElement* face = 0;
SMDS_ElemIteratorPtr invElemIt = n1->GetInverseElementIterator(SMDSAbs_Face);
- //MESSAGE("n1->GetInverseElementIterator(SMDSAbs_Face) " << invElemIt);
while ( invElemIt->more() && !face ) // loop on inverse faces of n1
{
- //MESSAGE("in while ( invElemIt->more() && !face )");
const SMDS_MeshElement* elem = invElemIt->next();
if (avoidSet.count( elem ))
continue;
if ( !face && elem->IsQuadratic())
{
// analysis for quadratic elements using all nodes
- // const SMDS_VtkFace* F = dynamic_cast<const SMDS_VtkFace*>(elem);
- // if (!F) throw SALOME_Exception(LOCALIZED("not an SMDS_VtkFace"));
- // use special nodes iterator
SMDS_ElemIteratorPtr anIter = elem->interlacedNodesElemIterator();
const SMDS_MeshNode* prevN = static_cast<const SMDS_MeshNode*>( anIter->next() );
for ( i1 = -1, i2 = 0; anIter->more() && !face; i1++, i2++ )