Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Generate testsuite from pgfmanual #1116

Draft
wants to merge 3 commits into
base: master
Choose a base branch
from
Draft
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
45 changes: 44 additions & 1 deletion doc/generic/pgf/extract.lua
Original file line number Diff line number Diff line change
@@ -92,6 +92,7 @@ local function walk(sourcedir, targetdir)

-- Process all items in the directory
for file in lfs.dir(sourcedir) do

if file == "." or file == ".." then
-- Ignore these two special ones
elseif lfs.attributes(sourcedir .. file, "mode") == "directory" then
@@ -113,8 +114,12 @@ local function walk(sourcedir, targetdir)
-- extract all code examples
local matches = extractor:match(text) or {}

-- write code examples to separate files
-- storage
local setup_code = ""
local preamble = ""
local document = ""

-- write code examples to separate files
for n, e in ipairs(matches) do
local options = e[1]
local content = e[2]
@@ -133,6 +138,7 @@ local function walk(sourcedir, targetdir)
-- Skip those that say "code only" or "setup code"
if not options["code only"] and not options["setup code"] then
local newname = name .. "-" .. n .. ".tex"
--[[
local examplefile = io.open(targetdir .. newname, "w")
examplefile:write"\\documentclass{standalone}\n"
@@ -153,10 +159,47 @@ local function walk(sourcedir, targetdir)
examplefile:write"\\end{document}\n"
examplefile:close()
--]]
preamble = preamble .. (options["preamble"] and (options["preamble"] .. "\n") or "")
document = document .. "\\BEGINBOXTEST{" .. name .. "-" .. n .. "}\n"
local pre = options["pre"]
if pre then
pre = pre:gsub("##", "#")
document = document .. pre .. "\n"
end
if options["render instead"] then
document = document .. options["render instead"] .. "\n"
else
document = document .. strip(content) .. "\n"
end
document = document .. (options["post"] and (options["post"] .. "\n") or "")
document = document .. "\\ENDBOXTEST\n\n"
end

::continue::
end

document = strip(document)
if document ~= "" then
local examplefile = io.open(targetdir .. name .. ".lvt", "w")
examplefile:write"\\documentclass{minimal}\n"
examplefile:write"\\input{pgf-regression-test}\n"
examplefile:write"\\RequirePackage{fp,pgf,tikz,xcolor}\n"
if preamble ~= "" then
examplefile:write"\n"
examplefile:write(preamble)
examplefile:write"\n"
end
examplefile:write"\\begin{document}\n\n"
if setup_code ~= "" then
examplefile:write(setup_code)
examplefile:write"\n"
end
examplefile:write(document)
examplefile:write"\n"
examplefile:write"\\END\n"
examplefile:close()
end
end
end
end
4 changes: 2 additions & 2 deletions testfiles/pgf001.latexdvips.tlg
Original file line number Diff line number Diff line change
@@ -25,7 +25,7 @@ TEST 1: pgf: \pgfpathmoveto
...\special{ps::[end]}
...\glue 0.0 plus 1.0fil minus 1.0fil
! OK.
\ENDPGFTEST ...th =\maxdimen \showbox \PGFTESTBOX
\ENDBOXTEST ...th =\maxdimen \showbox \PGFTESTBOX
\endgroup \ENDTEST
l. ...\ENDPGFTEST
============================================================
@@ -54,7 +54,7 @@ TEST 2: pgf: \pgfpathlineto
...\special{ps::[end]}
...\glue 0.0 plus 1.0fil minus 1.0fil
! OK.
\ENDPGFTEST ...th =\maxdimen \showbox \PGFTESTBOX
\ENDBOXTEST ...th =\maxdimen \showbox \PGFTESTBOX
\endgroup \ENDTEST
l. ...\ENDPGFTEST
============================================================
4 changes: 2 additions & 2 deletions testfiles/pgf001.latexdvisvgm.tlg
Original file line number Diff line number Diff line change
@@ -26,7 +26,7 @@ TEST 1: pgf: \pgfpathmoveto
....\special{color pop}
....\glue 0.0 plus 1.0fil minus 1.0fil
! OK.
\ENDPGFTEST ...th =\maxdimen \showbox \PGFTESTBOX
\ENDBOXTEST ...th =\maxdimen \showbox \PGFTESTBOX
\endgroup \ENDTEST
l. ...\ENDPGFTEST
============================================================
@@ -56,7 +56,7 @@ TEST 2: pgf: \pgfpathlineto
....\special{color pop}
....\glue 0.0 plus 1.0fil minus 1.0fil
! OK.
\ENDPGFTEST ...th =\maxdimen \showbox \PGFTESTBOX
\ENDBOXTEST ...th =\maxdimen \showbox \PGFTESTBOX
\endgroup \ENDTEST
l. ...\ENDPGFTEST
============================================================
4 changes: 2 additions & 2 deletions testfiles/pgf001.luatex.tlg
Original file line number Diff line number Diff line change
@@ -21,7 +21,7 @@ TEST 1: pgf: \pgfpathmoveto
...\pdfliteral origin{Q }
...\glue 0.0 plus 1.0fil minus 1.0fil
! OK.
\ENDPGFTEST ...th =\maxdimen \showbox \PGFTESTBOX
\ENDBOXTEST ...th =\maxdimen \showbox \PGFTESTBOX
\endgroup \ENDTEST
l. ...\ENDPGFTEST
============================================================
@@ -46,7 +46,7 @@ TEST 2: pgf: \pgfpathlineto
...\pdfliteral origin{Q }
...\glue 0.0 plus 1.0fil minus 1.0fil
! OK.
\ENDPGFTEST ...th =\maxdimen \showbox \PGFTESTBOX
\ENDBOXTEST ...th =\maxdimen \showbox \PGFTESTBOX
\endgroup \ENDTEST
l. ...\ENDPGFTEST
============================================================
4 changes: 2 additions & 2 deletions testfiles/pgf001.tlg
Original file line number Diff line number Diff line change
@@ -21,7 +21,7 @@ TEST 1: pgf: \pgfpathmoveto
...\pdfliteral{Q }
...\glue 0.0 plus 1.0fil minus 1.0fil
! OK.
\ENDPGFTEST ...th =\maxdimen \showbox \PGFTESTBOX
\ENDBOXTEST ...th =\maxdimen \showbox \PGFTESTBOX
\endgroup \ENDTEST
l. ...\ENDPGFTEST
============================================================
@@ -46,7 +46,7 @@ TEST 2: pgf: \pgfpathlineto
...\pdfliteral{Q }
...\glue 0.0 plus 1.0fil minus 1.0fil
! OK.
\ENDPGFTEST ...th =\maxdimen \showbox \PGFTESTBOX
\ENDBOXTEST ...th =\maxdimen \showbox \PGFTESTBOX
\endgroup \ENDTEST
l. ...\ENDPGFTEST
============================================================
4 changes: 2 additions & 2 deletions testfiles/pgf001.xetex.tlg
Original file line number Diff line number Diff line change
@@ -23,7 +23,7 @@ TEST 1: pgf: \pgfpathmoveto
...\special{pdf:econtent}
...\glue 0.0 plus 1.0fil minus 1.0fil
! OK.
\ENDPGFTEST ...th =\maxdimen \showbox \PGFTESTBOX
\ENDBOXTEST ...th =\maxdimen \showbox \PGFTESTBOX
\endgroup \ENDTEST
l. ...\ENDPGFTEST
============================================================
@@ -50,7 +50,7 @@ TEST 2: pgf: \pgfpathlineto
...\special{pdf:econtent}
...\glue 0.0 plus 1.0fil minus 1.0fil
! OK.
\ENDPGFTEST ...th =\maxdimen \showbox \PGFTESTBOX
\ENDBOXTEST ...th =\maxdimen \showbox \PGFTESTBOX
\endgroup \ENDTEST
l. ...\ENDPGFTEST
============================================================
2 changes: 1 addition & 1 deletion testfiles/pgf002.latexdvips.tlg
Original file line number Diff line number Diff line change
@@ -214,7 +214,7 @@ TEST 1: tikz: matrix
...\special{ps::[end]}
...\glue 0.0 plus 1.0fil minus 1.0fil
! OK.
\ENDTIKZTEST ...h =\maxdimen \showbox \PGFTESTBOX
\ENDBOXTEST ...th =\maxdimen \showbox \PGFTESTBOX
\endgroup \ENDTEST
l. ...\ENDTIKZTEST
============================================================
2 changes: 1 addition & 1 deletion testfiles/pgf002.latexdvisvgm.tlg
Original file line number Diff line number Diff line change
@@ -145,7 +145,7 @@ TEST 1: tikz: matrix
....\special{color pop}
....\glue 0.0 plus 1.0fil minus 1.0fil
! OK.
\ENDTIKZTEST ...h =\maxdimen \showbox \PGFTESTBOX
\ENDBOXTEST ...th =\maxdimen \showbox \PGFTESTBOX
\endgroup \ENDTEST
l. ...\ENDTIKZTEST
============================================================
2 changes: 1 addition & 1 deletion testfiles/pgf002.luatex.tlg
Original file line number Diff line number Diff line change
@@ -206,7 +206,7 @@ TEST 1: tikz: matrix
...\pdfliteral origin{Q }
...\glue 0.0 plus 1.0fil minus 1.0fil
! OK.
\ENDTIKZTEST ...h =\maxdimen \showbox \PGFTESTBOX
\ENDBOXTEST ...th =\maxdimen \showbox \PGFTESTBOX
\endgroup \ENDTEST
l. ...\ENDTIKZTEST
============================================================
2 changes: 1 addition & 1 deletion testfiles/pgf002.tlg
Original file line number Diff line number Diff line change
@@ -210,7 +210,7 @@ TEST 1: tikz: matrix
...\pdfliteral{Q }
...\glue 0.0 plus 1.0fil minus 1.0fil
! OK.
\ENDTIKZTEST ...h =\maxdimen \showbox \PGFTESTBOX
\ENDBOXTEST ...th =\maxdimen \showbox \PGFTESTBOX
\endgroup \ENDTEST
l. ...\ENDTIKZTEST
============================================================
2 changes: 1 addition & 1 deletion testfiles/pgf002.xetex.tlg
Original file line number Diff line number Diff line change
@@ -246,7 +246,7 @@ TEST 1: tikz: matrix
...\special{pdf:econtent}
...\glue 0.0 plus 1.0fil minus 1.0fil
! OK.
\ENDTIKZTEST ...h =\maxdimen \showbox \PGFTESTBOX
\ENDBOXTEST ...th =\maxdimen \showbox \PGFTESTBOX
\endgroup \ENDTEST
l. ...\ENDTIKZTEST
============================================================
179 changes: 179 additions & 0 deletions testfiles/pgfmanual-en-base-actions.lvt
Original file line number Diff line number Diff line change
@@ -0,0 +1,179 @@
\documentclass{minimal}
\input{pgf-regression-test}
\RequirePackage{fp,pgf,tikz,xcolor}

\usepgflibrary{arrows.meta}
\usepgflibrary{arrows.meta}
\usepgflibrary{arrows.meta}
\usepgflibrary{arrows.meta}

\begin{document}

\BEGINBOXTEST{pgfmanual-en-base-actions-1}
\begin{pgfpicture}
\pgfpathmoveto{\pgfpointorigin}
\pgfpathlineto{\pgfpoint{1cm}{1cm}}
\pgfpathlineto{\pgfpoint{1cm}{0cm}}
\pgfusepath{fill}
\end{pgfpicture}
\ENDBOXTEST

\BEGINBOXTEST{pgfmanual-en-base-actions-2}
\begin{pgfpicture}
\pgfpathmoveto{\pgfpointorigin}
\pgfpathlineto{\pgfpoint{1cm}{1cm}}
\pgfpathlineto{\pgfpoint{1cm}{0cm}}
\pgfusepath{stroke}
\end{pgfpicture}
\ENDBOXTEST

\BEGINBOXTEST{pgfmanual-en-base-actions-3}
\begin{pgfpicture}
\pgfpathmoveto{\pgfpointorigin}
\pgfpathlineto{\pgfpoint{1cm}{1cm}}
\pgfpathlineto{\pgfpoint{1cm}{0cm}}
\pgfusepath{stroke,clip}
\pgfpathcircle{\pgfpoint{1cm}{1cm}}{0.5cm}
\pgfusepath{fill}
\end{pgfpicture}
\ENDBOXTEST

\BEGINBOXTEST{pgfmanual-en-base-actions-4}
\begin{pgfpicture}
\pgfsetlinewidth{1mm}
\pgfpathmoveto{\pgfpoint{0mm}{0mm}}
\pgfpathlineto{\pgfpoint{2cm}{0mm}}
\pgfusepath{stroke}
\pgfsetlinewidth{2\pgflinewidth} % double in size
\pgfpathmoveto{\pgfpoint{0mm}{5mm}}
\pgfpathlineto{\pgfpoint{2cm}{5mm}}
\pgfusepath{stroke}
\end{pgfpicture}
\ENDBOXTEST

\BEGINBOXTEST{pgfmanual-en-base-actions-5}
\begin{pgfpicture}
\pgfsetdash{{0.5cm}{0.5cm}{0.1cm}{0.2cm}}{0cm}
\pgfpathmoveto{\pgfpoint{0mm}{0mm}}
\pgfpathlineto{\pgfpoint{2cm}{0mm}}
\pgfusepath{stroke}
\pgfsetdash{{0.5cm}{0.5cm}{0.1cm}{0.2cm}}{0.1cm}
\pgfpathmoveto{\pgfpoint{0mm}{1mm}}
\pgfpathlineto{\pgfpoint{2cm}{1mm}}
\pgfusepath{stroke}
\pgfsetdash{{0.5cm}{0.5cm}{0.1cm}{0.2cm}}{0.2cm}
\pgfpathmoveto{\pgfpoint{0mm}{2mm}}
\pgfpathlineto{\pgfpoint{2cm}{2mm}}
\pgfusepath{stroke}
\end{pgfpicture}
\ENDBOXTEST

\BEGINBOXTEST{pgfmanual-en-base-actions-6}
\begin{pgfpicture}
\pgfsetlinewidth{1pt}
\color{red}
\pgfpathcircle{\pgfpoint{0cm}{0cm}}{3mm} \pgfusepath{fill,stroke}
\pgfsetstrokecolor{black}
\pgfpathcircle{\pgfpoint{1cm}{0cm}}{3mm} \pgfusepath{fill,stroke}
\color{red}
\pgfpathcircle{\pgfpoint{2cm}{0cm}}{3mm} \pgfusepath{fill,stroke}
\end{pgfpicture}
\ENDBOXTEST

\BEGINBOXTEST{pgfmanual-en-base-actions-7}
\begin{pgfpicture}
\pgfpathmoveto{\pgfpointorigin}
\pgfpathlineto{\pgfpoint{1cm}{1cm}}
\pgfpathlineto{\pgfpoint{1cm}{0cm}}
\pgfsetlinewidth{2pt}
\pgfsetinnerlinewidth{1pt}
\pgfusepath{stroke}
\end{pgfpicture}
\ENDBOXTEST

\BEGINBOXTEST{pgfmanual-en-base-actions-8}
\begin{pgfpicture}
\pgfpathmoveto{\pgfpointorigin}
\pgfpathlineto{\pgfpoint{1cm}{1cm}}
\pgfpathlineto{\pgfpoint{1cm}{0cm}}
\pgfsetlinewidth{2pt}
\pgfsetinnerlinewidth{1pt}
\pgfsetinnerstrokecolor{red!50}
\pgfusepath{stroke}
\end{pgfpicture}
\ENDBOXTEST

\BEGINBOXTEST{pgfmanual-en-base-actions-9}
\begin{pgfpicture}
\pgfsetarrowsstart{Latex[length=10pt]}
\pgfpathmoveto{\pgfpointorigin}
\pgfpathlineto{\pgfpoint{1cm}{0cm}}
\pgfusepath{stroke}
\pgfsetarrowsstart{Computer Modern Rightarrow}
\pgfpathmoveto{\pgfpoint{0cm}{2mm}}
\pgfpathlineto{\pgfpoint{1cm}{2mm}}
\pgfusepath{stroke}
\end{pgfpicture}
\ENDBOXTEST

\BEGINBOXTEST{pgfmanual-en-base-actions-10}
\begin{pgfpicture}
\pgfsetarrowsstart{Latex[length=10pt]}
\pgfsetarrowsend{Computer Modern Rightarrow}
\pgfpathmoveto{\pgfpointorigin}
\pgfpathlineto{\pgfpoint{1cm}{0cm}}
\pgfusepath{stroke}
\end{pgfpicture}
\ENDBOXTEST

\BEGINBOXTEST{pgfmanual-en-base-actions-11}
\begin{pgfpicture}
\pgfsetarrows{Latex[length=10pt]->>}
\pgfpathmoveto{\pgfpointorigin}
\pgfpathlineto{\pgfpoint{1cm}{0cm}}
\pgfusepath{stroke}
\end{pgfpicture}
\ENDBOXTEST

\BEGINBOXTEST{pgfmanual-en-base-actions-12}
\begin{pgfpicture}
\pgfpathcircle{\pgfpointorigin}{5mm}
\pgfusepath{stroke}
\pgfsetarrows{Latex-}
\pgfsetshortenstart{4pt}
\pgfpathmoveto{\pgfpoint{5mm}{0cm}} % would be on the circle
\pgfpathlineto{\pgfpoint{2cm}{0cm}}
\pgfusepath{stroke}
\end{pgfpicture}
\ENDBOXTEST

