I'm currently fiddling around with the pgf library curvilinear. What I want to do is make a shape bending like the shape of a grid, a grid very similar to this one: Canvas transformation of grid to curvilinear grid
One issue however, is that I cannot seem to spawn this grid at a designated place in my tikzpicture. How can I spawn the grid at say, point (0,-5) in my tikzpicture?
So basically, I want to create a flat amount of offset on the nonlinear transformation to then use it as a reference to make a rectangular curve wrapped across the grid (but that shouldn't be too much of an issue).
Code:
\documentclass[landscape,svgnames]{article}
\usepackage[a3paper]{geometry}
\usepackage{tikz}
\usetikzlibrary{fadings,shapes.arrows,shadows,arrows,positioning,shapes}
\usepgflibrary{curvilinear}
\usepgfmodule{nonlineartransformations}
\makeatletter
\pgfkeys{%
/polargrid/.cd,
rmin/.code ={\global\def\rmin {#1}},
rmax/.code ={\global\def\rmax {#1}},
amin/.code ={\global\def\amin {#1}},
amax/.code ={\global\def\amax {#1}},
rstep/.code={\global\def\rstep{#1}},
astep/.code={\global\def\astep{#1}}}
\def\polargrid{\pgfutil@ifnextchar[{\polar@grid}{\polar@grid[]}}%
\def\polar@grid[#1]{%
\pgfkeys{/polargrid/.cd,
rmin ={0},
rmax ={10},
amin ={0},
amax ={180},
rstep={1},
astep={10}}
%
\pgfqkeys{/polargrid}{#1}%
\pgfmathsetmacro{\addastep}{\amin+\astep}
\pgfmathsetmacro{\addrstep}{\rmin+\rstep}
\foreach \a in {\amin,\addastep,...,\amax} \draw[gray] (\a:\rmin) -- (\a:\rmax);
\foreach \r in {\rmin,\addrstep,...,\rmax} \draw[gray] (\amin:\r cm) arc (\amin:\amax:\r cm);
}
\makeatother
\begin{document}
\begin{tikzpicture}[scale=2,node distance=1cm, auto,baseline=-.5ex]
\polargrid[rmin=4,rmax=8,amin=180,amax=360] at (5,0)
\end{tikzpicture}
\end{document}
curvilinearlibrary: could you point the source code? – Claudio Fiandrino Apr 12 '14 at 08:16TikZ3manual. – Malipivo Apr 12 '14 at 08:23