mirror of
https://git.salome-platform.org/gitpub/modules/smesh.git
synced 2025-03-01 12:45:38 +05:00
Bug 0019943: Pb with projection 2d. Fix for a seam edge on not really closed face.
This commit is contained in:
parent
08ba46c116
commit
4b33363430
@ -32,6 +32,7 @@
|
||||
#include <BRepAdaptor_Surface.hxx>
|
||||
#include <BRepTools.hxx>
|
||||
#include <BRep_Tool.hxx>
|
||||
#include <BRepTools_WireExplorer.hxx>
|
||||
#include <Geom2d_Curve.hxx>
|
||||
#include <Geom_Curve.hxx>
|
||||
#include <Geom_Surface.hxx>
|
||||
@ -169,11 +170,29 @@ void SMESH_MesherHelper::SetSubShape(const TopoDS_Shape& aSh)
|
||||
BRepAdaptor_Surface surface( face );
|
||||
if ( surface.IsUPeriodic() || surface.IsVPeriodic() )
|
||||
{
|
||||
for ( TopExp_Explorer exp( face, TopAbs_EDGE ); exp.More(); exp.Next())
|
||||
for (TopExp_Explorer exp( face, TopAbs_EDGE ); exp.More(); exp.Next())
|
||||
{
|
||||
// look for a seam edge
|
||||
const TopoDS_Edge& edge = TopoDS::Edge( exp.Current() );
|
||||
if ( BRep_Tool::IsClosed( edge, face )) {
|
||||
bool isClosed = BRep_Tool::IsClosed( edge, face );
|
||||
// BEGIN: jfa for bug 0019943
|
||||
if (isClosed) {
|
||||
MESSAGE("$$$ CLOSED 1 $$$")
|
||||
isClosed = false;
|
||||
for (TopExp_Explorer expw (face, TopAbs_WIRE); expw.More() && !isClosed; expw.Next()) {
|
||||
const TopoDS_Wire& wire = TopoDS::Wire(expw.Current());
|
||||
int nbe = 0;
|
||||
for (BRepTools_WireExplorer we (wire, face); we.More() && !isClosed; we.Next()) {
|
||||
if (we.Current().IsSame(edge)) {
|
||||
nbe++;
|
||||
if (nbe == 2) isClosed = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
// END: jfa for bug 0019943
|
||||
if (isClosed) {
|
||||
MESSAGE("$$$ CLOSED 2 $$$")
|
||||
// initialize myPar1, myPar2 and myParIndex
|
||||
if ( mySeamShapeIds.empty() ) {
|
||||
gp_Pnt2d uv1, uv2;
|
||||
|
@ -634,7 +634,23 @@ bool SMESH_Pattern::Load (SMESH_Mesh* theMesh,
|
||||
// vertices
|
||||
for ( elIt = eList.begin(); elIt != eList.end(); elIt++ ) {
|
||||
myShapeIDMap.Add( TopExp::FirstVertex( *elIt, true ));
|
||||
if ( BRep_Tool::IsClosed( *elIt, theFace ) )
|
||||
bool isClosed1 = BRep_Tool::IsClosed( *elIt, theFace );
|
||||
// BEGIN: jfa for bug 0019943
|
||||
if (isClosed1) {
|
||||
isClosed1 = false;
|
||||
for (TopExp_Explorer expw (theFace, TopAbs_WIRE); expw.More() && !isClosed1; expw.Next()) {
|
||||
const TopoDS_Wire& wire = TopoDS::Wire(expw.Current());
|
||||
int nbe = 0;
|
||||
for (BRepTools_WireExplorer we (wire, theFace); we.More() && !isClosed1; we.Next()) {
|
||||
if (we.Current().IsSame(*elIt)) {
|
||||
nbe++;
|
||||
if (nbe == 2) isClosed1 = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
// END: jfa for bug 0019943
|
||||
if (isClosed1)
|
||||
myShapeIDMap.Add( TopExp::LastVertex( *elIt, true ));
|
||||
SMESHDS_SubMesh * eSubMesh = aMeshDS->MeshElements( *elIt );
|
||||
if ( eSubMesh )
|
||||
@ -2060,7 +2076,6 @@ bool SMESH_Pattern::
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
@ -2354,7 +2369,23 @@ bool SMESH_Pattern::Apply (const TopoDS_Face& theFace,
|
||||
list<TopoDS_Edge>::iterator elIt = eList.begin();
|
||||
for ( ; elIt != eList.end(); elIt++ ) {
|
||||
myShapeIDMap.Add( TopExp::FirstVertex( *elIt, true ));
|
||||
if ( BRep_Tool::IsClosed( *elIt, theFace ) )
|
||||
bool isClosed1 = BRep_Tool::IsClosed( *elIt, theFace );
|
||||
// BEGIN: jfa for bug 0019943
|
||||
if (isClosed1) {
|
||||
isClosed1 = false;
|
||||
for (TopExp_Explorer expw (theFace, TopAbs_WIRE); expw.More() && !isClosed1; expw.Next()) {
|
||||
const TopoDS_Wire& wire = TopoDS::Wire(expw.Current());
|
||||
int nbe = 0;
|
||||
for (BRepTools_WireExplorer we (wire, theFace); we.More() && !isClosed1; we.Next()) {
|
||||
if (we.Current().IsSame(*elIt)) {
|
||||
nbe++;
|
||||
if (nbe == 2) isClosed1 = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
// END: jfa for bug 0019943
|
||||
if (isClosed1)
|
||||
myShapeIDMap.Add( TopExp::LastVertex( *elIt, true ));
|
||||
}
|
||||
int nbVertices = myShapeIDMap.Extent();
|
||||
@ -4549,10 +4580,29 @@ bool SMESH_Pattern::setShapeToMesh(const TopoDS_Shape& theShape)
|
||||
if ( myIs2D ) {
|
||||
TopoDS_Face face = TopoDS::Face( theShape );
|
||||
TopExp_Explorer eExp( theShape, TopAbs_EDGE );
|
||||
for ( ; eExp.More() && nbNodeOnSeamEdge == 0; eExp.Next() )
|
||||
if ( BRep_Tool::IsClosed( TopoDS::Edge( eExp.Current() ), face ))
|
||||
for ( ; eExp.More() && nbNodeOnSeamEdge == 0; eExp.Next() ) {
|
||||
const TopoDS_Edge& ee = TopoDS::Edge(eExp.Current());
|
||||
bool isClosed1 = BRep_Tool::IsClosed(ee, face);
|
||||
// BEGIN: jfa for bug 0019943
|
||||
if (isClosed1) {
|
||||
isClosed1 = false;
|
||||
for (TopExp_Explorer expw (face, TopAbs_WIRE); expw.More() && !isClosed1; expw.Next()) {
|
||||
const TopoDS_Wire& wire = TopoDS::Wire(expw.Current());
|
||||
int nbe = 0;
|
||||
for (BRepTools_WireExplorer we (wire, face); we.More() && !isClosed1; we.Next()) {
|
||||
if (we.Current().IsSame(ee)) {
|
||||
nbe++;
|
||||
if (nbe == 2) isClosed1 = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
// END: jfa for bug 0019943
|
||||
if (isClosed1) {
|
||||
nbNodeOnSeamEdge = 2;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// check nb of vertices
|
||||
TopTools_IndexedMapOfShape vMap;
|
||||
|
Loading…
Reference in New Issue
Block a user