% Copyright 2006 by Till Tantau
%
% This file may be distributed and/or modified
%
% 1. under the LaTeX Project Public License and/or
% 2. under the GNU Public License.
%
% See the file doc/generic/pgf/licenses/LICENSE for more details.

\ProvidesFileRCS[v\pgfversion] $Header: /cvsroot/pgf/pgf/generic/pgf/libraries/pgflibrarypatterns.code.tex,v 1.7 2006/10/11 15:22:26 tantau Exp $


% Lines in different directions

\pgfdeclarepatternformonly{horizontal lines}{\pgfpointorigin}{\pgfpoint{100pt}{1pt}}{\pgfpoint{100pt}{3pt}}%
{
  \pgfsetlinewidth{0.4pt}
  \pgfpathmoveto{\pgfpoint{0pt}{0.5pt}}
  \pgfpathlineto{\pgfpoint{100pt}{0.5pt}}
  \pgfusepath{stroke}
}

\pgfdeclarepatternformonly{vertical lines}{\pgfpointorigin}{\pgfpoint{1pt}{100pt}}{\pgfpoint{3pt}{100pt}}%
{
  \pgfsetlinewidth{0.4pt}
  \pgfpathmoveto{\pgfpoint{0.5pt}{0pt}}
  \pgfpathlineto{\pgfpoint{0.5pt}{100pt}}
  \pgfusepath{stroke}
}

\pgfdeclarepatternformonly{north east lines}{\pgfpoint{-1pt}{-1pt}}{\pgfpoint{4pt}{4pt}}{\pgfpoint{3pt}{3pt}}%
{
  \pgfsetlinewidth{0.4pt}
  \pgfpathmoveto{\pgfpoint{0pt}{0pt}}
  \pgfpathlineto{\pgfpoint{3.1pt}{3.1pt}}
  \pgfusepath{stroke}
}

\pgfdeclarepatternformonly{north west lines}{\pgfpoint{-1pt}{-1pt}}{\pgfpoint{4pt}{4pt}}{\pgfpoint{3pt}{3pt}}%
{
  \pgfsetlinewidth{0.4pt}
  \pgfpathmoveto{\pgfpoint{0pt}{3pt}}
  \pgfpathlineto{\pgfpoint{3.1pt}{-0.1pt}}
  \pgfusepath{stroke}
}

% Crossed lines in different directions

\pgfdeclarepatternformonly{grid}{\pgfpoint{-1pt}{-1pt}}{\pgfpoint{4pt}{4pt}}{\pgfpoint{3pt}{3pt}}%
{
  \pgfsetlinewidth{0.4pt}
  \pgfpathmoveto{\pgfpoint{0pt}{0pt}}
  \pgfpathlineto{\pgfpoint{0pt}{3.1pt}}
  \pgfpathmoveto{\pgfpoint{0pt}{0pt}}
  \pgfpathlineto{\pgfpoint{3.1pt}{0pt}}
  \pgfusepath{stroke}
}

\pgfdeclarepatternformonly{crosshatch}{\pgfpoint{-1pt}{-1pt}}{\pgfpoint{4pt}{4pt}}{\pgfpoint{3pt}{3pt}}%
{
  \pgfsetlinewidth{0.4pt}
  \pgfpathmoveto{\pgfpoint{3.1pt}{0pt}}
  \pgfpathlineto{\pgfpoint{0pt}{3.1pt}}
  \pgfpathmoveto{\pgfpoint{0pt}{0pt}}
  \pgfpathlineto{\pgfpoint{3.1pt}{3.1pt}}
  \pgfusepath{stroke}
}


% Dotted regions

\pgfdeclarepatternformonly{dots}{\pgfpoint{-1pt}{-1pt}}{\pgfpoint{1pt}{1pt}}{\pgfpoint{3pt}{3pt}}%
{
  \pgfpathcircle{\pgfpoint{0pt}{0pt}}{.5pt}
  \pgfusepath{fill}
}

\pgfdeclarepatternformonly{crosshatch dots}{\pgfpoint{-1pt}{-1pt}}{\pgfpoint{2.5pt}{2.5pt}}{\pgfpoint{3pt}{3pt}}%
{
  \pgfpathcircle{\pgfpoint{0pt}{0pt}}{.5pt}
  \pgfpathcircle{\pgfpoint{1.5pt}{1.5pt}}{.5pt}
  \pgfusepath{fill}
}




% Star shaped patterns

\pgfdeclarepatternformonly{fivepointed stars}{\pgfpointorigin}{\pgfpoint{3mm}{3mm}}{\pgfpoint{3mm}{3mm}}%
{
  \pgftransformshift{\pgfpoint{1mm}{1mm}}
  \pgfpathmoveto{\pgfpointpolar{18}{1mm}}
  \pgfpathlineto{\pgfpointpolar{162}{1mm}}
  \pgfpathlineto{\pgfpointpolar{306}{1mm}}
  \pgfpathlineto{\pgfpointpolar{90}{1mm}}
  \pgfpathlineto{\pgfpointpolar{234}{1mm}}
  \pgfpathclose%
  \pgfusepath{fill}
}

\pgfdeclarepatternformonly{sixpointed stars}{\pgfpointorigin}{\pgfpoint{3mm}{3mm}}{\pgfpoint{3mm}{3mm}}%
{
  \pgftransformshift{\pgfpoint{1mm}{1mm}}
  \pgfpathmoveto{\pgfpointpolar{30}{1mm}}
  \pgfpathlineto{\pgfpointpolar{150}{1mm}}
  \pgfpathlineto{\pgfpointpolar{270}{1mm}}
  \pgfpathclose%
  \pgfpathmoveto{\pgfpointpolar{-30}{1mm}}
  \pgfpathlineto{\pgfpointpolar{-270}{1mm}}
  \pgfpathlineto{\pgfpointpolar{-150}{1mm}}
  \pgfpathclose%
  \pgfsetnonzerorule
  \pgfusepath{fill}
}



% Bricks

\pgfdeclarepatternformonly{bricks}{\pgfpoint{-1pt}{-1pt}}{\pgfpoint{5mm}{5mm}}{\pgfpoint{4mm}{4mm}}%
{
  \pgfsetlinewidth{0.8pt}
  \pgfpathmoveto{\pgfpoint{0mm}{1mm}}
  \pgfpathlineto{\pgfpoint{4mm}{1mm}}
  \pgfpathmoveto{\pgfpoint{0mm}{3mm}}
  \pgfpathlineto{\pgfpoint{4mm}{3mm}}
  \pgfpathmoveto{\pgfpoint{1mm}{0mm}}
  \pgfpathlineto{\pgfpoint{1mm}{1mm}}
  \pgfpathmoveto{\pgfpoint{3mm}{1mm}}
  \pgfpathlineto{\pgfpoint{3mm}{3mm}}
  \pgfpathmoveto{\pgfpoint{1mm}{3mm}}
  \pgfpathlineto{\pgfpoint{1mm}{4mm}}
  \pgfusepath{stroke}
}




\endinput
