enum EQuadNature { NOT_QUAD, QUAD, DEGEN_QUAD };
- // std-like iterator used to get coordinates of nodes of mesh element
+// std-like iterator used to get coordinates of nodes of mesh element
typedef SMDS_StdIterator< SMESH_MeshEditor::TNodeXYZ, SMDS_ElemIteratorPtr > TXyzIterator;
namespace
*/
//================================================================================
- class SMDS_EXPORT Q2TAdaptor_Triangle : public SMDS_MeshFace
+ class STDMESHERS_EXPORT Q2TAdaptor_Triangle : public SMDS_MeshFace
{
const SMDS_MeshNode* _nodes[3];
public:
//================================================================================
/*!
* \brief Return true if two adjacent pyramids are too close one to another
- * so that a tetrahedron to built between them whoul have too poor quality
+ * so that a tetrahedron to built between them would have too poor quality
*/
//================================================================================
// Check angle between normals
double angle = nI.Angle( nJ );
- bool tooClose = ( angle < 10 * PI180 );
+ bool tooClose = ( angle < 15 * PI180 );
// Check if pyramids collide
bool isOutI, isOutJ;
}
}
if ( !mergedPyrams.empty() )
- for (TIDSortedElemSet::iterator prm = mergedPyrams.begin(); prm != mergedPyrams.end(); ++prm)
+ {
+ TIDSortedElemSet::iterator prm;
+// for (prm = mergedPyrams.begin(); prm != mergedPyrams.end(); ++prm)
+// MergeAdjacent( *prm, mesh, nodesToMove );
+
+ for (prm = adjacentPyrams.begin(); prm != adjacentPyrams.end(); ++prm)
MergeAdjacent( *prm, mesh, nodesToMove );
+ }
}
}
//================================================================================
StdMeshers_QuadToTriaAdaptor::StdMeshers_QuadToTriaAdaptor():
- myElemSearcher(0)
+ myElemSearcher(0), myNbTriangles(0)
{
}
gp_Vec& VNorm,
const SMDS_MeshElement** volumes)
{
- if( face->NbNodes() != ( face->IsQuadratic() ? 8 : 4 ))
- if( face->NbNodes() != 4 )
- return NOT_QUAD;
+ if( face->NbCornerNodes() != 4 )
+ {
+ myNbTriangles += int( face->NbCornerNodes() == 3 );
+ return NOT_QUAD;
+ }
int i = 0;
gp_XYZ xyzC(0., 0., 0.);
{
myResMap.clear();
myPyramids.clear();
+ myNbTriangles = 0;
+ myShape = aShape;
SMESHDS_Mesh * meshDS = aMesh.GetMeshDS();
SMESH_MesherHelper helper(aMesh);
nodesToMove.insert( aNode1 );
nodesToMove.insert( aNode2 );
}
+ // fix intersections that could appear after apex movement
+ MergeAdjacent( PrmI, aMesh, nodesToMove );
+ MergeAdjacent( PrmJ, aMesh, nodesToMove );
+
} // end if(hasInt)
} // loop on suspectPyrams
} // loop on 4 base nodes of PrmI
if ( q2t->first == q2tPrev->first )
q2tPrev->second.splice( q2tPrev->second.end(), q2t->second );
}
- // delete removed triangles
+ // delete removed triangles and count resulting nb of triangles
for ( q2t = myResMap.begin(); q2t != myResMap.end(); ++q2t )
{
TTriaList & trias = q2t->second;
if ( ((const Q2TAdaptor_Triangle*) *tri)->IsRemoved() )
delete *tri, trias.erase( tri++ );
else
- tri++;
+ tri++, myNbTriangles++;
}
myPyramids.clear(); // no more needed