TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

My question is related to Wind power and tikz force.

Thanks to Mark Wibrow I have some nice wind turbines, but I want to scale them and make some dynamic changes. I try to had some new parameters, but it doesn' work. I just add to his original code:

  \tikzset{path/.style args={#1 scale #2}{fill, draw=white, ultra thick, line join=round}}
  \path [path] 
(-.25,0) arc (180:360:.25 and .0625) -- (.0625,3) -- (-.0625,3) -- cycle;


It's not working:

<argument> ...set {path/.style args={##1 scale ##2
                                              }{fill, draw=white, ultra ...
l.418 }}

Edit Solved thanks to Ignasi:

enter image description here


    pics/mysymbol/.style args={#1 scale #2 with #3}{
                fill,draw=white,line join=round,#3}}
    \path[WinT] (-.25,0) arc (180:360:.25 and .0625)
        -- (.0625,3) -- (-.0625,3) -- cycle;
    \pgfmathsetmacro{\Rand}{(rand*60 + 1) - 30}
    \foreach \i in {90, 210, 330}{
        \path [WinT, shift=(90:3), rotate=\i+\Rand] 
        (.5,-.1875) arc (270:90:.5 and .1875)
        arc (90:-90:1.5 and .1875);
        \path [WinT, shift=(90:3), rotate=\i+\Rand] 
        (0,0.125) -- (2,0.125) -- (2,0) -- (0.5,-0.375) -- cycle;
        \path [WinT, shift=(90:3), rotate=\i+\Rand]
        (0,-0.125) arc (180:0:1 and 0.125) -- ++(0,0.125)
        arc (0:180:1 and 0.25) -- cycle;
    \path [WinT] (0,3) circle [radius=.25];

\draw[help lines] (0,-2) grid (20,20) ;

\draw[fill=blue!50, opacity=.5] (1,0) arc (180:90:18) -- ++(0,-2)
    arc (90:180:16) --cycle ;

\draw[<->,>=stealth,thick] (1,-1)--(3,-1) node[midway,below]
        {\scriptsize 200\,m} ;

\foreach \i in {13,12,...,0} {%
    \begin{scope}[shift={($(19,0) + (176-\i*6.35:16.9)$)}]
    \path (0,0) pic {mysymbol={1 scale .25 with thick}} ;

share|improve this question
I'm not sure because you don't show the initial code but when pics with parameters are declared, a special declaration is needed. Instead of wind turbine/.pic you must use pics/wind turbine/.style={code={... An example: How to create something like a function (procedure, macros, etc.) in TikZ? – Ignasi Apr 26 '14 at 9:08
path style requires arguments but you are not providing any in the required form such as path=1 scale 2 – percusse Apr 26 '14 at 9:40
@Ignasi Thank you it works, feel free to make answer, I'll accept it. – Tarass Apr 26 '14 at 10:14
@percusse you're right, I missplaced the args stuff. Thank's. – Tarass Apr 26 '14 at 10:35
up vote 7 down vote accepted

TikZ documentation explains (section 18.3) that pics are defined with syntax

            <pic commands>},

although key handler .pic is provided to allow an alternative and easier version

       <pic commands> },

But TikZ documentation also says:

In almost all cases, the .pic key handler will suffice to setup keys. However, there are cases where you really need to use the first version using .style and code=:

  • Whenever your pic type needs to set the foreground or the background code.
  • In case of complicated arguments given to the keys.

Therefore, you must change your wind turbine declaration to use first (complete) syntax to pass complicated arguments.

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.