bool StdMeshers_Prism_3D::isSimpleBottom( const Prism_3D::TPrismTopo& thePrism )
{
+ if ( thePrism.myBottomEdges.size() != 4 )
+ return false;
+
// analyse angles between edges
double nbConcaveAng = 0, nbConvexAng = 0;
TopoDS_Face reverseBottom = TopoDS::Face( thePrism.myBottom.Reversed() ); // see initPrism()
bool _isBase; /* is used in a base FACE */
EdgeWithNeighbors(const TopoDS_Edge& E, int iE, int nbE, int shift, bool isBase ):
_edge( E ), _iBase( iE + shift ),
- _iL( SMESH_MesherHelper::WrapIndex( iE-1, nbE ) + shift ),
- _iR( SMESH_MesherHelper::WrapIndex( iE+1, nbE ) + shift ),
+ _iL( SMESH_MesherHelper::WrapIndex( iE-1, Max( 1, nbE )) + shift ),
+ _iR( SMESH_MesherHelper::WrapIndex( iE+1, Max( 1, nbE )) + shift ),
_isBase( isBase )
{
}
edges[ iFirst ]._iL = edges[ iFirst ]._iBase; // connect to self
edges[ iLast ]._iR = edges[ iLast ]._iBase;
- // look for an EDGE of the outer WIRE connected to vv
+ // look for an EDGE of the outer WIREs connected to vv
TopoDS_Vertex v0, v1;
- for ( iE = 0; iE < nbEdgesInWires.front(); ++iE )
+ for ( iE = 0; iE < iFirst; ++iE )
{
v0 = SMESH_MesherHelper::IthVertex( 0, edges[ iE ]._edge );
v1 = SMESH_MesherHelper::IthVertex( 1, edges[ iE ]._edge );
if ( vv[0].IsSame( v0 ) || vv[0].IsSame( v1 ))
edges[ iFirst ]._iL = edges[ iE ]._iBase;
if ( vv[1].IsSame( v0 ) || vv[1].IsSame( v1 ))
- edges[ iLast ]._iR = edges[ iE ]._iBase;
+ edges[ iLast ]._iR = edges[ iE ]._iBase;
}
}
iFirst += *nbE;
}
}
- //centerIntErrorIsSmall = true;
- //bndErrorIsSmall = true;
+ centerIntErrorIsSmall = true; // 3D_mesh_Extrusion_00/A3
+ bndErrorIsSmall = true;
if ( !centerIntErrorIsSmall )
{
// Compensate the central error; continue adding projection