Next: , Previous: , Up: Base modules   [Contents][Index]


8.33 solids

This solid geometry package defines a structure revolution that can be used to fill and draw surfaces of revolution. The following example uses it to display the outline of a circular cylinder of radius 1 with axis O--1.5unit(Y+Z) with perspective projection:

import solids;

size(0,100);

revolution r=cylinder(O,1,1.5,Y+Z);
draw(r,heavygreen);

cylinderskeleton

Further illustrations are provided in the example files cylinder.asy, cones.asy, hyperboloid.asy, and torus.asy.

The structure skeleton contains the three-dimensional wireframe used to visualize a volume of revolution:

struct skeleton {
  struct curve {
    path3[] front;
    path3[] back;
  }
  // transverse skeleton (perpendicular to axis of revolution)
  curve transverse;
  // longitudinal skeleton (parallel to axis of revolution)
  curve longitudinal;
}