DRAWELLIPSECYLINDER Draw a cylinder with ellipse cross-section.

   drawEllipseCylinder(CYL)
   draws the cylinder CYL on the current axis.
   CYL is a cylinder defined by [x1 y1 z1 x2 y2 z2 r1 r2 roll], with:
   * [x1 y2 z1] are coordinates of starting point,
   * [x2 y2 z2] are coordinates of ending point, 
   * R1 and R2 are the lengths of the ellipse semi axes, and
   * ROLL is the rotation of the cylinder around its main axis (in
      degrees)

   drawEllipseCylinder(CYL, N)
   uses N points for discretisation of angle. Default value is 32.

   drawEllipseCylinder(..., OPT)
   with OPT = 'open' (default) or 'closed', specify if bases of the
   cylinder should be drawn.

   drawEllipseCylinder(..., 'FaceColor', COLOR)
   Specifies the color of the cylinder. Any couple of parameters name and
   value can be given as argument, and will be transfered to the 'surf'
   matlab function

   H = drawEllipseCylinder(...)
   returns a handle to the patch representing the cylinder.


   Example:
     figure; drawEllipseCylinder([0 0 0 10 20 30 5 2]);

     figure; drawEllipseCylinder([0 0 0 10 20 30 5 2], 'open');

     figure; drawEllipseCylinder([0 0 0 10 20 30 5 2], 'FaceColor', 'r');

     figure;
     h = drawEllipseCylinder([0 0 0 10 20 30 5 2]);
     set(h, 'facecolor', 'b');

     % Draw three mutually intersecting elliptic cylinders
     p1 = [30 0 0];
     p2 = [0 30 0];
     p3 = [0 0 30];
     radii = [20 10];
     figure;
     drawEllipseCylinder([-p1 p1 radii 0], 'FaceColor', 'r');
     hold on
     drawEllipseCylinder([-p2 p2 radii 90], 'FaceColor', 'g');
     drawEllipseCylinder([-p3 p3 radii 90], 'FaceColor', 'b');
     axis equal
     set(gcf, 'renderer', 'opengl')
     view([60 30]); light;

   See Also:
   drawCylinder, drawSphere, cylinderMesh, drawLine3d, surf

Package: matgeom