Spline and revolution solids


I have a curve which is the product of a spline, I would like to use it to make a revolution solid, I did this...

GeomAPI_PointsToBSpline GeomAPI = GeomAPI_PointsToBSpline(array);
Handle(Geom_BSplineCurve) bsCurve = GeomAPI.Curve();
TopoDS_Edge aEdge = BRepBuilderAPI_MakeEdge(bsCurve);
Handle(Geom_Curve) myCurve = BRep_Tool::Curve(aEdge, First, Last); TopoDS_Solid aSolid = RepPrimAPI_MakeRevolution(Axes,myCurve,VMin,VMax,Ang);

I declared First and Last and all the parameters and it compiles o.k., but finally I can not get the revolution solid. I tried to use the bscurve directly which is a Geom_BSplineCurve but it didn't work either.

Maybe I have to do something else?


PG's picture

I think u need a closed loop curve to build a revolved solid. Make a wire out of ur b-spline and then build a
face out of it. Give this face as a input to ur constructor of BRepPrimAPI_MakeRevol.


- GP

Roman Lygin's picture

The start and end points should lie on the axis and the curve should be planar.
No need to create an edge and then to extract a curve - this will be the same as original (i.e. myCurve = bsCurve).
Hope this helps.