mirror of
https://git.dev.opencascade.org/repos/occt.git
synced 2025-04-10 18:51:21 +03:00
0026230: Segmentation fault because a NULL curve is used without precaution in case of a projection failure
This commit is contained in:
parent
3e673cffa9
commit
5050c82886
@ -38,7 +38,8 @@ is
|
||||
aF: Face from TopoDS);
|
||||
---Purpose:
|
||||
--- Compute P-Curve for the edge <aE> on the face <aF>
|
||||
---
|
||||
--- Raises exception Standard_ConstructionError if projection algorithm fails
|
||||
|
||||
EdgeTangent (myclass;
|
||||
anE : Edge from TopoDS;
|
||||
aT : Real from Standard;
|
||||
@ -56,8 +57,11 @@ is
|
||||
V : out Real from Standard);
|
||||
---Purpose:
|
||||
--- Compute surface parameters <U,V> of the face <aF>
|
||||
--- for the point from the edge <aE> at parameter <aT>.
|
||||
---
|
||||
--- for the point from the edge <aE> at parameter <aT>.
|
||||
--- If <aE> has't pcurve on surface, algorithm tries to get it by
|
||||
--- projection and can
|
||||
--- raise exception Standard_ConstructionError if projection algorithm fails
|
||||
|
||||
CurveOnSurface (myclass;
|
||||
aE: Edge from TopoDS;
|
||||
aF: Face from TopoDS;
|
||||
@ -67,7 +71,8 @@ is
|
||||
--- Get P-Curve <aC> for the edge <aE> on surface <aF> .
|
||||
--- If the P-Curve does not exist, build it using Make2D().
|
||||
--- [aToler] - reached tolerance
|
||||
---
|
||||
--- Raises exception Standard_ConstructionError if algorithm Make2D() fails
|
||||
|
||||
CurveOnSurface (myclass;
|
||||
aE: Edge from TopoDS;
|
||||
aF: Face from TopoDS;
|
||||
@ -81,7 +86,8 @@ is
|
||||
--- If the P-Curve does not exist, build it using Make2D().
|
||||
--- [aFirst, aLast] - range of the P-Curve
|
||||
--- [aToler] - reached tolerance
|
||||
---
|
||||
--- Raises exception Standard_ConstructionError if algorithm Make2D() fails
|
||||
|
||||
HasCurveOnSurface (myclass;
|
||||
aE: Edge from TopoDS;
|
||||
aF: Face from TopoDS;
|
||||
@ -167,18 +173,8 @@ is
|
||||
--- Make P-Curve <aC> for the edge <aE> on surface <aF> .
|
||||
--- [aFirst, aLast] - range of the P-Curve
|
||||
--- [aToler] - reached tolerance
|
||||
---
|
||||
--- Raises exception Standard_ConstructionError if algorithm fails
|
||||
|
||||
MakeCurveOnSurface (myclass;
|
||||
aE: Edge from TopoDS;
|
||||
aF: Face from TopoDS;
|
||||
aC : out Curve from Geom2d;
|
||||
aFirst: out Real from Standard;
|
||||
aLast : out Real from Standard;
|
||||
aToler: out Real from Standard);
|
||||
---Purpose:
|
||||
--- Same as Make2D()
|
||||
---
|
||||
MakePCurveOnFace (myclass;
|
||||
aF: Face from TopoDS;
|
||||
C3D : Curve from Geom;
|
||||
@ -187,7 +183,8 @@ is
|
||||
---Purpose:
|
||||
--- Make P-Curve <aC> for the 3D-curve <C3D> on surface <aF> .
|
||||
--- [aToler] - reached tolerance
|
||||
---
|
||||
--- Raises exception Standard_ConstructionError if projection algorithm fails
|
||||
|
||||
MakePCurveOnFace (myclass;
|
||||
aF: Face from TopoDS;
|
||||
C3D : Curve from Geom;
|
||||
@ -199,7 +196,8 @@ is
|
||||
--- Make P-Curve <aC> for the 3D-curve <C3D> on surface <aF> .
|
||||
--- [aT1, aT2] - range to build
|
||||
--- [aToler] - reached tolerance
|
||||
---
|
||||
--- Raises exception Standard_ConstructionError if projection algorithm fails
|
||||
|
||||
MakePCurveOfType (myclass;
|
||||
PC : ProjectedCurve from ProjLib;
|
||||
aC : out Curve from Geom2d);
|
||||
|
@ -15,6 +15,7 @@
|
||||
#include <BOPTools_AlgoTools2D.ixx>
|
||||
|
||||
#include <Standard_NotImplemented.hxx>
|
||||
#include <Standard_ConstructionError.hxx>
|
||||
#include <Precision.hxx>
|
||||
#include <gp.hxx>
|
||||
|
||||
@ -652,6 +653,12 @@ void BOPTools_AlgoTools2D::MakePCurveOnFace
|
||||
aTolR = aProj3.GetTolerance();
|
||||
}
|
||||
}
|
||||
//
|
||||
if(aC2D.IsNull())
|
||||
{
|
||||
Standard_ConstructionError::Raise("BOPTools_AlgoTools2D::MakePCurveOnFace : PCurve is Null");
|
||||
}
|
||||
//
|
||||
TolReached2d=aTolR;
|
||||
BOPTools_AlgoTools2D::AdjustPCurveOnFace (aBAS, aT1, aT2,
|
||||
aC2D, aC2DA);
|
||||
|
Loading…
x
Reference in New Issue
Block a user