mirror of
https://git.dev.opencascade.org/repos/occt.git
synced 2025-04-10 18:51:21 +03:00
0027568: Exception is thrown when a degenerated edge is added to a wire
Test cases for issue CR27568 Other methods of BRep_Tool corrected to ensure that output arguments are always initialized
This commit is contained in:
parent
dfb3bdd43a
commit
3672371654
@ -179,6 +179,7 @@ const Handle(Geom_Curve)& BRep_Tool::Curve(const TopoDS_Edge& E,
|
|||||||
itcr.Next();
|
itcr.Next();
|
||||||
}
|
}
|
||||||
L.Identity();
|
L.Identity();
|
||||||
|
First = Last = 0.;
|
||||||
return nullCurve;
|
return nullCurve;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -346,6 +347,7 @@ Handle(Geom2d_Curve) BRep_Tool::CurveOnSurface(const TopoDS_Edge& E,
|
|||||||
|
|
||||||
if (C3d.IsNull())
|
if (C3d.IsNull())
|
||||||
{
|
{
|
||||||
|
First = Last = 0.;
|
||||||
return nullPCurve;
|
return nullPCurve;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -384,6 +386,7 @@ Handle(Geom2d_Curve) BRep_Tool::CurveOnSurface(const TopoDS_Edge& E,
|
|||||||
return pc;
|
return pc;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
First = Last = 0.;
|
||||||
return nullPCurve;
|
return nullPCurve;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -416,9 +419,10 @@ void BRep_Tool::CurveOnSurface(const TopoDS_Edge& E,
|
|||||||
itcr.Next();
|
itcr.Next();
|
||||||
}
|
}
|
||||||
|
|
||||||
C = Handle(Geom2d_Curve)();
|
C.Nullify();
|
||||||
S = Handle(Geom_Surface)();
|
S.Nullify();
|
||||||
L = TopLoc_Location();
|
L.Identity();
|
||||||
|
First = Last = 0.;
|
||||||
}
|
}
|
||||||
|
|
||||||
//=======================================================================
|
//=======================================================================
|
||||||
@ -465,9 +469,10 @@ void BRep_Tool::CurveOnSurface(const TopoDS_Edge& E,
|
|||||||
itcr.Next();
|
itcr.Next();
|
||||||
}
|
}
|
||||||
|
|
||||||
C = Handle(Geom2d_Curve)();
|
C.Nullify();
|
||||||
S = Handle(Geom_Surface)();
|
S.Nullify();
|
||||||
L = TopLoc_Location();
|
L.Identity();
|
||||||
|
First = Last = 0.;
|
||||||
}
|
}
|
||||||
|
|
||||||
//=======================================================================
|
//=======================================================================
|
||||||
@ -553,9 +558,9 @@ void BRep_Tool::PolygonOnSurface(const TopoDS_Edge& E,
|
|||||||
itcr.Next();
|
itcr.Next();
|
||||||
}
|
}
|
||||||
|
|
||||||
L = TopLoc_Location();
|
L.Identity();
|
||||||
P = Handle(Poly_Polygon2D)();
|
P.Nullify();
|
||||||
S = Handle(Geom_Surface)();
|
S.Nullify();
|
||||||
}
|
}
|
||||||
|
|
||||||
//=======================================================================
|
//=======================================================================
|
||||||
@ -591,9 +596,9 @@ void BRep_Tool::PolygonOnSurface(const TopoDS_Edge& E,
|
|||||||
itcr.Next();
|
itcr.Next();
|
||||||
}
|
}
|
||||||
|
|
||||||
L = TopLoc_Location();
|
L.Identity();
|
||||||
P = Handle(Poly_Polygon2D)();
|
P.Nullify();
|
||||||
S = Handle(Geom_Surface)();
|
S.Nullify();
|
||||||
}
|
}
|
||||||
|
|
||||||
//=======================================================================
|
//=======================================================================
|
||||||
@ -659,9 +664,9 @@ BRep_Tool::PolygonOnTriangulation(const TopoDS_Edge& E,
|
|||||||
itcr.Next();
|
itcr.Next();
|
||||||
}
|
}
|
||||||
|
|
||||||
L = TopLoc_Location();
|
L.Identity();
|
||||||
P = Handle(Poly_PolygonOnTriangulation)();
|
P.Nullify();
|
||||||
T = Handle(Poly_Triangulation)();
|
T.Nullify();
|
||||||
}
|
}
|
||||||
|
|
||||||
//=======================================================================
|
//=======================================================================
|
||||||
@ -699,9 +704,9 @@ BRep_Tool::PolygonOnTriangulation(const TopoDS_Edge& E,
|
|||||||
itcr.Next();
|
itcr.Next();
|
||||||
}
|
}
|
||||||
|
|
||||||
L = TopLoc_Location();
|
L.Identity();
|
||||||
P = Handle(Poly_PolygonOnTriangulation)();
|
P.Nullify();
|
||||||
T = Handle(Poly_Triangulation)();
|
T.Nullify();
|
||||||
}
|
}
|
||||||
|
|
||||||
//=======================================================================
|
//=======================================================================
|
||||||
@ -839,7 +844,7 @@ void BRep_Tool::Range(const TopoDS_Edge& E,
|
|||||||
// set the range to all the representations
|
// set the range to all the representations
|
||||||
const BRep_TEdge* TE = static_cast<const BRep_TEdge*>(E.TShape().get());
|
const BRep_TEdge* TE = static_cast<const BRep_TEdge*>(E.TShape().get());
|
||||||
BRep_ListIteratorOfListOfCurveRepresentation itcr(TE->Curves());
|
BRep_ListIteratorOfListOfCurveRepresentation itcr(TE->Curves());
|
||||||
|
|
||||||
while (itcr.More()) {
|
while (itcr.More()) {
|
||||||
const Handle(BRep_CurveRepresentation)& cr = itcr.Value();
|
const Handle(BRep_CurveRepresentation)& cr = itcr.Value();
|
||||||
if (cr->IsCurve3D()) {
|
if (cr->IsCurve3D()) {
|
||||||
@ -847,17 +852,18 @@ void BRep_Tool::Range(const TopoDS_Edge& E,
|
|||||||
if (!CR->Curve3D().IsNull()) {
|
if (!CR->Curve3D().IsNull()) {
|
||||||
First = CR->First();
|
First = CR->First();
|
||||||
Last = CR->Last();
|
Last = CR->Last();
|
||||||
break;
|
return;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else if (cr->IsCurveOnSurface()) {
|
else if (cr->IsCurveOnSurface()) {
|
||||||
const BRep_GCurve* CR = static_cast<const BRep_GCurve*>(cr.get());
|
const BRep_GCurve* CR = static_cast<const BRep_GCurve*>(cr.get());
|
||||||
First = CR->First();
|
First = CR->First();
|
||||||
Last = CR->Last();
|
Last = CR->Last();
|
||||||
break;
|
return;
|
||||||
}
|
}
|
||||||
itcr.Next();
|
itcr.Next();
|
||||||
}
|
}
|
||||||
|
First = Last = 0.;
|
||||||
}
|
}
|
||||||
|
|
||||||
//=======================================================================
|
//=======================================================================
|
||||||
@ -890,7 +896,7 @@ void BRep_Tool::Range(const TopoDS_Edge& E,
|
|||||||
Range(E,First,Last);
|
Range(E,First,Last);
|
||||||
}
|
}
|
||||||
E.TShape()->Modified(Standard_True);
|
E.TShape()->Modified(Standard_True);
|
||||||
}
|
}
|
||||||
|
|
||||||
//=======================================================================
|
//=======================================================================
|
||||||
//function : Range
|
//function : Range
|
||||||
@ -979,7 +985,12 @@ void BRep_Tool::UVPoints(const TopoDS_Edge& E,
|
|||||||
ElSLib::Parameters(pln,PL,u,v);
|
ElSLib::Parameters(pln,PL,u,v);
|
||||||
}
|
}
|
||||||
PLast.SetCoord(u,v);
|
PLast.SetCoord(u,v);
|
||||||
}
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
PFirst.SetCoord (0., 0.);
|
||||||
|
PLast.SetCoord (0., 0.);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
//=======================================================================
|
//=======================================================================
|
||||||
|
19
tests/bugs/modalg_6/bug27568
Normal file
19
tests/bugs/modalg_6/bug27568
Normal file
@ -0,0 +1,19 @@
|
|||||||
|
puts "============"
|
||||||
|
puts "OCC27568"
|
||||||
|
puts "============"
|
||||||
|
puts ""
|
||||||
|
######################################################
|
||||||
|
# Exception is thrown when a degenerated edge is added to a wire
|
||||||
|
######################################################
|
||||||
|
|
||||||
|
restore [locate_data_file bug27568_curves.brep] c
|
||||||
|
|
||||||
|
explode c
|
||||||
|
|
||||||
|
wire result c_1 c_2
|
||||||
|
|
||||||
|
checknbshapes result -vertex 2 -edge 2 -wire 1
|
||||||
|
|
||||||
|
smallview
|
||||||
|
fit
|
||||||
|
checkview -screenshot -2d -path ${imagedir}/${casename}.png
|
Loading…
x
Reference in New Issue
Block a user