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

0030204: BRepOffsetAPI_MakePipeShell crash

Add protection from type mismatch while ensuring Same Parameter on U-edges
This commit is contained in:
jgv 2018-10-12 13:02:34 +03:00 committed by apn
parent b34d86cb28
commit cb6a45e318
3 changed files with 55 additions and 3 deletions

View File

@ -3052,10 +3052,19 @@ void BRepFill_Sweep::Build(TopTools_MapOfShape& ReversedEdges,
if (i2 > myFaces->UpperRow())
i2 = 0;
if (i1 != 0)
Face1 = TopoDS::Face(myFaces->Value(i1, jj));
{
const TopoDS_Shape& aShape1 = myFaces->Value(i1, jj);
if (aShape1.ShapeType() == TopAbs_FACE)
Face1 = TopoDS::Face(aShape1);
}
if (i2 != 0)
Face2 = TopoDS::Face(myFaces->Value(i2, jj));
CorrectSameParameter(anEdge, Face1, Face2);
{
const TopoDS_Shape& aShape2 = myFaces->Value(i2, jj);
if (aShape2.ShapeType() == TopAbs_FACE)
Face2 = TopoDS::Face(aShape2);
}
if (!Face1.IsNull() && !Face2.IsNull())
CorrectSameParameter(anEdge, Face1, Face2);
}
}

View File

@ -0,0 +1,17 @@
puts "============"
puts "OCC30204"
puts "============"
puts ""
###################################
# BRepOffsetAPI_MakePipeShell crash
###################################
#test only for no crash
restore [locate_data_file bug30204_path.brep] path
restore [locate_data_file bug30204_base.brep] base
mksweep path
setsweep -CN 0 1 0
addsweep base
buildsweep result

View File

@ -0,0 +1,26 @@
puts "============"
puts "OCC30204"
puts "============"
puts ""
###################################
# BRepOffsetAPI_MakePipeShell crash
###################################
restore [locate_data_file bug30204_path.brep] path
restore [locate_data_file bug30204_base.brep] base
mksweep path
addsweep base
buildsweep result
checkshape result
checknbshapes result -shell 1 -face 20 -wire 20 -edge 44 -vertex 24
set tolres [checkmaxtol result]
if { ${tolres} > 2.e-7} {
puts "Error: bad tolerance of result"
}
checkprops result -s 6851.98