if( ad.GetType() == GeomAbs_BSplineCurve )
{
- //just ignore Z coord, without projecting
Handle(Geom_BSplineCurve) aSpline = ad.Curve().BSpline();
if (aSpline.IsNull())
return Handle(Geom2d_Curve)();
- TColgp_Array1OfPnt poles3d = aSpline->Poles();
- TColgp_HArray1OfPnt2d poles2d(poles3d.Lower(), poles3d.Upper());
- for (int i=poles3d.Lower(); i<=poles3d.Upper();i++)
- {
- gp_XY p2d(poles3d(i).X(), poles3d(i).Y());
- poles2d(i).SetXY(p2d);
- }
- const TColStd_Array1OfReal& knots = aSpline->Knots();
- const TColStd_Array1OfInteger& multiplicities = aSpline->Multiplicities();
- int aDegree = aSpline->Degree();
- return new Geom2d_BSplineCurve( poles2d, knots, multiplicities, aDegree );
+
+ return GeomAPI::To2d(aSpline, gp_Pln(gp::XOY()));
+
+ //TColgp_Array1OfPnt poles3d = aSpline->Poles();
+ //TColgp_HArray1OfPnt2d poles2d(poles3d.Lower(), poles3d.Upper());
+ //for (int i=poles3d.Lower(); i<=poles3d.Upper();i++)
+ //{
+ // gp_XY p2d(poles3d(i).X(), poles3d(i).Y());
+ // poles2d(i).SetXY(p2d);
+ //}
+ //const TColStd_Array1OfReal& knots = aSpline->Knots();
+ //const TColStd_Array1OfInteger& multiplicities = aSpline->Multiplicities();
+ //int aDegree = aSpline->Degree();
+ //return new Geom2d_BSplineCurve( poles2d, knots, multiplicities, aDegree );
}
return Handle(Geom2d_Curve)();
}