From: eap Date: Mon, 4 Feb 2013 12:18:16 +0000 (+0000) Subject: 0021893: EDF 2133 SMESH : Improvement of 3D extrusion algorithm X-Git-Tag: pluginMGCleaner~138 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=1263fe9d1b1ebcdc1c8b98e41dc1e39fbe2e86a7;p=modules%2Fsmesh.git 0021893: EDF 2133 SMESH : Improvement of 3D extrusion algorithm find the source FACE by local 1D hyps --- diff --git a/src/StdMeshers/StdMeshers_Prism_3D.cxx b/src/StdMeshers/StdMeshers_Prism_3D.cxx index ee33b9793..fb93ab135 100644 --- a/src/StdMeshers/StdMeshers_Prism_3D.cxx +++ b/src/StdMeshers/StdMeshers_Prism_3D.cxx @@ -485,8 +485,8 @@ bool StdMeshers_Prism_3D::Compute(SMESH_Mesh& theMesh, const TopoDS_Shape& theSh } //meshedFaces.splice( meshedFaces.begin(), notQuadMeshedFaces ); - if ( meshedFaces.empty() ) - return error( COMPERR_BAD_INPUT_MESH, "No meshed source faces found" ); + // if ( meshedFaces.empty() ) + // return error( COMPERR_BAD_INPUT_MESH, "No meshed source faces found" ); TopTools_MapOfShape meshedSolids; list< Prism_3D::TPrismTopo > meshedPrism; @@ -574,6 +574,36 @@ bool StdMeshers_Prism_3D::Compute(SMESH_Mesh& theMesh, const TopoDS_Shape& theSh break; // to compute prisms with avident sources } + // find FACEs with local 1D hyps, which has to be computed by now, + // or at least any computed FACEs + for ( int iF = 1; iF < faceToSolids.Extent(); ++iF ) + { + const TopoDS_Face& face = TopoDS::Face( faceToSolids.FindKey( iF )); + SMESH_subMesh* faceSM = theMesh.GetSubMesh( face ); + if ( !faceSM->IsEmpty() ) + { + meshedFaces.push_back( face ); // lower priority + } + else + { + bool allSubMeComputed = true; + SMESH_subMeshIteratorPtr smIt = faceSM->getDependsOnIterator(false,true); + while ( smIt->more() && allSubMeComputed ) + allSubMeComputed = smIt->next()->IsMeshComputed(); + if ( allSubMeComputed ) + { + faceSM->ComputeStateEngine( SMESH_subMesh::COMPUTE ); + if ( !faceSM->IsEmpty() ) + meshedFaces.push_front( face ); // higher priority + else + faceSM->ComputeStateEngine( SMESH_subMesh::CHECK_COMPUTE_STATE ); + } + } + if ( !meshedFaces.empty() ) + break; + } + + // TODO. there are other ways to find out the source FACE: // propagation, topological similarity, ect.