From ef444297f5e08475b6da7335d4083a43923bf09d Mon Sep 17 00:00:00 2001 From: msv Date: Mon, 12 Sep 2016 10:21:53 +0300 Subject: [PATCH] 0027862: Exception in BRepOffsetAPI_MakePipeShell Check if the shape is not null before querying its ShapeType. Create test case for the bug. Small correction of test case for issue CR27862 --- src/BRepFill/BRepFill_Sweep.cxx | 11 ++++++----- tests/bugs/modalg_6/bug27862 | 11 +++++++++++ 2 files changed, 17 insertions(+), 5 deletions(-) create mode 100644 tests/bugs/modalg_6/bug27862 diff --git a/src/BRepFill/BRepFill_Sweep.cxx b/src/BRepFill/BRepFill_Sweep.cxx index e9bf5b698a..7037f12903 100644 --- a/src/BRepFill/BRepFill_Sweep.cxx +++ b/src/BRepFill/BRepFill_Sweep.cxx @@ -2606,11 +2606,12 @@ BRepFill_Sweep::BRepFill_Sweep(const Handle(BRepFill_SectionLaw)& Section, B.MakeCompound(Comp); for (isec=1; isec <= NbLaw+1; isec++) for (ipath=1, IPath=IFirst; ipath<= NbPath+1; ipath++, IPath++) { - if (ipath <= NbPath) myUEdges->SetValue(isec, IPath, UEdge(isec, ipath)); - if (isec <= NbLaw) myVEdges->SetValue(isec, IPath, VEdge(isec, ipath)); - if ((ipath <= NbPath) && (isec <= NbLaw) && - (myFaces->Value(isec, IPath).ShapeType() == TopAbs_FACE)) - B.Add(Comp, myFaces->Value(isec, IPath)); + if (ipath <= NbPath) myUEdges->SetValue(isec, IPath, UEdge(isec, ipath)); + if (isec <= NbLaw) myVEdges->SetValue(isec, IPath, VEdge(isec, ipath)); + if ((ipath <= NbPath) && (isec <= NbLaw) && + !myFaces->Value(isec, IPath).IsNull() && + myFaces->Value(isec, IPath).ShapeType() == TopAbs_FACE) + B.Add(Comp, myFaces->Value(isec, IPath)); } BRepLib::EncodeRegularity(Comp, myTolAngular); } diff --git a/tests/bugs/modalg_6/bug27862 b/tests/bugs/modalg_6/bug27862 new file mode 100644 index 0000000000..43dd7bb737 --- /dev/null +++ b/tests/bugs/modalg_6/bug27862 @@ -0,0 +1,11 @@ +puts "============" +puts "OCC27862" +puts "============" +puts "" +###################################################### +# Exception in BRepOffsetAPI_MakePipeShell +###################################################### + +restore [locate_data_file bug27862.brep] a +explode a +pipe r a_1 a_2