\BEGINBOXTEST{pgfmanual-en-base-actions-13}
\begin{pgfpicture}
\pgfseteorule
\pgfpathcircle{\pgfpoint{0mm}{0cm}}{7mm}
\pgfpathcircle{\pgfpoint{5mm}{0cm}}{7mm}
\pgfusepath{fill}
\end{pgfpicture}
\ENDBOXTEST

\BEGINBOXTEST{pgfmanual-en-base-actions-14}
\begin{pgfpicture}
\pgfsetnonzerorule
\pgfpathcircle{\pgfpoint{0mm}{0cm}}{7mm}
\pgfpathcircle{\pgfpoint{5mm}{0cm}}{7mm}
\pgfusepath{fill}
\end{pgfpicture}
\ENDBOXTEST

\BEGINBOXTEST{pgfmanual-en-base-actions-15}
Left
\begin{pgfpicture}
\pgfpathrectangle{\pgfpointorigin}{\pgfpoint{2ex}{1ex}}
\pgfusepath{use as bounding box} % draws nothing

\pgfpathcircle{\pgfpointorigin}{2ex}
\pgfusepath{stroke}
\end{pgfpicture}
right.
\ENDBOXTEST
\END
549 changes: 549 additions & 0 deletions testfiles/pgfmanual-en-base-animations.lvt

Large diffs are not rendered by default.

79 changes: 79 additions & 0 deletions testfiles/pgfmanual-en-base-arrows.lvt
Original file line number Diff line number Diff line change
@@ -0,0 +1,79 @@
\documentclass{minimal}
\input{pgf-regression-test}
\RequirePackage{fp,pgf,tikz,xcolor}

\usetikzlibrary{arrows.meta}
\usetikzlibrary{arrows.meta,bending}

\begin{document}

\makeatletter
\def\showvalueofmacro#1{%
\texttt{\expandafter\expandafter\expandafter\expandafter\expandafter\expandafter\expandafter\pgfutil@gobble\expandafter\expandafter\expandafter\string\expandafter\csname#1\endcsname}
}%

\BEGINBOXTEST{pgfmanual-en-base-arrows-8}
\pgfdeclarearrow{
name = foo,
parameters = { \the\pgfarrowlength },
setup code = {
% The different end values:
\pgfarrowssettipend{.25\pgfarrowlength}
\pgfarrowssetlineend{-.25\pgfarrowlength}
\pgfarrowssetvisualbackend{-.5\pgfarrowlength}
\pgfarrowssetbackend{-.75\pgfarrowlength}
% The hull
\pgfarrowshullpoint{.25\pgfarrowlength}{0pt}
\pgfarrowshullpoint{-.75\pgfarrowlength}{.5\pgfarrowlength}
\pgfarrowshullpoint{-.75\pgfarrowlength}{-.5\pgfarrowlength}
% Saves: Only the length:
\pgfarrowssavethe\pgfarrowlength
},
drawing code = {
\pgfpathmoveto{\pgfqpoint{.25\pgfarrowlength}{0pt}}
\pgfpathlineto{\pgfqpoint{-.75\pgfarrowlength}{.5\pgfarrowlength}}
\pgfpathlineto{\pgfqpoint{-.5\pgfarrowlength}{0pt}}
\pgfpathlineto{\pgfqpoint{-.75\pgfarrowlength}{-.5\pgfarrowlength}}
\pgfpathclose
\pgfusepathqfill
},
defaults = { length = 4cm }
}
\tikz \draw [-foo] (0,0) -- (8,0);
\ENDBOXTEST

\BEGINBOXTEST{pgfmanual-en-base-arrows-9}
\pgfdeclarearrow{
name = foo,
parameters = { \the\pgfarrowlength },
setup code = {
% The different end values:
\pgfarrowssettipend{.25\pgfarrowlength}
\pgfarrowssetlineend{-.25\pgfarrowlength}
\pgfarrowssetvisualbackend{-.5\pgfarrowlength}
\pgfarrowssetbackend{-.75\pgfarrowlength}
% The hull
\pgfarrowshullpoint{.25\pgfarrowlength}{0pt}
\pgfarrowshullpoint{-.75\pgfarrowlength}{.5\pgfarrowlength}
\pgfarrowshullpoint{-.75\pgfarrowlength}{-.5\pgfarrowlength}
% Saves: Only the length:
\pgfarrowssavethe\pgfarrowlength
},
drawing code = {
\pgfpathmoveto{\pgfqpoint{.25\pgfarrowlength}{0pt}}
\pgfpathlineto{\pgfqpoint{-.75\pgfarrowlength}{.5\pgfarrowlength}}
\pgfpathlineto{\pgfqpoint{-.5\pgfarrowlength}{0pt}}
\pgfpathlineto{\pgfqpoint{-.75\pgfarrowlength}{-.5\pgfarrowlength}}
\pgfpathclose
\pgfusepathqfill
},
defaults = { length = 4cm }
}
\tikz \draw [-{foo[length=2cm,bend]}] (0,0) to [bend left] (3,0);
\ENDBOXTEST

\BEGINBOXTEST{pgfmanual-en-base-arrows-18}
\pgfarrowsthreeparameters{2pt 1}
\showvalueofmacro\pgfarrowstheparameters
\ENDBOXTEST
\END
243 changes: 243 additions & 0 deletions testfiles/pgfmanual-en-base-decorations.lvt
Original file line number Diff line number Diff line change
@@ -0,0 +1,243 @@
\documentclass{minimal}
\input{pgf-regression-test}
\RequirePackage{fp,pgf,tikz,xcolor}

\usetikzlibrary{decorations,decorations.pathmorphing}
\usetikzlibrary{decorations,decorations.text}
\usetikzlibrary{decorations}
\usetikzlibrary{decorations,shapes.geometric}
\usetikzlibrary{decorations}
\usetikzlibrary{decorations,decorations.pathmorphing}
\usetikzlibrary{decorations,decorations.pathmorphing}
\usetikzlibrary{decorations,decorations.pathmorphing}
\usetikzlibrary{decorations,decorations.pathmorphing}
\usetikzlibrary{decorations,decorations.pathmorphing}

\begin{document}

\BEGINBOXTEST{pgfmanual-en-base-decorations-1}
\tikz \draw decorate[decoration=zigzag] {(0,0) -- (3,0)};
\ENDBOXTEST

\BEGINBOXTEST{pgfmanual-en-base-decorations-2}
\tikz \path decorate [decoration={text along path,
text={Some text along a path}}]
{ (0,2) .. controls (2,2) and (1,0) .. (3,0) };
\ENDBOXTEST

\BEGINBOXTEST{pgfmanual-en-base-decorations-4}
\pgfdeclaredecoration{example}{initial}
{
\state{initial}[width=10pt]
{
\pgfpathlineto{\pgfpoint{0pt}{5pt}}
\pgfpathlineto{\pgfpoint{5pt}{5pt}}
\pgfpathlineto{\pgfpoint{5pt}{-5pt}}
\pgfpathlineto{\pgfpoint{10pt}{-5pt}}
\pgfpathlineto{\pgfpoint{10pt}{0pt}}
}
\state{final}
{
\pgfpathlineto{\pgfpointdecoratedpathlast}
}
}
\tikz[decoration=example]
{
\draw [decorate] (0,0) -- (3,0);
\draw [red,decorate] (0,0) to [out=45,in=135] (3,0);
}
\ENDBOXTEST

\BEGINBOXTEST{pgfmanual-en-base-decorations-5}
\pgfmathsetseed{1}
\pgfdeclaredecoration{stars}{initial}{
\state{initial}[width=15pt]
{
\pgfmathparse{round(rnd*100)}
\pgfsetfillcolor{yellow!\pgfmathresult!orange}
\pgfsetstrokecolor{yellow!\pgfmathresult!red}
\pgfnode{star}{center}{}{}{\pgfusepath{stroke,fill}}
}
\state{final}
{
\pgfpathmoveto{\pgfpointdecoratedpathlast}
}
}
\tikz\path[decorate, decoration=stars, star point ratio=2, star points=5,
inner sep=0, minimum size=rnd*10pt+2pt]
(0,0) .. controls (0,2) and (3,2) .. (3,0)
.. controls (3,-3) and (0,0) .. (0,-3)
.. controls (0,-5) and (3,-5) .. (3,-3);
\ENDBOXTEST

\BEGINBOXTEST{pgfmanual-en-base-decorations-6}
\pgfdeclaredecoration{complicated example decoration}{initial}
{
\state{initial}[width=5pt,next state=up]
{ \pgfpathlineto{\pgfpoint{5pt}{0pt}} }

\state{up}[width=5pt,next state=down]
{
\ifdim\pgfdecoratedremainingdistance>\pgfdecoratedcompleteddistance
% Growing
\pgfpathlineto{\pgfpoint{0pt}{\pgfdecoratedcompleteddistance}}
\pgfpathlineto{\pgfpoint{5pt}{\pgfdecoratedcompleteddistance}}
\pgfpathlineto{\pgfpoint{5pt}{0pt}}
\else
% Shrinking
\pgfpathlineto{\pgfpoint{0pt}{\pgfdecoratedremainingdistance}}
\pgfpathlineto{\pgfpoint{5pt}{\pgfdecoratedremainingdistance}}
\pgfpathlineto{\pgfpoint{5pt}{0pt}}
\fi%
}
\state{down}[width=5pt,next state=up]
{
\ifdim\pgfdecoratedremainingdistance>\pgfdecoratedcompleteddistance
% Growing
\pgfpathlineto{\pgfpoint{0pt}{-\pgfdecoratedcompleteddistance}}
\pgfpathlineto{\pgfpoint{5pt}{-\pgfdecoratedcompleteddistance}}
\pgfpathlineto{\pgfpoint{5pt}{0pt}}
\else
% Shrinking
\pgfpathlineto{\pgfpoint{0pt}{-\pgfdecoratedremainingdistance}}
\pgfpathlineto{\pgfpoint{5pt}{-\pgfdecoratedremainingdistance}}
\pgfpathlineto{\pgfpoint{5pt}{0pt}}
\fi%
}
\state{final}
{
\pgfpathlineto{\pgfpointdecoratedpathlast}
}
}
\begin{tikzpicture}[decoration=complicated example decoration]
\draw decorate{ (0,0) -- (3,0)};
\fill [red!50,rounded corners=2pt]
decorate {(.5,-2) -- ++(2.5,-2.5)} -- (3,-5) -| (0,-2) -- cycle;
\end{tikzpicture}
\ENDBOXTEST

\BEGINBOXTEST{pgfmanual-en-base-decorations-7}
\begin{tikzpicture}[decoration={segment length=5pt}]
\draw [help lines] grid (3,2);
\begin{pgfdecoration}{{curveto}{1cm},{zigzag}{2cm},{curveto}{1cm}}
\pgfpathmoveto{\pgfpointorigin}
\pgfpathcurveto
{\pgfpoint{0cm}{2cm}}{\pgfpoint{3cm}{2cm}}{\pgfpoint{3cm}{0cm}}
\end{pgfdecoration}
\pgfusepath{stroke}
\end{tikzpicture}
\ENDBOXTEST

\BEGINBOXTEST{pgfmanual-en-base-decorations-8}
\begin{tikzpicture}[decoration={segment length=5pt}]
\draw [help lines] grid (3,2);
\begin{pgfdecoration}{
{curveto}{\pgfdecoratedpathlength/3},
{zigzag}{\pgfdecoratedpathlength/3},
{curveto}{\pgfdecoratedremainingdistance}
}
\pgfpathmoveto{\pgfpointorigin}
\pgfpathcurveto
{\pgfpoint{0cm}{2cm}}{\pgfpoint{3cm}{2cm}}{\pgfpoint{3cm}{0cm}}
\end{pgfdecoration}
\pgfusepath{stroke}
\end{tikzpicture}
\ENDBOXTEST

\BEGINBOXTEST{pgfmanual-en-base-decorations-9}
\begin{tikzpicture}
\draw [help lines] grid (3,2);
\begin{pgfdecoration}{
{curveto}{\pgfdecoratedpathlength/3}
{}
{
\pgfusepath{stroke}
},
{zigzag}{\pgfdecoratedpathlength/3}
{
\pgfpathmoveto{\pgfpointdecoratedpathfirst}
\pgfdecorationsegmentlength=5pt
}
{
\pgfsetstrokecolor{red}
\pgfusepath{stroke}
\pgfpathmoveto{\pgfpointdecoratedpathlast}
\pgfsetstrokecolor{black}
},
{curveto}{\pgfdecoratedremainingdistance}
}
\pgfpathmoveto{\pgfpointorigin}
\pgfpathcurveto
{\pgfpoint{0cm}{2cm}}{\pgfpoint{3cm}{2cm}}{\pgfpoint{3cm}{0cm}}
\end{pgfdecoration}
\pgfusepath{stroke}
\end{tikzpicture}
\ENDBOXTEST

\BEGINBOXTEST{pgfmanual-en-base-decorations-11}
\begin{tikzpicture}
\draw [help lines] grid (3,2);
\begin{pgfdecoration}{
{curveto}{\pgfdecoratedpathlength/3},
{zigzag}{\pgfdecoratedpathlength/3}
{
\pgfdecorationsegmentlength=5pt
\pgfsetdecorationsegmenttransformation{\pgftransformyshift{.5cm}}
},
{curveto}{\pgfdecoratedremainingdistance}
}
\pgfpathmoveto{\pgfpointorigin}
\pgfpathcurveto
{\pgfpoint{0cm}{2cm}}{\pgfpoint{3cm}{2cm}}{\pgfpoint{3cm}{0cm}}
\end{pgfdecoration}
\pgfusepath{stroke}
\end{tikzpicture}
\ENDBOXTEST

\BEGINBOXTEST{pgfmanual-en-base-decorations-12}
\pgfdeclaremetadecoration{arrows}{initial}{
\state{initial}[width=0pt, next state=arrow]
{
\pgfmathdivide{100}{\pgfmetadecoratedpathlength}
\let\factor\pgfmathresult
\pgfsetlinewidth{1pt}
\pgfset{/pgf/decoration/segment length=4pt}
}
\state{arrow}[
switch if less than=\pgfmetadecorationsegmentlength to final,
width=\pgfmetadecorationsegmentlength/3,
next state=zigzag]
{
\decoration{curveto}
\beforedecoration
{
\pgfmathparse{\pgfmetadecoratedcompleteddistance*\factor}
\pgfsetcolor{red!\pgfmathresult!yellow}
\pgfpathmoveto{\pgfpointmetadecoratedpathfirst}
}
}
\state{zigzag}[width=\pgfmetadecorationsegmentlength/3, next state=end arrow]
{
\decoration{zigzag}
}
\state{end arrow}[width=\pgfmetadecorationsegmentlength/3, next state=move]
{
\decoration{curveto}
\beforedecoration{\pgfpathmoveto{\pgfpointmetadecoratedpathfirst}}
\afterdecoration
{
\pgfsetarrowsend{to}
\pgfusepath{stroke}
}
}
\state{move}[width=\pgfmetadecorationsegmentlength/2, next state=arrow]{}
\state{final}{}
}

\tikz\draw[decorate,decoration={arrows,meta-segment length=2cm}]
(0,0) .. controls (0,2) and (3,2) .. (3,0)
.. controls (3,-2) and (0,-2) .. (0,-4)
.. controls (0,-6) and (3,-6) .. (3,-8)
.. controls (3,-10) and (0,-10) .. (0,-8);
\ENDBOXTEST
\END
17 changes: 17 additions & 0 deletions testfiles/pgfmanual-en-base-design.lvt
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
\documentclass{minimal}
\input{pgf-regression-test}
\RequirePackage{fp,pgf,tikz,xcolor}
\begin{document}

\BEGINBOXTEST{pgfmanual-en-base-design-1}
\newdimen\myypos
\begin{pgfpicture}
\pgfpathmoveto{\pgfpoint{0cm}{\myypos}}
\pgfpathlineto{\pgfpoint{1cm}{\myypos}}
\advance \myypos by 1cm
\pgfpathlineto{\pgfpoint{1cm}{\myypos}}
\pgfpathclose
\pgfusepath{stroke}
\end{pgfpicture}
\ENDBOXTEST
\END
77 changes: 77 additions & 0 deletions testfiles/pgfmanual-en-base-images.lvt
Original file line number Diff line number Diff line change
@@ -0,0 +1,77 @@
\documentclass{minimal}
\input{pgf-regression-test}
\RequirePackage{fp,pgf,tikz,xcolor}

\usepackage{xxcolor}
\usepackage{xxcolor}

\begin{document}

\BEGINBOXTEST{pgfmanual-en-base-images-2}
\pgfdeclareimage[interpolate=true,width=1cm,height=1cm]
{image1}{brave-gnu-world-logo}
\pgfdeclareimage[interpolate=true,width=1cm]{image2}{brave-gnu-world-logo}
\pgfdeclareimage[interpolate=true,height=1cm]{image3}{brave-gnu-world-logo}
\begin{pgfpicture}
\pgftext[at=\pgfpoint{1cm}{5cm},left,base]{\pgfuseimage{image1}}
\pgftext[at=\pgfpoint{1cm}{3cm},left,base]{\pgfuseimage{image2}}
\pgftext[at=\pgfpoint{1cm}{1cm},left,base]{\pgfuseimage{image3}}

\pgfpathrectangle{\pgfpoint{1cm}{5cm}}{\pgfpoint{1cm}{1cm}}
\pgfpathrectangle{\pgfpoint{1cm}{3cm}}{\pgfpoint{1cm}{1cm}}
\pgfpathrectangle{\pgfpoint{1cm}{1cm}}{\pgfpoint{1cm}{1cm}}
\pgfusepath{stroke}
\end{pgfpicture}
\ENDBOXTEST

