mirror of
https://git.dev.opencascade.org/repos/occt.git
synced 2025-08-19 13:40:49 +03:00
0029939: Modeling Algorithms - add NULL check to BRepGProp_Face::Load()
BRepGProp_Face::Load() has been protected against crash in case of edges without p-curves.
This commit is contained in:
@@ -175,11 +175,14 @@ void BRepGProp_Face::Bounds(Standard_Real& U1,
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
|
||||
void BRepGProp_Face::Load(const TopoDS_Edge& E)
|
||||
bool BRepGProp_Face::Load(const TopoDS_Edge& E)
|
||||
{
|
||||
Standard_Real a,b;
|
||||
Handle(Geom2d_Curve) C =
|
||||
BRep_Tool::CurveOnSurface(E, mySurface.Face(), a,b);
|
||||
Handle(Geom2d_Curve) C = BRep_Tool::CurveOnSurface(E, mySurface.Face(), a,b);
|
||||
if (C.IsNull())
|
||||
{
|
||||
return false;
|
||||
}
|
||||
if (E.Orientation() == TopAbs_REVERSED) {
|
||||
Standard_Real x = a;
|
||||
a = C->ReversedParameter(b);
|
||||
@@ -187,6 +190,7 @@ void BRepGProp_Face::Load(const TopoDS_Edge& E)
|
||||
C = C->Reversed();
|
||||
}
|
||||
myCurve.Load(C,a,b);
|
||||
return true;
|
||||
}
|
||||
|
||||
//=======================================================================
|
||||
|
Reference in New Issue
Block a user