From: nbv Date: Wed, 11 Apr 2018 09:23:29 +0000 (+0300) Subject: # Warning: Building 2D curve of edge on face has failed. X-Git-Url: http://git.dev.opencascade.org/gitweb/?a=commitdiff_plain;h=4dff80e12a6316478b220646dc4871144fe7ff0d;p=occt-copy.git # Warning: Building 2D curve of edge on face has failed. (cherry picked from commit d0d712265120631f5cc58c3d480492e79a6c5123) --- diff --git a/src/BOPAlgo/BOPAlgo_PaveFiller.cxx b/src/BOPAlgo/BOPAlgo_PaveFiller.cxx index 5867221f5e..5c3b35cf92 100644 --- a/src/BOPAlgo/BOPAlgo_PaveFiller.cxx +++ b/src/BOPAlgo/BOPAlgo_PaveFiller.cxx @@ -294,6 +294,8 @@ void BOPAlgo_PaveFiller::PerformInternal() // UpdateBlocksWithSharedVertices(); // + myDS->RefineFaceInfoIn(); + // MakeSplitEdges(); if (HasErrors()) { return; diff --git a/src/BOPDS/BOPDS_DS.cxx b/src/BOPDS/BOPDS_DS.cxx index c89f7a31b9..58bbe6d79f 100644 --- a/src/BOPDS/BOPDS_DS.cxx +++ b/src/BOPDS/BOPDS_DS.cxx @@ -1418,6 +1418,44 @@ void BOPDS_DS::RefineFaceInfoOn() } } } + +//======================================================================= +//function : RefineFaceInfoIn +//purpose : +//======================================================================= +void BOPDS_DS::RefineFaceInfoIn() +{ + for (Standard_Integer i = 0; i < myNbSourceShapes; ++i) + { + const BOPDS_ShapeInfo& aSI = ShapeInfo(i); + if (aSI.ShapeType() != TopAbs_FACE) + continue; + + if (!aSI.HasReference()) + continue; + + BOPDS_FaceInfo& aFI = ChangeFaceInfo(i); + + const BOPDS_IndexedMapOfPaveBlock& aMPBOn = aFI.PaveBlocksOn(); + BOPDS_IndexedMapOfPaveBlock& aMPBIn = aFI.ChangePaveBlocksIn(); + + if (aMPBIn.IsEmpty() || aMPBOn.IsEmpty()) + continue; + + BOPDS_IndexedMapOfPaveBlock aMPBInNew; + + const Standard_Integer aNbPBIn = aMPBIn.Extent(); + for (Standard_Integer j = 1; j <= aNbPBIn; ++j) + { + if (!aMPBOn.Contains(aMPBIn(j))) + aMPBInNew.Add(aMPBIn(j)); + } + + if (aMPBInNew.Extent() < aNbPBIn) + aMPBIn = aMPBInNew; + } +} + //======================================================================= //function : AloneVertices //purpose : diff --git a/src/BOPDS/BOPDS_DS.hxx b/src/BOPDS/BOPDS_DS.hxx index 6b19debd0e..276c15961a 100644 --- a/src/BOPDS/BOPDS_DS.hxx +++ b/src/BOPDS/BOPDS_DS.hxx @@ -302,6 +302,9 @@ Standard_EXPORT virtual ~BOPDS_DS(); //! ++ Standard_EXPORT void RefineFaceInfoOn(); + //! Removes faces with state ON from the + //! list of IN-faces + Standard_EXPORT void RefineFaceInfoIn(); //! Returns information about ON/IN subshapes of the given faces. //! @param theMVOnIn the indices of ON/IN vertices from both faces