Asked
Active
Viewed 131 times
0
-
3There are a lot of links that provides to create clouds: https://tex.stackexchange.com/questions/45404/asymmetric-cloud-shape-in-tikz/448414 (for example). You can search: clouds puff. – Sebastiano May 30 '21 at 11:59
-
1Show us what you have tried. – hola May 30 '21 at 12:53
-
2Actually, your suestion is not clear enough. Do you only want to draw these or do you want to create node shapes like these that could be automatically scaled depending of their content? If this is the first case, the answer is pretty straightforward. The latter, on the other hand... – SebGlav May 30 '21 at 13:20
-
1thank you @Sebastiano I think it will help – Karim May 30 '21 at 17:59
-
@hola I just start learning latex, and Tikz is much harder (I think) I don't know anything about it... I've already found alot of shapes that I need but those two I didn't found them. – Karim May 30 '21 at 18:04
-
@SebGlav well, I want node shapes. – Karim May 30 '21 at 18:06
-
I think that the first one should be feasible, at least by drawing around the rectangle shape. But to create a real node shape like this, with correct anchors would be very hard. – SebGlav May 30 '21 at 18:21
1 Answers
1
(I always wanted to try https://tex.stackexchange.com/a/435766 )
\documentclass[tikz,border=3.14mm]{standalone}
\usetikzlibrary{calc}
% (2) define the result of (1)
\newsavebox\mybanner
\sbox\mybanner{\begin{tikzpicture}[line cap=round,line join=round,scale=0.25]
\tikzstyle{l}=[rounded corners,draw=blue];
\tikzstyle{f}=[l,fill=blue];
\draw[l] (-44, 36) -- (-38 , 41) -- (-44, 47.5) -- (-27, 47) -- (-27, 43) -- (-23, 35.5) -- cycle;
\draw[f] (-27, 43) -- (-23, 35.5) -- (-22, 43) -- cycle;
\draw[l] (-27, 43) -- (25, 43) -- (25, 59) -- (-27, 59) -- cycle;
\draw[f] (25, 43) -- (21.5, 37) -- (21.5, 43) -- cycle;
\draw[f] (25, 43) -- (21.5, 37) -- (21.5, 43) -- cycle;
\draw[l] (25, 43) -- (21.5, 37) -- (44, 38) -- (37, 43.5) -- (42, 48) -- (25, 49) -- cycle;
\end{tikzpicture}}
\newsavebox\mybubble
\sbox\mybubble{\begin{tikzpicture}[line cap=round,line join=round,scale=0.25]
\tikzstyle{l}=[rounded corners,draw=green];
\draw[l] (-5,15) .. controls ( 0,24) and ( 18,24) ..
(21,18) .. controls (21,21) and ( 27,21) ..
(23,17) .. controls (25,15) and ( 26, 9) ..
(22, 5) .. controls (23, 4) and ( 23, 2) ..
(20, 4) .. controls (20,-5) and ( -5,-6) ..
(-3, 2) .. controls (-5, 0) and ( -5, 1) ..
(-4, 3) .. controls (-8, 0) and (-12,10) ..
(-7,14) .. controls (-9,17) and ( -7,18) ..
(-5,15)
-- cycle;
\end{tikzpicture}}
\begin{document}
\begin{tikzpicture}
% (0) include the image
\node (tmp) {\includegraphics{OMfYk.jpg}};
\draw (tmp.south west) grid (tmp.north east);
\draw let \p1=(tmp.south west), \p2=(tmp.north east) in
\pgfextra{\pgfmathsetmacro{\xmin}{int(\x1/1cm)}
\pgfmathsetmacro{\xmax}{int(\x2/1cm)}
\pgfmathsetmacro{\ymin}{int(\y1/1cm)}
\pgfmathsetmacro{\ymax}{int(\y2/1cm)}
\typeout{\xmin,\xmax}}
\foreach \X in {\xmin,...,\xmax} {(\X,\y1) node[anchor=north] {\X}}
\foreach \Y in {\ymin,...,\ymax} {(\x1,\Y) node[anchor=east] {\Y}};
\tikzstyle{l}=[line width=9pt,rounded corners,draw=red];
\tikzstyle{f}=[l,fill=red];
% (1) figure out its shape
\draw[l] (-44, 36) -- (-38 , 41) -- (-44, 47.5) -- (-27, 47) -- (-27, 43) -- (-23, 35.5) -- cycle;
\draw[f] (-27, 43) -- (-23, 35.5) -- (-22, 43) -- cycle;
\draw[l] (-27, 43) -- (25, 43) -- (25, 59) -- (-27, 59) -- cycle;
\draw[f] (25, 43) -- (21.5, 37) -- (21.5, 43) -- cycle;
\draw[f] (25, 43) -- (21.5, 37) -- (21.5, 43) -- cycle;
\draw[l] (25, 43) -- (21.5, 37) -- (44, 38) -- (37, 43.5) -- (42, 48) -- (25, 49) -- cycle;
\draw[l] (-5,15) .. controls ( 0,24) and ( 18,24) ..
(21,18) .. controls (21,21) and ( 27,21) ..
(23,17) .. controls (25,15) and ( 26, 9) ..
(22, 5) .. controls (23, 4) and ( 23, 2) ..
(20, 4) .. controls (20,-5) and ( -5,-6) ..
(-3, 2) .. controls (-5, 0) and ( -5, 1) ..
(-4, 3) .. controls (-8, 0) and (-12,10) ..
(-7,14) .. controls (-9,17) and ( -7,18) ..
(-5,15);
-- cycle;
% (3) usable like this:
\node at (0,30) [node contents=\usebox{\mybanner}, rotate=180, scale=2];
\node at (-25,0) [node contents=\usebox{\mybubble}, rotate= 12, scale=3];
\end{tikzpicture}
\end{document}
See also:
Cameron Hudson
- 125