\BEGINBOXTEST{pgfmanual-en-base-images-3}
\pgfdeclareimage[interpolate=true,width=1cm,height=1cm]
{image1.!25!white}{brave-gnu-world-logo.25}
\pgfdeclareimage[interpolate=true,width=1cm]
{image2.25!white}{brave-gnu-world-logo.25}
\pgfdeclareimage[interpolate=true,height=1cm]
{image3.white}{brave-gnu-world-logo.25}
\begin{colormixin}{25!white}
\begin{pgfpicture}
\pgftext[at=\pgfpoint{1cm}{5cm},left,base]{\pgfuseimage{image1}}
\pgftext[at=\pgfpoint{1cm}{3cm},left,base]{\pgfuseimage{image2}}
\pgftext[at=\pgfpoint{1cm}{1cm},left,base]{\pgfuseimage{image3}}

\pgfpathrectangle{\pgfpoint{1cm}{5cm}}{\pgfpoint{1cm}{1cm}}
\pgfpathrectangle{\pgfpoint{1cm}{3cm}}{\pgfpoint{1cm}{1cm}}
\pgfpathrectangle{\pgfpoint{1cm}{1cm}}{\pgfpoint{1cm}{1cm}}
\pgfusepath{stroke}
\end{pgfpicture}
\end{colormixin}
\ENDBOXTEST

\BEGINBOXTEST{pgfmanual-en-base-images-4}
\begin{colormixin}{25!white}
\begin{pgfpicture}
\pgftext[at=\pgfpoint{1cm}{5cm},left,base]
{\pgfimage[interpolate=true,width=1cm,height=1cm]{brave-gnu-world-logo}}
\pgftext[at=\pgfpoint{1cm}{3cm},left,base]
{\pgfimage[interpolate=true,width=1cm]{brave-gnu-world-logo}}
\pgftext[at=\pgfpoint{1cm}{1cm},left,base]
{\pgfimage[interpolate=true,height=1cm]{brave-gnu-world-logo}}

\pgfpathrectangle{\pgfpoint{1cm}{5cm}}{\pgfpoint{1cm}{1cm}}
\pgfpathrectangle{\pgfpoint{1cm}{3cm}}{\pgfpoint{1cm}{1cm}}
\pgfpathrectangle{\pgfpoint{1cm}{1cm}}{\pgfpoint{1cm}{1cm}}
\pgfusepath{stroke}
\end{pgfpicture}
\end{colormixin}
\ENDBOXTEST

\BEGINBOXTEST{pgfmanual-en-base-images-5}
\pgfdeclarehorizontalshading{colorful}{5cm}{color(0cm)=(red);
color(2cm)=(green); color(4cm)=(blue); color(6cm)=(red);
color(8cm)=(green); color(10cm)=(blue); color(12cm)=(red);
color(14cm)=(green)}
\hbox{\pgfuseshading{colorful}\hskip-14cm\hskip1cm
\pgfimage[height=4cm]{brave-gnu-world-logo}\hskip1cm
\pgfimage[height=4cm]{brave-gnu-world-logo-mask}\hskip1cm
\pgfdeclaremask{mymask}{brave-gnu-world-logo-mask}
\pgfimage[mask=mymask,height=4cm,interpolate=true]{brave-gnu-world-logo}}
\ENDBOXTEST
\END
30 changes: 30 additions & 0 deletions testfiles/pgfmanual-en-base-layers.lvt
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
\documentclass{minimal}
\input{pgf-regression-test}
\RequirePackage{fp,pgf,tikz,xcolor}
\begin{document}

\BEGINBOXTEST{pgfmanual-en-base-layers-2}
\pgfdeclarelayer{background layer}
\pgfdeclarelayer{foreground layer}
\pgfsetlayers{background layer,main,foreground layer}
\begin{tikzpicture}
% On main layer:
\fill[blue] (0,0) circle (1cm);

\begin{pgfonlayer}{background layer}
\fill[yellow] (-1,-1) rectangle (1,1);
\end{pgfonlayer}

\begin{pgfonlayer}{foreground layer}
\node[white] {foreground};
\end{pgfonlayer}

\begin{pgfonlayer}{background layer}
\fill[black] (-.8,-.8) rectangle (.8,.8);
\end{pgfonlayer}

% On main layer again:
\fill[blue!50] (-.5,-1) rectangle (.5,1);
\end{tikzpicture}
\ENDBOXTEST
\END
106 changes: 106 additions & 0 deletions testfiles/pgfmanual-en-base-matrices.lvt
Original file line number Diff line number Diff line change
@@ -0,0 +1,106 @@
\documentclass{minimal}
\input{pgf-regression-test}
\RequirePackage{fp,pgf,tikz,xcolor}
\begin{document}

\BEGINBOXTEST{pgfmanual-en-base-matrices-1}
\begin{tikzpicture}[x=3mm,y=3mm,fill=blue!50]
\def\atorig#1{\node[black] at (0,0) {\tiny #1};}

\pgfmatrix{rectangle}{center}{mymatrix}
{\pgfusepath{}}{\pgfpointorigin}{}
{
\fill (0,-3) rectangle (1,1);\atorig1 \pgfmatrixnextcell
\fill (-1,0) rectangle (1,1);\atorig2 \pgfmatrixnextcell
\fill (-1,-2) rectangle (0,0);\atorig3 \pgfmatrixnextcell
\fill (-1,-1) rectangle (0,3);\atorig4 \\
\fill (-1,0) rectangle (4,1);\atorig5 \pgfmatrixnextcell
\fill (0,-1) rectangle (1,1);\atorig6 \pgfmatrixnextcell
\fill (0,0) rectangle (1,4);\atorig7 \pgfmatrixnextcell
\fill (-1,-1) rectangle (0,0);\atorig8 \\
}
\end{tikzpicture}
\ENDBOXTEST

\BEGINBOXTEST{pgfmanual-en-base-matrices-2}
\begin{tikzpicture}
\pgfmatrix{rectangle}{center}{mymatrix}
{\pgfusepath{}}{\pgfpointorigin}{}
{
\node {a}; \pgfmatrixnextcell \node {b}; \pgfmatrixendrow
\node {c}; \pgfmatrixnextcell \node {d}; \pgfmatrixendrow
}
\end{tikzpicture}
\ENDBOXTEST

\BEGINBOXTEST{pgfmanual-en-base-matrices-3}
\begin{tikzpicture}[every node/.style=draw]
\pgfsetmatrixcolumnsep{1mm}
\pgfmatrix{rectangle}{center}{mymatrix}
{\pgfusepath{}}{\pgfpointorigin}{\let\&=\pgfmatrixnextcell}
{
\node {8}; \&[2mm] \node{1}; \&[-1mm] \node {6}; \\
\node {3}; \& \node{5}; \& \node {7}; \\
\node {4}; \& \node{9}; \& \node {2}; \\
}
\end{tikzpicture}
\ENDBOXTEST

\BEGINBOXTEST{pgfmanual-en-base-matrices-4}
\begin{tikzpicture}[every node/.style=draw]
\pgfsetmatrixcolumnsep{1mm}
\pgfmatrix{rectangle}{center}{mymatrix}
{\pgfusepath{}}{\pgfpointorigin}{\let\&=\pgfmatrixnextcell}
{
\node {8}; \&[2mm] \node(a){1}; \&[1cm,between origins] \node(b){6}; \\
\node {3}; \& \node {5}; \& \node {7}; \\
\node {4}; \& \node {9}; \& \node {2}; \\
}
\draw [<->,red,thick,every node/.style=] (a.center) -- (b.center)
node [above,midway] {11mm};
\end{tikzpicture}
\ENDBOXTEST

\BEGINBOXTEST{pgfmanual-en-base-matrices-5}
\begin{tikzpicture}[every node/.style=draw]
\pgfsetmatrixcolumnsep{1cm,between origins}
\pgfmatrix{rectangle}{center}{mymatrix}
{\pgfusepath{}}{\pgfpointorigin}{\let\&=\pgfmatrixnextcell}
{
\node (a) {8}; \& \node (b) {1}; \&[between borders] \node (c) {6}; \\
\node {3}; \& \node {5}; \& \node {7}; \\
\node {4}; \& \node {9}; \& \node {2}; \\
}
\begin{scope}[every node/.style=]
\draw [<->,red,thick] (a.center) -- (b.center) node [above,midway] {10mm};
\draw [<->,red,thick] (b.east) -- (c.west) node [above,midway]
{10mm};
\end{scope}
\end{tikzpicture}
\ENDBOXTEST

\BEGINBOXTEST{pgfmanual-en-base-matrices-6}
\begin{tikzpicture}
\def\pgfmatrixemptycode{\node{empty};}
\pgfmatrix{rectangle}{center}{mymatrix}
{\pgfusepath{}}{\pgfpointorigin}{\let\&=\pgfmatrixnextcell}
{
\node {a}; \& \& \node {b}; \\
\& \node{c}; \& \node {d}; \& \\
}
\end{tikzpicture}
\ENDBOXTEST

\BEGINBOXTEST{pgfmanual-en-base-matrices-7}
\begin{tikzpicture}
\def\pgfmatrixbegincode{\node[draw]\bgroup}
\def\pgfmatrixendcode{\egroup;}
\pgfmatrix{rectangle}{center}{mymatrix}
{\pgfusepath{}}{\pgfpointorigin}{\let\&=\pgfmatrixnextcell}
{
a \& b \& c \\
d \& \& e \\
}
\end{tikzpicture}
\ENDBOXTEST
\END
211 changes: 211 additions & 0 deletions testfiles/pgfmanual-en-base-nodes.lvt
Original file line number Diff line number Diff line change
@@ -0,0 +1,211 @@
\documentclass{minimal}
\input{pgf-regression-test}
\RequirePackage{fp,pgf,tikz,xcolor}

\usetikzlibrary{shapes}
\usetikzlibrary{scopes}
\usetikzlibrary{shapes.geometric}

\begin{document}

\BEGINBOXTEST{pgfmanual-en-base-nodes-1}
\begin{tikzpicture}
\draw[help lines] (0,0) grid (4,3);
{
\pgftransformshift{\pgfpoint{1.5cm}{1cm}}
\pgfnode{rectangle}{north}{Hello World}{hellonode}{\pgfusepath{stroke}}
}
{
\color{red!20}
\pgftransformrotate{10}
\pgftransformshift{\pgfpoint{3cm}{1cm}}
\pgfnode{rectangle}{center}
{\color{black}Hello World}{hellonode}{\pgfusepath{fill}}
}
\end{tikzpicture}
\ENDBOXTEST

\BEGINBOXTEST{pgfmanual-en-base-nodes-2}
\begin{tikzpicture}
\draw[help lines] (0,0) grid (4,3);
{
\color{red!20}
\pgftransformrotate{10}
\pgftransformshift{\pgfpoint{3cm}{1cm}}
\pgftransformresetnontranslations
\pgfnode{rectangle}{center}
{\color{black}Hello World}{hellonode}{\pgfusepath{fill}}
}
\end{tikzpicture}
\ENDBOXTEST

\BEGINBOXTEST{pgfmanual-en-base-nodes-3}
\setbox\pgfnodeparttextbox=\hbox{$q_1$}
\setbox\pgfnodepartlowerbox=\hbox{01}
\begin{pgfpicture}
\pgfmultipartnode{circle split}{center}{my state}{\pgfusepath{stroke}}
\end{pgfpicture}
\ENDBOXTEST

\BEGINBOXTEST{pgfmanual-en-base-nodes-6}
\begin{tikzpicture}
\draw[help lines] (-2,0) grid (2,1);

\pgfset{minimum width=3cm}
\pgfnode{rectangle}{center}{Hello World}{}{\pgfusepath{stroke}}
\end{tikzpicture}
\ENDBOXTEST

\BEGINBOXTEST{pgfmanual-en-base-nodes-7}
\begin{tikzpicture}
\draw[help lines] (-2,0) grid (2,1);

\pgfset{inner xsep=1cm}
\pgfnode{rectangle}{center}{Hello World}{}{\pgfusepath{stroke}}
\end{tikzpicture}
\ENDBOXTEST

\BEGINBOXTEST{pgfmanual-en-base-nodes-8}
\begin{tikzpicture}
\draw[help lines] (-2,0) grid (2,1);

\pgfset{outer xsep=.5cm}
\pgfnode{rectangle}{center}{Hello World}{x}{\pgfusepath{stroke}}

\pgfpathcircle{\pgfpointanchor{x}{north}}{2pt}
\pgfpathcircle{\pgfpointanchor{x}{south}}{2pt}
\pgfpathcircle{\pgfpointanchor{x}{east}}{2pt}
\pgfpathcircle{\pgfpointanchor{x}{west}}{2pt}
\pgfpathcircle{\pgfpointanchor{x}{north east}}{2pt}
\pgfusepath{fill}
\end{tikzpicture}
\ENDBOXTEST

\BEGINBOXTEST{pgfmanual-en-base-nodes-9}
\newbox\mybox

\def\mysaver{
\global\setbox\mybox=\box\pgfpositionnodelaterbox
\global\let\myname=\pgfpositionnodelatername
\global\let\myminx=\pgfpositionnodelaterminx
\global\let\myminy=\pgfpositionnodelaterminy
\global\let\mymaxx=\pgfpositionnodelatermaxx
\global\let\mymaxy=\pgfpositionnodelatermaxy
}

\begin{tikzpicture}
{
\pgfpositionnodelater{\mysaver}
\node [fill=blue!20,below,rotate=30] (hi) {Hello world};
}
\draw [help lines] (0,0) grid (3,2);

\let\pgfpositionnodelatername=\myname
\let\pgfpositionnodelaterminx=\myminx
\let\pgfpositionnodelaterminy=\myminy
\let\pgfpositionnodelatermaxx=\mymaxx
\let\pgfpositionnodelatermaxy=\mymaxy
\setbox\pgfpositionnodelaterbox=\box\mybox
\pgfpositionnodenow{\pgfqpoint{2cm}{2cm}}

\draw (hi) -- (0,0);
\end{tikzpicture}
\ENDBOXTEST

\BEGINBOXTEST{pgfmanual-en-base-nodes-10}
\begin{pgfpicture}
\pgftransformrotate{30}
\pgfnode{rectangle}{center}{Hello World!}{x}{\pgfusepath{stroke}}

\pgfpathcircle{\pgfpointanchor{x}{north}}{2pt}
\pgfpathcircle{\pgfpointanchor{x}{south}}{2pt}
\pgfpathcircle{\pgfpointanchor{x}{east}}{2pt}
\pgfpathcircle{\pgfpointanchor{x}{west}}{2pt}
\pgfpathcircle{\pgfpointanchor{x}{north east}}{2pt}
\pgfusepath{fill}
\end{pgfpicture}
\ENDBOXTEST

\BEGINBOXTEST{pgfmanual-en-base-nodes-11}
\makeatletter
\begin{pgfpicture}
\pgftransformrotate{30}
\pgfnode{rectangle}{center}{Hello World!}{x}{\pgfusepath{stroke}}

{
\pgftransformreset
\pgfpointanchor{x}{east}
\xdef\mycoordinate{\noexpand\pgfpoint{\the\pgf@x}{\the\pgf@y}}
}

\pgfpathcircle{\mycoordinate}{2pt}
\pgfusepath{fill}
\end{pgfpicture}
\ENDBOXTEST

\BEGINBOXTEST{pgfmanual-en-base-nodes-12}
\begin{pgfpicture}
\begin{pgfscope}
\pgftransformrotate{30}
\pgfnode{rectangle}{center}{Hello World!}{x}{\pgfusepath{stroke}}
\end{pgfscope}
\pgfpathcircle{\pgfpointshapeborder{x}{\pgfpoint{2cm}{1cm}}}{2pt}
\pgfpathcircle{\pgfpoint{2cm}{1cm}}{2pt}
\pgfpathcircle{\pgfpointshapeborder{x}{\pgfpoint{-1cm}{1cm}}}{2pt}
\pgfpathcircle{\pgfpoint{-1cm}{1cm}}{2pt}
\pgfusepath{fill}
\end{pgfpicture}
\ENDBOXTEST

\BEGINBOXTEST{pgfmanual-en-base-nodes-15}
\begin{tikzpicture}
\draw [help lines] (0,0) grid (3,2);
{ [local bounding box=outer box]
\draw (1,1) circle (.5) [local bounding box=inner box] (2,2) circle (.5);
}
\draw (outer box.south west) rectangle (outer box.north east);
\draw[red] (inner box.south west) rectangle (inner box.north east);
\end{tikzpicture}
\ENDBOXTEST

