DownCast, BSplineSurface

Hi all,

I am creating a BSPlineSurface from scattered points, and this routine returns the BSplineSurface (Geom_BSplineSurface-package) to my viewer.
But, my viewer needs TopoDS_Shape.
Is there a simple way to cast them into one another ?

My Compiler complaints:

../../src/MakeBlade.cxx: In function `class TopoDS_Shape MakeBlade(double, double, double)':
../../src/MakeBlade.cxx:372: no match for `TopoDS_Shape & = const Handle_Geom_BSplineSurface'
/opt/OpenCASCADE-50/ros/inc/TopoDS_Shape.hxx:147: candidates are: class TopoDS_Shape & TopoDS_Shape::operator =(const TopoDS_Shape &)
make[1]: *** [../../Linux/obj/MakeBlade.o] Error 1

This is the Code:

Handle(Geom_BSplineSurface) myBSplineSurface = GeomAPI_PointsToBSplineSurface(myArrayForSpline,3,8,GeomAbs_C0);
TopoDS_Shape myShape;
myShape=Handle(Geom_BSplineSurface)::DownCast(myBSplineSurface);

return myShape;
Does anyone know a way to solve it ?
How to convert a Geom_BSplineSurface into a TopoDS_Shape ??

Any hints are very welcome.
Thank you.

MCV

n-southall's picture

Hi MCV,

BRepBuilderAPI_MakeFace is what you need for he conversion.