diff options
Diffstat (limited to 'graphics/pgf/contrib/jigsaw/jigsaw.sty')
-rw-r--r-- | graphics/pgf/contrib/jigsaw/jigsaw.sty | 37 |
1 files changed, 24 insertions, 13 deletions
diff --git a/graphics/pgf/contrib/jigsaw/jigsaw.sty b/graphics/pgf/contrib/jigsaw/jigsaw.sty index 748014c842..ae1a736042 100644 --- a/graphics/pgf/contrib/jigsaw/jigsaw.sty +++ b/graphics/pgf/contrib/jigsaw/jigsaw.sty @@ -11,12 +11,8 @@ % Released under the LaTeX Project Public License v1.3c or later % See http://www.latex-project.org/lppl.txt % -% Version 0.1a -% NOv 9, 2018 -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -\ProvidesPackage{jigsaw} - [2018/11/09 v0.1a Draw jigsaw pieces in TikZ] +\ProvidesPackage{jigsaw}[2018/11/09 v0.1 Draw jigsaw pieces in TikZ] \RequirePackage{tikz} @@ -40,7 +36,7 @@ (0.4,#1*0.04) .. controls (0.4,#1*0.11) and (0.2,#1*0.26) .. (0.5,#1*0.26) .. controls (0.8,#1*0.26) and (0.6,#1*0.11) .. (0.6,#1*0.04) .. controls (0.6,#1*-0.04) and (1.0,#1*0.00) .. -(1.0,#1*0.00) +(1.0,#1*0.00) -- ++(.5\pgflinewidth,0) } \newcommand{\halfpiece}[2]{ @@ -52,17 +48,17 @@ \ifx\tmp\@nnil \else \fill[#1] - \side{#2} -- (0.5,0.5) - [rotate around={90:(0.5,0.5)}] \side{#3} -- (0.5,0.5) - [rotate around={180:(0.5,0.5)}] \side{#5} -- (0.5,0.5) - [rotate around={270:(0.5,0.5)}] \side{#4} -- (0.5,0.5) + \side{#2} + [rotate around={90:(0.5,0.5)}] -- \side{#3} + [rotate around={90:(0.5,0.5)}] -- \side{#4} + [rotate around={90:(0.5,0.5)}] -- \side{#5} -- cycle; \fi \draw \side{#2} - [rotate around={90:(0.5,0.5)}] \side{#3} - [rotate around={180:(0.5,0.5)}] \side{#5} - [rotate around={270:(0.5,0.5)}] \side{#4}; + [rotate around={90:(0.5,0.5)}] -- \side{#3} + [rotate around={90:(0.5,0.5)}] -- \side{#4} + [rotate around={90:(0.5,0.5)}] -- \side{#5}; } \newcommand{\tile}[5][\@nil]{% @@ -97,4 +93,19 @@ } } \draw (0,0) -- (0,\ymax) -- (\xmax,\ymax); +} + +\tikzset{ + pics/piece/.style n args={4}{ + inherit options/.code={\csname tikz@options\endcsname},inherit options, + code = { + \path[pic actions] + \side{#1} + [rotate around={90:(0.5,0.5)}] -- \side{#2} + [rotate around={90:(0.5,0.5)}] -- \side{#3} + [rotate around={90:(0.5,0.5)}] -- \side{#4} + -- cycle; + } + }, + piece/.search also={,/tikz,/pgf}, }
\ No newline at end of file |