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

0031294: Modeling Algorithms - Regression relatively 7.3.0. Crash in method BRepPrimAPI_MakePrism::Generated(...)

BRepSweep_NumLinearRegularSweep.cxx: raising exeption is removed

Test case is added

QABugs_20.cxx - test command is added
This commit is contained in:
ifv 2020-01-13 14:50:03 +03:00 committed by bugmaster
parent c8bead4752
commit 08353e37cf
3 changed files with 41 additions and 4 deletions

View File

@ -523,8 +523,10 @@ TopoDS_Shape BRepSweep_NumLinearRegularSweep::SplitShell(const TopoDS_Shape& aNe
Standard_Boolean BRepSweep_NumLinearRegularSweep::IsUsed(const TopoDS_Shape& aGenS) const
{
Standard_Integer iGenS = myGenShapeTool.Index(aGenS);
Standard_OutOfRange_Raise_if(iGenS == 0,
"BRepSweep_NumLinearRegularSweep::IsUsed: shape index = 0")
if (iGenS == 0)
{
return Standard_False;
}
Standard_Integer j;
Standard_Boolean isBuilt = Standard_False;
Standard_Boolean isUsed = Standard_False;
@ -576,8 +578,10 @@ Standard_Boolean BRepSweep_NumLinearRegularSweep::IsUsed(const TopoDS_Shape& aGe
Standard_Boolean BRepSweep_NumLinearRegularSweep::GenIsUsed(const TopoDS_Shape& aGenS) const
{
Standard_Integer iGenS = myGenShapeTool.Index(aGenS);
Standard_OutOfRange_Raise_if(iGenS == 0,
"BRepSweep_NumLinearRegularSweep::GenIsUsed: shape index = 0")
if (iGenS == 0)
{
return Standard_False;
}
if (iGenS == 1)
{
return myBuiltShapes(iGenS, 1);

View File

@ -3447,6 +3447,30 @@ static Standard_Integer OCC30990 (Draw_Interpretor& theDI, Standard_Integer theN
return 0;
}
//=======================================================================
//function : OCC31294
//purpose : check list of shapes generated from shape, which is not any subshape
// of input shape for prism algorithm
//=======================================================================
#include <BRepPrimAPI_MakePrism.hxx>
#include <BRepBuilderAPI_MakeVertex.hxx>
static Standard_Integer OCC31294(Draw_Interpretor& di, Standard_Integer, const char**)
{
BRepBuilderAPI_MakeVertex mkVert(gp_Pnt(0., 0., 0.));
BRepBuilderAPI_MakeVertex mkDummy(gp_Pnt(0., 0., 0.));
BRepPrimAPI_MakePrism mkPrism(mkVert.Shape(), gp_Vec(0., 0., 1.));
Standard_Integer nbgen = mkPrism.Generated(mkVert.Shape()).Extent();
Standard_Integer nbdummy = mkPrism.Generated(mkDummy.Shape()).Extent();
if (nbgen != 1 || nbdummy != 0)
{
di << "Error: wrong generated list \n";
}
return 0;
}
void QABugs::Commands_20(Draw_Interpretor& theCommands) {
const char *group = "QABugs";
@ -3511,6 +3535,7 @@ void QABugs::Commands_20(Draw_Interpretor& theCommands) {
theCommands.Add("OCC30704", "OCC30704", __FILE__, OCC30704, group);
theCommands.Add("OCC30704_1", "OCC30704_1", __FILE__, OCC30704_1, group);
theCommands.Add("OCC31294", "OCC31294", __FILE__, OCC31294, group);
return;
}

View File

@ -0,0 +1,8 @@
puts "======================================================="
puts "0031294: Modeling Algorithms - Regression relatively 7.3.0."
puts "Crash in method BRepPrimAPI_MakePrism::Generated(...) if input sub-shape does not belong to the base shape"
puts "======================================================="
puts ""
pload QAcommands
OCC31294