Previous: dem80 Up: ../plot79_d.html Next: dem82


DEM81

       SUBROUTINE  DEM81 (NIN,NOUT)
 C$    (DEM81 - Sierpinski Curves)
 C$    This routine demonstrates the translation of the  recursive
 C$    Sierpinski curve into a non-recursive stack-based algorithm
 C$    in SFTRAN3.
 C$
 C$    Apart from  its  geometrically interesting  shape,  tending
 C$    toward  space  filling,  the  principle  interest  of   the
 C$    Sierpinski curve here  is that it  can be made  arbitrarily
 C$    long by simply increasing the  order, and it therefore  may
 C$    serve as a useful test of plotter speed.
 C$
 C$    The Sierpinski curves are  closed, and a  curve of order  N
 C$    has 4**(N+1)+1 vertices.  When used as a test of a  polygon
 C$    flood fill algorithm which fills up to, but not  including,
 C$    the boundary color, both the  interior and exterior can  be
 C$    separately flooded.  Such algorithms usually have  internal
 C$    stacks  which  keep  track  of  areas  to  return  to,  and
 C$    Sierpinski curve  flooding  explores the  limits  of  these
 C$    stacks.  The  curves are  also excellent  tests of  polygon
 C$    edge fill algorithms, which may not be limited by  internal
 C$    stacks,  but  nevertheless  can  fail  to  handle   complex
 C$    polygons, or polygons with colinear edges.
 C$
 C$    For amusement,  the curves  are plotted  in five  different
 C$    coordinate systems.
 C$    (19-SEP-85)