Salome HOME
Patch modules/smesh.git for Doxygen typos/grammar + misc. typos
[modules/smesh.git] / src / StdMeshers / StdMeshers_Prism_3D.cxx
index 9aed55e3e88f7ea1e16b69652f2b98737fc31c31..538cbdddf30a02736b91346fdf9300447e1f8be1 100644 (file)
@@ -872,7 +872,7 @@ bool StdMeshers_Prism_3D::Compute(SMESH_Mesh& theMesh, const TopoDS_Shape& theSh
 
 
     // TODO. there are other ways to find out the source FACE:
-    // propagation, topological similarity, ect.
+    // propagation, topological similarity, etc...
 
     // simply try to mesh all not meshed SOLIDs
     if ( meshedFaces.empty() )
@@ -1603,7 +1603,7 @@ bool StdMeshers_Prism_3D::computeWalls(const Prism_3D::TPrismTopo& thePrism)
       if ( ! fSM->IsMeshComputed() )
       {
         // Top EDGEs must be projections from the bottom ones
-        // to compute stuctured quad mesh on wall FACEs
+        // to compute structured quad mesh on wall FACEs
         // ---------------------------------------------------
         const TopoDS_Edge& botE = (*quad)->side[ QUAD_BOTTOM_SIDE ].grid->Edge(0);
         const TopoDS_Edge& topE = (*quad)->side[ QUAD_TOP_SIDE    ].grid->Edge(0);
@@ -2400,6 +2400,9 @@ double StdMeshers_Prism_3D::getSweepTolerance( const Prism_3D::TPrismTopo& thePr
 
 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()
@@ -2541,8 +2544,8 @@ namespace // utils used by StdMeshers_Prism_3D::IsApplicable()
     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 )
     {
     }
@@ -2671,16 +2674,16 @@ namespace // utils used by StdMeshers_Prism_3D::IsApplicable()
           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;
@@ -4889,8 +4892,8 @@ bool StdMeshers_Sweeper::ComputeNodes( SMESH_MesherHelper& helper,
     }
   }
 
-  //centerIntErrorIsSmall = true;
-  //bndErrorIsSmall = true;
+  centerIntErrorIsSmall = true; // 3D_mesh_Extrusion_00/A3
+  bndErrorIsSmall = true;
   if ( !centerIntErrorIsSmall )
   {
     // Compensate the central error; continue adding projection