\BEGINBOXTEST{pgfmanual-en-base-nodes-30}
\makeatletter
\pgfdeclareshape{document}{
\inheritsavedanchors[from=rectangle] % this is nearly a rectangle
\inheritanchorborder[from=rectangle]
\inheritanchor[from=rectangle]{center}
\inheritanchor[from=rectangle]{north}
\inheritanchor[from=rectangle]{south}
\inheritanchor[from=rectangle]{west}
\inheritanchor[from=rectangle]{east}
% ... and possibly more
\backgroundpath{% this is new
% store lower right in xa/ya and upper right in xb/yb
\southwest \pgf@xa=\pgf@x \pgf@ya=\pgf@y
\northeast \pgf@xb=\pgf@x \pgf@yb=\pgf@y
% compute corner of ``flipped page''
\pgf@xc=\pgf@xb \advance\pgf@xc by-5pt % this should be a parameter
\pgf@yc=\pgf@yb \advance\pgf@yc by-5pt
% construct main path
\pgfpathmoveto{\pgfpoint{\pgf@xa}{\pgf@ya}}
\pgfpathlineto{\pgfpoint{\pgf@xa}{\pgf@yb}}
\pgfpathlineto{\pgfpoint{\pgf@xc}{\pgf@yb}}
\pgfpathlineto{\pgfpoint{\pgf@xb}{\pgf@yc}}
\pgfpathlineto{\pgfpoint{\pgf@xb}{\pgf@ya}}
\pgfpathclose
% add little corner
\pgfpathmoveto{\pgfpoint{\pgf@xc}{\pgf@yb}}
\pgfpathlineto{\pgfpoint{\pgf@xc}{\pgf@yc}}
\pgfpathlineto{\pgfpoint{\pgf@xb}{\pgf@yc}}
\pgfpathlineto{\pgfpoint{\pgf@xc}{\pgf@yc}}
}
}\hskip-1.2cm
\begin{tikzpicture}
\node[shade,draw,shape=document,inner sep=2ex] (x) {Remark};
\node[fill=yellow!80!black,draw,ellipse,double]
at ([shift=(-80:3cm)]x) (y) {Use Case};

\draw[dashed] (x) -- (y);
\end{tikzpicture}
\ENDBOXTEST
\END
353 changes: 353 additions & 0 deletions testfiles/pgfmanual-en-base-paths.lvt
Original file line number Diff line number Diff line change
@@ -0,0 +1,353 @@
\documentclass{minimal}
\input{pgf-regression-test}
\RequirePackage{fp,pgf,tikz,xcolor}
\begin{document}

\BEGINBOXTEST{pgfmanual-en-base-paths-1}
\begin{tikzpicture}[scale=2]
\draw[thick,red]
(0,0) coordinate (a)
-- coordinate (ab) (1,.5) coordinate (b)
.. coordinate (bc) controls +(up:1cm) and +(left:1cm) .. (3,1) coordinate (c)
(0,1) -- (2,1) -- coordinate (x) (1,2) -- cycle;

\draw (a) node[below] {start part 1}
(ab) node[below right] {straight segment}
(b) node[right] {end first segment}
(c) node[right] {end part 1}
(x) node[above right] {part 2 (closed)};
\end{tikzpicture}
\ENDBOXTEST

\BEGINBOXTEST{pgfmanual-en-base-paths-2}
\begin{pgfpicture}
\pgfpathmoveto{\pgfpointorigin}
\pgfpathlineto{\pgfpoint{1cm}{1cm}}
\pgfpathlineto{\pgfpoint{2cm}{1cm}}
\pgfpathlineto{\pgfpoint{3cm}{0.5cm}}
\pgfpathlineto{\pgfpoint{3cm}{0cm}}
\pgfsetfillcolor{yellow!80!black}
\pgfusepath{fill,stroke}
\end{pgfpicture}
\ENDBOXTEST

\BEGINBOXTEST{pgfmanual-en-base-paths-3}
\begin{pgfpicture}
\pgfpathmoveto{\pgfpointorigin}
\pgfpathlineto{\pgfpoint{1cm}{1cm}}
\pgfpathlineto{\pgfpoint{2cm}{1cm}}
\pgfpathmoveto{\pgfpoint{2cm}{1cm}} % New part
\pgfpathlineto{\pgfpoint{3cm}{0.5cm}}
\pgfpathlineto{\pgfpoint{3cm}{0cm}}
\pgfsetfillcolor{yellow!80!black}
\pgfusepath{fill,stroke}
\end{pgfpicture}
\ENDBOXTEST

\BEGINBOXTEST{pgfmanual-en-base-paths-4}
\begin{pgfpicture}
\pgfpathmoveto{\pgfpointorigin}
\pgfpathlineto{\pgfpoint{1cm}{1cm}}
\pgfpathlineto{\pgfpoint{2cm}{1cm}}
\pgfsetfillcolor{yellow!80!black}
\pgfusepath{fill,stroke}
\end{pgfpicture}
\ENDBOXTEST

\BEGINBOXTEST{pgfmanual-en-base-paths-5}
\begin{pgfpicture}
\pgfpathmoveto{\pgfpointorigin}
\pgfpathcurveto
{\pgfpoint{1cm}{1cm}}{\pgfpoint{2cm}{1cm}}{\pgfpoint{3cm}{0cm}}
\pgfsetfillcolor{yellow!80!black}
\pgfusepath{fill,stroke}
\end{pgfpicture}
\ENDBOXTEST

\BEGINBOXTEST{pgfmanual-en-base-paths-6}
\begin{pgfpicture}
\pgfpathmoveto{\pgfpointorigin}
\pgfpathquadraticcurveto
{\pgfpoint{1cm}{1cm}}{\pgfpoint{2cm}{0cm}}
\pgfsetfillcolor{yellow!80!black}
\pgfusepath{fill,stroke}
\end{pgfpicture}
\ENDBOXTEST

\BEGINBOXTEST{pgfmanual-en-base-paths-7}
\begin{tikzpicture}
\draw [thin] (0,0) .. controls (0,2) and (3,0) .. (3,2);
\pgfpathcurvebetweentime{0.25}{0.9}{\pgfpointxy{0}{0}}{\pgfpointxy{0}{2}}
{\pgfpointxy{3}{0}}{\pgfpointxy{3}{2}}
\pgfsetstrokecolor{red}
\pgfsetstrokeopacity{0.5}
\pgfsetlinewidth{2pt}
\pgfusepath{stroke}
\end{tikzpicture}
\ENDBOXTEST

\BEGINBOXTEST{pgfmanual-en-base-paths-8}
\begin{tikzpicture}
\draw[help lines] (0,0) grid (3,2);
\pgfsetlinewidth{5pt}
\pgfpathmoveto{\pgfpoint{1cm}{1cm}}
\pgfpathlineto{\pgfpoint{0cm}{-1cm}}
\pgfpathlineto{\pgfpoint{1cm}{-1cm}}
\pgfpathclose
\pgfpathmoveto{\pgfpoint{2.5cm}{1cm}}
\pgfpathlineto{\pgfpoint{1.5cm}{-1cm}}
\pgfpathlineto{\pgfpoint{2.5cm}{-1cm}}
\pgfpathlineto{\pgfpoint{2.5cm}{1cm}}
\pgfusepath{stroke}
\end{tikzpicture}
\ENDBOXTEST

\BEGINBOXTEST{pgfmanual-en-base-paths-9}
\begin{tikzpicture}
\draw[help lines] (0,0) grid (3,2);
\pgfpathmoveto{\pgfpointorigin}
\pgfpathlineto{\pgfpoint{0cm}{1cm}}
\pgfpatharc{180}{90}{.5cm}
\pgfpathlineto{\pgfpoint{3cm}{1.5cm}}
\pgfpatharc{90}{-45}{.5cm}
\pgfusepath{fill}
\end{tikzpicture}
\ENDBOXTEST

\BEGINBOXTEST{pgfmanual-en-base-paths-10}
\begin{tikzpicture}
\draw[help lines] (0,0) grid (3,2);
\pgfpathmoveto{\pgfpointorigin}
\pgfpatharc{180}{45}{2cm and 1cm}
\pgfusepath{draw}
\end{tikzpicture}
\ENDBOXTEST

\BEGINBOXTEST{pgfmanual-en-base-paths-11}
\begin{tikzpicture}
\draw[help lines] (0,0) grid (3,2);
\pgftransformrotate{30}
\pgfpathmoveto{\pgfpointorigin}
\pgfpatharc{180}{45}{2cm and 1cm}
\pgfusepath{draw}
\end{tikzpicture}
\ENDBOXTEST

\BEGINBOXTEST{pgfmanual-en-base-paths-12}
\begin{tikzpicture}
\draw[help lines] (0,0) grid (3,2);
\draw (0,0) -- (2cm,5mm) (0,0) -- (0cm,1cm);

\pgfpathmoveto{\pgfpoint{2cm}{5mm}}
\pgfpatharcaxes{0}{90}{\pgfpoint{2cm}{5mm}}{\pgfpoint{0cm}{1cm}}
\pgfusepath{draw}
\end{tikzpicture}
\ENDBOXTEST

\BEGINBOXTEST{pgfmanual-en-base-paths-13}
\begin{tikzpicture}
\draw[help lines] (0,0) grid (3,2);

\pgfpathmoveto{\pgfpoint{0mm}{20mm}}
\pgfpatharcto{3cm}{1cm}{0}{0}{0}{\pgfpoint{3cm}{1cm}}
\pgfusepath{draw}
\end{tikzpicture}
\ENDBOXTEST

\BEGINBOXTEST{pgfmanual-en-base-paths-14}
\begin{tikzpicture}
\pgfsetlinewidth{2pt}
% Flags 0 0: red
\pgfsetstrokecolor{red}
\pgfpathmoveto{\pgfpointorigin}
\pgfpatharcto{20pt}{10pt}{0}{0}{0}{\pgfpoint{20pt}{10pt}}
\pgfusepath{stroke}
% Flags 0 1: blue
\pgfsetstrokecolor{blue}
\pgfpathmoveto{\pgfpointorigin}
\pgfpatharcto{20pt}{10pt}{0}{0}{1}{\pgfpoint{20pt}{10pt}}
\pgfusepath{stroke}
% Flags 1 0: orange
\pgfsetstrokecolor{orange}
\pgfpathmoveto{\pgfpointorigin}
\pgfpatharcto{20pt}{10pt}{0}{1}{0}{\pgfpoint{20pt}{10pt}}
\pgfusepath{stroke}
% Flags 1 1: black
\pgfsetstrokecolor{black}
\pgfpathmoveto{\pgfpointorigin}
\pgfpatharcto{20pt}{10pt}{0}{1}{1}{\pgfpoint{20pt}{10pt}}
\pgfusepath{stroke}
\end{tikzpicture}
\ENDBOXTEST

\BEGINBOXTEST{pgfmanual-en-base-paths-15}
\begin{tikzpicture}
\draw[help lines] (0,0) grid (3,2);

\def\cx{1.5cm}% center x
\def\cy{1cm}% center y
\def\startangle{0}%
\def\endangle{270}%
\def\a{1.5cm}% xradius
\def\b{0.5cm}% yradius
\pgfmathparse{\a/\b}\let\abratio=\pgfmathresult
\pgfmathparse{\b/\a}\let\baratio=\pgfmathresult
%
% start point:
\pgfpathmoveto{\pgfpoint{\cx+\a*cos(\startangle)}{\cy+\b*sin(\startangle)}}%
\pgfpatharctoprecomputed
{\pgfpoint{\cx}{\cy}}
{\startangle}
{\endangle}
{\pgfpoint{\cx+\a*cos(\endangle)}{\cy+\b*sin(\endangle)}}% end point
{\a}
{\b}
{\abratio}
{\baratio}
\pgfusepath{draw}
\end{tikzpicture}
\ENDBOXTEST

\BEGINBOXTEST{pgfmanual-en-base-paths-16}
\begin{tikzpicture}
\draw[help lines] (0,0) grid (3,2);
\pgfpathellipse{\pgfpoint{1cm}{0cm}}
{\pgfpoint{1.5cm}{0cm}}
{\pgfpoint{0cm}{1cm}}
\pgfusepath{draw}
\color{red}
\pgfpathellipse{\pgfpoint{1cm}{0cm}}
{\pgfpoint{1cm}{1cm}}
{\pgfpoint{-0.5cm}{0.5cm}}
\pgfusepath{draw}
\end{tikzpicture}
\ENDBOXTEST

\BEGINBOXTEST{pgfmanual-en-base-paths-17}
\begin{tikzpicture}
\draw[help lines] (0,0) grid (3,2);
\pgfpathrectangle{\pgfpoint{1cm}{0cm}}{\pgfpoint{1.5cm}{1cm}}
\pgfpathrectangle{\pgfpoint{1.5cm}{0.25cm}}{\pgfpoint{1.5cm}{1cm}}
\pgfpathrectangle{\pgfpoint{2cm}{0.5cm}}{\pgfpoint{1.5cm}{1cm}}
\pgfusepath{draw}
\end{tikzpicture}
\ENDBOXTEST

\BEGINBOXTEST{pgfmanual-en-base-paths-18}
\begin{tikzpicture}
\draw[help lines] (0,0) grid (3,2);
\pgfpathrectanglecorners{\pgfpoint{1cm}{0cm}}{\pgfpoint{1.5cm}{1cm}}
\pgfusepath{draw}
\end{tikzpicture}
\ENDBOXTEST

\BEGINBOXTEST{pgfmanual-en-base-paths-19}
\begin{pgfpicture}
\pgfsetlinewidth{0.8pt}
\pgfpathgrid[step={\pgfpoint{1cm}{1cm}}]
{\pgfpoint{-3mm}{-3mm}}{\pgfpoint{33mm}{23mm}}
\pgfusepath{stroke}
\pgfsetlinewidth{0.4pt}
\pgfpathgrid[stepx=1mm,stepy=1mm]
{\pgfpoint{-1.5mm}{-1.5mm}}{\pgfpoint{31.5mm}{21.5mm}}
\pgfusepath{stroke}
\end{pgfpicture}
\ENDBOXTEST

\BEGINBOXTEST{pgfmanual-en-base-paths-20}
\begin{pgfpicture}
\pgftransformrotate{10}
\pgfpathgrid[stepx=1mm,stepy=2mm]{\pgfpoint{0mm}{0mm}}{\pgfpoint{30mm}{30mm}}
\pgfusepath{stroke}
\end{pgfpicture}
\ENDBOXTEST

\BEGINBOXTEST{pgfmanual-en-base-paths-21}
\begin{pgfpicture}
% Half-parabola going ``up and right''
\pgfpathmoveto{\pgfpointorigin}
\pgfpathparabola{\pgfpointorigin}{\pgfpoint{2cm}{4cm}}
\color{red}
\pgfusepath{stroke}

% Half-parabola going ``down and right''
\pgfpathmoveto{\pgfpointorigin}
\pgfpathparabola{\pgfpoint{-2cm}{4cm}}{\pgfpointorigin}
\color{blue}
\pgfusepath{stroke}

% Full parabola
\pgfpathmoveto{\pgfpoint{-2cm}{2cm}}
\pgfpathparabola{\pgfpoint{1cm}{-1cm}}{\pgfpoint{2cm}{4cm}}
\color{orange}
\pgfusepath{stroke}
\end{pgfpicture}
\ENDBOXTEST

\BEGINBOXTEST{pgfmanual-en-base-paths-22}
\begin{tikzpicture}
\draw[help lines] (0,0) grid (3,1);
\pgfpathmoveto{\pgfpoint{1cm}{0cm}}
\pgfpathsine{\pgfpoint{1cm}{1cm}}
\pgfusepath{stroke}

\color{red}
\pgfpathmoveto{\pgfpoint{1cm}{0cm}}
\pgfpathsine{\pgfpoint{-2cm}{-2cm}}
\pgfusepath{stroke}
\end{tikzpicture}
\ENDBOXTEST

\BEGINBOXTEST{pgfmanual-en-base-paths-23}
\begin{pgfpicture}
\pgfpathmoveto{\pgfpoint{0cm}{0cm}}
\pgfpathsine{\pgfpoint{1cm}{1cm}}
\pgfpathcosine{\pgfpoint{1cm}{-1cm}}
\pgfpathsine{\pgfpoint{1cm}{-1cm}}
\pgfpathcosine{\pgfpoint{1cm}{1cm}}
\pgfsetfillcolor{yellow!80!black}
\pgfusepath{fill,stroke}
\end{pgfpicture}
\ENDBOXTEST

\BEGINBOXTEST{pgfmanual-en-base-paths-24}
\begin{tikzpicture}
\draw[help lines] (0,0) grid (3,2);

\pgfsetcornersarced{\pgfpoint{5mm}{5mm}}
\pgfpathrectanglecorners{\pgfpointorigin}{\pgfpoint{3cm}{2cm}}
\pgfusepath{stroke}
\end{tikzpicture}
\ENDBOXTEST

\BEGINBOXTEST{pgfmanual-en-base-paths-25}
\begin{tikzpicture}
\draw[help lines] (0,0) grid (3,2);

\pgfsetcornersarced{\pgfpoint{10mm}{5mm}}
% 10mm entering,
% 5mm leaving.
\pgfpathmoveto{\pgfpointorigin}
\pgfpathlineto{\pgfpoint{0cm}{2cm}}
\pgfpathlineto{\pgfpoint{3cm}{2cm}}
\pgfpathcurveto
{\pgfpoint{3cm}{0cm}}
{\pgfpoint{2cm}{0cm}}
{\pgfpoint{1cm}{0cm}}
\pgfusepath{stroke}
\end{tikzpicture}
\ENDBOXTEST

\BEGINBOXTEST{pgfmanual-en-base-paths-26}
\begin{pgfpicture}
\pgfsetcornersarced{\pgfpoint{4pt}{4pt}}
\pgfpathmoveto{\pgfpointpolar{0}{1cm}}
\pgfpathlineto{\pgfpointpolar{72}{1cm}}
\pgfpathlineto{\pgfpointpolar{144}{1cm}}
\pgfpathlineto{\pgfpointpolar{216}{1cm}}
\pgfpathlineto{\pgfpointpolar{288}{1cm}}
\pgfpathclose
\pgfusepath{stroke}
\end{pgfpicture}
\ENDBOXTEST
\END
114 changes: 114 additions & 0 deletions testfiles/pgfmanual-en-base-patterns.lvt
Original file line number Diff line number Diff line change
@@ -0,0 +1,114 @@
\documentclass{minimal}
\input{pgf-regression-test}
\RequirePackage{fp,pgf,tikz,xcolor}

