mirror of
https://git.dev.opencascade.org/repos/occt.git
synced 2025-04-16 10:08:36 +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);
|
aF: Face from TopoDS);
|
||||||
---Purpose:
|
---Purpose:
|
||||||
--- Compute P-Curve for the edge <aE> on the face <aF>
|
--- Compute P-Curve for the edge <aE> on the face <aF>
|
||||||
---
|
--- Raises exception Standard_ConstructionError if projection algorithm fails
|
||||||
|
|
||||||
EdgeTangent (myclass;
|
EdgeTangent (myclass;
|
||||||
anE : Edge from TopoDS;
|
anE : Edge from TopoDS;
|
||||||
aT : Real from Standard;
|
aT : Real from Standard;
|
||||||
@ -57,7 +58,10 @@ is
|
|||||||
---Purpose:
|
---Purpose:
|
||||||
--- Compute surface parameters <U,V> of the face <aF>
|
--- 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;
|
CurveOnSurface (myclass;
|
||||||
aE: Edge from TopoDS;
|
aE: Edge from TopoDS;
|
||||||
aF: Face from TopoDS;
|
aF: Face from TopoDS;
|
||||||
@ -67,7 +71,8 @@ is
|
|||||||
--- Get P-Curve <aC> for the edge <aE> on surface <aF> .
|
--- Get P-Curve <aC> for the edge <aE> on surface <aF> .
|
||||||
--- If the P-Curve does not exist, build it using Make2D().
|
--- If the P-Curve does not exist, build it using Make2D().
|
||||||
--- [aToler] - reached tolerance
|
--- [aToler] - reached tolerance
|
||||||
---
|
--- Raises exception Standard_ConstructionError if algorithm Make2D() fails
|
||||||
|
|
||||||
CurveOnSurface (myclass;
|
CurveOnSurface (myclass;
|
||||||
aE: Edge from TopoDS;
|
aE: Edge from TopoDS;
|
||||||
aF: Face from TopoDS;
|
aF: Face from TopoDS;
|
||||||
@ -81,7 +86,8 @@ is
|
|||||||
--- If the P-Curve does not exist, build it using Make2D().
|
--- If the P-Curve does not exist, build it using Make2D().
|
||||||
--- [aFirst, aLast] - range of the P-Curve
|
--- [aFirst, aLast] - range of the P-Curve
|
||||||
--- [aToler] - reached tolerance
|
--- [aToler] - reached tolerance
|
||||||
---
|
--- Raises exception Standard_ConstructionError if algorithm Make2D() fails
|
||||||
|
|
||||||
HasCurveOnSurface (myclass;
|
HasCurveOnSurface (myclass;
|
||||||
aE: Edge from TopoDS;
|
aE: Edge from TopoDS;
|
||||||
aF: Face from TopoDS;
|
aF: Face from TopoDS;
|
||||||
@ -167,18 +173,8 @@ is
|
|||||||
--- Make P-Curve <aC> for the edge <aE> on surface <aF> .
|
--- Make P-Curve <aC> for the edge <aE> on surface <aF> .
|
||||||
--- [aFirst, aLast] - range of the P-Curve
|
--- [aFirst, aLast] - range of the P-Curve
|
||||||
--- [aToler] - reached tolerance
|
--- [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;
|
MakePCurveOnFace (myclass;
|
||||||
aF: Face from TopoDS;
|
aF: Face from TopoDS;
|
||||||
C3D : Curve from Geom;
|
C3D : Curve from Geom;
|
||||||
@ -187,7 +183,8 @@ is
|
|||||||
---Purpose:
|
---Purpose:
|
||||||
--- Make P-Curve <aC> for the 3D-curve <C3D> on surface <aF> .
|
--- Make P-Curve <aC> for the 3D-curve <C3D> on surface <aF> .
|
||||||
--- [aToler] - reached tolerance
|
--- [aToler] - reached tolerance
|
||||||
---
|
--- Raises exception Standard_ConstructionError if projection algorithm fails
|
||||||
|
|
||||||
MakePCurveOnFace (myclass;
|
MakePCurveOnFace (myclass;
|
||||||
aF: Face from TopoDS;
|
aF: Face from TopoDS;
|
||||||
C3D : Curve from Geom;
|
C3D : Curve from Geom;
|
||||||
@ -199,7 +196,8 @@ is
|
|||||||
--- Make P-Curve <aC> for the 3D-curve <C3D> on surface <aF> .
|
--- Make P-Curve <aC> for the 3D-curve <C3D> on surface <aF> .
|
||||||
--- [aT1, aT2] - range to build
|
--- [aT1, aT2] - range to build
|
||||||
--- [aToler] - reached tolerance
|
--- [aToler] - reached tolerance
|
||||||
---
|
--- Raises exception Standard_ConstructionError if projection algorithm fails
|
||||||
|
|
||||||
MakePCurveOfType (myclass;
|
MakePCurveOfType (myclass;
|
||||||
PC : ProjectedCurve from ProjLib;
|
PC : ProjectedCurve from ProjLib;
|
||||||
aC : out Curve from Geom2d);
|
aC : out Curve from Geom2d);
|
||||||
|
@ -15,6 +15,7 @@
|
|||||||
#include <BOPTools_AlgoTools2D.ixx>
|
#include <BOPTools_AlgoTools2D.ixx>
|
||||||
|
|
||||||
#include <Standard_NotImplemented.hxx>
|
#include <Standard_NotImplemented.hxx>
|
||||||
|
#include <Standard_ConstructionError.hxx>
|
||||||
#include <Precision.hxx>
|
#include <Precision.hxx>
|
||||||
#include <gp.hxx>
|
#include <gp.hxx>
|
||||||
|
|
||||||
@ -652,6 +653,12 @@ void BOPTools_AlgoTools2D::MakePCurveOnFace
|
|||||||
aTolR = aProj3.GetTolerance();
|
aTolR = aProj3.GetTolerance();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
//
|
||||||
|
if(aC2D.IsNull())
|
||||||
|
{
|
||||||
|
Standard_ConstructionError::Raise("BOPTools_AlgoTools2D::MakePCurveOnFace : PCurve is Null");
|
||||||
|
}
|
||||||
|
//
|
||||||
TolReached2d=aTolR;
|
TolReached2d=aTolR;
|
||||||
BOPTools_AlgoTools2D::AdjustPCurveOnFace (aBAS, aT1, aT2,
|
BOPTools_AlgoTools2D::AdjustPCurveOnFace (aBAS, aT1, aT2,
|
||||||
aC2D, aC2DA);
|
aC2D, aC2DA);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user