TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. It's 100% free, no registration required.

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

I'm using TikZ to draw a cloud. Also I'm drawing arrows from the cloud to some nodes. But the startpoints of the arrows are in or outside the cloud but not exactly on the outer line. I think the picture shows my problem:

a cloud with arrows

As well here is an MWE:

    \node[cloud, cloud puffs=15.7, minimum width=3cm, draw] (cloud) at (0,0) {Cloud};
    \path[->] (cloud) edge (2, 2)
          (cloud) edge (2, 1);

As you may think by yourself my question is how to position the start points of the arrows on the line of the cloud.

share|improve this question
It's due to the fractional numbers of puffs. – percusse Jan 11 '13 at 13:38
I thought that as well. But is there a simple possibility to position the start points correctly? – Dave Jan 11 '13 at 13:53
up vote 10 down vote accepted

You can either use an integer number of puffs or the intersections library and find the points manually.


  • I used named coordinates for (2,1) and (2,2) to not repeat hard-coded coordinates.
  • The anchor .center is neede because in the second example (the one to (2,1)) the (cloud) -- (2,1) does not intersect with the cloud’s border.


        name path=cloud,
        cloud, cloud puffs=15.7,
        minimum width=3cm, draw,
    ] (cloud) at (0,0) {Cloud};
    \path[name path=path22] (cloud.center) -- (2, 2) coordinate (to22);
    \path[name path=path21] (cloud.center) -- (2, 1) coordinate (to21);
          name intersections={of=cloud and path22,name=from22},
          name intersections={of=cloud and path21,name=from21}
       ] (from22-1) edge (to22)
         (from21-1) to   (to21);


enter image description here

share|improve this answer
Thank you very much for this simple solution. I think I will simply use an integer numer ;-) – Dave Jan 11 '13 at 22:24

Of course Qrrbrbirlbel answer is the right one, but I cannot resist to post this cheat idea: draw the cloud shape after the rays, and use white fill. This solution is much simpler if you have lots of rays to draw.

    \coordinate (cloud) at (0,0);
    \foreach \angle in {0,15,...,360}
      \draw[->] (cloud) -- (\angle:2);
    \node[cloud, cloud puffs=15.7, minimum width=3cm, draw,
          fill=white] (cloud) at (cloud) {Cloud};



share|improve this answer
Try something like \foreach \angle in {0,1,...,360}\draw (cloud) -- (\angle:2); (cloud being the node not the coordinate!) and you will see that only the upper right part of the cloud (the asymmetric one due to the non-integer number of puffs) is the problem. The cloud puffs=15 border is clearly visible. – Qrrbrbirlbel Jan 11 '13 at 15:14
@Qrrbrbirlbel Right! Nice demonstration indeed. – JLDiaz Jan 11 '13 at 15:18
@JLDiaz Thanks for the solution :-) – Dave Jan 11 '13 at 22:25

@Dave I never even thought of a non-integer number of puffs. You've stumbled on something that shouldn't work, but does. Obviously Qrrbrbirlbel provides the proper solution. But for fans of impenetrable hacking, here's something that also shouldn't work, but does:




% Save the original background path definition.

% Redefine the cloud background path.
    % Draw the original path.
    % Now save it globally.
    % NB this will NOT work with early PGF versions as this
    % relies on \pgf@node@name
        \let\csname pgf@sh@bg@path@saved@\pgf@node@name\endcsname=\tmp@path%

% Now redefine the cloud anchor border.
% NB Outer sep is NOT taken into account.
        % Set the transform of the current referenced node.
        \pgfsettransform{\csname pgf@sh@nt@\pgfreferencednodename\endcsname}%
        % Draw a line from the center of the cloud to the the external point.
        % Install the saved cloud path.
            \csname pgf@sh@bg@path@saved@\pgfreferencednodename\endcsname%      
            % Transform the intersection appropriately.


\node [cloud, cloud puffs=15.7, minimum width=3cm, draw]
    (cloud) at (0,0) {Cloud};

\foreach \i in {0, 10, ..., 360}
    \draw [black, ->] (cloud) -- (\i:5cm and 3cm);


cloud border intersections

Note, that it doesn't take into account the outer sep and is likely not to be particularly robust, nor will it work with early versions of PGF. It is also slow.

share|improve this answer
fans of impenetrable hacking that would be me :) But there was another question for asymetrical cloud puffs which might be the reason for this question because on that question the asymmetry was achieved via nonineteger puff number. – percusse Jan 11 '13 at 20:40
@mwibrow Yes, I like hacky solutions as well :-) But for the my presentation I will use a simple one ;-) – Dave Jan 11 '13 at 22:26

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.