(texdraw)Fill commands


Prev: Bezier curves Up: TeXdraw Commands
Enter node , (file) or (file)node

2.9 Fill commands
=================

PostScript deals with paths consisting of line segments.  The paths can
be closed and the interior of the closed region filled.  From TeXdraw,
paths start with a '\move' or '\rmove' command and continue with
'\lvec', '\rlvec' or '\clvec' commands.  The TeXdraw fill commands close
the path and fill the interior of the closed region.  Closing the path
means that effectively another '\lvec' line is drawn from the last point
specified to the initial point.  TeXdraw provides two forms of the fill
command.  The '\ifill' fills the interior of the region with the given
gray level.  The lines defining the path are not drawn.  The '\lfill'
command fills the region defined by the closed path and draws a line
along the enclosing path.  Note for both forms of the fill command, the
gray level used for filling is opaque, even if the gray level is chosen
to be white.

'\lfill f:LEVEL'
     Close the current path, draw the line around the path using the
     current grey level for lines and paint the interior of the region
     with specified gray level LEVEL.  Gray levels are real values from
     0 (black) through intermediate values (grays) to 1 (white).
'\ifill f:LEVEL'
     Close the current path and paint the interior of the region with
     gray level LEVEL.  The line around the path is not drawn.  Gray
     levels are real values from 0 (black) through intermediate values
     (grays) to 1 (white).

   The following example draws a "flag" with the interior filled in.
The path around the boundary is given in a clockwise order to define a
closed path.  We could take advantage of the fact that the fill command
will close an open path to eliminate one of the '\lvec' commands.
     \centertexdraw{
     \move (0.5 0)
     \lvec (0 0.5) \clvec (0.5 0.85)(1 0.65)(1.5 1)
     \lvec (2 0.5) \clvec (1.5 0.15)(1 0.35)(0.5 0)
     \lfill f:0.8
     }

   In TeXdraw, the '\move' command always terminates any previous paths
and starts a new path.  Commands that change line parameters (e.g.
'\setgray' or '\lpatt') also terminate paths and start new paths.  The
circle, ellipse and arc commands do not affect the definition of the
current path.  The '\avec' command is not appropriate for defining a
path to be filled.  It ends a subpath at its tail and begins a new
subpath at its tip.  Filling a region defined by a path with subpaths is
more complicated in that each subpath is closed before filling.


automatically generated by info2www version 1.2.2.9