// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
-// SMESH SMESH : implementaion of SMESH idl descriptions
// File : StdMeshers_QuadToTriaAdaptor.cxx
// Module : SMESH
// Created : Wen May 07 16:37:07 2008
bool tooClose = ( angle < 15 * PI180 );
// Check if pyramids collide
- bool isOutI, isOutJ;
if ( !tooClose && baI * baJ > 0 )
{
// find out if nI points outside of PrmI or inside
int dInd = baseNodesIndI[1] - baseNodesIndI[0];
- isOutI = ( abs(dInd)==1 ) ? dInd < 0 : dInd > 0;
+ bool isOutI = ( abs(dInd)==1 ) ? dInd < 0 : dInd > 0;
// find out sign of projection of nJ to baI
double proj = baI * nJ;
// check order of baseNodes within pyramids, it must be opposite
int dInd;
dInd = baseNodesIndI[1] - baseNodesIndI[0];
- isOutI = ( abs(dInd)==1 ) ? dInd < 0 : dInd > 0;
+ bool isOutI = ( abs(dInd)==1 ) ? dInd < 0 : dInd > 0;
dInd = baseNodesIndJ[1] - baseNodesIndJ[0];
- isOutJ = ( abs(dInd)==1 ) ? dInd < 0 : dInd > 0;
+ bool isOutJ = ( abs(dInd)==1 ) ? dInd < 0 : dInd > 0;
if ( isOutJ == isOutI )
return false; // other domain
+ // direct both normals outside pyramid
+ ( isOutI ? nJ : nI ).Reverse();
+
// check absence of a face separating domains between pyramids
TIDSortedElemSet emptySet, avoidSet;
int i1, i2;
while ( otherNodeInd == i1 || otherNodeInd == i2 ) otherNodeInd++;
const SMDS_MeshNode* otherFaceNode = f->GetNode( otherNodeInd );
+ if ( otherFaceNode == nApexI || otherFaceNode == nApexJ )
+ continue; // f is a temporary triangle
+
// check if f is a base face of either of pyramids
if ( f->NbCornerNodes() == 4 &&
( PrmI->GetNodeIndex( otherFaceNode ) >= 0 ||
// check projections of face direction (baOFN) to triange normals (nI and nJ)
gp_Vec baOFN( base1, SMESH_TNodeXYZ( otherFaceNode ));
- ( isOutI ? nJ : nI ).Reverse();
if ( nI * baOFN > 0 && nJ * baOFN > 0 )
{
tooClose = false; // f is between pyramids
vector<gp_Pnt> PsJ( xyzIt, TXyzIterator() );
gp_Pnt Pint;
- bool hasInt;
+ bool hasInt=false;
for(k=0; k<4 && !hasInt; k++) {
gp_Vec Vtmp(PsI[k],PsI[4]);
gp_Pnt Pshift = PsI[k].XYZ() + Vtmp.XYZ() * 0.01; // base node moved a bit to apex
return true;
}
-//================================================================================
-/*!
- * \brief Return list of created triangles for given face
- */
-//================================================================================
-
-// const list<const SMDS_MeshFace* >* StdMeshers_QuadToTriaAdaptor::GetTriangles (const SMDS_MeshElement* aQuad)
-// {
-// TQuad2Trias::iterator it = myResMap.find(aQuad);
-// return ( it != myResMap.end() ? & it->second : 0 );
-// }