+ // check that the found top and bottom faces are opposite
+ {
+ for (TopExp_Explorer edge(botSM->GetSubShape(), TopAbs_EDGE); edge.More(); edge.Next())
+ if ( helper->IsSubShape( edge.Current(), topSM->GetSubShape() ))
+ return error(notQuadGeomSubMesh.empty() ? COMPERR_BAD_INPUT_MESH : COMPERR_BAD_SHAPE,
+ "Non-quadrilateral faces are not opposite");
+ }
+
+ // Protect from a distorted block (test 3D_mesh_HEXA3D/B7 on 32bit platform)
+ // check that all wall faces have an edge common with the top face
+ {
+ list< TopoDS_Face >::iterator faceIt = wallFaces.begin();
+ for ( ; faceIt != wallFaces.end(); ++faceIt )
+ {
+ bool hasCommon = false;
+ for (TopExp_Explorer edge(*faceIt, TopAbs_EDGE); !hasCommon && edge.More(); edge.Next())
+ if ( helper->IsSubShape( edge.Current(), topSM->GetSubShape() ))
+ hasCommon = true;
+ if ( !hasCommon )
+ return error(COMPERR_BAD_SHAPE);
+ }
+ }
+