mirror of
https://git.dev.opencascade.org/repos/occt.git
synced 2025-08-19 13:40:49 +03:00
0026498: BRepOffsetAPI_MakeOffset causes segmentation fault
Test case for issue CR26498
This commit is contained in:
@@ -222,6 +222,8 @@ static void MakeOffset
|
||||
const GeomAbs_JoinType theJoinType,
|
||||
const TopoDS_Vertex * Ends);
|
||||
|
||||
Standard_Boolean CheckSmallParamOnEdge(const TopoDS_Edge& anEdge);
|
||||
|
||||
//=======================================================================
|
||||
//function : KPartCircle
|
||||
//purpose :
|
||||
@@ -1379,6 +1381,8 @@ void BRepFill_OffsetWire::MakeWires()
|
||||
TopExp::Vertices (E,V1,V2);
|
||||
if (V1.IsSame(V2) && IsSmallClosedEdge(E, V1))
|
||||
continue; //remove small closed edges
|
||||
if (!CheckSmallParamOnEdge(E))
|
||||
continue;
|
||||
if (!MVE.Contains(V1)) {
|
||||
TopTools_ListOfShape empty;
|
||||
MVE.Add(V1,empty);
|
||||
@@ -2756,3 +2760,18 @@ static void QuasiFleche(const Adaptor3d_Curve& C,
|
||||
}
|
||||
}
|
||||
|
||||
Standard_Boolean CheckSmallParamOnEdge(const TopoDS_Edge& anEdge)
|
||||
{
|
||||
const BRep_ListOfCurveRepresentation& aList = ((Handle(BRep_TEdge)::DownCast(anEdge.TShape()))->Curves());
|
||||
if (!aList.IsEmpty())
|
||||
{
|
||||
Handle( BRep_CurveRepresentation ) CRep = ((Handle(BRep_TEdge)::DownCast(anEdge.TShape()))->Curves()).First();
|
||||
Standard_Real f = (Handle(BRep_GCurve)::DownCast(CRep))->First();
|
||||
Standard_Real l = (Handle(BRep_GCurve)::DownCast(CRep))->Last();
|
||||
if (Abs (l - f) < Precision::PConfusion())
|
||||
return Standard_False;
|
||||
}
|
||||
return Standard_True;
|
||||
}
|
||||
|
||||
|
||||
|
Reference in New Issue
Block a user