1
0
mirror of https://git.dev.opencascade.org/repos/occt.git synced 2025-04-07 18:30:55 +03:00

0030795: BRepOffsetAPI_MakePipeShell: hangs on the attached model and produces infinite rails

Added new condition to catch bad shape
This commit is contained in:
akaftasev 2020-08-17 18:44:19 +03:00 committed by bugmaster
parent eca6e7c547
commit 992876e98f
10 changed files with 177 additions and 29 deletions

View File

@ -2942,8 +2942,12 @@ void BRepFill_Sweep::Build(TopTools_MapOfShape& ReversedEdges,
EvalExtrapol(ILast, Transition)); EvalExtrapol(ILast, Transition));
if (IFirst>1) { if (IFirst>1) {
Translate(myVEdges, IFirst, Bounds, 2); Translate(myVEdges, IFirst, Bounds, 2);
PerformCorner(IFirst, if (!PerformCorner(IFirst,
Transition, Bounds); Transition, Bounds))
{
isDone = Standard_False;
return;
}
} }
IFirst = ILast; IFirst = ILast;
Translate(myVEdges, IFirst, Bounds, 1); Translate(myVEdges, IFirst, Bounds, 1);
@ -2954,7 +2958,11 @@ void BRepFill_Sweep::Build(TopTools_MapOfShape& ReversedEdges,
(Trous->Value(NbTrous) == NbPath+1) ) { (Trous->Value(NbTrous) == NbPath+1) ) {
Translate(myVEdges, NbPath+1, Bounds, 1); Translate(myVEdges, NbPath+1, Bounds, 1);
Translate(myVEdges, 1, Bounds, 2); Translate(myVEdges, 1, Bounds, 2);
PerformCorner(1, Transition, Bounds); if (!PerformCorner(1, Transition, Bounds))
{
isDone = Standard_False;
return;
}
Translate(myVEdges, 1, myVEdges, NbPath+1); Translate(myVEdges, 1, myVEdges, NbPath+1);
} }
@ -3175,12 +3183,14 @@ TopoDS_Shape BRepFill_Sweep::Tape(const Standard_Integer Index) const
//function : PerformCorner //function : PerformCorner
//purpose : Trim and/or loop a corner //purpose : Trim and/or loop a corner
//====================================================================== //======================================================================
void BRepFill_Sweep::PerformCorner(const Standard_Integer Index, Standard_Boolean BRepFill_Sweep::PerformCorner(const Standard_Integer Index,
const BRepFill_TransitionStyle Transition, const BRepFill_TransitionStyle Transition,
const Handle(TopTools_HArray2OfShape)& Bounds) const Handle(TopTools_HArray2OfShape)& Bounds)
{ {
if (Transition == BRepFill_Modified) return; // Do nothing. if (Transition == BRepFill_Modified) return Standard_True; // Do nothing.
const Standard_Real anAngularTol = 0.025;
BRepFill_TransitionStyle TheTransition = Transition; BRepFill_TransitionStyle TheTransition = Transition;
Standard_Boolean isTangent=Standard_False; Standard_Boolean isTangent=Standard_False;
@ -3226,11 +3236,15 @@ TopoDS_Shape BRepFill_Sweep::Tape(const Standard_Integer Index) const
#ifdef OCCT_DEBUG #ifdef OCCT_DEBUG
std::cout << "BRepFill_Sweep::PerformCorner : This is not a corner !" << std::endl; std::cout << "BRepFill_Sweep::PerformCorner : This is not a corner !" << std::endl;
#endif #endif
return; return Standard_True;
} }
Sortant = t2 - t1; Sortant = t2 - t1;
} }
if (T1.Angle(T2) >= M_PI - anAngularTol)
{
return Standard_False;
}
if ((TheTransition == BRepFill_Right) if ((TheTransition == BRepFill_Right)
&& (T1.Angle(T2) > myAngMax) ) { && (T1.Angle(T2) > myAngMax) ) {
TheTransition = BRepFill_Round; TheTransition = BRepFill_Round;
@ -3336,7 +3350,7 @@ TopoDS_Shape BRepFill_Sweep::Tape(const Standard_Integer Index) const
#ifdef OCCT_DEBUG #ifdef OCCT_DEBUG
std::cout << "Fail of TrimCorner" << std::endl; std::cout << "Fail of TrimCorner" << std::endl;
#endif #endif
return; // Nothing is touched return Standard_True; // Nothing is touched
} }
if (mySec->IsUClosed()) if (mySec->IsUClosed())
@ -3416,7 +3430,7 @@ TopoDS_Shape BRepFill_Sweep::Tape(const Standard_Integer Index) const
#endif #endif
} }
} }
return Standard_True;
/* /*
#if DRAW #if DRAW
if (Affich) { if (Affich) {

View File

@ -124,7 +124,7 @@ protected:
Standard_EXPORT Standard_Boolean BuildShell (const BRepFill_TransitionStyle Transition, const Standard_Integer Vf, const Standard_Integer Vl, TopTools_MapOfShape& ReversedEdges, BRepFill_DataMapOfShapeHArray2OfShape& Tapes, BRepFill_DataMapOfShapeHArray2OfShape& Rails, const Standard_Real ExtendFirst = 0.0, const Standard_Real ExtendLast = 0.0); Standard_EXPORT Standard_Boolean BuildShell (const BRepFill_TransitionStyle Transition, const Standard_Integer Vf, const Standard_Integer Vl, TopTools_MapOfShape& ReversedEdges, BRepFill_DataMapOfShapeHArray2OfShape& Tapes, BRepFill_DataMapOfShapeHArray2OfShape& Rails, const Standard_Real ExtendFirst = 0.0, const Standard_Real ExtendLast = 0.0);
Standard_EXPORT void PerformCorner (const Standard_Integer Index, const BRepFill_TransitionStyle Transition, const Handle(TopTools_HArray2OfShape)& Bounds); Standard_EXPORT Standard_Boolean PerformCorner (const Standard_Integer Index, const BRepFill_TransitionStyle Transition, const Handle(TopTools_HArray2OfShape)& Bounds);
Standard_EXPORT Standard_Real EvalExtrapol (const Standard_Integer Index, const BRepFill_TransitionStyle Transition) const; Standard_EXPORT Standard_Real EvalExtrapol (const Standard_Integer Index, const BRepFill_TransitionStyle Transition) const;

View File

@ -1,6 +1,3 @@
puts "TODO OCC30808 ALL: An exception was caught"
puts "TODO OCC30808 ALL:TEST INCOMPLETE"
puts "========" puts "========"
puts "0030787: BRepOffsetAPI_MakePipeShell: hangs on the attached model" puts "0030787: BRepOffsetAPI_MakePipeShell: hangs on the attached model"
puts "========" puts "========"

View File

@ -0,0 +1,11 @@
puts "========"
puts "0030795: BRepOffsetAPI_MakePipeShell: hangs on the attached model and produces infinite rails"
puts "========"
puts ""
restore [locate_data_file bug30795.brep] a
explode a
mksweep a_1
addsweep a_2
buildsweep result -C -S

22
tests/pipe/standard/G1 Normal file
View File

@ -0,0 +1,22 @@
circle c1 0 10 0 10
circle c2 0 9 0 9.1
circle c3 10 10 0 0 10 0 0.05
mkedge e1 c1
mkedge e2 c2
mkedge profile c3
bclearobjects
baddobjects e1 e2
bfillds
bbuild result
explode result e
wire path result_1 result_3 result_4 result_6
wire profile profile
mksweep path
addsweep profile
buildsweep result -C -R
checkprops result -s 32.412

20
tests/pipe/standard/G2 Normal file
View File

@ -0,0 +1,20 @@
circle c1 0 10 0 10
circle c2 0 9 0 9.01
circle c3 10 10 0 0 10 0 0.05
mkedge e1 c1
mkedge e2 c2
mkedge profile c3
bclearobjects
baddobjects e1 e2
bfillds
bbuild result
explode result e
wire path result_1 result_3 result_4 result_6
wire profile profile
mksweep path
addsweep profile
buildsweep result -C -R

20
tests/pipe/standard/G3 Normal file
View File

@ -0,0 +1,20 @@
circle c1 0 10 0 10
circle c2 0 9 0 9.001
circle c3 10 10 0 0 10 0 0.05
mkedge e1 c1
mkedge e2 c2
mkedge profile c3
bclearobjects
baddobjects e1 e2
bfillds
bbuild result
explode result e
wire path result_1 result_3 result_4 result_6
wire profile profile
mksweep path
addsweep profile
buildsweep result -C -R

22
tests/pipe/standard/G4 Normal file
View File

@ -0,0 +1,22 @@
circle c1 0 10 0 10
circle c2 0 -9 0 9.1
circle c3 10 10 0 0 10 0 0.05
mkedge e1 c1
mkedge e2 c2
mkedge profile c3
bclearobjects
baddobjects e1 e2
bfillds
bbuild result
explode result e
wire path result_1 result_3 result_4 result_6
wire profile profile
mksweep path
addsweep profile
buildsweep result -C -R
checkprops result -s 36.5019

22
tests/pipe/standard/G5 Normal file
View File

@ -0,0 +1,22 @@
circle c1 0 10 0 10
circle c2 0 -9 0 9.01
circle c3 10 10 0 0 10 0 0.05
mkedge e1 c1
mkedge e2 c2
mkedge profile c3
bclearobjects
baddobjects e1 e2
bfillds
bbuild result
explode result e
wire path result_1 result_3 result_4 result_6
wire profile profile
mksweep path
addsweep profile
buildsweep result -C -R
checkprops result -s 37.4358

20
tests/pipe/standard/G6 Normal file
View File

@ -0,0 +1,20 @@
circle c1 0 10 0 10
circle c2 0 -9 0 9.001
circle c3 10 10 0 0 10 0 0.05
mkedge e1 c1
mkedge e2 c2
mkedge profile c3
bclearobjects
baddobjects e1 e2
bfillds
bbuild result
explode result e
wire path result_1 result_3 result_4 result_6
wire profile profile
mksweep path
addsweep profile
buildsweep result -C -R