mirror of
https://git.dev.opencascade.org/repos/occt.git
synced 2025-04-10 18:51:21 +03:00
0007570: Exception in ShapeFix_Wireframe::FixSmallEdges
Exception fixed by checking if subshape removed completely. Test-case for issue #7570
This commit is contained in:
parent
256f9ac0ad
commit
c60370656c
@ -2861,6 +2861,27 @@ static Standard_Integer OCC25202 ( Draw_Interpretor& theDI,
|
|||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#include <ShapeFix_Wireframe.hxx>
|
||||||
|
//=======================================================================
|
||||||
|
//function : OCC7570
|
||||||
|
//purpose :
|
||||||
|
//=======================================================================
|
||||||
|
static Standard_Integer OCC7570 (Draw_Interpretor& di, Standard_Integer n, const char** a)
|
||||||
|
{
|
||||||
|
if (n != 2) {
|
||||||
|
di<<"Usage: "<<a[0]<<" invalid number of arguments"<<"\n";
|
||||||
|
return 1;
|
||||||
|
}
|
||||||
|
TopoDS_Shape in_shape (DBRep::Get (a[1]));
|
||||||
|
ShapeFix_Wireframe fix_tool (in_shape);
|
||||||
|
fix_tool.ModeDropSmallEdges () = Standard_True;
|
||||||
|
fix_tool.SetPrecision (1.e+6);
|
||||||
|
fix_tool.SetLimitAngle (0.01);
|
||||||
|
fix_tool.FixSmallEdges ();
|
||||||
|
TopoDS_Shape new_shape = fix_tool.Shape ();
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
/*****************************************************************************/
|
/*****************************************************************************/
|
||||||
|
|
||||||
void QABugs::Commands_19(Draw_Interpretor& theCommands) {
|
void QABugs::Commands_19(Draw_Interpretor& theCommands) {
|
||||||
@ -2918,5 +2939,6 @@ void QABugs::Commands_19(Draw_Interpretor& theCommands) {
|
|||||||
theCommands.Add ("OCC25043", "OCC25043 shape", __FILE__, OCC25043, group);
|
theCommands.Add ("OCC25043", "OCC25043 shape", __FILE__, OCC25043, group);
|
||||||
theCommands.Add ("OCC24606", "OCC24606 : Tests ::FitAll for V3d view ('vfit' is for NIS view)", __FILE__, OCC24606, group);
|
theCommands.Add ("OCC24606", "OCC24606 : Tests ::FitAll for V3d view ('vfit' is for NIS view)", __FILE__, OCC24606, group);
|
||||||
theCommands.Add ("OCC25202", "OCC25202 res shape numF1 face1 numF2 face2", __FILE__, OCC25202, group);
|
theCommands.Add ("OCC25202", "OCC25202 res shape numF1 face1 numF2 face2", __FILE__, OCC25202, group);
|
||||||
|
theCommands.Add ("OCC7570", "OCC7570 shape", __FILE__, OCC7570, group);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
@ -426,16 +426,21 @@ ShapeFix_Wireframe::ShapeFix_Wireframe(const TopoDS_Shape& shape)
|
|||||||
TopoDS_Shape res;
|
TopoDS_Shape res;
|
||||||
if ( cont.IsBound ( shape1 ) )
|
if ( cont.IsBound ( shape1 ) )
|
||||||
{
|
{
|
||||||
res = cont.Find ( shape1 ).Oriented ( shape1.Orientation() );
|
res = cont.Find ( shape1 ).Oriented ( shape1.Orientation() );
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
myShape = shape1;
|
myShape = shape1;
|
||||||
FixSmallEdges();
|
FixSmallEdges();
|
||||||
res = Shape();
|
res = Shape();
|
||||||
cont.Bind(myShape,res);
|
cont.Bind(myShape,res);
|
||||||
}
|
}
|
||||||
if ( ! res.IsSame ( shape1 ) ) locModified = Standard_True;
|
if ( ! res.IsSame ( shape1 ) ) locModified = Standard_True;
|
||||||
|
|
||||||
|
//check if resulting shape if not empty
|
||||||
|
if( res.IsNull())
|
||||||
|
continue;
|
||||||
|
|
||||||
res.Location ( L );
|
res.Location ( L );
|
||||||
B.Add ( C, res );
|
B.Add ( C, res );
|
||||||
|
|
||||||
|
13
tests/bugs/heal/bug7570
Normal file
13
tests/bugs/heal/bug7570
Normal file
@ -0,0 +1,13 @@
|
|||||||
|
puts "======="
|
||||||
|
puts "OCC7570"
|
||||||
|
puts "======="
|
||||||
|
puts ""
|
||||||
|
##################################################
|
||||||
|
# Exception in ShapeFix_Wireframe::FixSmallEdges
|
||||||
|
##################################################
|
||||||
|
|
||||||
|
pload QAcommands
|
||||||
|
|
||||||
|
restore [locate_data_file bug7570_small.brep] a
|
||||||
|
|
||||||
|
OCC7570 a
|
Loading…
x
Reference in New Issue
Block a user