mirror of
https://git.salome-platform.org/gitpub/modules/smesh.git
synced 2024-12-28 18:30:35 +05:00
Merge branch 'master' into V7_5_BR
This commit is contained in:
commit
381c06d4b7
@ -49,6 +49,7 @@
|
|||||||
#include <Bnd_B3d.hxx>
|
#include <Bnd_B3d.hxx>
|
||||||
#include <Geom2dAdaptor_Curve.hxx>
|
#include <Geom2dAdaptor_Curve.hxx>
|
||||||
#include <Geom2d_Line.hxx>
|
#include <Geom2d_Line.hxx>
|
||||||
|
#include <GeomLib_IsPlanarSurface.hxx>
|
||||||
#include <Geom_Curve.hxx>
|
#include <Geom_Curve.hxx>
|
||||||
#include <TopExp.hxx>
|
#include <TopExp.hxx>
|
||||||
#include <TopExp_Explorer.hxx>
|
#include <TopExp_Explorer.hxx>
|
||||||
@ -2228,6 +2229,41 @@ bool StdMeshers_Prism_3D::projectBottomToTop( const gp_Trsf & bottom
|
|||||||
|
|
||||||
myHelper->SetElementsOnShape( oldSetElemsOnShape );
|
myHelper->SetElementsOnShape( oldSetElemsOnShape );
|
||||||
|
|
||||||
|
// Check the projected mesh
|
||||||
|
|
||||||
|
if ( thePrism.myNbEdgesInWires.size() > 1 && // there are holes
|
||||||
|
topHelper.IsDistorted2D( topSM, /*checkUV=*/false ))
|
||||||
|
{
|
||||||
|
SMESH_MeshEditor editor( topHelper.GetMesh() );
|
||||||
|
|
||||||
|
// smooth in 2D or 3D?
|
||||||
|
TopLoc_Location loc;
|
||||||
|
Handle(Geom_Surface) surface = BRep_Tool::Surface( topFace, loc );
|
||||||
|
bool isPlanar = GeomLib_IsPlanarSurface( surface ).IsPlanar();
|
||||||
|
|
||||||
|
bool isFixed = false;
|
||||||
|
set<const SMDS_MeshNode*> fixedNodes;
|
||||||
|
for ( int iAttemp = 0; !isFixed && iAttemp < 10; ++iAttemp )
|
||||||
|
{
|
||||||
|
TIDSortedElemSet faces;
|
||||||
|
for ( faceIt = topSMDS->GetElements(); faceIt->more(); )
|
||||||
|
faces.insert( faces.end(), faceIt->next() );
|
||||||
|
|
||||||
|
SMESH_MeshEditor::SmoothMethod algo =
|
||||||
|
iAttemp ? SMESH_MeshEditor::CENTROIDAL : SMESH_MeshEditor::LAPLACIAN;
|
||||||
|
|
||||||
|
// smoothing
|
||||||
|
editor.Smooth( faces, fixedNodes, algo, /*nbIterations=*/ 10,
|
||||||
|
/*theTgtAspectRatio=*/1.0, /*the2D=*/!isPlanar);
|
||||||
|
|
||||||
|
isFixed = !topHelper.IsDistorted2D( topSM, /*checkUV=*/true );
|
||||||
|
}
|
||||||
|
if ( !isFixed )
|
||||||
|
return toSM( error( TCom("Projection from face #") << botSM->GetId()
|
||||||
|
<< " to face #" << topSM->GetId()
|
||||||
|
<< " failed: inverted elements created"));
|
||||||
|
}
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user