\usetikzlibrary{patterns}
\usetikzlibrary{patterns}
\usetikzlibrary{patterns}
\usetikzlibrary{patterns}
\pgfdeclarepatternformonly{stars}
{\pgfpointorigin}{\pgfpoint{1cm}{1cm}}
{\pgfpoint{1cm}{1cm}}
{
\pgftransformshift{\pgfpoint{.5cm}{.5cm}}
\pgfpathmoveto{\pgfpointpolar{0}{4mm}}
\pgfpathlineto{\pgfpointpolar{144}{4mm}}
\pgfpathlineto{\pgfpointpolar{288}{4mm}}
\pgfpathlineto{\pgfpointpolar{72}{4mm}}
\pgfpathlineto{\pgfpointpolar{216}{4mm}}
\pgfpathclose%
\pgfusepath{fill}
}
\pgfdeclarepatterninherentlycolored{green stars}
{\pgfpointorigin}{\pgfpoint{1cm}{1cm}}
{\pgfpoint{1cm}{1cm}}
{
\pgfsetfillcolor{green!50!black}
\pgftransformshift{\pgfpoint{.5cm}{.5cm}}
\pgfpathmoveto{\pgfpointpolar{0}{4mm}}
\pgfpathlineto{\pgfpointpolar{144}{4mm}}
\pgfpathlineto{\pgfpointpolar{288}{4mm}}
\pgfpathlineto{\pgfpointpolar{72}{4mm}}
\pgfpathlineto{\pgfpointpolar{216}{4mm}}
\pgfpathclose%
\pgfusepath{stroke,fill}
}

\begin{document}

\BEGINBOXTEST{pgfmanual-en-base-patterns-1}
\pgfdeclarepatternformonly{stars}
{\pgfpointorigin}{\pgfpoint{1cm}{1cm}}
{\pgfpoint{1cm}{1cm}}
{
\pgftransformshift{\pgfpoint{.5cm}{.5cm}}
\pgfpathmoveto{\pgfpointpolar{0}{4mm}}
\pgfpathlineto{\pgfpointpolar{144}{4mm}}
\pgfpathlineto{\pgfpointpolar{288}{4mm}}
\pgfpathlineto{\pgfpointpolar{72}{4mm}}
\pgfpathlineto{\pgfpointpolar{216}{4mm}}
\pgfpathclose%
\pgfusepath{fill}
}
\begin{tikzpicture}
\filldraw[pattern=stars] (0,0) rectangle (1.5,2);
\filldraw[pattern=stars,pattern color=red]
(1.5,0) rectangle (3,2);
\end{tikzpicture}
\ENDBOXTEST

