How to draw a parametric cylinder or cone

I need to draw a cylinder or cone whose horizontal cross sections are circles. The centers and radii of these cross sections vary with height.

Parametrization:
1. Parameter u: 0, H (height).
2. Parameter v: 0, 2\pi.
3. X coordinate of point on surface: Ox(u) + R(u)*cos(v)
4. Y coordinate of point on surface: Oy(u) + R(u)*sin(v)
5. Z coordinate of point on surface: u.
Here Ox(u), Oy(u), and R(u) are x & y coordinates of the center and radius, respectively.

Please say how to make this. The bottle example has confused me as it is not using any explicit equations.

Mikhail Sazonov's picture

It will be nor a cylinder nor a cone.

You have 2 options to do this in OCCT:

  1. Use surface approximation algorithm that will allow you to create a bspline surface approximating your formula. See for example the class GeomPlate_MakeApprox.
  2. Create your own surface class inheriting interface Geom_Surface. It must have the type GeomAbs_OtherSurface.
Eugene Zaliznyak's picture

Approving answer from Mikhail) In case you need help in any of 1-2 items, please ask me.

DKGH's picture

Didn't understand Mikhail's answer yet, Eugene. Maybe in time, I will.

Eugene Zaliznyak's picture

Hello DKGH! Could you define exactly what do you need? Do you need to draw set of circles (cross-sections) of cone-cylinder according your parametric formula or you require to build and show complete continous surface of cone-cylinder ?
With respects, Eugene.