mirror of
https://git.dev.opencascade.org/repos/occt.git
synced 2025-04-10 18:51:21 +03:00
0026553: Out of range exception in BRepFill_Pipe::FindEdge
Test case for issue CR26553 Warning fix Conflicts: src/QABugs/QABugs_19.cxx
This commit is contained in:
parent
09e3484fc0
commit
3b3c61fbf9
@ -798,14 +798,14 @@ Standard_Integer BRepFill_Pipe::FindEdge(const TopoDS_Shape& S,
|
|||||||
|
|
||||||
case TopAbs_WIRE :
|
case TopAbs_WIRE :
|
||||||
{
|
{
|
||||||
Standard_Integer ii = InitialLength+1;
|
|
||||||
Handle(BRepFill_ShapeLaw) Section =
|
Handle(BRepFill_ShapeLaw) Section =
|
||||||
new (BRepFill_ShapeLaw) (TopoDS::Wire(S), Standard_False);
|
new (BRepFill_ShapeLaw) (TopoDS::Wire(S), Standard_False);
|
||||||
InitialLength += Section->NbLaw();
|
Standard_Integer NbLaw = Section->NbLaw();
|
||||||
|
|
||||||
for (; (ii<=InitialLength) && (!result); ii++) {
|
for (Standard_Integer ii = 1; (ii<=NbLaw) && (!result); ii++) {
|
||||||
if (E.IsSame(Section->Edge(ii)) ) result = ii;
|
if (E.IsSame(Section->Edge(ii)) ) result = InitialLength + ii;
|
||||||
}
|
}
|
||||||
|
InitialLength += NbLaw;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -4033,6 +4033,53 @@ static Standard_Integer OCC26462 (Draw_Interpretor& theDI, Standard_Integer /*th
|
|||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//=======================================================================
|
||||||
|
//function : OCC26553
|
||||||
|
//purpose :
|
||||||
|
//=======================================================================
|
||||||
|
#include <BRepBuilderAPI_MakeWire.hxx>
|
||||||
|
|
||||||
|
static Standard_Integer OCC26553 (Draw_Interpretor& theDI, Standard_Integer theArgc, const char** theArgv)
|
||||||
|
{
|
||||||
|
if (theArgc < 2)
|
||||||
|
{
|
||||||
|
theDI << "Error: path to file with shell is missing\n";
|
||||||
|
return 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
BRep_Builder aBuilder;
|
||||||
|
TopoDS_Shape aShell;
|
||||||
|
BRepTools::Read(aShell, theArgv[1], aBuilder);
|
||||||
|
|
||||||
|
if (aShell.IsNull())
|
||||||
|
{
|
||||||
|
theDI << "Error: shell not loaded\n";
|
||||||
|
return 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
TopoDS_Edge aPipeEdge = BRepBuilderAPI_MakeEdge (gp_Pnt (0, 0, 0), gp_Pnt (0, 0, 10));
|
||||||
|
TopoDS_Wire aPipeWire = BRepBuilderAPI_MakeWire(aPipeEdge).Wire();
|
||||||
|
|
||||||
|
BRepOffsetAPI_MakePipe aPipeBuilder(aPipeWire, aShell);
|
||||||
|
if (!aPipeBuilder.IsDone())
|
||||||
|
{
|
||||||
|
theDI << "Error: failed to create pipe\n";
|
||||||
|
return 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
for (TopExp_Explorer aShapeExplorer(aShell, TopAbs_EDGE); aShapeExplorer.More(); aShapeExplorer.Next ()) {
|
||||||
|
const TopoDS_Shape& aGeneratedShape = aPipeBuilder.Generated(aPipeEdge, aShapeExplorer.Current());
|
||||||
|
if (aGeneratedShape.IsNull())
|
||||||
|
{
|
||||||
|
theDI << "Error: null shape\n";
|
||||||
|
return 1;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
theDI << "History returned successfully\n";
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
void QABugs::Commands_19(Draw_Interpretor& theCommands) {
|
void QABugs::Commands_19(Draw_Interpretor& theCommands) {
|
||||||
const char *group = "QABugs";
|
const char *group = "QABugs";
|
||||||
|
|
||||||
@ -4107,5 +4154,6 @@ void QABugs::Commands_19(Draw_Interpretor& theCommands) {
|
|||||||
theCommands.Add ("OCC26139", "OCC26139 [-boxsize value] [-boxgrid value] [-compgrid value]", __FILE__, OCC26139, group);
|
theCommands.Add ("OCC26139", "OCC26139 [-boxsize value] [-boxgrid value] [-compgrid value]", __FILE__, OCC26139, group);
|
||||||
theCommands.Add ("OCC26195", "OCC26195 x1_pix y1_pix [x2_pix y2_pix] [toPrintPixelCoord 0|1]", __FILE__, OCC26195, group);
|
theCommands.Add ("OCC26195", "OCC26195 x1_pix y1_pix [x2_pix y2_pix] [toPrintPixelCoord 0|1]", __FILE__, OCC26195, group);
|
||||||
theCommands.Add ("OCC26462", "OCC26462", __FILE__, OCC26462, group);
|
theCommands.Add ("OCC26462", "OCC26462", __FILE__, OCC26462, group);
|
||||||
|
theCommands.Add ("OCC26553", "OCC26553 file_path", __FILE__, OCC26553, group);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
11
tests/bugs/modalg_6/bug26553
Normal file
11
tests/bugs/modalg_6/bug26553
Normal file
@ -0,0 +1,11 @@
|
|||||||
|
puts "================"
|
||||||
|
puts "OCC26553"
|
||||||
|
puts "================"
|
||||||
|
puts ""
|
||||||
|
#######################################################################
|
||||||
|
# Out of range exception in BRepFill_Pipe::FindEdge
|
||||||
|
#######################################################################
|
||||||
|
|
||||||
|
pload QAcommands
|
||||||
|
|
||||||
|
OCC26553 [locate_data_file bug26553_wire.brep]
|
Loading…
x
Reference in New Issue
Block a user