\BEGINBOXTEST{pgfmanual-en-base-patterns-2}
\pgfdeclarepatternformonly[/tikz/radius,\thickness,\size]{rings}
{\pgfpoint{-0.5*\size}{-0.5*\size}}
{\pgfpoint{0.5*\size}{0.5*\size}}
{\pgfpoint{\size}{\size}}
{
\pgfsetlinewidth{\thickness}
\pgfpathcircle\pgfpointorigin{\pgfkeysvalueof{/tikz/radius}}
\pgfusepath{stroke}
}
\newdimen\thickness
\tikzset{
radius/.initial=4pt,
size/.store in=\size, size=20pt,
thickness/.code={\thickness=#1},
thickness=0.75pt
}
\begin{tikzpicture}[rings/.style={pattern=rings}]
\filldraw [rings, radius=2pt, size=6pt] (0,0) rectangle +(1.5,2);
\filldraw [rings, radius=2pt, size=8pt] (2,0) rectangle +(1.5,2);
\filldraw [rings, radius=6pt, thickness=2pt] (0,2.5) rectangle +(1.5,2);
\filldraw [rings, radius=8pt, thickness=4pt] (2,2.5) rectangle +(1.5,2);
\end{tikzpicture}
\ENDBOXTEST

\BEGINBOXTEST{pgfmanual-en-base-patterns-3}
\pgfdeclarepatterninherentlycolored{green stars}
{\pgfpointorigin}{\pgfpoint{1cm}{1cm}}
{\pgfpoint{1cm}{1cm}}
{
\pgfsetfillcolor{green!50!black}
\pgftransformshift{\pgfpoint{.5cm}{.5cm}}
\pgfpathmoveto{\pgfpointpolar{0}{4mm}}
\pgfpathlineto{\pgfpointpolar{144}{4mm}}
\pgfpathlineto{\pgfpointpolar{288}{4mm}}
\pgfpathlineto{\pgfpointpolar{72}{4mm}}
\pgfpathlineto{\pgfpointpolar{216}{4mm}}
\pgfpathclose%
\pgfusepath{stroke,fill}
}
\begin{tikzpicture}
\filldraw[pattern=green stars] (0,0) rectangle (3,2);
\end{tikzpicture}
\ENDBOXTEST

\BEGINBOXTEST{pgfmanual-en-base-patterns-4}
\begin{tikzpicture}
\pgfsetfillpattern{stars}{red}
\filldraw (0,0) rectangle (1.5,2);

\pgfsetfillpattern{green stars}{red}
\filldraw (1.5,0) rectangle (3,2);
\end{tikzpicture}
\ENDBOXTEST
\END
112 changes: 112 additions & 0 deletions testfiles/pgfmanual-en-base-plots.lvt
Original file line number Diff line number Diff line change
@@ -0,0 +1,112 @@
\documentclass{minimal}
\input{pgf-regression-test}
\RequirePackage{fp,pgf,tikz,xcolor}
\begin{document}

\BEGINBOXTEST{pgfmanual-en-base-plots-6}
\begin{tikzpicture}[x=3.8cm/360]
\pgfplothandlerlineto
\pgfplotfunction{\x}{0,5,...,360}{\pgfpointxy{\x}{sin(\x)+sin(3*\x)}}
\pgfusepath{stroke}
\end{tikzpicture}
\ENDBOXTEST

\BEGINBOXTEST{pgfmanual-en-base-plots-7}
\begin{tikzpicture}[y=3cm/360]
\pgfplothandlerlineto
\pgfplotfunction{\y}{0,5,...,360}{\pgfpointxyz{sin(2*\y)}{\y}{cos(2*\y)}}
\pgfusepath{stroke}
\end{tikzpicture}
\ENDBOXTEST

\BEGINBOXTEST{pgfmanual-en-base-plots-9}
\begin{tikzpicture}
\draw[help lines] (0,-1) grid (4,1);
\pgfplothandlerlineto
\pgfplotgnuplot[plots/pgfplotgnuplot-example]{plot [x=0:3.5] x*sin(x)}
\pgfusepath{stroke}
\end{tikzpicture}
\ENDBOXTEST

\BEGINBOXTEST{pgfmanual-en-base-plots-11}
\begin{pgfpicture}
\pgfpathmoveto{\pgfpointorigin}
\pgfplothandlerlineto
\pgfplotstreamstart
\pgfplotstreampoint{\pgfpoint{1cm}{0cm}}
\pgfplotstreampoint{\pgfpoint{2cm}{1cm}}
\pgfplotstreampoint{\pgfpoint{3cm}{2cm}}
\pgfplotstreampoint{\pgfpoint{1cm}{2cm}}
\pgfplotstreamend
\pgfusepath{stroke}
\end{pgfpicture}
\ENDBOXTEST

\BEGINBOXTEST{pgfmanual-en-base-plots-12}
\begin{pgfpicture}
\pgfpathmoveto{\pgfpointorigin}
\pgfsetlinetofirstplotpoint
\pgfplothandlerlineto
\pgfplotstreamstart
\pgfplotstreampoint{\pgfpoint{1cm}{0cm}}
\pgfplotstreampoint{\pgfpoint{2cm}{1cm}}
\pgfplotstreampoint{\pgfpoint{3cm}{2cm}}
\pgfplotstreampoint{\pgfpoint{1cm}{2cm}}
\pgfplotstreamend
\pgfusepath{stroke}
\end{pgfpicture}
\ENDBOXTEST

\BEGINBOXTEST{pgfmanual-en-base-plots-13}
\begin{pgfpicture}
\pgfplothandlerrecord{\mystream}
\pgfplotstreamstart
\pgfplotstreampoint{\pgfpoint{1cm}{0cm}}
\pgfplotstreampoint{\pgfpoint{2cm}{1cm}}
\pgfplotstreampoint{\pgfpoint{3cm}{1cm}}
\pgfplotstreampoint{\pgfpoint{1cm}{2cm}}
\pgfplotstreamend
\pgfplothandlerlineto
\mystream
\pgfplothandlerclosedcurve
\mystream
\pgfusepath{stroke}
\end{pgfpicture}
\ENDBOXTEST

\BEGINBOXTEST{pgfmanual-en-base-plots-15}
\pgfdeclareplothandler{\myhandler}{#1}{
start = Hi #1.,
end = Bye #1.,
}
\myhandler{foo}
\pgfplotstreamstart
\pgfplotstreamend
\myhandler{bar}
\pgfplotstreamstart
\pgfplotstreamend
\ENDBOXTEST

\BEGINBOXTEST{pgfmanual-en-base-plots-16}
\pgfdeclareplothandler{\myhandler}{#1}{
point=\pgfpathcircle{##1}{#1} % ##1 is the coordinate,
% #1 the parameter for \myhandler
}
\begin{pgfpicture}
\myhandler{1pt}
\pgfplotstreamstart
\pgfplotstreampoint{\pgfpoint{0pt}{0pt}}
\pgfplotstreampoint{\pgfpoint{3pt}{3pt}}
\pgfplotstreampoint{\pgfpoint{6pt}{3pt}}
\pgfplotstreampoint{\pgfpoint{9pt}{0pt}}
\pgfplotstreamend
\pgfusepath{stroke}
\myhandler{3pt}
\pgfplotstreamstart
\pgfplotstreampoint{\pgfpoint{0pt}{0pt}}
\pgfplotstreampoint{\pgfpoint{9pt}{0pt}}
\pgfplotstreamend
\pgfusepath{stroke}
\end{pgfpicture}
\ENDBOXTEST
\END
300 changes: 300 additions & 0 deletions testfiles/pgfmanual-en-base-points.lvt
Original file line number Diff line number Diff line change
@@ -0,0 +1,300 @@
\documentclass{minimal}
\input{pgf-regression-test}
\RequirePackage{fp,pgf,tikz,xcolor}

\usetikzlibrary{intersections}

\begin{document}

\BEGINBOXTEST{pgfmanual-en-base-points-1}
\begin{tikzpicture}
\draw[help lines] (0,0) grid (3,2);
\pgfpathcircle{\pgfpoint{1cm}{1cm}} {2pt}
\pgfpathcircle{\pgfpoint{2cm}{5pt}} {2pt}
\pgfpathcircle{\pgfpoint{0pt}{.5in}}{2pt}
\pgfusepath{fill}
\end{tikzpicture}
\ENDBOXTEST

\BEGINBOXTEST{pgfmanual-en-base-points-2}
\begin{tikzpicture}
\draw[help lines] (0,0) grid (3,2);

\foreach \angle in {0,10,...,90}
{\pgfpathcircle{\pgfpointpolar{\angle}{1cm}}{2pt}}
\pgfusepath{fill}
\end{tikzpicture}
\ENDBOXTEST

\BEGINBOXTEST{pgfmanual-en-base-points-3}
\begin{tikzpicture}
\draw[help lines] (0,0) grid (3,2);

\foreach \angle in {0,10,...,90}
{\pgfpathcircle{\pgfpointpolar{\angle}{1cm and 2cm}}{2pt}}
\pgfusepath{fill}
\end{tikzpicture}
\ENDBOXTEST

\BEGINBOXTEST{pgfmanual-en-base-points-4}
\begin{tikzpicture}
\draw[help lines] (0,0) grid (3,2);
\pgfpathmoveto{\pgfpointxy{1}{0}}
\pgfpathlineto{\pgfpointxy{2}{2}}
\pgfusepath{stroke}
\end{tikzpicture}
\ENDBOXTEST

\BEGINBOXTEST{pgfmanual-en-base-points-5}
\begin{tikzpicture}
\draw[help lines] (0,0) grid (3,2);

\pgfpathmoveto{\pgfpointxy{1}{0}}
\pgfpathlineto{\pgfpointxy{2}{2}}
\pgfusepath{stroke}

\color{red}
\pgfsetxvec{\pgfpoint{0.75cm}{0cm}}
\pgfpathmoveto{\pgfpointxy{1}{0}}
\pgfpathlineto{\pgfpointxy{2}{2}}
\pgfusepath{stroke}
\end{tikzpicture}
\ENDBOXTEST

\BEGINBOXTEST{pgfmanual-en-base-points-6}
\begin{tikzpicture}
\draw[help lines] (0,0) grid (3,2);

\begin{scope}[x={(1cm,-5mm)},y=1.5cm]
\foreach \angle in {0,10,...,90}
{\pgfpathcircle{\pgfpointpolarxy{\angle}{1}}{2pt}}
\pgfusepath{fill}
\end{scope}
\end{tikzpicture}
\ENDBOXTEST

\BEGINBOXTEST{pgfmanual-en-base-points-7}
\begin{pgfpicture}
\pgfsetarrowsend{to}

\pgfpathmoveto{\pgfpointorigin}
\pgfpathlineto{\pgfpointxyz{0}{0}{1}}
\pgfusepath{stroke}
\pgfpathmoveto{\pgfpointorigin}
\pgfpathlineto{\pgfpointxyz{0}{1}{0}}
\pgfusepath{stroke}
\pgfpathmoveto{\pgfpointorigin}
\pgfpathlineto{\pgfpointxyz{1}{0}{0}}
\pgfusepath{stroke}
\end{pgfpicture}
\ENDBOXTEST

\BEGINBOXTEST{pgfmanual-en-base-points-8}
\begin{tikzpicture}
\draw [->] (0,0) -- (1,0,0) node [right] {$x$};
\draw [->] (0,0) -- (0,1,0) node [above] {$y$};
\draw [->] (0,0) -- (0,0,1) node [below left] {$z$};

\pgfpathcircle{\pgfpointcylindrical{80}{1}{.5}}{2pt}
\pgfusepath{fill}

\draw[red] (0,0) -- (0,0,.5) -- +(80:1);
\end{tikzpicture}
\ENDBOXTEST

\BEGINBOXTEST{pgfmanual-en-base-points-9}
\begin{tikzpicture}
\pgfsetfillcolor{lightgray}

\foreach \latitude in {-90,-75,...,30}
{
\foreach \longitude in {0,20,...,360}
{
\pgfpathmoveto{\pgfpointspherical{\longitude}{\latitude}{1}}
\pgfpathlineto{\pgfpointspherical{\longitude+20}{\latitude}{1}}
\pgfpathlineto{\pgfpointspherical{\longitude+20}{\latitude+15}{1}}
\pgfpathlineto{\pgfpointspherical{\longitude}{\latitude+15}{1}}
\pgfpathclose
}
\pgfusepath{fill,stroke}
}
\end{tikzpicture}
\ENDBOXTEST

\BEGINBOXTEST{pgfmanual-en-base-points-10}
\begin{tikzpicture}
\draw[help lines] (0,0) grid (3,2);
\pgfpathcircle{\pgfpointadd{\pgfpoint{1cm}{0cm}}{\pgfpoint{1cm}{1cm}}}{2pt}
\pgfusepath{fill}
\end{tikzpicture}
\ENDBOXTEST

\BEGINBOXTEST{pgfmanual-en-base-points-11}
\begin{tikzpicture}
\draw[help lines] (0,0) grid (3,2);
\pgfpathcircle{\pgfpointscale{1.5}{\pgfpoint{1cm}{0cm}}}{2pt}
\pgfusepath{fill}
\end{tikzpicture}
\ENDBOXTEST

\BEGINBOXTEST{pgfmanual-en-base-points-12}
\begin{tikzpicture}
\draw[help lines] (0,0) grid (3,2);
\pgfpathcircle{\pgfpointdiff{\pgfpoint{1cm}{0cm}}{\pgfpoint{1cm}{1cm}}}{2pt}
\pgfusepath{fill}
\end{tikzpicture}
\ENDBOXTEST

\BEGINBOXTEST{pgfmanual-en-base-points-13}
\begin{tikzpicture}
\draw[help lines] (0,0) grid (3,2);
\pgfpathcircle{\pgfpoint{2cm}{1cm}}{2pt}
\pgfpathcircle{\pgfpointscale{20}
{\pgfpointnormalised{\pgfpoint{2cm}{1cm}}}}{2pt}
\pgfusepath{fill}
\end{tikzpicture}
\ENDBOXTEST

\BEGINBOXTEST{pgfmanual-en-base-points-14}
\begin{tikzpicture}
\draw[help lines] (0,0) grid (3,2);
\pgfpathmoveto{\pgfpointorigin}
\pgfpathlineto{\pgfpoint{2cm}{2cm}}
\pgfusepath{stroke}
\foreach \t in {0,0.25,...,1.25}
{\pgftext[at=
\pgfpointlineattime{\t}{\pgfpointorigin}{\pgfpoint{2cm}{2cm}}]{\t}}
\end{tikzpicture}
\ENDBOXTEST

\BEGINBOXTEST{pgfmanual-en-base-points-15}
\begin{tikzpicture}
\draw[help lines] (0,0) grid (3,2);
\pgfpathmoveto{\pgfpointorigin}
\pgfpathlineto{\pgfpoint{3cm}{2cm}}
\pgfusepath{stroke}
\foreach \d in {0pt,20pt,40pt,70pt}
{\pgftext[at=
\pgfpointlineatdistance{\d}{\pgfpointorigin}{\pgfpoint{3cm}{2cm}}]{\d}}
\end{tikzpicture}
\ENDBOXTEST

\BEGINBOXTEST{pgfmanual-en-base-points-16}
\begin{tikzpicture}
\draw[help lines] (0,0) grid (3,2);
\pgfpathmoveto{\pgfpoint{2cm}{1cm}}
\pgfpatharcaxes{0}{60}{\pgfpoint{2cm}{0cm}}{\pgfpoint{0cm}{1cm}}
\pgfusepath{stroke}
\foreach \t in {0,0.25,0.5,0.75,1}
{\pgftext[at=\pgfpointarcaxesattime{\t}{\pgfpoint{0cm}{1cm}}
{\pgfpoint{2cm}{0cm}}{\pgfpoint{0cm}{1cm}}{0}{60}]{\t}}
\end{tikzpicture}
\ENDBOXTEST

\BEGINBOXTEST{pgfmanual-en-base-points-17}
\begin{tikzpicture}
\draw[help lines] (0,0) grid (3,2);
\pgfpathmoveto{\pgfpointorigin}
\pgfpathcurveto
{\pgfpoint{0cm}{2cm}}{\pgfpoint{0cm}{2cm}}{\pgfpoint{3cm}{2cm}}
\pgfusepath{stroke}
\foreach \t in {0,0.25,0.5,0.75,1}
{\pgftext[at=\pgfpointcurveattime{\t}{\pgfpointorigin}
{\pgfpoint{0cm}{2cm}}
{\pgfpoint{0cm}{2cm}}
{\pgfpoint{3cm}{2cm}}]{\t}}
\end{tikzpicture}
\ENDBOXTEST

\BEGINBOXTEST{pgfmanual-en-base-points-18}
\begin{tikzpicture}
\draw[help lines] (0,0) grid (2,1.5);
\pgfpathrectanglecorners{\pgfpoint{-1cm}{-1.25cm}}{\pgfpoint{1cm}{1.25cm}}
\pgfusepath{stroke}

\pgfpathcircle{\pgfpoint{5pt}{5pt}}{2pt}
\pgfpathcircle{\pgfpoint{-10pt}{5pt}}{2pt}
\pgfusepath{fill}
\color{red}
\pgfpathcircle{\pgfpointborderrectangle
{\pgfpoint{5pt}{5pt}}{\pgfpoint{1cm}{1.25cm}}}{2pt}
\pgfpathcircle{\pgfpointborderrectangle
{\pgfpoint{-10pt}{5pt}}{\pgfpoint{1cm}{1.25cm}}}{2pt}
\pgfusepath{fill}
\end{tikzpicture}
\ENDBOXTEST

\BEGINBOXTEST{pgfmanual-en-base-points-19}
\begin{tikzpicture}
\draw[help lines] (0,0) grid (2,1.5);
\pgfpathellipse{\pgfpointorigin}{\pgfpoint{1cm}{0cm}}{\pgfpoint{0cm}{1.25cm}}
\pgfusepath{stroke}

\pgfpathcircle{\pgfpoint{5pt}{5pt}}{2pt}
\pgfpathcircle{\pgfpoint{-10pt}{5pt}}{2pt}
\pgfusepath{fill}
\color{red}
\pgfpathcircle{\pgfpointborderellipse
{\pgfpoint{5pt}{5pt}}{\pgfpoint{1cm}{1.25cm}}}{2pt}
\pgfpathcircle{\pgfpointborderellipse
{\pgfpoint{-10pt}{5pt}}{\pgfpoint{1cm}{1.25cm}}}{2pt}
\pgfusepath{fill}
\end{tikzpicture}
\ENDBOXTEST

\BEGINBOXTEST{pgfmanual-en-base-points-20}
\begin{tikzpicture}
\draw[help lines] (0,0) grid (2,2);
\draw (.5,0) -- (2,2);
\draw (1,2) -- (2,0);
\pgfpathcircle{%
\pgfpointintersectionoflines
{\pgfpointxy{.5}{0}}{\pgfpointxy{2}{2}}
{\pgfpointxy{1}{2}}{\pgfpointxy{2}{0}}}
{2pt}
\pgfusepath{stroke}
\end{tikzpicture}
\ENDBOXTEST

\BEGINBOXTEST{pgfmanual-en-base-points-21}
\begin{tikzpicture}
\draw[help lines] (0,0) grid (2,2);
\draw (0.5,0) circle (1);
\draw (1.5,1) circle (.8);
\pgfpathcircle{%
\pgfpointintersectionofcircles
{\pgfpointxy{.5}{0}}{\pgfpointxy{1.5}{1}}
{1cm}{0.8cm}{1}}
{2pt}
\pgfusepath{stroke}
\end{tikzpicture}
\ENDBOXTEST

\BEGINBOXTEST{pgfmanual-en-base-points-22}
\begin{pgfpicture}
\pgfintersectionofpaths
{
\pgfpathellipse{\pgfpointxy{0}{0}}{\pgfpointxy{1}{0}}{\pgfpointxy{0}{2}}
\pgfgetpath\temppath
\pgfusepath{stroke}
\pgfsetpath\temppath
}
{
\pgftransformrotate{-30}
\pgfpathrectangle{\pgfpointorigin}{\pgfpointxy{2}{2}}
\pgfgetpath\temppath
\pgfusepath{stroke}
\pgfsetpath\temppath
}
\foreach \s in {1,...,\pgfintersectionsolutions}
{\pgfpathcircle{\pgfpointintersectionsolution{\s}}{2pt}}
\pgfusepath{stroke}
\end{pgfpicture}
\ENDBOXTEST

\BEGINBOXTEST{pgfmanual-en-base-points-24}
\pgfpoint{2cm}{4cm}
\pgfgetlastxy{\macrox}{\macroy}
Macro $x$ is `\macrox' and macro $y$ is `\macroy'.
\ENDBOXTEST
\END
42 changes: 42 additions & 0 deletions testfiles/pgfmanual-en-base-quick.lvt
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
\documentclass{minimal}
\input{pgf-regression-test}
\RequirePackage{fp,pgf,tikz,xcolor}
\begin{document}

\BEGINBOXTEST{pgfmanual-en-base-quick-1}
\begin{tikzpicture}
\draw[help lines] (0,0) grid (3,2);
\pgftransformxshift{1cm}
\pgfpathqmoveto{0pt}{0pt} % not transformed
\pgfpathqlineto{1cm}{1cm} % not transformed
\pgfpathlineto{\pgfpoint{2cm}{0cm}}
\pgfusepath{stroke}
\end{tikzpicture}
\ENDBOXTEST

\BEGINBOXTEST{pgfmanual-en-base-quick-2}
\begin{tikzpicture}
\draw[help lines] (0,0) grid (3,2);
\pgfpathqmoveto{0pt}{0pt}
\pgfpathqcurveto{1cm}{1cm}{2cm}{1cm}{3cm}{0cm}
\pgfusepath{stroke}
\end{tikzpicture}
\ENDBOXTEST

\BEGINBOXTEST{pgfmanual-en-base-quick-3}
\colorlet{examplefill}{yellow!80!black}
\begin{tikzpicture}
\draw[help lines] (0,0) grid (1,1);
\pgfpathqcircle{10pt}
\pgfsetfillcolor{examplefill}
\pgfusepath{stroke,fill}
\end{tikzpicture}
\ENDBOXTEST

\BEGINBOXTEST{pgfmanual-en-base-quick-4}
\begin{pgfpicture}
\pgfpathqcircle{5pt}
\pgfusepathqstroke
\end{pgfpicture}
\ENDBOXTEST
\END
168 changes: 168 additions & 0 deletions testfiles/pgfmanual-en-base-scopes.lvt
Original file line number Diff line number Diff line change
@@ -0,0 +1,168 @@
\documentclass{minimal}
\input{pgf-regression-test}
\RequirePackage{fp,pgf,tikz,xcolor}
\begin{document}

\BEGINBOXTEST{pgfmanual-en-base-scopes-1}
Hello \begin{pgfpicture}
\pgfpathrectangle{\pgfpointorigin}{\pgfpoint{2ex}{1ex}}
\pgfusepath{stroke}
\end{pgfpicture} World!
\ENDBOXTEST

\BEGINBOXTEST{pgfmanual-en-base-scopes-2}
Rectangles \begin{pgfpicture}
\pgfpathrectangle{\pgfpointorigin}{\pgfpoint{2ex}{1ex}}
\pgfusepath{stroke}
\end{pgfpicture} and \begin{pgfpicture}
\pgfpathrectangle{\pgfpoint{0ex}{1ex}}{\pgfpoint{2ex}{1ex}}
\pgfusepath{stroke}
\end{pgfpicture}.
\ENDBOXTEST

\BEGINBOXTEST{pgfmanual-en-base-scopes-3}
Rectangles \begin{pgfpicture}
\pgfpathrectangle{\pgfpointorigin}{\pgfpoint{2ex}{1ex}}
\pgfusepath{stroke}
\pgfsetbaseline{0pt}
\end{pgfpicture} and \begin{pgfpicture}
\pgfpathrectangle{\pgfpoint{0ex}{1ex}}{\pgfpoint{2ex}{1ex}}
\pgfusepath{stroke}
\pgfsetbaseline{0pt}
\end{pgfpicture}.
\ENDBOXTEST

\BEGINBOXTEST{pgfmanual-en-base-scopes-4}
Text
\begin{pgfpicture}
\pgfpathcircle{\pgfpointorigin}{1ex}\pgfusepath{stroke}
\end{pgfpicture},
\begin{pgfpicture}
\pgfsetbaseline{0pt}
\pgfpathcircle{\pgfpointorigin}{1ex}\pgfusepath{stroke}
\end{pgfpicture},
\begin{pgfpicture}
\pgfsetbaseline{.5ex}
\pgfpathcircle{\pgfpointorigin}{1ex}\pgfusepath{stroke}
\end{pgfpicture},
\begin{pgfpicture}
\pgfsetbaseline{-1ex}
\pgfpathcircle{\pgfpointorigin}{1ex}\pgfusepath{stroke}
\end{pgfpicture}.
\ENDBOXTEST

\BEGINBOXTEST{pgfmanual-en-base-scopes-5}
Hello
\begin{pgfpicture}
\pgfsetbaselinepointlater{\pgfpointanchor{X}{base}}
% Note: no shape X, yet
\pgfnode{cross out}{center}{world.}{X}{\pgfusepath{stroke}}
\end{pgfpicture}
\ENDBOXTEST

\BEGINBOXTEST{pgfmanual-en-base-scopes-6}
\begin{pgfpicture}
\begin{pgfscope}
{
\pgfsetlinewidth{2pt}
\pgfpathrectangle{\pgfpointorigin}{\pgfpoint{2ex}{2ex}}
\pgfusepath{stroke}
}
\pgfpathrectangle{\pgfpoint{3ex}{0ex}}{\pgfpoint{2ex}{2ex}}
\pgfusepath{stroke}
\end{pgfscope}
\pgfpathrectangle{\pgfpoint{6ex}{0ex}}{\pgfpoint{2ex}{2ex}}
\pgfusepath{stroke}
\end{pgfpicture}
\ENDBOXTEST

\BEGINBOXTEST{pgfmanual-en-base-scopes-7}
\begin{pgfpicture}
\begin{pgfscope}
{
\pgfsetarrows{->}
\pgfpathmoveto{\pgfpointorigin}\pgfpathlineto{\pgfpoint{2ex}{2ex}}
\pgfusepath{stroke}
}
\pgfpathmoveto{\pgfpoint{3ex}{0ex}}\pgfpathlineto{\pgfpoint{5ex}{2ex}}
\pgfusepath{stroke}
\end{pgfscope}
\pgfpathmoveto{\pgfpoint{6ex}{0ex}}\pgfpathlineto{\pgfpoint{8ex}{2ex}}
\pgfusepath{stroke}
\end{pgfpicture}
\ENDBOXTEST

\BEGINBOXTEST{pgfmanual-en-base-scopes-8}
\begin{pgfpicture}
\pgfpathmoveto{\pgfpoint{0cm}{0cm}} % In the middle of path, now
\newbox\mybox
\setbox\mybox=\hbox{
\begin{pgfinterruptpicture}
Sub-\begin{pgfpicture} % a subpicture
\pgfpathmoveto{\pgfpoint{1cm}{0cm}}
\pgfpathlineto{\pgfpoint{1cm}{1cm}}
\pgfusepath{stroke}
\end{pgfpicture}-picture.
\end{pgfinterruptpicture}
}
\pgfqbox{\mybox}%
\pgfpathlineto{\pgfpoint{0cm}{1cm}}
\pgfusepath{stroke}
\end{pgfpicture}\hskip3.9cm
\ENDBOXTEST

\BEGINBOXTEST{pgfmanual-en-base-scopes-9}
\tikz{\draw[help lines] (-1,-.5) grid (1,.5);
\pgftext[left] {lovely}}
\ENDBOXTEST

\BEGINBOXTEST{pgfmanual-en-base-scopes-10}
\tikz{\draw[help lines] (-1,-.5) grid (1,.5);
\pgftext[right] {lovely}}
\ENDBOXTEST

\BEGINBOXTEST{pgfmanual-en-base-scopes-11}
\tikz{\draw[help lines] (-1,-.5) grid (1,.5);
\pgftext[top] {lovely}}
\ENDBOXTEST

\BEGINBOXTEST{pgfmanual-en-base-scopes-12}
\tikz{\draw[help lines] (-1,-.5) grid (1,.5);
\pgftext[top,right] {lovely}}
\ENDBOXTEST

\BEGINBOXTEST{pgfmanual-en-base-scopes-13}
\tikz{\draw[help lines] (-1,-.5) grid (1,.5);
\pgftext[bottom] {lovely}}
\ENDBOXTEST

\BEGINBOXTEST{pgfmanual-en-base-scopes-14}
\tikz{\draw[help lines] (-1,-.5) grid (1,.5);
\pgftext[bottom,right] {lovely}}
\ENDBOXTEST

\BEGINBOXTEST{pgfmanual-en-base-scopes-15}
\tikz{\draw[help lines] (-1,-.5) grid (1,.5);
\pgftext[base] {lovely}}
\ENDBOXTEST

\BEGINBOXTEST{pgfmanual-en-base-scopes-16}
\tikz{\draw[help lines] (-1,-.5) grid (1,.5);
\pgftext[base,right] {lovely}}
\ENDBOXTEST

\BEGINBOXTEST{pgfmanual-en-base-scopes-17}
\tikz{\draw[help lines] (-1,-.5) grid (1,.5);
\pgftext[base,at={\pgfpoint{1cm}{0cm}}] {lovely}}
\ENDBOXTEST

\BEGINBOXTEST{pgfmanual-en-base-scopes-18}
\tikz{\draw[help lines] (-1,-.5) grid (1,.5);
\pgftext[base,x=1cm,y=-0.5cm] {lovely}}
\ENDBOXTEST

\BEGINBOXTEST{pgfmanual-en-base-scopes-19}
\tikz{\draw[help lines] (-1,-.5) grid (1,.5);
\pgftext[base,x=1cm,y=-0.5cm,rotate=30] {lovely}}
\ENDBOXTEST
\END
224 changes: 224 additions & 0 deletions testfiles/pgfmanual-en-base-shadings.lvt
Original file line number Diff line number Diff line change
@@ -0,0 +1,224 @@
\documentclass{minimal}
\input{pgf-regression-test}
\RequirePackage{fp,pgf,tikz,xcolor}
\begin{document}

\BEGINBOXTEST{pgfmanual-en-base-shadings-3}
\pgfdeclarehorizontalshading{myshadingA}
{1cm}{rgb(0cm)=(1,0,0); color(2cm)=(green); color(4cm)=(blue)}
\pgfuseshading{myshadingA}
\ENDBOXTEST

\BEGINBOXTEST{pgfmanual-en-base-shadings-4}
\pgfdeclarehorizontalshading[mycolor]{myshadingB}
{1cm}{rgb(0cm)=(1,0,0); color(2cm)=(mycolor)}
\colorlet{mycolor}{green}
\pgfuseshading{myshadingB}
\colorlet{mycolor}{blue}
\pgfuseshading{myshadingB}
\ENDBOXTEST

\BEGINBOXTEST{pgfmanual-en-base-shadings-5}
\pgfdeclareverticalshading{myshadingC}
{4cm}{rgb(0cm)=(1,0,0); rgb(1.5cm)=(0,1,0); rgb(2cm)=(0,0,1)}
\pgfuseshading{myshadingC}
\ENDBOXTEST

\BEGINBOXTEST{pgfmanual-en-base-shadings-6}
\pgfdeclareradialshading{sphere}{\pgfpoint{0.5cm}{0.5cm}}%
{rgb(0cm)=(0.9,0,0);
rgb(0.7cm)=(0.7,0,0);
rgb(1cm)=(0.5,0,0);
rgb(1.05cm)=(1,1,1)}
\pgfuseshading{sphere}
\ENDBOXTEST

\BEGINBOXTEST{pgfmanual-en-base-shadings-7}
\pgfdeclarefunctionalshading{twospots}
{\pgfpointorigin}{\pgfpoint{4cm}{4cm}}{}{
% Save coordinates for later
2 copy
% Compute distance from (40bp,45bp), with x doubled
45 sub dup mul exch
40 sub dup mul 0.5 mul add sqrt
% exponential decay
dup mul neg 1.0005 exch exp 1.0 exch sub
% Compute distance from (70bp,70bp) from stored coordinate, scaled
3 1 roll
70 sub dup mul .5 mul exch
70 sub dup mul add sqrt
% Decay
dup mul neg 1.002 exch exp 1.0 exch sub
% red component
1.0 3 1 roll
}
\pgfuseshading{twospots}
\ENDBOXTEST

\BEGINBOXTEST{pgfmanual-en-base-shadings-8}
\pgfdeclarefunctionalshading[mycol]{sweep}{\pgfpoint{-1cm}{-1cm}}
{\pgfpoint{1cm}{1cm}}{\pgfshadecolortorgb{mycol}{\myrgb}}{
2 copy % whirl
% Calculate "safe" atan of position
2 copy abs exch abs add 0.0001 ge { atan } { pop } ifelse
3 1 roll
dup mul exch
dup mul add sqrt
30 mul
add
sin
1 add 2 div
dup
\myrgb % push mycol
5 4 roll % multiply all components by calculated value
mul
3 1 roll
3 index
mul
3 1 roll
4 3 roll
mul
3 1 roll
}
\colorlet{mycol}{white}%
\pgfuseshading{sweep}%
\colorlet{mycol}{red}%
\pgfuseshading{sweep}
\ENDBOXTEST

\BEGINBOXTEST{pgfmanual-en-base-shadings-9}
\pgfshadecolortorgb{orange}{\mycol}
|\mycol|=\mycol |\mycolred|=\mycolred |\mycolgreen|=\mycolgreen |\mycolblue|=\mycolblue
\ENDBOXTEST

\BEGINBOXTEST{pgfmanual-en-base-shadings-10}
\pgfdeclarefunctionalshading[col1,col2,col3,col4]{bilinear interpolation}
{\pgfpointorigin}{\pgfpoint{100bp}{100bp}}
{
\pgfshadecolortorgb{col1}{\first}\pgfshadecolortorgb{col2}{\second}
\pgfshadecolortorgb{col3}{\third}\pgfshadecolortorgb{col4}{\fourth}
}{
100 div exch 100 div 2 copy % Calculate y/100 x/100.
neg 1 add exch neg 1 add % Calculate 1-y/100 1-x/100.
3 1 roll 2 copy exch 5 2 roll 6 copy 6 copy % Set up stack.
\firstred mul exch \secondred mul add mul % Process red component.
4 1 roll
\thirdred mul exch \fourthred mul add mul
add
13 1 roll
\firstgreen mul exch \secondgreen mul add mul % Process green component.
4 1 roll
\thirdgreen mul exch \fourthgreen mul add mul
add
7 1 roll
\firstblue mul exch \secondblue mul add mul % Process blue component.
4 1 roll
\thirdblue mul exch \fourthblue mul add mul
add
}

\colorlet{col1}{blue}
\colorlet{col2}{yellow}
\colorlet{col3}{red}
\colorlet{col4}{green}
\pgfuseshading{bilinear interpolation}
\ENDBOXTEST

\BEGINBOXTEST{pgfmanual-en-base-shadings-12}
\begin{pgfpicture}
\pgfdeclareverticalshading{myshadingD}
{20pt}{color(0pt)=(red); color(20pt)=(blue)}
\pgftext[at=\pgfpoint{1cm}{0cm}] {\pgfuseshading{myshadingD}}
\pgftext[at=\pgfpoint{2cm}{0.5cm}]{\pgfuseshading{myshadingD}}
\end{pgfpicture}
\ENDBOXTEST

\BEGINBOXTEST{pgfmanual-en-base-shadings-13}
\pgfdeclareverticalshading{myshadingE}{100bp}
{color(0bp)=(red); color(25bp)=(green); color(75bp)=(blue); color(100bp)=(black)}
\pgfuseshading{myshadingE}
\hskip 1cm
\begin{pgfpicture}
\pgfpathrectangle{\pgfpointorigin}{\pgfpoint{2cm}{1cm}}
\pgfshadepath{myshadingE}{0}
\pgfusepath{stroke}
\pgfpathrectangle{\pgfpoint{3cm}{0cm}}{\pgfpoint{1cm}{2cm}}
\pgfshadepath{myshadingE}{0}
\pgfusepath{stroke}
\pgfpathrectangle{\pgfpoint{5cm}{0cm}}{\pgfpoint{2cm}{2cm}}
\pgfshadepath{myshadingE}{45}
\pgfusepath{stroke}
\pgfpathcircle{\pgfpoint{9cm}{1cm}}{1cm}
\pgfshadepath{myshadingE}{45}
\pgfusepath{stroke}
\end{pgfpicture}
\ENDBOXTEST

\BEGINBOXTEST{pgfmanual-en-base-shadings-14}
\pgfdeclareverticalshading{myshadingF}{100bp}
{color(0bp)=(red); color(25bp)=(green); color(75bp)=(blue); color(100bp)=(black)}
\begin{tikzpicture}
\draw (50bp,50bp) node {\pgfuseshading{myshadingF}};
\draw[white,thick] (25bp,25bp) rectangle (75bp,75bp);
\draw (50bp,0bp) node[below] {first two applications};

\begin{scope}[xshift=5cm]
\draw (50bp,50bp) node{\pgfuseshading{myshadingF}};
\draw[rotate around={45:(50bp,50bp)},white,thick] (25bp,25bp) rectangle (75bp,75bp);
\draw (50bp,0bp) node[below] {third application};
\end{scope}

\begin{scope}[xshift=10cm]
\draw (50bp,50bp) node{\pgfuseshading{myshadingF}};
\draw[white,thick] (50bp,50bp) circle (25bp);
\draw (50bp,0bp) node[below] {fourth application};
\end{scope}
\end{tikzpicture}
\ENDBOXTEST

\BEGINBOXTEST{pgfmanual-en-base-shadings-15}
\pgfdeclareradialshading{ballshading}{\pgfpoint{-10bp}{10bp}}
{color(0bp)=(red!15!white); color(9bp)=(red!75!white);
color(18bp)=(red!70!black); color(25bp)=(red!50!black); color(50bp)=(black)}
\pgfuseshading{ballshading}
\hskip 1cm
\begin{pgfpicture}
\pgfpathrectangle{\pgfpointorigin}{\pgfpoint{1cm}{1cm}}
\pgfshadepath{ballshading}{0}
\pgfusepath{}
\pgfpathcircle{\pgfpoint{3cm}{0cm}}{1cm}
\pgfshadepath{ballshading}{0}
\pgfusepath{}
\pgfpathcircle{\pgfpoint{6cm}{0cm}}{1cm}
\pgfshadepath{ballshading}{45}
\pgfusepath{}
\end{pgfpicture}
\ENDBOXTEST

\BEGINBOXTEST{pgfmanual-en-base-shadings-16}
\pgfdeclareverticalshading{myshadingG}{100bp}
{color(0bp)=(red); color(25bp)=(green); color(75bp)=(blue); color(100bp)=(black)}
\begin{pgfpicture}
\pgfpathrectangle{\pgfpointorigin}{\pgfpoint{2cm}{1cm}}
\pgfshadepath{myshadingG}{0}
\pgfusepath{stroke}
\pgfpathrectangle{\pgfpoint{3cm}{0cm}}{\pgfpoint{2cm}{1cm}}
\pgfshadepath{myshadingG}{90}
\pgfusepath{stroke}
\pgfpathrectangle{\pgfpoint{6cm}{0cm}}{\pgfpoint{2cm}{1cm}}
\pgfshadepath{myshadingG}{45}
\pgfusepath{stroke}
\end{pgfpicture}
\ENDBOXTEST

\BEGINBOXTEST{pgfmanual-en-base-shadings-17}
\pgfdeclareverticalshading{rainbow}{100bp}
{color(0bp)=(red); color(25bp)=(red); color(35bp)=(yellow);
color(45bp)=(green); color(55bp)=(cyan); color(65bp)=(blue);
color(75bp)=(violet); color(100bp)=(violet)}
\begin{tikzpicture}[shading=rainbow]
\shade (0,0) rectangle node[white] {\textsc{pride}} (2,1);
\shade[shading angle=90] (3,0) rectangle +(1,2);
\end{tikzpicture}
\ENDBOXTEST
\END
497 changes: 497 additions & 0 deletions testfiles/pgfmanual-en-base-transformations.lvt

Large diffs are not rendered by default.

166 changes: 166 additions & 0 deletions testfiles/pgfmanual-en-base-transparency.lvt
Original file line number Diff line number Diff line change
@@ -0,0 +1,166 @@
\documentclass{minimal}
\input{pgf-regression-test}
\RequirePackage{fp,pgf,tikz,xcolor}

\pgfdeclarefading{fading2}
{\tikz \shade[left color=pgftransparent!0,
right color=pgftransparent!100] (0,0) rectangle (2,2);}
\pgfdeclarehorizontalshading{shading}{100bp}
{ color(0pt)=(transparent!0); color(25bp)=(transparent!0);
color(75bp)=(transparent!100); color(100bp)=(transparent!100)}
\pgfdeclarefading{fading}{\pgfuseshading{shading}}
\usetikzlibrary{shapes.symbols}

\begin{document}

\BEGINBOXTEST{pgfmanual-en-base-transparency-1}
\begin{pgfpicture}
\pgfsetlinewidth{5mm}
\color{red}
\pgfpathcircle{\pgfpoint{0cm}{0cm}}{10mm} \pgfusepath{stroke}
\color{black}
\pgfsetstrokeopacity{0.5}
\pgfpathcircle{\pgfpoint{1cm}{0cm}}{10mm} \pgfusepath{stroke}
\end{pgfpicture}
\ENDBOXTEST

\BEGINBOXTEST{pgfmanual-en-base-transparency-2}
\begin{tikzpicture}
\pgfsetfillopacity{0.5}
\fill[red] (90:1cm) circle (11mm);
\fill[green] (210:1cm) circle (11mm);
\fill[blue] (-30:1cm) circle (11mm);
\end{tikzpicture}
\ENDBOXTEST

\BEGINBOXTEST{pgfmanual-en-base-transparency-3}
\begin{tikzpicture}
\pgfsetfillopacity{0.5}
\fill[red] (0,0) circle (1);
\fill[red] (1,0) circle (1);
\end{tikzpicture}
\ENDBOXTEST

\BEGINBOXTEST{pgfmanual-en-base-transparency-4}
\tikz [transparency group] {
\pgfsetblendmode{screen}

\fill[red!90!black] ( 90:.6) circle (1);
\fill[green!80!black] (210:.6) circle (1);
\fill[blue!90!black] (330:.6) circle (1);
}
\ENDBOXTEST

\BEGINBOXTEST{pgfmanual-en-base-transparency-5}
\pgfdeclarefading{fading1}{\textcolor{white}{Ti\emph{k}Z}}
\begin{tikzpicture}
\fill [black!20] (0,0) rectangle (2,2);
\fill [black!30] (0,0) arc (180:0:1);
\pgfsetfading{fading1}{\pgftransformshift{\pgfpoint{1cm}{1cm}}}
\fill [red] (0,0) rectangle (2,2);
\end{tikzpicture}
\ENDBOXTEST

\BEGINBOXTEST{pgfmanual-en-base-transparency-6}
\pgfdeclarefading{fading2}
{\tikz \shade[left color=pgftransparent!0,
right color=pgftransparent!100] (0,0) rectangle (2,2);}
\begin{tikzpicture}
\fill [black!20] (0,0) rectangle (2,2);
\fill [black!30] (0,0) arc (180:0:1);
\pgfsetfading{fading2}{\pgftransformshift{\pgfpoint{1cm}{1cm}}}
\fill [red] (0,0) rectangle (2,2);
\end{tikzpicture}
\ENDBOXTEST

\BEGINBOXTEST{pgfmanual-en-base-transparency-7}
\pgfdeclareradialshading{myshading}{\pgfpointorigin}
{
color(0mm)=(pgftransparent!0);
color(5mm)=(pgftransparent!0);
color(8mm)=(pgftransparent!100);
color(15mm)=(pgftransparent!100)
}
\pgfdeclarefading{fading3}{\pgfuseshading{myshading}}
\begin{tikzpicture}
\fill [black!20] (0,0) rectangle (2,2);
\fill [black!30] (0,0) arc (180:0:1);
\pgfsetfading{fading3}{\pgftransformshift{\pgfpoint{1cm}{1cm}}}
\fill [red] (0,0) rectangle (2,2);
\end{tikzpicture}
\ENDBOXTEST

\BEGINBOXTEST{pgfmanual-en-base-transparency-8}
\pgfdeclarefading{fading2}
{\tikz \shade[left color=pgftransparent!0,
right color=pgftransparent!100] (0,0) rectangle (2,2);}
\begin{tikzpicture}
\fill [black!20] (0,0) rectangle (2,2);
\fill [black!30] (0,0) arc (180:0:1);
\pgfsetfading{fading2}{}
\fill [red] (0,0) rectangle (2,2);
\end{tikzpicture}
\ENDBOXTEST

\BEGINBOXTEST{pgfmanual-en-base-transparency-9}
\begin{tikzpicture}
\fill [black!20] (0,0) rectangle (2,2);
\fill [black!30] (0,0) arc (180:0:1);
\pgfsetfading{fading2}{\pgftransformshift{\pgfpoint{1cm}{1cm}}
\pgftransformrotate{20}}
\fill [red] (0,0) rectangle (2,2);
\end{tikzpicture}
\ENDBOXTEST

\BEGINBOXTEST{pgfmanual-en-base-transparency-10}
\pgfdeclarehorizontalshading{shading}{100bp}
{ color(0pt)=(transparent!0); color(25bp)=(transparent!0);
color(75bp)=(transparent!100); color(100bp)=(transparent!100)}

\pgfdeclarefading{fading}{\pgfuseshading{shading}}

\begin{tikzpicture}
\fill [black!20] (0,0) rectangle (2,2);
\fill [black!30] (0,0) arc (180:0:1);

\pgfpathrectangle{\pgfpointorigin}{\pgfpoint{2cm}{1cm}}
\pgfsetfadingforcurrentpath{fading}{}
\pgfusepath{discard}

\fill [red] (0,0) rectangle (2,1);

\pgfpathrectangle{\pgfpoint{0cm}{1cm}}{\pgfpoint{2cm}{1cm}}
\pgfsetfadingforcurrentpath{fading}{\pgftransformrotate{90}}
\pgfusepath{discard}

\fill [red] (0,1) rectangle (2,2);
\end{tikzpicture}
\ENDBOXTEST

\BEGINBOXTEST{pgfmanual-en-base-transparency-11}
\begin{tikzpicture}
\pgfsetlinewidth{2mm}
\pgfpathmoveto{\pgfpointorigin}
\pgfpathlineto{\pgfpoint{2cm}{0cm}}
\pgfsetfadingforcurrentpathstroked{fading}{}
\pgfusepath{stroke}
\end{tikzpicture}
\ENDBOXTEST

\BEGINBOXTEST{pgfmanual-en-base-transparency-12}
\begin{tikzpicture}
\draw [help lines] (0,0) grid (2,2);

% Stuff outside the picture, but still in a transparency group.
\node [left,overlay] at (0,1) {
\begin{tikzpicture}
\pgfsetfillopacity{0.5}
\pgftransparencygroup
\node at (2,0) [forbidden sign,line width=2ex,draw=red,fill=white]
{Smoking};
\endpgftransparencygroup
\end{tikzpicture}
};
\end{tikzpicture}
\ENDBOXTEST
\END
1,345 changes: 1,345 additions & 0 deletions testfiles/pgfmanual-en-dv-axes.lvt

Large diffs are not rendered by default.

88 changes: 88 additions & 0 deletions testfiles/pgfmanual-en-dv-examples.lvt
Original file line number Diff line number Diff line change
@@ -0,0 +1,88 @@
\documentclass{minimal}
\input{pgf-regression-test}
\RequirePackage{fp,pgf,tikz,xcolor}

\usetikzlibrary{datavisualization.formats.functions}
\usetikzlibrary{datavisualization.formats.functions}
\usetikzlibrary{datavisualization}

\begin{document}

\BEGINBOXTEST{pgfmanual-en-dv-examples-1}
\begin{tikzpicture}[baseline]
\datavisualization [
school book axes,
visualize as smooth line,
clean ticks,
all axes={grid={step=1,minor steps between steps=1}},
x axis={
ticks={
major={
also at={(0.5*pi) as $\pi/2$},
also at={(pi) as $\pi$},
options at=3 as [no tick text]
}
},
label=$x$
},
y axis={
label=$y$,
}
]
data [format=function] {
var x : interval [-0.5*pi:4] samples 50;
func y = sin(\value x r);
};
\end{tikzpicture}
\ENDBOXTEST

\BEGINBOXTEST{pgfmanual-en-dv-examples-2}
\begin{tikzpicture}[baseline]
\datavisualization [
scientific axes=clean,
visualize as line,
all axes={padding=4pt},
x axis={logarithmic,
ticks={many, tick unit={ms},
node style={rotate=45,anchor=north east}},
label={time},
grid},
y axis={label={distance}},
]
data {
x, y, z
0.001, 0, 0
2000, 2.23, 2
20670, 1, 3
501, -2, 0
};
\end{tikzpicture}
\ENDBOXTEST

\BEGINBOXTEST{pgfmanual-en-dv-examples-3}
\begin{tikzpicture}[baseline,mark=*]
\datavisualization [
scientific axes=inner ticks,
all axes={padding=4pt},
euro about strategy,
visualize as scatter,
x axis={attribute=x2},
y axis={attribute=y2}
]
data [separator=\space] {
x y x1 y1 x2 y2 x3 y3
10.0 8.04 10.0 9.14 10.0 7.46 8.0 6.58
8.0 6.95 8.0 8.14 8.0 6.77 8.0 5.76
13.0 7.58 13.0 8.74 13.0 12.74 8.0 7.71
9.0 8.81 9.0 8.77 9.0 7.11 8.0 8.84
11.0 8.33 11.0 9.26 11.0 7.81 8.0 8.47
14.0 9.96 14.0 8.10 14.0 8.84 8.0 7.04
6.0 7.24 6.0 6.13 6.0 6.08 8.0 5.25
4.0 4.26 4.0 3.10 4.0 5.39 19.0 12.50
12.0 10.84 12.0 9.13 12.0 8.15 8.0 5.56
7.0 4.82 7.0 7.26 7.0 6.42 8.0 7.91
5.0 5.68 5.0 4.74 5.0 5.73 8.0 6.89
};
\end{tikzpicture}
\ENDBOXTEST
\END
122 changes: 122 additions & 0 deletions testfiles/pgfmanual-en-dv-formats.lvt
Original file line number Diff line number Diff line change
@@ -0,0 +1,122 @@
\documentclass{minimal}
\input{pgf-regression-test}
\RequirePackage{fp,pgf,tikz,xcolor}

\usetikzlibrary{datavisualization}
\usetikzlibrary{datavisualization}
\usetikzlibrary{datavisualization}
\usetikzlibrary{datavisualization}
\usetikzlibrary{datavisualization}
\usetikzlibrary{datavisualization.formats.functions}
\usetikzlibrary{datavisualization.formats.functions}
\usetikzlibrary{datavisualization.formats.functions}

\begin{document}

\BEGINBOXTEST{pgfmanual-en-dv-formats-3}
\begin{tikzpicture}
\datavisualization [school book axes, visualize as line]
data [separator=\space] {
x y
0 0
1 1
2 1
3 0
}
data [separator=;] {
x; y; z
3; 1; 0
2; 2; 0
};
\end{tikzpicture}
\ENDBOXTEST

\BEGINBOXTEST{pgfmanual-en-dv-formats-4}
\begin{tikzpicture}
\datavisualization [school book axes, visualize as line]
data [headline={x, y}] {
0, 0
1, 1
2, 1
3, 0
};
\end{tikzpicture}
\ENDBOXTEST

\BEGINBOXTEST{pgfmanual-en-dv-formats-5}
\begin{tikzpicture}
\datavisualization [school book axes, visualize as line]
data [format=named] {
x=0, y=0
x=1, y=1
x=2, y=1
x=3, y=0
};
\end{tikzpicture}
\ENDBOXTEST

\BEGINBOXTEST{pgfmanual-en-dv-formats-6}
\tikz \datavisualization
[scientific axes=clean,
visualize as scatter/.list={a,b,c},
style sheet=cross marks]
data [format=named] {
x=0, y={1,2,3}, set=a
x={2,3,4}, y={3,4,5,7}, set=b
x=6, y={5,7,...,15}, set=c
};
\ENDBOXTEST

\BEGINBOXTEST{pgfmanual-en-dv-formats-7}
\begin{tikzpicture}
\datavisualization [school book axes, visualize as line]
data [format=TeX code] {
\pgfkeys{/data point/.cd,x=0, y=0} \pgfdatapoint
\pgfkeys{/data point/.cd,x=1, y=1} \pgfdatapoint
\pgfkeys{/data point/x=2} \pgfdatapoint
\pgfkeyssetvalue{/data point/x}{3}
\pgfkeyssetvalue{/data point/y}{0} \pgfdatapoint
};
\end{tikzpicture}
\ENDBOXTEST

\BEGINBOXTEST{pgfmanual-en-dv-formats-8}
\tikz
\datavisualization [school book axes, visualize as smooth line]
data [format=function] {
var x : interval [-1.5:1.5];

func y = \value x * \value x;
};
\ENDBOXTEST

\BEGINBOXTEST{pgfmanual-en-dv-formats-9}
\tikz \datavisualization [
school book axes,
all axes={unit length=5mm, ticks={step=2}},
visualize as smooth line]
data [format=function] {
var t : interval [0:2*pi];

func x = \value t * cos(\value t r);
func y = \value t * sin(\value t r);
};
\ENDBOXTEST

\BEGINBOXTEST{pgfmanual-en-dv-formats-10}
\tikz \datavisualization [
scientific axes=clean,
y axis={ticks={style={
/pgf/number format/fixed,
/pgf/number format/fixed zerofill,
/pgf/number format/precision=2}}},
x axis={ticks={tick suffix=${}^\circ$}},
visualize as smooth line/.list={1,2,3,4,5,6},
style sheet=vary hue]
data [format=function] {
var set : {1,...,6};
var x : interval [0:50];
func y = sin(\value x * (\value{set}+10))/(\value{set}+5);
};
\ENDBOXTEST
\END
29 changes: 29 additions & 0 deletions testfiles/pgfmanual-en-dv-introduction.lvt
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
\documentclass{minimal}
\input{pgf-regression-test}
\RequirePackage{fp,pgf,tikz,xcolor}

\usetikzlibrary{datavisualization.formats.functions}
\usetikzlibrary{datavisualization.formats.functions}

\begin{document}

\BEGINBOXTEST{pgfmanual-en-dv-introduction-1}
\begin{tikzpicture}[scale=.7]
\datavisualization [school book axes, visualize as smooth line]
data [format=function] {
var x : interval [-2:2];
func y = \value x*\value x + 1;
};
\end{tikzpicture}
\ENDBOXTEST

\BEGINBOXTEST{pgfmanual-en-dv-introduction-2}
\begin{tikzpicture}[scale=.7]
\datavisualization [scientific axes, visualize as smooth line]
data [format=function] {
var x : interval [-2:2];
func y = \value x*\value x + 1;
};
\end{tikzpicture}
\ENDBOXTEST
\END
206 changes: 206 additions & 0 deletions testfiles/pgfmanual-en-dv-main.lvt
Original file line number Diff line number Diff line change
@@ -0,0 +1,206 @@
\documentclass{minimal}
\input{pgf-regression-test}
\RequirePackage{fp,pgf,tikz,xcolor}

\usetikzlibrary{datavisualization}
\usetikzlibrary{datavisualization.formats.functions}
\usetikzlibrary{datavisualization.formats.functions}
\usetikzlibrary{datavisualization.formats.functions}
\usetikzlibrary{datavisualization.formats.functions}
\usetikzlibrary{datavisualization.formats.functions}
\usetikzlibrary{datavisualization.formats.functions}
\usetikzlibrary{datavisualization}
\usetikzlibrary{datavisualization}
\usetikzlibrary{datavisualization}
\usetikzlibrary{datavisualization}
\usetikzlibrary{datavisualization.formats.functions}
\usetikzlibrary{datavisualization.formats.functions}

\begin{document}

\tikz \datavisualization data group {points} = {
data {
x, y
0, 1
1, 2
2, 2
5, 1
2, 0
1, 1
}
};

\BEGINBOXTEST{pgfmanual-en-dv-main-1}
\begin{tikzpicture}
\datavisualization [school book axes, visualize as smooth line]
data {
x, y
-1.5, 2.25
-1, 1
-.5, .25
0, 0
.5, .25
1, 1
1.5, 2.25
};
\end{tikzpicture}
\ENDBOXTEST

\BEGINBOXTEST{pgfmanual-en-dv-main-2}
\begin{tikzpicture}
\datavisualization [school book axes, visualize as smooth line]
data [format=function] {
var x : interval [-1.5:1.5] samples 7;
func y = \value x*\value x;
};
\end{tikzpicture}
\ENDBOXTEST

\BEGINBOXTEST{pgfmanual-en-dv-main-3}
\begin{tikzpicture}
\datavisualization [
scientific axes,
x axis={length=3cm, ticks=few},
visualize as smooth line
]
data [format=function] {
var x : interval [-1.5:1.5] samples 7;
func y = \value x*\value x;
};
\end{tikzpicture}
\ENDBOXTEST

\BEGINBOXTEST{pgfmanual-en-dv-main-4}
\begin{tikzpicture}
\datavisualization [
scientific axes=clean,
x axis={length=3cm, ticks=few},
all axes={grid},
visualize as smooth line
]
data [format=function] {
var x : interval [-1.5:1.5] samples 7;
func y = \value x*\value x;
};
\end{tikzpicture}
\ENDBOXTEST

\BEGINBOXTEST{pgfmanual-en-dv-main-5}
\begin{tikzpicture}
\datavisualization [
scientific axes=clean,
x axis={length=3cm, ticks=few},
visualize as smooth line
]
data [format=function] {
var x : interval [-1.5:1.5] samples 7;
func y = \value x*\value x;
};
\end{tikzpicture}
\ENDBOXTEST

\BEGINBOXTEST{pgfmanual-en-dv-main-6}
\begin{tikzpicture}
\datavisualization [
scientific axes=clean,
x axis={length=3cm, ticks=few},
visualize as scatter
]
data [format=function] {
var x : interval [-1.5:1.5] samples 7;
func y = \value x*\value x;
};
\end{tikzpicture}
\ENDBOXTEST

\BEGINBOXTEST{pgfmanual-en-dv-main-7}
\begin{tikzpicture}[baseline]
\datavisualization [ scientific axes=clean,
y axis=grid,
visualize as smooth line/.list={sin,cos,tan},
style sheet=strong colors,
style sheet=vary dashing,
sin={label in legend={text=$\sin x$}},
cos={label in legend={text=$\cos x$}},
tan={label in legend={text=$\tan x$}},
data/format=function ]
data [set=sin] {
var x : interval [-0.5*pi:4];
func y = sin(\value x r);
}
data [set=cos] {
var x : interval [-0.5*pi:4];
func y = cos(\value x r);
}
data [set=tan] {
var x : interval [-0.3*pi:.3*pi];
func y = tan(\value x r);
};
\end{tikzpicture}
\ENDBOXTEST

\BEGINBOXTEST{pgfmanual-en-dv-main-11}
\tikz
\datavisualization [school book axes, visualize as line]
data [/data point/x=1] {
y
1
2
}
data [/data point/x=2] {
y
2
0.5
};
\ENDBOXTEST

\BEGINBOXTEST{pgfmanual-en-dv-main-12}
\tikz \datavisualization [school book axes, visualize as line]
data point [x=1, y=1] data point [x=1, y=2]
data point [x=2, y=2] data point [x=2, y=0.5];
\ENDBOXTEST

\BEGINBOXTEST{pgfmanual-en-dv-main-13}
\tikzdatavisualizationset{
horizontal/.style={
data point={x=#1, y=1}, data point={x=#1, y=2}},
}
\tikz \datavisualization
[ school book axes, visualize as line,
horizontal=1,
horizontal=2 ];
\ENDBOXTEST

\BEGINBOXTEST{pgfmanual-en-dv-main-15}
\tikz \datavisualization [school book axes, visualize as line] data group {points};
\qquad
\tikz \datavisualization [scientific axes=clean, visualize as line] data group {points};
\ENDBOXTEST

\BEGINBOXTEST{pgfmanual-en-dv-main-17}
\begin{tikzpicture}[baseline]
\datavisualization [ school book axes, visualize as line ]
data [format=function] {
var x : interval [-0.1*pi:2];
func y = sin(\value x r);
}
info {
\draw [red] (visualization cs: x={(.5*pi)}, y=1) circle [radius=1pt]
node [above,font=\footnotesize] {extremal point};
};
\end{tikzpicture}
\ENDBOXTEST

\BEGINBOXTEST{pgfmanual-en-dv-main-18}
\begin{tikzpicture}[baseline]
\datavisualization [ school book axes, visualize as line ]
data [format=function] {
var x : interval [-0.1*pi:2];
func y = sin(\value x r);
}
info' {
\fill [red] (visualization cs: x={(.5*pi)}, y=1) circle [radius=2mm];
};
\end{tikzpicture}
\ENDBOXTEST
\END
190 changes: 190 additions & 0 deletions testfiles/pgfmanual-en-dv-polar.lvt
Original file line number Diff line number Diff line change
@@ -0,0 +1,190 @@
\documentclass{minimal}
\input{pgf-regression-test}
\RequirePackage{fp,pgf,tikz,xcolor}

\usetikzlibrary{
datavisualization.formats.functions,
datavisualization.polar,
}
\usetikzlibrary{
datavisualization.formats.functions,
datavisualization.polar,
}
\usetikzlibrary{
datavisualization.formats.functions,
datavisualization.polar,
}
\usetikzlibrary{
datavisualization.formats.functions,
datavisualization.polar,
}
\usetikzlibrary{
datavisualization.formats.functions,
datavisualization.polar,
}
\usetikzlibrary{
datavisualization.formats.functions,
datavisualization.polar,
}
\usetikzlibrary{datavisualization.polar}
\usetikzlibrary{datavisualization.polar}
\usetikzlibrary{datavisualization.polar}
\usetikzlibrary{datavisualization.polar}
\usetikzlibrary{datavisualization.polar}

\begin{document}

\BEGINBOXTEST{pgfmanual-en-dv-polar-1}
\tikz \datavisualization [
scientific polar axes={0 to pi, clean},
all axes=grid,
style sheet=vary hue,
legend=below
]
[visualize as smooth line=sin,
sin={label in legend={text=$1+\sin \alpha$}}]
data [format=function] {
var angle : interval [0:pi];
func radius = sin(\value{angle}r) + 1;
}
[visualize as smooth line=cos,
cos={label in legend={text=$1+\cos\alpha$}}]
data [format=function] {
var angle : interval [0:pi];
func radius = cos(\value{angle}r) + 1;
};
\ENDBOXTEST

\BEGINBOXTEST{pgfmanual-en-dv-polar-2}
\tikz[baseline] \datavisualization [
scientific axes={clean},
x axis={attribute=angle, ticks={minor steps between steps=4}},
y axis={attribute=radius, ticks={some, style=red!80!black}},
all axes=grid,
visualize as smooth line=sin]
data [format=function] {
var t : interval [-3:3];
func angle = exp(\value t);
func radius = \value{t}*\value{t};
};
\qquad
\tikz[baseline] \datavisualization [
scientific polar axes={right half clockwise, clean},
angle axis={logarithmic,
ticks={
minor steps between steps=8,
major also at/.list={2,3,4,5,15,20}}},
radius axis={ticks={some, style=red!80!black}},
all axes=grid,
visualize as smooth line=sin]
data [format=function] {
var t : interval [-3:3];
func angle = exp(\value t);
func radius = \value{t}*\value{t};
};
\ENDBOXTEST

\BEGINBOXTEST{pgfmanual-en-dv-polar-4}
\tikz \datavisualization [
scientific polar axes,
radius axis={
attribute=distance,
ticks={step=5000},
padding=1.5em,
length=3cm,
grid
},
visualize as smooth line]
data [format=function] {
var angle : interval [0:100];
func distance = \value{angle}*\value{angle};
};
\ENDBOXTEST

\BEGINBOXTEST{pgfmanual-en-dv-polar-5}
\tikz \datavisualization [
scientific polar axes={outer ticks, 0 to 180},
visualize as smooth line]
data [format=function] {
var angle : interval [0:100];
func radius = \value{angle};
};
\ENDBOXTEST

\BEGINBOXTEST{pgfmanual-en-dv-polar-6}
\tikz \datavisualization [
scientific polar axes={inner ticks, 0 to 180},
visualize as smooth line]
data [format=function] {
var angle : interval [0:100];
func radius = \value{angle};
};
\ENDBOXTEST

\BEGINBOXTEST{pgfmanual-en-dv-polar-7}
\tikz \datavisualization [
scientific polar axes={clean, 0 to 180},
visualize as smooth line]
data [format=function] {
var angle : interval [0:100];
func radius = \value{angle};
};
\ENDBOXTEST

\BEGINBOXTEST{pgfmanual-en-dv-polar-8}
\tikz \datavisualization [
scientific polar axes={
clean,
0 to 90 % the option
},
angle axis={ticks={step=30}},
radius axis={length=1cm, ticks={step=1}},
visualize as scatter]
data point [angle=20, radius=0.5]
data point [angle=30, radius=1]
data point [angle=40, radius=1.5];
\ENDBOXTEST

\BEGINBOXTEST{pgfmanual-en-dv-polar-9}
\tikz \datavisualization
[new polar axes={angle axis}{radius axis},
radius axis={length=2cm},
visualize as scatter]
data [format=named] {
angle={0,20,...,160}, radius={0,...,5}
};
\ENDBOXTEST

\BEGINBOXTEST{pgfmanual-en-dv-polar-10}
\tikz \datavisualization
[new polar axes={angle axis}{radius axis},
radius axis={unit length=1cm},
angle axis={unit vectors={(10:1pt)}{(60:1pt)}},
visualize as scatter]
data [format=named] {
angle={0,90}, radius={0.25,0.5,...,2}
};
\ENDBOXTEST

\BEGINBOXTEST{pgfmanual-en-dv-polar-11}
\tikz \datavisualization
[new polar axes={angle axis}{radius axis},
radius axis={unit length=1cm},
angle axis={degrees},
visualize as scatter]
data [format=named] {
angle={10,90}, radius={0.25,0.5,...,2}
};
\ENDBOXTEST

\BEGINBOXTEST{pgfmanual-en-dv-polar-12}
\tikz \datavisualization
[new polar axes={angle axis}{radius axis},
radius axis={unit length=1cm},
angle axis={radians},
visualize as scatter]
data [format=named] {
angle={0,1.5}, radius={0.25,0.5,...,2}
};
\ENDBOXTEST
\END
Loading