Next: , Previous: graph3, Up: Base modules


7.23 solids

This solid geometry package defines a struct 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 and height 1.5 aligned in the direction (0,1,1) with perspective projection:

import solids;

size(0,100);

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

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