How to make a sylinder with elliptical base.

If I want to make a cone with circular base, I use 'BRepPrimAPI_MakeCylinder'.

but when I make a sylinder with elliptical base, I don't know about it.

what is useful syntex?

Dennis G.'s picture

Hello Erwin,

please take a look at: BRepPrimAPI_MakePrism.

Regards,

Dennis

mekibos's picture

I already know 'BRepPrimAPI_MakePrism'.
but I don't know make a ellipse in order to make prism.
show me the example, please.

Dennis G.'s picture

Hello again,

I'm absolutely not sure if the following procedure works, but you might give it a try:

1. Create a gp_Elips : gp_Elips anEllipse(A2 : Ax2; MajorRadius, MinorRadius : Real);
2. Make a TopoDS_Edge: BRepBuilder_MakeEdge edgeMaker(anEllipse);
TopoDS_Edge anEdge = edgeMaker.Edge();
3. Make a TopoDS_Wire: BRepBuilderAPI_MakeWire wireMaker(anEdge);
TopoDS_Wire aWire = wireMaker.Wire();
4. Make a TopoDS_Face: BRepBuilderAPI_MakeFace faceMaker(aWire);
TopoDS_Face aFace = faceMaker.Face();
5. Make a Prism: BRepPrimAPI_MakePrism prismMaker(aFace);
TopoDS_Shape finalShape = prismMaker.Shape();

I did NOT test the listed steps.
I hope it is of any help.

Good luck,

Dennis

mekibos's picture

Hello Dennis.

I can make it I want shape now.
Thanks for your answer.
Good day!!

Erwin