1. Method IntTools_BeanFaceIntersector::ComputeRangeFromStartPoint(...) has been corrected in order to avoid infinite loop described in the issue. The algorithm of obtaining the neighborhood of the intersection point has been improved.
2. Post-processing has been added to join several common blocks to one. Method BOPDS_DS::RemoveCommonBlock(...) has been added in order to avoid duplication after joining.
// into all faces, not participated in creation of that edge, as IN edge
PutSEInOtherFaces(aPSOuter.Next());
- //
+
+ // Filter the Common Blocks created on the Face/Face post treatment stage from duplicates
+ myDS->FilterCommonBlocks();
+
//-----------------------------------------------------scope t
aMVStick.Clear();
aMPBOnIn.Clear();
void BOPDS_DS::SetCommonBlock(const Handle(BOPDS_PaveBlock)& thePB,
const Handle(BOPDS_CommonBlock)& theCB)
{
- if (IsCommonBlock(thePB)) {
- Handle(BOPDS_CommonBlock)& aCB = myMapPBCB.ChangeFind(thePB);
- aCB=theCB;
- }
- else {
- myMapPBCB.Bind(thePB, theCB);
- }
+ myMapPBCB.Bind(thePB, theCB);
}
//
}
}
return Standard_True;
+}
+
+//=======================================================================
+//function : FilterCommonBlocks
+//purpose :
+//=======================================================================
+void BOPDS_DS::FilterCommonBlocks()
+{
+ // Connection map from edge to common block
+ NCollection_DataMap<Standard_Integer, Handle(BOPDS_CommonBlock)> aMapEC;
+
+ // Iterate on all Pave Blocks in the Data Structure and make
+ // the Pave Blocks with the same edges be lined to the same Common Block
+ BOPDS_VectorOfListOfPaveBlock& aPBP = ChangePaveBlocksPool();
+ Standard_Integer aNbPBP = aPBP.Length();
+ for (Standard_Integer i = 0; i < aNbPBP; ++i)
+ {
+ BOPDS_ListOfPaveBlock& aLPB = aPBP(i);
+ BOPDS_ListIteratorOfListOfPaveBlock aItPB;
+ aItPB.Initialize(aLPB);
+ for (; aItPB.More(); aItPB.Next())
+ {
+ const Handle(BOPDS_PaveBlock) &aPB = aItPB.Value();
+
+ if (!IsCommonBlock(aPB))
+ // not a Common block - skip
+ continue;
+
+ // Get index of the edge
+ const Standard_Integer anEIdx = aPB->Edge();
+
+ Handle(BOPDS_CommonBlock) *aCB = aMapEC.ChangeSeek(anEIdx);
+ if (!aCB)
+ {
+ // Firstly met edge. Make all other Pave Blocks with the same edge
+ // be linked to the same Common Block.
+ aCB = aMapEC.Bound(anEIdx, CommonBlock(aPB));
+ }
+ else
+ {
+ // Update the information about Common Block
+ (*aCB)->AddPaveBlock(aPB);
+ SetCommonBlock(aPB, *aCB);
+ }
+ }
+ }
}
\ No newline at end of file
Bnd_Box& theBox,
const Standard_Boolean theCheckInverted = Standard_True);
+ //! Filter the Common Blocks on edges so that all Pave Blocks with the same Edge
+ //! have the same Common Block linked to it.
+ Standard_EXPORT void FilterCommonBlocks();
+
protected:
}
}
//
+
+ if (aLCEFx.IsEmpty())
+ return Standard_False;
+
// F2
BOPTools_AlgoTools::GetFaceOff(aE1, aF1, aLCEFx, aF2, theContext);
//
#include <gp.hxx>
#include <gp_Vec2d.hxx>
+#include <Precision.hxx>
+
//======================================================================
#define EPSDIST Tol
#define EPSNUL TolConf
Resultat2.SetValue(NbResultats, Inter2_And_Domain2.Value(indice_2));
}
else { //====== la borne2 et la borne1 sont hors domaine =====
- if (param1<TheImpCurveDomain.FirstParameter()
- && param2>TheImpCurveDomain.LastParameter()) {
+ const Standard_Real aParF = TheImpCurveDomain.HasFirstPoint() ?
+ TheImpCurveDomain.FirstParameter() :
+ -Precision::Infinite();
+ const Standard_Real aParL = TheImpCurveDomain.HasLastPoint() ?
+ TheImpCurveDomain.LastParameter() :
+ Precision::Infinite();
+ if (param1<aParF && param2>aParL) {
Standard_Real t;
NbResultats++;
t = TheImpCurveDomain.FirstParameter();
// if point found decide to increase aDelta using derivative of distance function
//
- aDelta = (pointfound) ? (aDelta * 2.) : (aDelta * 0.5);
+ // (aDelta*2) and (aDelta/(3/2)).
+ // Use of constants 2 and 0.5 leads to infinite loop
+ // connected with the sequence: pointfound == TRUE ==>
+ // aDelta *= 2.0 ==> pointfound == FALSE ==> aDelta *= 0.5 ...
+ aDelta *= (pointfound) ? 2.0 : 0.6667;
aDelta = (aDelta < aDeltaRestrictor) ? aDelta : aDeltaRestrictor;
aCurPar = (ToIncreaseParameter) ? (aPrevPar + aDelta) : (aPrevPar - aDelta);
--- /dev/null
+puts "========"
+puts "0029144: Modeling Algorithms - BOP PaveFiller hangs in some case"
+puts "========"
+puts ""
+
+puts "TODO OCC29145 ALL : Faulty shapes in variables faulty_1 to faulty_"
+
+bclearobjects;
+bcleartools;
+
+restore [locate_data_file bug29093_hung3.brep] a
+explode a So
+baddobjects a_7
+baddtools a_11
+
+dchrono cr restart
+
+bfillds
+bbuild result
+
+dchrono cr stop counter bbuild
+
+checkshape result
+checkprops result -s 1313890 -v 46778600
+checknbshapes result -vertex 9 -edge 20 -wire 12 -face 12 -shell 3 -solid 3
+
+checkview -display result -2d -path ${imagedir}/${test_image}.png