mirror of
https://git.dev.opencascade.org/repos/occt.git
synced 2025-08-24 13:50:49 +03:00
Compare commits
2 Commits
Author | SHA1 | Date | |
---|---|---|---|
|
9726df44d5 | ||
|
d610ad7395 |
@@ -934,7 +934,10 @@ void BOPAlgo_PaveFiller::MakeBlocks(const Message_ProgressRange& theRange)
|
|||||||
// into all faces, not participated in creation of that edge, as IN edge
|
// into all faces, not participated in creation of that edge, as IN edge
|
||||||
|
|
||||||
PutSEInOtherFaces(aPSOuter.Next());
|
PutSEInOtherFaces(aPSOuter.Next());
|
||||||
//
|
|
||||||
|
// Filter the Common Blocks created on the Face/Face post treatment stage from duplicates
|
||||||
|
myDS->FilterCommonBlocks();
|
||||||
|
|
||||||
//-----------------------------------------------------scope t
|
//-----------------------------------------------------scope t
|
||||||
aMVStick.Clear();
|
aMVStick.Clear();
|
||||||
aMPBOnIn.Clear();
|
aMPBOnIn.Clear();
|
||||||
|
@@ -1116,13 +1116,7 @@ Handle(BOPDS_CommonBlock) BOPDS_DS::CommonBlock
|
|||||||
void BOPDS_DS::SetCommonBlock(const Handle(BOPDS_PaveBlock)& thePB,
|
void BOPDS_DS::SetCommonBlock(const Handle(BOPDS_PaveBlock)& thePB,
|
||||||
const Handle(BOPDS_CommonBlock)& theCB)
|
const Handle(BOPDS_CommonBlock)& theCB)
|
||||||
{
|
{
|
||||||
if (IsCommonBlock(thePB)) {
|
myMapPBCB.Bind(thePB, theCB);
|
||||||
Handle(BOPDS_CommonBlock)& aCB = myMapPBCB.ChangeFind(thePB);
|
|
||||||
aCB=theCB;
|
|
||||||
}
|
|
||||||
else {
|
|
||||||
myMapPBCB.Bind(thePB, theCB);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
//
|
//
|
||||||
@@ -2202,4 +2196,50 @@ Standard_Boolean BOPDS_DS::IsValidShrunkData(const Handle(BOPDS_PaveBlock)& theP
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
return Standard_True;
|
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);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
@@ -471,6 +471,10 @@ public:
|
|||||||
Bnd_Box& theBox,
|
Bnd_Box& theBox,
|
||||||
const Standard_Boolean theCheckInverted = Standard_True);
|
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:
|
protected:
|
||||||
|
|
||||||
|
|
||||||
|
@@ -1803,6 +1803,10 @@ Standard_Boolean FindFacePairs (const TopoDS_Edge& theE,
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
//
|
//
|
||||||
|
|
||||||
|
if (aLCEFx.IsEmpty())
|
||||||
|
return Standard_False;
|
||||||
|
|
||||||
// F2
|
// F2
|
||||||
BOPTools_AlgoTools::GetFaceOff(aE1, aF1, aLCEFx, aF2, theContext);
|
BOPTools_AlgoTools::GetFaceOff(aE1, aF1, aLCEFx, aF2, theContext);
|
||||||
//
|
//
|
||||||
|
@@ -32,6 +32,8 @@
|
|||||||
#include <gp.hxx>
|
#include <gp.hxx>
|
||||||
#include <gp_Vec2d.hxx>
|
#include <gp_Vec2d.hxx>
|
||||||
|
|
||||||
|
#include <Precision.hxx>
|
||||||
|
|
||||||
//======================================================================
|
//======================================================================
|
||||||
#define EPSDIST Tol
|
#define EPSDIST Tol
|
||||||
#define EPSNUL TolConf
|
#define EPSNUL TolConf
|
||||||
@@ -164,8 +166,13 @@ void IntImpParGen_Intersector::And_Domaine_Objet1_Intersections(const ImpTool& T
|
|||||||
Resultat2.SetValue(NbResultats, Inter2_And_Domain2.Value(indice_2));
|
Resultat2.SetValue(NbResultats, Inter2_And_Domain2.Value(indice_2));
|
||||||
}
|
}
|
||||||
else { //====== la borne2 et la borne1 sont hors domaine =====
|
else { //====== la borne2 et la borne1 sont hors domaine =====
|
||||||
if (param1<TheImpCurveDomain.FirstParameter()
|
const Standard_Real aParF = TheImpCurveDomain.HasFirstPoint() ?
|
||||||
&& param2>TheImpCurveDomain.LastParameter()) {
|
TheImpCurveDomain.FirstParameter() :
|
||||||
|
-Precision::Infinite();
|
||||||
|
const Standard_Real aParL = TheImpCurveDomain.HasLastPoint() ?
|
||||||
|
TheImpCurveDomain.LastParameter() :
|
||||||
|
Precision::Infinite();
|
||||||
|
if (param1<aParF && param2>aParL) {
|
||||||
Standard_Real t;
|
Standard_Real t;
|
||||||
NbResultats++;
|
NbResultats++;
|
||||||
t = TheImpCurveDomain.FirstParameter();
|
t = TheImpCurveDomain.FirstParameter();
|
||||||
|
@@ -1188,7 +1188,11 @@ void IntTools_BeanFaceIntersector::ComputeRangeFromStartPoint(const Standard_Boo
|
|||||||
// if point found decide to increase aDelta using derivative of distance function
|
// 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;
|
aDelta = (aDelta < aDeltaRestrictor) ? aDelta : aDeltaRestrictor;
|
||||||
|
|
||||||
aCurPar = (ToIncreaseParameter) ? (aPrevPar + aDelta) : (aPrevPar - aDelta);
|
aCurPar = (ToIncreaseParameter) ? (aPrevPar + aDelta) : (aPrevPar - aDelta);
|
||||||
|
@@ -1694,6 +1694,20 @@ void IntWalk_PWalking::Perform(const TColStd_Array1OfReal& ParDep,
|
|||||||
Standard_Boolean IntWalk_PWalking::ExtendLineInCommonZone(const IntImp_ConstIsoparametric theChoixIso,
|
Standard_Boolean IntWalk_PWalking::ExtendLineInCommonZone(const IntImp_ConstIsoparametric theChoixIso,
|
||||||
const Standard_Boolean theDirectionFlag)
|
const Standard_Boolean theDirectionFlag)
|
||||||
{
|
{
|
||||||
|
// Caro1 and Caro2
|
||||||
|
const Handle(Adaptor3d_Surface)& Caro1 = myIntersectionOn2S.Function().AuxillarSurface1();
|
||||||
|
const Handle(Adaptor3d_Surface)& Caro2 = myIntersectionOn2S.Function().AuxillarSurface2();
|
||||||
|
//
|
||||||
|
const Standard_Real UFirst1 = Adaptor3d_HSurfaceTool::FirstUParameter(Caro1);
|
||||||
|
const Standard_Real VFirst1 = Adaptor3d_HSurfaceTool::FirstVParameter(Caro1);
|
||||||
|
const Standard_Real ULast1 = Adaptor3d_HSurfaceTool::LastUParameter(Caro1);
|
||||||
|
const Standard_Real VLast1 = Adaptor3d_HSurfaceTool::LastVParameter(Caro1);
|
||||||
|
|
||||||
|
const Standard_Real UFirst2 = Adaptor3d_HSurfaceTool::FirstUParameter(Caro2);
|
||||||
|
const Standard_Real VFirst2 = Adaptor3d_HSurfaceTool::FirstVParameter(Caro2);
|
||||||
|
const Standard_Real ULast2 = Adaptor3d_HSurfaceTool::LastUParameter(Caro2);
|
||||||
|
const Standard_Real VLast2 = Adaptor3d_HSurfaceTool::LastVParameter(Caro2);
|
||||||
|
|
||||||
Standard_Boolean bOutOfTangentZone = Standard_False;
|
Standard_Boolean bOutOfTangentZone = Standard_False;
|
||||||
Standard_Boolean bStop = !myIntersectionOn2S.IsTangent();
|
Standard_Boolean bStop = !myIntersectionOn2S.IsTangent();
|
||||||
Standard_Integer dIncKey = 1;
|
Standard_Integer dIncKey = 1;
|
||||||
@@ -1705,6 +1719,42 @@ Standard_Boolean IntWalk_PWalking::ExtendLineInCommonZone(const IntImp_ConstIsop
|
|||||||
Standard_Integer uvit = 0;
|
Standard_Integer uvit = 0;
|
||||||
IntSurf_SequenceOfPntOn2S aSeqOfNewPoint;
|
IntSurf_SequenceOfPntOn2S aSeqOfNewPoint;
|
||||||
|
|
||||||
|
previousPoint.Parameters(Param(1), Param(2), Param(3), Param(4));
|
||||||
|
|
||||||
|
if (Param(1) - UFirst1 < ResoU1)
|
||||||
|
{
|
||||||
|
return bOutOfTangentZone;
|
||||||
|
}
|
||||||
|
else if (Param(2) - VFirst1 < ResoV1)
|
||||||
|
{
|
||||||
|
return bOutOfTangentZone;
|
||||||
|
}
|
||||||
|
else if (Param(3) - UFirst2 < ResoU2)
|
||||||
|
{
|
||||||
|
return bOutOfTangentZone;
|
||||||
|
}
|
||||||
|
else if (Param(4) - VFirst2 < ResoV2)
|
||||||
|
{
|
||||||
|
return bOutOfTangentZone;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (Param(1) - ULast1 > -ResoU1)
|
||||||
|
{
|
||||||
|
return bOutOfTangentZone;
|
||||||
|
}
|
||||||
|
else if (Param(2) - VLast1 > -ResoV1)
|
||||||
|
{
|
||||||
|
return bOutOfTangentZone;
|
||||||
|
}
|
||||||
|
else if (Param(3) - ULast2 > -ResoU2)
|
||||||
|
{
|
||||||
|
return bOutOfTangentZone;
|
||||||
|
}
|
||||||
|
else if (Param(4) - VLast2 > -ResoV2)
|
||||||
|
{
|
||||||
|
return bOutOfTangentZone;
|
||||||
|
}
|
||||||
|
|
||||||
while (!bStop) {
|
while (!bStop) {
|
||||||
nbIterWithoutAppend++;
|
nbIterWithoutAppend++;
|
||||||
|
|
||||||
|
30
tests/perf/modalg/bug29093
Normal file
30
tests/perf/modalg/bug29093
Normal file
@@ -0,0 +1,30 @@
|
|||||||
|
puts "========"
|
||||||
|
puts "0029093: BOP PaveFiller hungs and constantly consumes memory"
|
||||||
|
puts "========"
|
||||||
|
puts ""
|
||||||
|
|
||||||
|
bclearobjects;
|
||||||
|
bcleartools;
|
||||||
|
|
||||||
|
restore [locate_data_file bug29093.brep] a
|
||||||
|
|
||||||
|
explode a So
|
||||||
|
baddobjects a_7
|
||||||
|
baddtools a_9
|
||||||
|
|
||||||
|
dchrono cr restart
|
||||||
|
|
||||||
|
bfillds
|
||||||
|
bbuild result
|
||||||
|
|
||||||
|
dchrono cr stop counter bbuild
|
||||||
|
|
||||||
|
checkshape result
|
||||||
|
checkprops result -s 1329680 -v 34507100
|
||||||
|
checknbshapes result -vertex 5 -edge 13 -wire 9 -face 9 -shell 3 -solid 3
|
||||||
|
|
||||||
|
smallview
|
||||||
|
donly result
|
||||||
|
fit
|
||||||
|
|
||||||
|
checkview -display result -2d -path ${imagedir}/${test_image}.png
|
27
tests/perf/modalg/bug29144
Normal file
27
tests/perf/modalg/bug29144
Normal file
@@ -0,0 +1,27 @@
|
|||||||
|
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
|
Reference in New Issue
Block a user