1
0
mirror of https://git.dev.opencascade.org/repos/occt.git synced 2025-04-10 18:51:21 +03:00

0026588: SIGSEGV in BRepFeat_MakeDPrism::Perform()

Test case for issue CR26588
This commit is contained in:
ifv 2015-09-17 14:39:05 +03:00 committed by bugmaster
parent 836d7b64ba
commit 4c71cff8e9
2 changed files with 175 additions and 256 deletions

View File

@ -87,10 +87,6 @@ static Standard_Integer SensOfPrism(const Handle(Geom_Curve) C,
static Handle(Geom_Curve) TestCurve(const TopoDS_Face&);
static Standard_Boolean ToFuse(const TopoDS_Face& ,
const TopoDS_Face&);
//=======================================================================
//function : Init
@ -248,36 +244,6 @@ void BRepFeat_MakeDPrism::Perform(const Standard_Real Height)
return;
}
TopoDS_Face FFace;
Standard_Boolean found = Standard_False;
if(!mySkface.IsNull() || !mySlface.IsEmpty()) {
if(myLShape.ShapeType() == TopAbs_WIRE) {
TopExp_Explorer ex1(VraiDPrism, TopAbs_FACE);
for(; ex1.More(); ex1.Next()) {
TopExp_Explorer ex2(ex1.Current(), TopAbs_WIRE);
for(; ex2.More(); ex2.Next()) {
if(ex2.Current().IsSame(myLShape)) {
FFace = TopoDS::Face(ex1.Current());
found = Standard_True;
break;
}
}
if(found) break;
}
}
TopExp_Explorer anExp(mySbase, TopAbs_FACE);
for(; anExp.More(); anExp.Next()) {
const TopoDS_Face& ff = TopoDS::Face(anExp.Current());
if(ToFuse(ff, FFace)) {
TopTools_DataMapOfShapeListOfShape sl;
break;
}
}
}
// management of gluing faces
GluedFacesValid();
@ -1073,6 +1039,7 @@ void BRepFeat_MakeDPrism::BossEdges (const Standard_Integer signature)
for (itLS.Initialize(theLastShape);itLS.More();itLS.Next()) {
const TopoDS_Face& TopFace = TopoDS::Face(itLS.Value());
if (!FF.IsSame(TopFace)) {
TopExp_Explorer ExpE;
for (ExpE.Init(FF,TopAbs_EDGE);ExpE.More() && !Found ;ExpE.Next()) {
const TopoDS_Edge& E1 = TopoDS::Edge(ExpE.Current());
TopoDS_Vertex V1,V2;
@ -1295,70 +1262,3 @@ static Handle(Geom_Curve) TestCurve(const TopoDS_Face& Base)
return theLin;
}
//=======================================================================
//function : ToFuse
//purpose :
//=======================================================================
Standard_Boolean ToFuse(const TopoDS_Face& F1,
const TopoDS_Face& F2)
{
if (F1.IsNull() || F2.IsNull()) {
return Standard_False;
}
Handle(Geom_Surface) S1,S2;
TopLoc_Location loc1, loc2;
Handle(Standard_Type) typS1,typS2;
const Standard_Real tollin = Precision::Confusion();
const Standard_Real tolang = Precision::Angular();
S1 = BRep_Tool::Surface(F1,loc1);
S2 = BRep_Tool::Surface(F2,loc2);
typS1 = S1->DynamicType();
typS2 = S2->DynamicType();
if (typS1 == STANDARD_TYPE(Geom_RectangularTrimmedSurface)) {
S1 = Handle(Geom_RectangularTrimmedSurface)::DownCast (S1)->BasisSurface();
typS1 = S1->DynamicType();
}
if (typS2 == STANDARD_TYPE(Geom_RectangularTrimmedSurface)) {
S2 = Handle(Geom_RectangularTrimmedSurface)::DownCast (S2)->BasisSurface();
typS2 = S2->DynamicType();
}
if (typS1 != typS2) {
return Standard_False;
}
Standard_Boolean ValRet = Standard_False;
if (typS1 == STANDARD_TYPE(Geom_Plane)) {
S1 = BRep_Tool::Surface(F1); // to apply the location.
S2 = BRep_Tool::Surface(F2);
gp_Pln pl1( Handle(Geom_Plane)::DownCast (S1)->Pln());
gp_Pln pl2( Handle(Geom_Plane)::DownCast (S2)->Pln());
if (pl1.Position().IsCoplanar(pl2.Position(),tollin,tolang)) {
ValRet = Standard_True;
}
}
return ValRet;
}

View File

@ -0,0 +1,19 @@
puts "================"
puts "CR26588"
puts "================"
puts ""
###############################################
## SIGSEGV in BRepFeat_MakeDPrism::Perform()
###############################################
pload DCAF
Open [locate_data_file bug26588_Study1_new_GEOM.cbf] D
GetShape D 0:1:8:1:1:2 s
GetShape D 0:1:27:1:1:2 a
featdprism s a a 25 0 1
featperformval dprism result 200
set 2dviewer 1