1
0
mirror of https://git.dev.opencascade.org/repos/occt.git synced 2025-08-04 13:13:25 +03:00

0026016: BRepPrimAPI_MakeRevol crash

Correctly treat the case when the line is a trimmed curve.

Test-case for issue #26016
This commit is contained in:
msv
2015-04-09 15:03:01 +03:00
committed by bugmaster
parent e9e33e9167
commit 24e40cc2dc
2 changed files with 32 additions and 2 deletions

View File

@@ -435,8 +435,17 @@ void BRepSweep_Rotation::SetGeneratingPCurve
if (AS.GetType()==GeomAbs_Plane){
gp_Pln pln = AS.Plane();
gp_Ax3 ax3 = pln.Position();
Handle(Geom_Line) GL = Handle(Geom_Line)::DownCast
(BRep_Tool::Curve(TopoDS::Edge(aNewEdge),Loc,First,Last));
Handle(Geom_Curve) aC = BRep_Tool::Curve(TopoDS::Edge(aNewEdge),Loc,First,Last);
Handle(Geom_Line) GL = Handle(Geom_Line)::DownCast(aC);
if (GL.IsNull()) {
Handle(Geom_TrimmedCurve) aTrimmedCurve = Handle(Geom_TrimmedCurve)::DownCast(aC);
if (!aTrimmedCurve.IsNull()) {
GL = Handle(Geom_Line)::DownCast(aTrimmedCurve->BasisCurve());
if (GL.IsNull()) {
Standard_ConstructionError::Raise("BRepSweep_Rotation::SetGeneratingPCurve");
}
}
}
gp_Lin gl = GL->Lin();
gl.Transform(Loc.Transformation());
point = gl.Location();