X-Git-Url: http://git.salome-platform.org/gitweb/?a=blobdiff_plain;f=src%2FPARTITION%2FPartition_Inter3d.cxx;h=e9bf649ce6fb4d905706ac6a7c48b9fb7f460471;hb=35c0ccc26885b896b4e62981979fd987e4b20f76;hp=7724b73f1a2a76103622ccc3030f36e346fbaa17;hpb=0e49ec355ed82035e3a8f370d0539a258aca21e2;p=modules%2Fgeom.git diff --git a/src/PARTITION/Partition_Inter3d.cxx b/src/PARTITION/Partition_Inter3d.cxx index 7724b73f1..e9bf649ce 100644 --- a/src/PARTITION/Partition_Inter3d.cxx +++ b/src/PARTITION/Partition_Inter3d.cxx @@ -67,7 +67,6 @@ using namespace std; #include #include #include -#include #include #include #include @@ -136,10 +135,10 @@ void Partition_Inter3d::CompletPart3d(const TopTools_ListOfShape& SetOfFaces1, // avoid intersecting faces of one shape TopoDS_Shape S1; if (FaceShapeMap.IsBound(F1)) S1 = FaceShapeMap.Find(F1); - // avoid intersecting faces sharing vertices, suppose they belong to - // shapes sharing same faces - TopTools_IndexedMapOfShape VM; - TopExp::MapShapes( F1, TopAbs_VERTEX, VM); + + // to filter faces sharing an edge + TopTools_IndexedMapOfShape EM; + TopExp::MapShapes( F1, TopAbs_EDGE, EM); TColStd_ListIteratorOfListOfInteger itLI = BOS.Compare(F1); for (; itLI.More(); itLI.Next()) { @@ -152,13 +151,22 @@ void Partition_Inter3d::CompletPart3d(const TopTools_ListOfShape& SetOfFaces1, if (!S1.IsNull() && S1.IsSame(S2)) continue; // descendants of one shape - TopExp_Explorer expV (F2, TopAbs_VERTEX); - for ( ; expV.More(); expV.Next()) - if (VM.Contains( expV.Current() )) + TopExp_Explorer expE (F2, TopAbs_EDGE); + for ( ; expE.More(); expE.Next()) + if (EM.Contains( expE.Current() )) break; - if (expV.More()) - continue; // faces have a common edge - + if (expE.More()) + { + // faces have a common edge, check if they are a tool and a face + // generated by the tool in another shape; in that case they are + // to be intersected + TopLoc_Location L1, L2; + Handle(Geom_Surface) S1 = BRep_Tool::Surface( F1, L1 ); + Handle(Geom_Surface) S2 = BRep_Tool::Surface( F2, L2 ); + if ( S1 != S2 || L1 != L2 ) + continue; + } + F1.Orientation(TopAbs_FORWARD); F2.Orientation(TopAbs_FORWARD); FacesPartition(F1,F2); @@ -210,8 +218,7 @@ static void PutInBounds (const TopoDS_Face& F, // UPeriodic, sometimes it is in domain but nontheless it has // wrong position. // Check pcurve position by 3D point - if (S->IsKind(STANDARD_TYPE( Geom_SphericalSurface )) || - S->IsKind(STANDARD_TYPE( Geom_ToroidalSurface ))) + if (S->IsKind(STANDARD_TYPE( Geom_SphericalSurface ))) { // get point on the surface gp_Pnt Ps = S->Value( Pm.X(), Pm.Y() ); @@ -472,11 +479,17 @@ void Partition_Inter3d::Inter3D(const TopoDS_Face& F1, TopoDS_Edge se = TopoDS::Edge( itLSE.Value() ); + // move itLSE to the next se Standard_Integer ancRank = DS.AncestorRank(se); if (ME[ancRank-1].Contains( se )) + { LSE.Remove( itLSE ); // se is an edge of face it intersects + continue; + } else + { itLSE.Next(); + } const TopoDS_Face& F = (ancRank == 1) ? F2 : F1;