mirror of
https://git.dev.opencascade.org/repos/occt.git
synced 2025-04-04 18:06:22 +03:00
0026553: Out of range exception in BRepFill_Pipe::FindEdge
Test case for issue CR26553 Warning fix
This commit is contained in:
parent
1fa8e37b83
commit
5a8dc41a47
@ -799,14 +799,14 @@ Standard_Integer BRepFill_Pipe::FindEdge(const TopoDS_Shape& S,
|
||||
|
||||
case TopAbs_WIRE :
|
||||
{
|
||||
Standard_Integer ii = InitialLength+1;
|
||||
Handle(BRepFill_ShapeLaw) Section =
|
||||
new (BRepFill_ShapeLaw) (TopoDS::Wire(S), Standard_False);
|
||||
InitialLength += Section->NbLaw();
|
||||
|
||||
for (; (ii<=InitialLength) && (!result); ii++) {
|
||||
if (E.IsSame(Section->Edge(ii)) ) result = ii;
|
||||
new (BRepFill_ShapeLaw) (TopoDS::Wire(S), Standard_False);
|
||||
Standard_Integer NbLaw = Section->NbLaw();
|
||||
|
||||
for (Standard_Integer ii = 1; (ii<=NbLaw) && (!result); ii++) {
|
||||
if (E.IsSame(Section->Edge(ii)) ) result = InitialLength + ii;
|
||||
}
|
||||
InitialLength += NbLaw;
|
||||
break;
|
||||
}
|
||||
|
||||
|
@ -3876,6 +3876,53 @@ static Standard_Integer OCC26485 (Draw_Interpretor& theDI, Standard_Integer theA
|
||||
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) {
|
||||
const char *group = "QABugs";
|
||||
|
||||
@ -3951,5 +3998,6 @@ void QABugs::Commands_19(Draw_Interpretor& theCommands) {
|
||||
theCommands.Add ("OCC26448", "OCC26448: check method Prepend() of sequence", __FILE__, OCC26448, group);
|
||||
theCommands.Add ("OCC26407", "OCC26407 result_name", __FILE__, OCC26407, group);
|
||||
theCommands.Add ("OCC26485", "OCC26485 shape", __FILE__, OCC26485, group);
|
||||
theCommands.Add ("OCC26553", "OCC26553 file_path", __FILE__, OCC26553, group);
|
||||
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