Dataset Viewer
Auto-converted to Parquet Duplicate
id
stringlengths
8
28
code
stringlengths
1.14k
3.28k
instruction
stringlengths
21
328
code_solution
stringlengths
1.13k
3.31k
image_input
imagewidth (px)
343
1.14k
image_solution
imagewidth (px)
343
1.7k
bee_eyes
\documentclass[tikz,border=5]{standalone} \usepackage[prefix=]{xcolor-material} \tikzset{ half clip/.code={ \clip (0, -256) rectangle (256, 256); }, color alias/.code args={#1 as #2}{\colorlet{#1}{#2}}, colors alias/.style={color alias/.list/.expanded={#1}}, execute/.code={#1}, on left/.style={.. on left/.style={#1}}, on right/.style={.. on right/.style={#1}}, } \newcommand\reflect[2][]{ \begin{scope}[#1]\foreach \side in {-1, 1}{\begin{scope} \ifnum\side=-1 \tikzset{.. on left/.try}\else\tikzset{.. on right/.try}\fi \begin{scope}[xscale=\side]#2\end{scope} \end{scope}}\end{scope}} \tikzset{ bee/.pic={ \begin{scope}[x=3cm/480,y=3cm/480, rotate=-45, shift=(270:48)] \reflect[ on left= {colors alias={body as BlueGrey800, stripes as Amber500}}, on right={colors alias={body as BlueGrey900, stripes as Amber700}, half clip}, lower wing/.style={fill=BlueGrey100}, upper wing/.style={fill=BlueGrey50}]{ \fill [body] (0,-160) .. controls ++(120:64) and ++(270:64) .. (-88, -16) .. controls ++( 90:64) and ++(225:64) .. ( 0, 128) .. controls ++(315:64) and ++( 90:64) .. ( 88, -16) .. controls ++(270:64) and ++( 60:64) .. cycle; \fill [body] (0,128) ellipse [x radius=80, y radius=56]; \fill [body] (32,160) arc (180:90:64) -- ++(6,-6) coordinate [midway] (@) arc (90:180:64) -- cycle; \fill [body] (@) circle [radius=12]; \begin{scope} \clip (0,-160) .. controls ++(120:64) and ++(270:64) .. (-88, -16) .. controls ++( 90:64) and ++(225:64) .. ( 0, 128) .. controls ++(315:64) and ++( 90:64) .. ( 88, -16) .. controls ++(270:64) and ++( 60:64) .. cycle; \foreach \i in {0,...,2} \fill [stripes] (-256, -160 + \i*80) rectangle ++(512, 40); \end{scope} \foreach \s [count=\i from -1] in {lower wing, upper wing} \fill [style=\s, shift={(16,56)}, rotate=\i*32] (0,0) .. controls ++( 30:64) and ++(180:32) .. (128,56) arc (90:-90:56) .. controls ++(180:32) and ++(330:64) .. cycle; } \end{scope}} } \begin{document} \begin{tikzpicture} \fill [fill=LightBlue300] circle [radius=2]; \pic {bee}; \end{tikzpicture} \end{document}
Add eyes to the bee with pupils, on the front of its head, looking forward
\documentclass[tikz,border=5]{standalone} \usepackage[prefix=]{xcolor-material} \tikzset{ half clip/.code={ \clip (0, -256) rectangle (256, 256); }, color alias/.code args={#1 as #2}{\colorlet{#1}{#2}}, colors alias/.style={color alias/.list/.expanded={#1}}, execute/.code={#1}, on left/.style={.. on left/.style={#1}}, on right/.style={.. on right/.style={#1}}, } \newcommand\reflect[2][]{ \begin{scope}[#1]\foreach \side in {-1, 1}{\begin{scope} \ifnum\side=-1 \tikzset{.. on left/.try}\else\tikzset{.. on right/.try}\fi \begin{scope}[xscale=\side]#2\end{scope} \end{scope}}\end{scope}} \tikzset{ bee/.pic={ \begin{scope}[x=3cm/480,y=3cm/480, rotate=-45, shift=(270:48)] \reflect[ on left= {colors alias={body as BlueGrey800, stripes as Amber500}}, on right={colors alias={body as BlueGrey900, stripes as Amber700}, half clip}, lower wing/.style={fill=BlueGrey100}, upper wing/.style={fill=BlueGrey50}]{ \fill [body] (0,-160) .. controls ++(120:64) and ++(270:64) .. (-88, -16) .. controls ++( 90:64) and ++(225:64) .. ( 0, 128) .. controls ++(315:64) and ++( 90:64) .. ( 88, -16) .. controls ++(270:64) and ++( 60:64) .. cycle; \fill [body] (0,128) ellipse [x radius=80, y radius=56]; \fill [body] (32,160) arc (180:90:64) -- ++(6,-6) coordinate [midway] (@) arc (90:180:64) -- cycle; \fill [body] (@) circle [radius=12]; \begin{scope} \clip (0,-160) .. controls ++(120:64) and ++(270:64) .. (-88, -16) .. controls ++( 90:64) and ++(225:64) .. ( 0, 128) .. controls ++(315:64) and ++( 90:64) .. ( 88, -16) .. controls ++(270:64) and ++( 60:64) .. cycle; \foreach \i in {0,...,2} \fill [stripes] (-256, -160 + \i*80) rectangle ++(512, 40); \end{scope} \foreach \s [count=\i from -1] in {lower wing, upper wing} \fill [style=\s, shift={(16,56)}, rotate=\i*32] (0,0) .. controls ++( 30:64) and ++(180:32) .. (128,56) arc (90:-90:56) .. controls ++(180:32) and ++(330:64) .. cycle; \fill [BlueGrey100] (40, 150) circle [radius=20]; \fill [BlueGrey700] (40, 160) circle [radius=7]; } \end{scope}} } \begin{document} \begin{tikzpicture} \fill [fill=LightBlue300] circle [radius=2]; \pic {bee}; \end{tikzpicture} \end{document}
box_other_measure
\documentclass[tikz,border=5]{standalone} \usepackage{amsmath, amsthm, amssymb,enumerate} \usepackage{tikz} \usetikzlibrary{shapes,arrows,fit,calc,positioning,patterns} \usepackage{xcolor} \usepackage{tikz} \usepackage{pgfplots,amsmath} \usetikzlibrary{shapes,arrows,fit,calc,positioning,patterns,decorations.pathmorphing,decorations.pathreplacing} \tikzset{ brokenrect/.style={ append after command={ \pgfextra{ \path[draw,#1] decorate[decoration={zigzag,segment length=0.3em, amplitude=.7mm}] {(\tikzlastnode.north east)--(\tikzlastnode.south east)} -- (\tikzlastnode.south west)|-cycle; }}}} \tikzset{ brokenrect2/.style={ append after command={ \pgfextra{ \path[draw,#1] decorate[decoration={zigzag,segment length=0.3em, amplitude=.7mm}] {(\tikzlastnode.north west)--(\tikzlastnode.south west)} -- (\tikzlastnode.south east)|-cycle; }}}} \tikzset{cross/.style={cross out, draw=black, minimum size=2*(#1-\pgflinewidth), inner sep=0pt, outer sep=0pt}, cross/.default={1pt}} \begin{document} \begin{tikzpicture} \def\ox{0} \def\oy{0} \coordinate(o) at (\ox,\oy); \def\tl{10.0} \draw [-latex](\ox,\oy) node[above left]{} -- (\ox+\tl,\oy) node[above,font=\small]{$t$}; \def\pi{0.5} \tikzstyle{mystyle}=[draw, minimum height=0.5cm,rectangle, inner sep=0pt,font=\scriptsize] \tikzstyle{mystyle2}=[draw = none, minimum height=0.25cm,rectangle, inner sep=0pt,font=\scriptsize] \draw (0,0) -- (0,-0.2) node[below] {\tiny $S_1$}; \draw (\pi,0) -- (\pi,-0.2) node[below] {\tiny $S_2$}; \draw (2.5,0) -- (2.5,-0.2) node[below] {\tiny $S_3$}; \draw (7.5,0) -- (7.5,-0.2) node[below] {\tiny $C_1$}; \draw (4.75,0) -- (4.75,-0.2) node[below] {\tiny $C_2$}; \draw (9.5,0) -- (9.5,-0.2) node[below] {\tiny $C_3$}; \draw [<->] (\pi,0.65)--node[above]{\small $L_1$}(\pi+5,0.65); \node(b1) [above right=-0.01cm and -0.01cm of o,mystyle, minimum width=\pi cm,pattern=north west lines, pattern color=red]{}; \node(b1_t) [mystyle2, fill = white] at (b1.center) {$a_1$}; \node(b2) [right=5cm of b1,mystyle, minimum width=2 cm,pattern=north west lines, pattern color=red]{}; \node(b2_t) [mystyle2, fill = white] at (b2.center) {$b_1$}; \node(b3) [right=0cm of b1,mystyle, minimum width=1.5 cm,pattern=north east lines, pattern color=green]{}; \node(b3_t) [mystyle2, fill = white] at (b3.center) {$a_2$}; \node(b4) [right=2cm of b3,mystyle, minimum width=0.75 cm,pattern=north east lines, pattern color=green]{}; \node(b4_t) [mystyle2, fill = white] at (b4.center) {$b_2$}; \node(b5) [right=0.5cm of b3,mystyle, minimum width=1 cm,pattern=vertical lines, pattern color=yellow]{}; \node(b5_t) [mystyle2, fill = white] at (b5.center) {$a_3$}; \node(b6) [right=1cm of b2,mystyle, minimum width=1 cm,pattern=vertical lines, pattern color=yellow]{}; \node(b6_t) [mystyle2, fill = white] at (b6.center) {$b_3$}; \end{tikzpicture} \end{document}
Add another interval L2, going from the end of b1 to the end of b3.
\documentclass[tikz,border=5]{standalone} \usepackage{amsmath, amsthm, amssymb,enumerate} \usepackage{tikz} \usetikzlibrary{shapes,arrows,fit,calc,positioning,patterns} \usepackage{xcolor} \usepackage{tikz} \usepackage{pgfplots,amsmath} \usetikzlibrary{shapes,arrows,fit,calc,positioning,patterns,decorations.pathmorphing,decorations.pathreplacing} \tikzset{ brokenrect/.style={ append after command={ \pgfextra{ \path[draw,#1] decorate[decoration={zigzag,segment length=0.3em, amplitude=.7mm}] {(\tikzlastnode.north east)--(\tikzlastnode.south east)} -- (\tikzlastnode.south west)|-cycle; }}}} \tikzset{ brokenrect2/.style={ append after command={ \pgfextra{ \path[draw,#1] decorate[decoration={zigzag,segment length=0.3em, amplitude=.7mm}] {(\tikzlastnode.north west)--(\tikzlastnode.south west)} -- (\tikzlastnode.south east)|-cycle; }}}} \tikzset{cross/.style={cross out, draw=black, minimum size=2*(#1-\pgflinewidth), inner sep=0pt, outer sep=0pt}, cross/.default={1pt}} \begin{document} \begin{tikzpicture} \def\ox{0} \def\oy{0} \coordinate(o) at (\ox,\oy); \def\tl{10.0} \draw [-latex](\ox,\oy) node[above left]{} -- (\ox+\tl,\oy) node[above,font=\small]{$t$}; \def\pi{0.5} \tikzstyle{mystyle}=[draw, minimum height=0.5cm,rectangle, inner sep=0pt,font=\scriptsize] \tikzstyle{mystyle2}=[draw = none, minimum height=0.25cm,rectangle, inner sep=0pt,font=\scriptsize] \draw (0,0) -- (0,-0.2) node[below] {\tiny $S_1$}; \draw (\pi,0) -- (\pi,-0.2) node[below] {\tiny $S_2$}; \draw (2.5,0) -- (2.5,-0.2) node[below] {\tiny $S_3$}; \draw (7.5,0) -- (7.5,-0.2) node[below] {\tiny $C_1$}; \draw (4.75,0) -- (4.75,-0.2) node[below] {\tiny $C_2$}; \draw (9.5,0) -- (9.5,-0.2) node[below] {\tiny $C_3$}; \draw [<->] (\pi,0.65)--node[above]{\small $L_1$}(\pi+5,0.65); \draw [<->] (7.5,0.65)--node[above]{\small $L_2$}(9.5,0.65); \node(b1) [above right=-0.01cm and -0.01cm of o,mystyle, minimum width=\pi cm,pattern=north west lines, pattern color=red]{}; \node(b1_t) [mystyle2, fill = white] at (b1.center) {$a_1$}; \node(b2) [right=5cm of b1,mystyle, minimum width=2 cm,pattern=north west lines, pattern color=red]{}; \node(b2_t) [mystyle2, fill = white] at (b2.center) {$b_1$}; \node(b3) [right=0cm of b1,mystyle, minimum width=1.5 cm,pattern=north east lines, pattern color=green]{}; \node(b3_t) [mystyle2, fill = white] at (b3.center) {$a_2$}; \node(b4) [right=2cm of b3,mystyle, minimum width=0.75 cm,pattern=north east lines, pattern color=green]{}; \node(b4_t) [mystyle2, fill = white] at (b4.center) {$b_2$}; \node(b5) [right=0.5cm of b3,mystyle, minimum width=1 cm,pattern=vertical lines, pattern color=yellow]{}; \node(b5_t) [mystyle2, fill = white] at (b5.center) {$a_3$}; \node(b6) [right=1cm of b2,mystyle, minimum width=1 cm,pattern=vertical lines, pattern color=yellow]{}; \node(b6_t) [mystyle2, fill = white] at (b6.center) {$b_3$}; \end{tikzpicture} \end{document}
cardiac_right_align
\documentclass[tikz,border=5]{standalone} \usepackage{amsmath} \usepackage{tikz} \usepgfmodule{nonlineartransformations} \usetikzlibrary{curvilinear,patterns,decorations.pathreplacing,spy,calc} \usepackage{pgfplots} \usepackage{pgfplotstable} \usepgfplotslibrary{groupplots} \pgfplotsset{/pgfplots/table/search path={dat}} \begin{document} \begin{tikzpicture}[xscale=1.3,yscale=1.2] \def\block(#1,#2,#3,#4){\node[draw=black,thick,rounded corners=2,inner sep=8,fill=white] (#1) at (#2,#3) [anchor=center] {#4};} \begin{scope}[shift={(0,8)}] \draw[thick,blue](-1,-0.75) rectangle (4,3.25); \node at (0.5,2.75) {\bf{OpenCL Program}}; \block(A, 0.0, 0, Block 6) \block(B, 1.5, 0, Block 7) \block(C, 3.0, 0, Block 8) \block(E, 0.0, 1, Block 3) \block(F, 1.5, 1, Block 4) \block(G, 3.0, 1, Block 5) \block(E, 0.0, 2, Block 0) \block(F, 1.5, 2, Block 1) \block(G, 3.0, 2, Block 2) \end{scope} \begin{scope}[shift={(2,1.25)}] \draw[->,thick,blue] (0.0,4) to (0.0,-0.75); \draw[->,thick,blue] (1.5,4) to (1.5,0.25); \draw[->,thick,blue] (3.0,4) to (3.0,0.25); \draw[->,thick,blue] (4.5,4) to (4.5,0.25); \end{scope} \begin{scope}[shift={(2,5)}] \draw[thick,black](-1,-0.75) rectangle (5.5,1.25); \draw[pattern=north east lines,pattern color=lightgray](-1,-0.75) rectangle (5.5,1.25); \node at (0.5,0.75) {\bf{GPU with 4 Cores}}; \block(A, 0.0, 0, Core 0) \block(B, 1.5, 0, Core 1) \block(C, 3.0, 0, Core 2) \block(E, 4.5, 0, Core 3) \end{scope} \begin{scope}[shift={(2,1.25)}] \draw[thick,black](-1,-1) rectangle (5.5,2.75); \block(A, 0.0, 2, Block 0) \block(B, 1.5, 2, Block 1) \block(C, 3.0, 2, Block 2) \block(E, 4.5, 2, Block 3) \block(A, 0.0, 1, Block 4) \block(B, 1.5, 1, Block 5) \block(C, 3.0, 1, Block 6) \block(E, 4.5, 1, Block 7) \block(A, 0.0, 0, Block 8) \end{scope} \draw[->,black,thick,out=0,in=90] (4.25,9) to node [midway,above,black,anchor=west] {\bf{Compile}} (6,6.5) ; \draw[->,black,thick] (0.5,5) to node [midway,above,black,anchor=east] {\bf{Execute}} (0.5,0.5) ; \end{tikzpicture} \end{document}
Move the gpu and the section under it(all the blocks on the right of the execute arrow) to the right of the OpenCL Program. Put the "Execute" arrow to the right so that it does not interfere with the compile arrow.
\documentclass[tikz,border=5]{standalone} \usepackage{amsmath} \usepackage{tikz} \usepgfmodule{nonlineartransformations} \usetikzlibrary{curvilinear,patterns,decorations.pathreplacing,spy,calc} \usepackage{pgfplots} \usepackage{pgfplotstable} \usepgfplotslibrary{groupplots} \pgfplotsset{/pgfplots/table/search path={dat}} \begin{document} \begin{tikzpicture}[xscale=1.3,yscale=1.2] \def\block(#1,#2,#3,#4){\node[draw=black,thick,rounded corners=2,inner sep=8,fill=white] (#1) at (#2,#3) [anchor=center] {#4};} \begin{scope}[shift={(0,8)}] \draw[thick,blue](-1,-0.75) rectangle (4,3.25); \node at (0.5,2.75) {\bf{OpenCL Program}}; \block(A, 0.0, 0, Block 6) \block(B, 1.5, 0, Block 7) \block(C, 3.0, 0, Block 8) \block(E, 0.0, 1, Block 3) \block(F, 1.5, 1, Block 4) \block(G, 3.0, 1, Block 5) \block(E, 0.0, 2, Block 0) \block(F, 1.5, 2, Block 1) \block(G, 3.0, 2, Block 2) \end{scope} \begin{scope}[shift={(7.5,8.25)}] \draw[->,thick,blue] (0.0,4) to (0.0,-0.75); \draw[->,thick,blue] (1.5,4) to (1.5,+0.25); \draw[->,thick,blue] (3.0,4) to (3.0,+0.25); \draw[->,thick,blue] (4.5,4) to (4.5,+0.25); \end{scope} \begin{scope}[shift={(7.5,12)}] \draw[thick,black](-1,-0.75) rectangle (5.5,1.25); \draw[pattern=north east lines,pattern color=lightgray](-1,-0.75) rectangle (5.5,1.25); \node at (0.5,0.75) {\bf{GPU with 4 Cores}}; \block(A, 0.0, 0, Core 0) \block(B, 1.5, 0, Core 1) \block(C, 3.0, 0, Core 2) \block(E, 4.5, 0, Core 3) \end{scope} \begin{scope}[shift={(7.5,8.25)}] \draw[thick,black](-1,-1) rectangle (5.5,2.75); \block(A, 0.0, 2, Block 0) \block(B, 1.5, 2, Block 1) \block(C, 3.0, 2, Block 2) \block(E, 4.5, 2, Block 3) \block(A, 0.0, 1, Block 4) \block(B, 1.5, 1, Block 5) \block(C, 3.0, 1, Block 6) \block(E, 4.5, 1, Block 7) \block(A, 0.0, 0, Block 8) \end{scope} \draw[->,black,thick] (4.25,9) to node [midway,above,black] {\bf{Compile}} (6,9) ; \draw[->,black,thick] (14,12) to node [midway,above,black,anchor=west] {\bf{Execute}} (14,7.5) ; \end{tikzpicture} \end{document}
cardiac_rm_blocks
\documentclass[tikz,border=5]{standalone} \usepackage{amsmath} \usepackage{tikz} \usepgfmodule{nonlineartransformations} \usetikzlibrary{curvilinear,patterns,decorations.pathreplacing,spy,calc} \usepackage{pgfplots} \usepackage{pgfplotstable} \usepgfplotslibrary{groupplots} \pgfplotsset{/pgfplots/table/search path={dat}} \begin{document} \begin{tikzpicture}[xscale=1.3,yscale=1.2] \def\block(#1,#2,#3,#4){\node[draw=black,thick,rounded corners=2,inner sep=8,fill=white] (#1) at (#2,#3) [anchor=center] {#4};} \begin{scope}[shift={(0,8)}] \draw[thick,blue](-1,-0.75) rectangle (4,3.25); \node at (0.5,2.75) {\bf{OpenCL Program}}; \block(A, 0.0, 0, Block 6) \block(B, 1.5, 0, Block 7) \block(C, 3.0, 0, Block 8) \block(E, 0.0, 1, Block 3) \block(F, 1.5, 1, Block 4) \block(G, 3.0, 1, Block 5) \block(E, 0.0, 2, Block 0) \block(F, 1.5, 2, Block 1) \block(G, 3.0, 2, Block 2) \end{scope} \begin{scope}[shift={(2,1.25)}] \draw[->,thick,blue] (0.0,4) to (0.0,-0.75); \draw[->,thick,blue] (1.5,4) to (1.5,0.25); \draw[->,thick,blue] (3.0,4) to (3.0,0.25); \draw[->,thick,blue] (4.5,4) to (4.5,0.25); \end{scope} \begin{scope}[shift={(2,5)}] \draw[thick,black](-1,-0.75) rectangle (5.5,1.25); \draw[pattern=north east lines,pattern color=lightgray](-1,-0.75) rectangle (5.5,1.25); \node at (0.5,0.75) {\bf{GPU with 4 Cores}}; \block(A, 0.0, 0, Core 0) \block(B, 1.5, 0, Core 1) \block(C, 3.0, 0, Core 2) \block(E, 4.5, 0, Core 3) \end{scope} \begin{scope}[shift={(2,1.25)}] \draw[thick,black](-1,-1) rectangle (5.5,2.75); \block(A, 0.0, 2, Block 0) \block(B, 1.5, 2, Block 1) \block(C, 3.0, 2, Block 2) \block(E, 4.5, 2, Block 3) \block(A, 0.0, 1, Block 4) \block(B, 1.5, 1, Block 5) \block(C, 3.0, 1, Block 6) \block(E, 4.5, 1, Block 7) \block(A, 0.0, 0, Block 8) \end{scope} \draw[->,black,thick,out=0,in=90] (4.25,9) to node [midway,above,black,anchor=west] {\bf{Compile}} (6,6.5) ; \draw[->,black,thick] (0.5,5) to node [midway,above,black,anchor=east] {\bf{Execute}} (0.5,0.5) ; \end{tikzpicture} \end{document}
Delete the Blocks 6, 7 and 8. update the size and positions of the boxes and arrows accordingly.
\documentclass[tikz,border=5]{standalone} \usepackage{amsmath} \usepackage{tikz} \usepgfmodule{nonlineartransformations} \usetikzlibrary{curvilinear,patterns,decorations.pathreplacing,spy,calc} \usepackage{pgfplots} \usepackage{pgfplotstable} \usepgfplotslibrary{groupplots} \pgfplotsset{/pgfplots/table/search path={dat}} \begin{document} \begin{tikzpicture}[xscale=1.3,yscale=1.2] \def\block(#1,#2,#3,#4){\node[draw=black,thick,rounded corners=2,inner sep=8,fill=white] (#1) at (#2,#3) [anchor=center] {#4};} \begin{scope}[shift={(0,7.25)}] \draw[thick,blue](-1,0) rectangle (4,3.25); \node at (0.5,2.75) {\bf{OpenCL Program}}; \block(E, 0.0, 1, Block 3) \block(F, 1.5, 1, Block 4) \block(G, 3.0, 1, Block 5) \block(E, 0.0, 2, Block 0) \block(F, 1.5, 2, Block 1) \block(G, 3.0, 2, Block 2) \end{scope} \begin{scope}[shift={(2,1.25)}] \draw[->,thick,blue] (0.0,4) to (0.0,0.25); \draw[->,thick,blue] (1.5,4) to (1.5,0.25); \draw[->,thick,blue] (3.0,4) to (3.0,1.25); \draw[->,thick,blue] (4.5,4) to (4.5,1.25); \end{scope} \begin{scope}[shift={(2,5)}] \draw[thick,black](-1,-0.75) rectangle (5.5,1.25); \draw[pattern=north east lines,pattern color=lightgray](-1,-0.75) rectangle (5.5,1.25); \node at (0.5,0.75) {\bf{GPU with 4 Cores}}; \block(A, 0.0, 0, Core 0) \block(B, 1.5, 0, Core 1) \block(C, 3.0, 0, Core 2) \block(E, 4.5, 0, Core 3) \end{scope} \begin{scope}[shift={(2,1.25)}] \draw[thick,black](-1,0) rectangle (5.5,2.75); \block(A, 0.0, 2, Block 0) \block(B, 1.5, 2, Block 1) \block(C, 3.0, 2, Block 2) \block(E, 4.5, 2, Block 3) \block(A, 0.0, 1, Block 4) \block(B, 1.5, 1, Block 5) \end{scope} \draw[->,black,thick,out=0,in=90] (4.25,9) to node [midway,above,black,anchor=west] {\bf{Compile}} (6,6.5) ; \draw[->,black,thick] (0.5,5) to node [midway,above,black,anchor=east] {\bf{Execute}} (0.5,1.5) ; \end{tikzpicture} \end{document}
cat_blue_nose
\documentclass[tikz,border=5]{standalone} \usepackage[prefix=]{xcolor-material} \tikzset{ cat/.pic={ \tikzset{x=3cm/5,y=3cm/5,shift={(0,-1/3)}} \useasboundingbox (-1,-1) (1,2); \fill [BlueGrey900] (0,-2) .. controls ++(180:3) and ++(0:5/4) .. (-2,0) arc (270:90:1/5) .. controls ++(0:2) and ++(180:11/4) .. (0,-2+2/5); \foreach \i in {-1,1} \scoped[shift={(1/2*\i,9/4)}, rotate=45*\i]{ \clip [overlay] (0, 5/9) ellipse [radius=8/9]; \clip [overlay] (0,-5/9) ellipse [radius=8/9]; \fill [BlueGrey900] ellipse [radius=1]; \clip [overlay] (0, 7/9) ellipse [radius=10/11]; \clip [overlay] (0,-7/9) ellipse [radius=10/11]; \fill [Purple100] ellipse [radius=1]; }; \fill [BlueGrey900] ellipse [x radius=3/4, y radius=2]; \fill [BlueGrey100] ellipse [x radius=1/3, y radius=1]; \fill [BlueGrey900] (0,15/8) ellipse [x radius=1, y radius=5/6] (0, 8/6) ellipse [x radius=1/2, y radius=1/2] {[shift={(-1/2,-2)}, rotate= 10] ellipse [x radius=1/3, y radius=5/4]} {[shift={( 1/2,-2)}, rotate=-10] ellipse [x radius=1/3, y radius=5/4]}; \fill [BlueGrey500] (-1/9,11/8) ellipse [x radius=1/5, y radius=1/5] ( 1/9,11/8) ellipse [x radius=1/5, y radius=1/5]; \fill [Purple100] (0,12/8) ellipse [x radius=1/10, y radius=1/5] (0,12/8+1/9) ellipse [x radius=1/5 , y radius=1/10]; \foreach \i in {-1,1} \scoped[shift={(1/2*\i,2)}, rotate=35*\i]{ \clip [overlay] (0, 1/7) ellipse [radius=2/7]; \clip [overlay] (0,-1/7) ellipse [radius=2/7]; \fill [Yellow50] ellipse [radius=1]; }; \scoped{ \clip (-1,-2) rectangle ++(2,1); \fill [BlueGrey900] (0,-2) ellipse [radius=1/2]; \fill [Grey100] (-1/2,-2) ellipse [x radius=1/3, y radius=1/4] ( 1/2,-2) ellipse [x radius=1/3, y radius=1/4]; }; \foreach \i in {-1,1} \foreach \j in {-1,0,1} \fill [Grey100, shift={(0,11/8)}, xscale=\i, rotate=\j*15, shift=(0:1/2)] ellipse [x radius=1/3, y radius=1/64]; } } \begin{document} \begin{tikzpicture} \fill [fill=LightBlue300] circle [radius=2]; \pic {cat}; \end{tikzpicture} \end{document}
Make the nose of the cat blue
\documentclass[tikz,border=5]{standalone} \usepackage[prefix=]{xcolor-material} \tikzset{ cat/.pic={ \tikzset{x=3cm/5,y=3cm/5,shift={(0,-1/3)}} \useasboundingbox (-1,-1) (1,2); \fill [BlueGrey900] (0,-2) .. controls ++(180:3) and ++(0:5/4) .. (-2,0) arc (270:90:1/5) .. controls ++(0:2) and ++(180:11/4) .. (0,-2+2/5); \foreach \i in {-1,1} \scoped[shift={(1/2*\i,9/4)}, rotate=45*\i]{ \clip [overlay] (0, 5/9) ellipse [radius=8/9]; \clip [overlay] (0,-5/9) ellipse [radius=8/9]; \fill [BlueGrey900] ellipse [radius=1]; \clip [overlay] (0, 7/9) ellipse [radius=10/11]; \clip [overlay] (0,-7/9) ellipse [radius=10/11]; \fill [Purple100] ellipse [radius=1]; }; \fill [BlueGrey900] ellipse [x radius=3/4, y radius=2]; \fill [BlueGrey100] ellipse [x radius=1/3, y radius=1]; \fill [BlueGrey900] (0,15/8) ellipse [x radius=1, y radius=5/6] (0, 8/6) ellipse [x radius=1/2, y radius=1/2] {[shift={(-1/2,-2)}, rotate= 10] ellipse [x radius=1/3, y radius=5/4]} {[shift={( 1/2,-2)}, rotate=-10] ellipse [x radius=1/3, y radius=5/4]}; \fill [BlueGrey500] (-1/9,11/8) ellipse [x radius=1/5, y radius=1/5] ( 1/9,11/8) ellipse [x radius=1/5, y radius=1/5]; \fill [Blue] (0,12/8) ellipse [x radius=1/10, y radius=1/5] (0,12/8+1/9) ellipse [x radius=1/5 , y radius=1/10]; \foreach \i in {-1,1} \scoped[shift={(1/2*\i,2)}, rotate=35*\i]{ \clip [overlay] (0, 1/7) ellipse [radius=2/7]; \clip [overlay] (0,-1/7) ellipse [radius=2/7]; \fill [Yellow50] ellipse [radius=1]; }; \scoped{ \clip (-1,-2) rectangle ++(2,1); \fill [BlueGrey900] (0,-2) ellipse [radius=1/2]; \fill [Grey100] (-1/2,-2) ellipse [x radius=1/3, y radius=1/4] ( 1/2,-2) ellipse [x radius=1/3, y radius=1/4]; }; \foreach \i in {-1,1} \foreach \j in {-1,0,1} \fill [Grey100, shift={(0,11/8)}, xscale=\i, rotate=\j*15, shift=(0:1/2)] ellipse [x radius=1/3, y radius=1/64]; } } \begin{document} \begin{tikzpicture} \fill [fill=LightBlue300] circle [radius=2]; \pic {cat}; \end{tikzpicture} \end{document}
cat_tail_other_side
\documentclass[tikz,border=5]{standalone} \usepackage[prefix=]{xcolor-material} \tikzset{ cat/.pic={ \tikzset{x=3cm/5,y=3cm/5,shift={(0,-1/3)}} \useasboundingbox (-1,-1) (1,2); \fill [BlueGrey900] (0,-2) .. controls ++(180:3) and ++(0:5/4) .. (-2,0) arc (270:90:1/5) .. controls ++(0:2) and ++(180:11/4) .. (0,-2+2/5); \foreach \i in {-1,1} \scoped[shift={(1/2*\i,9/4)}, rotate=45*\i]{ \clip [overlay] (0, 5/9) ellipse [radius=8/9]; \clip [overlay] (0,-5/9) ellipse [radius=8/9]; \fill [BlueGrey900] ellipse [radius=1]; \clip [overlay] (0, 7/9) ellipse [radius=10/11]; \clip [overlay] (0,-7/9) ellipse [radius=10/11]; \fill [Purple100] ellipse [radius=1]; }; \fill [BlueGrey900] ellipse [x radius=3/4, y radius=2]; \fill [BlueGrey100] ellipse [x radius=1/3, y radius=1]; \fill [BlueGrey900] (0,15/8) ellipse [x radius=1, y radius=5/6] (0, 8/6) ellipse [x radius=1/2, y radius=1/2] {[shift={(-1/2,-2)}, rotate= 10] ellipse [x radius=1/3, y radius=5/4]} {[shift={( 1/2,-2)}, rotate=-10] ellipse [x radius=1/3, y radius=5/4]}; \fill [BlueGrey500] (-1/9,11/8) ellipse [x radius=1/5, y radius=1/5] ( 1/9,11/8) ellipse [x radius=1/5, y radius=1/5]; \fill [Purple100] (0,12/8) ellipse [x radius=1/10, y radius=1/5] (0,12/8+1/9) ellipse [x radius=1/5 , y radius=1/10]; \foreach \i in {-1,1} \scoped[shift={(1/2*\i,2)}, rotate=35*\i]{ \clip [overlay] (0, 1/7) ellipse [radius=2/7]; \clip [overlay] (0,-1/7) ellipse [radius=2/7]; \fill [Yellow50] ellipse [radius=1]; }; \scoped{ \clip (-1,-2) rectangle ++(2,1); \fill [BlueGrey900] (0,-2) ellipse [radius=1/2]; \fill [Grey100] (-1/2,-2) ellipse [x radius=1/3, y radius=1/4] ( 1/2,-2) ellipse [x radius=1/3, y radius=1/4]; }; \foreach \i in {-1,1} \foreach \j in {-1,0,1} \fill [Grey100, shift={(0,11/8)}, xscale=\i, rotate=\j*15, shift=(0:1/2)] ellipse [x radius=1/3, y radius=1/64]; } } \begin{document} \begin{tikzpicture} \fill [fill=LightBlue300] circle [radius=2]; \pic {cat}; \end{tikzpicture} \end{document}
Change the position of the tail to the other side of the cat
\documentclass[tikz,border=5]{standalone} \usepackage[prefix=]{xcolor-material} \tikzset{ cat/.pic={ \tikzset{x=3cm/5,y=3cm/5,shift={(0,-1/3)}} \useasboundingbox (-1,-1) (1,2); \scoped[xscale=-1]{ \fill [BlueGrey900] (0,-2) .. controls ++(180:3) and ++(0:5/4) .. (-2,0) arc (270:90:1/5) .. controls ++(0:2) and ++(180:11/4) .. (0,-2+2/5); }; \foreach \i in {-1,1} \scoped[shift={(1/2*\i,9/4)}, rotate=45*\i]{ \clip [overlay] (0, 5/9) ellipse [radius=8/9]; \clip [overlay] (0,-5/9) ellipse [radius=8/9]; \fill [BlueGrey900] ellipse [radius=1]; \clip [overlay] (0, 7/9) ellipse [radius=10/11]; \clip [overlay] (0,-7/9) ellipse [radius=10/11]; \fill [Purple100] ellipse [radius=1]; }; \fill [BlueGrey900] ellipse [x radius=3/4, y radius=2]; \fill [BlueGrey100] ellipse [x radius=1/3, y radius=1]; \fill [BlueGrey900] (0,15/8) ellipse [x radius=1, y radius=5/6] (0, 8/6) ellipse [x radius=1/2, y radius=1/2] {[shift={(-1/2,-2)}, rotate= 10] ellipse [x radius=1/3, y radius=5/4]} {[shift={( 1/2,-2)}, rotate=-10] ellipse [x radius=1/3, y radius=5/4]}; \fill [BlueGrey500] (-1/9,11/8) ellipse [x radius=1/5, y radius=1/5] ( 1/9,11/8) ellipse [x radius=1/5, y radius=1/5]; \fill [Purple100] (0,12/8) ellipse [x radius=1/10, y radius=1/5] (0,12/8+1/9) ellipse [x radius=1/5 , y radius=1/10]; \foreach \i in {-1,1} \scoped[shift={(1/2*\i,2)}, rotate=35*\i]{ \clip [overlay] (0, 1/7) ellipse [radius=2/7]; \clip [overlay] (0,-1/7) ellipse [radius=2/7]; \fill [Yellow50] ellipse [radius=1]; }; \scoped{ \clip (-1,-2) rectangle ++(2,1); \fill [BlueGrey900] (0,-2) ellipse [radius=1/2]; \fill [Grey100] (-1/2,-2) ellipse [x radius=1/3, y radius=1/4] ( 1/2,-2) ellipse [x radius=1/3, y radius=1/4]; }; \foreach \i in {-1,1} \foreach \j in {-1,0,1} \fill [Grey100, shift={(0,11/8)}, xscale=\i, rotate=\j*15, shift=(0:1/2)] ellipse [x radius=1/3, y radius=1/64]; } } \begin{document} \begin{tikzpicture} \fill [fill=LightBlue300] circle [radius=2]; \pic {cat}; \end{tikzpicture} \end{document}
chimpanzee_blue_fur
\documentclass[tikz,border=5]{standalone} \usepackage[prefix=]{xcolor-material} \tikzset{ chimpanzee/.pic={ \tikzset{x=3cm/3.5,y=3cm/3.5, shift={(0,1/4)}} \fill [BlueGrey700] (165:5/4 and 1) ellipse [radius=1/2]; \fill [Pink100] (165:5/4 and 1) ellipse [radius=1/3]; \fill [BlueGrey700] (0,-1/2) ellipse [x radius=1, y radius=4/3] (0, 0) ellipse [x radius=4/3, y radius=1]; \scoped{ \clip(0,-2) rectangle(9/5,1); \fill [BlueGrey900] (15:5/4 and 1) ellipse [radius=1/2]; \fill [Pink200] (15:5/4 and 1) ellipse [radius=1/3]; \fill [BlueGrey900] (0,-1/2) ellipse [x radius=1, y radius=4/3] (0, 0) ellipse [x radius=4/3, y radius=1]; } \fill [Pink100] ( 0,-2/3) ellipse [x radius=5/6, y radius= 1]; \fill [Pink100, xscale=-1] (1/2, 0) ellipse [x radius=3/5, y radius=2/3]; \fill [Pink100, xscale= 1] (1/2, 0) ellipse [x radius=3/5, y radius=2/3]; \scoped{ \clip(0,-2) rectangle(9/5,1); \fill [Pink200] ( 0,-2/3) ellipse [x radius=5/6, y radius= 1]; \fill [Pink200, xscale=-1] (1/2, 0) ellipse [x radius=3/5, y radius=2/3]; \fill [Pink200, xscale= 1] (1/2, 0) ellipse [x radius=3/5, y radius=2/3]; } \foreach \i in {-1,1} \fill [BlueGrey900, xscale=\i] (1/2,0) ellipse [radius=1/4]; \fill [Pink300] (-1/7,-2/3) ellipse [radius=1/9] ( 1/7,-2/3) ellipse [radius=1/9]; \fill [Pink300] (-1/2,-1) arc (180:360:1/2 and 1/8) arc (360:180:1/2 and 1/4); } } \begin{document} \begin{tikzpicture} \fill [fill=LightBlue300] circle [radius=2]; \pic {chimpanzee}; \end{tikzpicture} \end{document}
Change the color of the chimpanzee's fur to blue
\documentclass[tikz,border=5]{standalone} \usepackage[prefix=]{xcolor-material} \tikzset{ chimpanzee/.pic={ \tikzset{x=3cm/3.5,y=3cm/3.5, shift={(0,1/4)}} \fill [Blue700] (165:5/4 and 1) ellipse [radius=1/2]; \fill [Pink100] (165:5/4 and 1) ellipse [radius=1/3]; \fill [Blue700] (0,-1/2) ellipse [x radius=1, y radius=4/3] (0, 0) ellipse [x radius=4/3, y radius=1]; \scoped{ \clip(0,-2) rectangle(9/5,1); \fill [Blue900] (15:5/4 and 1) ellipse [radius=1/2]; \fill [Pink200] (15:5/4 and 1) ellipse [radius=1/3]; \fill [Blue900] (0,-1/2) ellipse [x radius=1, y radius=4/3] (0, 0) ellipse [x radius=4/3, y radius=1]; } \fill [Pink100] ( 0,-2/3) ellipse [x radius=5/6, y radius= 1]; \fill [Pink100, xscale=-1] (1/2, 0) ellipse [x radius=3/5, y radius=2/3]; \fill [Pink100, xscale= 1] (1/2, 0) ellipse [x radius=3/5, y radius=2/3]; \scoped{ \clip(0,-2) rectangle(9/5,1); \fill [Pink200] ( 0,-2/3) ellipse [x radius=5/6, y radius= 1]; \fill [Pink200, xscale=-1] (1/2, 0) ellipse [x radius=3/5, y radius=2/3]; \fill [Pink200, xscale= 1] (1/2, 0) ellipse [x radius=3/5, y radius=2/3]; } \foreach \i in {-1,1} \fill [BlueGrey900, xscale=\i] (1/2,0) ellipse [radius=1/4]; \fill [Pink300] (-1/7,-2/3) ellipse [radius=1/9] ( 1/7,-2/3) ellipse [radius=1/9]; \fill [Pink300] (-1/2,-1) arc (180:360:1/2 and 1/8) arc (360:180:1/2 and 1/4); } } \begin{document} \begin{tikzpicture} \fill [fill=LightBlue300] circle [radius=2]; \pic {chimpanzee}; \end{tikzpicture} \end{document}
chimpanzee_shoulder_torso
\documentclass[tikz,border=5]{standalone} \usepackage[prefix=]{xcolor-material} \tikzset{ chimpanzee/.pic={ \tikzset{x=3cm/3.5,y=3cm/3.5, shift={(0,1/4)}} \fill [BlueGrey700] (165:5/4 and 1) ellipse [radius=1/2]; \fill [Pink100] (165:5/4 and 1) ellipse [radius=1/3]; \fill [BlueGrey700] (0,-1/2) ellipse [x radius=1, y radius=4/3] (0, 0) ellipse [x radius=4/3, y radius=1]; \scoped{ \clip(0,-2) rectangle(9/5,1); \fill [BlueGrey900] (15:5/4 and 1) ellipse [radius=1/2]; \fill [Pink200] (15:5/4 and 1) ellipse [radius=1/3]; \fill [BlueGrey900] (0,-1/2) ellipse [x radius=1, y radius=4/3] (0, 0) ellipse [x radius=4/3, y radius=1]; } \fill [Pink100] ( 0,-2/3) ellipse [x radius=5/6, y radius= 1]; \fill [Pink100, xscale=-1] (1/2, 0) ellipse [x radius=3/5, y radius=2/3]; \fill [Pink100, xscale= 1] (1/2, 0) ellipse [x radius=3/5, y radius=2/3]; \scoped{ \clip(0,-2) rectangle(9/5,1); \fill [Pink200] ( 0,-2/3) ellipse [x radius=5/6, y radius= 1]; \fill [Pink200, xscale=-1] (1/2, 0) ellipse [x radius=3/5, y radius=2/3]; \fill [Pink200, xscale= 1] (1/2, 0) ellipse [x radius=3/5, y radius=2/3]; } \foreach \i in {-1,1} \fill [BlueGrey900, xscale=\i] (1/2,0) ellipse [radius=1/4]; \fill [Pink300] (-1/7,-2/3) ellipse [radius=1/9] ( 1/7,-2/3) ellipse [radius=1/9]; \fill [Pink300] (-1/2,-1) arc (180:360:1/2 and 1/8) arc (360:180:1/2 and 1/4); } } \begin{document} \begin{tikzpicture} \fill [fill=LightBlue300] circle [radius=2]; \pic {chimpanzee}; \end{tikzpicture} \end{document}
Add a torso to the chimpanzee, in the shape of an ellipse
\documentclass[tikz,border=5]{standalone} \usepackage[prefix=]{xcolor-material} \tikzset{ chimpanzee/.pic={ \tikzset{x=3cm/3.5,y=3cm/3.5, shift={(0,1/4)}} \fill [BlueGrey700] (0,-2) ellipse (1.65 and 0.6); \fill [BlueGrey700] (165:5/4 and 1) ellipse [radius=1/2]; \fill [Pink100] (165:5/4 and 1) ellipse [radius=1/3]; \fill [BlueGrey700] (0,-1/2) ellipse [x radius=1, y radius=4/3] (0, 0) ellipse [x radius=4/3, y radius=1]; \scoped{ \clip(0,-2) rectangle(9/5,1); \fill [BlueGrey900] (15:5/4 and 1) ellipse [radius=1/2]; \fill [Pink200] (15:5/4 and 1) ellipse [radius=1/3]; \fill [BlueGrey900] (0,-1/2) ellipse [x radius=1, y radius=4/3] (0, 0) ellipse [x radius=4/3, y radius=1]; } \fill [Pink100] ( 0,-2/3) ellipse [x radius=5/6, y radius= 1]; \fill [Pink100, xscale=-1] (1/2, 0) ellipse [x radius=3/5, y radius=2/3]; \fill [Pink100, xscale= 1] (1/2, 0) ellipse [x radius=3/5, y radius=2/3]; \scoped{ \clip(0,-2) rectangle(9/5,1); \fill [Pink200] ( 0,-2/3) ellipse [x radius=5/6, y radius= 1]; \fill [Pink200, xscale=-1] (1/2, 0) ellipse [x radius=3/5, y radius=2/3]; \fill [Pink200, xscale= 1] (1/2, 0) ellipse [x radius=3/5, y radius=2/3]; } \foreach \i in {-1,1} \fill [BlueGrey900, xscale=\i] (1/2,0) ellipse [radius=1/4]; \fill [Pink300] (-1/7,-2/3) ellipse [radius=1/9] ( 1/7,-2/3) ellipse [radius=1/9]; \fill [Pink300] (-1/2,-1) arc (180:360:1/2 and 1/8) arc (360:180:1/2 and 1/4); } } \begin{document} \begin{tikzpicture} \fill [fill=LightBlue300] circle [radius=2]; \pic {chimpanzee}; \end{tikzpicture} \end{document}
colnodes_yellow_zone
\documentclass[tikz,border=5]{standalone} \usepackage{tikz} \usetikzlibrary{positioning} \usetikzlibrary{calc} \makeatletter \tikzset{curlybrace/.style={rounded corners=2pt,line cap=round}} \pgfkeys{ /curlybrace/.cd, tip angle/.code = \def\cb@angle{#1}, /curlybrace/.unknown/.code ={\let\searchname=\pgfkeyscurrentname \pgfkeysalso{\searchname/.try=#1, /tikz/\searchname/.retry=#1}}} \def\curlybrace{\pgfutil@ifnextchar[{\curly@brace}{\curly@brace[]}} \def\curly@brace[#1]#2#3#4{ \pgfkeys{/curlybrace/.cd, tip angle = 0.75} \pgfqkeys{/curlybrace}{#1} \ifnum 1>#4 \def\cbrd{0.05} \else \def\cbrd{0.075} \fi \draw[/curlybrace/.cd,curlybrace,#1] (#2:#4-\cbrd) -- (#2:#4) arc (#2:{(#2+#3)/2-\cb@angle}:#4) --({(#2+#3)/2}:#4+\cbrd) coordinate (curlybracetipn); \draw[/curlybrace/.cd,curlybrace,#1] ({(#2+#3)/2}:#4+\cbrd) -- ({(#2+#3)/2+\cb@angle}:#4) arc ({(#2+#3)/2+\cb@angle} :#3:#4) --(#3:#4-\cbrd); } \makeatother \begin{document} \centering \begin{tikzpicture}[scale=1.5, myline/.style={line width=1.5} ] \foreach \n in {1,...,8}{ \coordinate (P\n) at (\n*45:1); } \coordinate (P9) at ($.5*(P3)+.5*(P8)$); \coordinate (P10) at ($.5*(P4)+.5*(P7)$); \draw[myline,blue!70] (P7) -- (P8) -- (P9); \draw[myline,red!70] (P3) -- (P4) -- (P10); \draw[myline,green!70!black] (P1) -- (P9) -- (P2); \draw[myline] (P5) -- (P10); \draw[myline] (P6) -- (P7); \draw[myline] (P2) -- (P3); \draw[dashed, very thick] (0,0) circle (1.55); \curlybrace[tip angle=-2,thick]{90}{-45}{1.7} \draw[green!70!black, very thick] (45:1.25) arc (45:90:1.25) arc (90:190:.25) -- ($(P9)+(-170:.25)$) arc (-170:-55:.25) -- ($(P1)+(-55:.25)$) arc (-55:45:.25); \draw[red!70, very thick] (135:1.25) arc (135:180:1.25) arc (180:250:.25) -- ($(P10)+(250:.25)$) arc (250:380:.25) -- ($(P3)+(20:.25)$) arc (20:135:.25); \draw[blue!70, very thick] (-45:1.2) arc (-45:0:1.2) arc (0:70:.2) -- ($(P9)+(70:.2)$) arc (70:215:.2) -- ($(P7)+(215:.2)$) arc (215:315:.2); \foreach \n in {1,...,10}{ \fill (P\n) circle (.1); } \end{tikzpicture} \end{document}
Add a new yellow zone, that contains the two nodes that are not circled.
\documentclass[tikz,border=5]{standalone} \usepackage{tikz} \usetikzlibrary{positioning} \usetikzlibrary{calc} \makeatletter \tikzset{curlybrace/.style={rounded corners=2pt,line cap=round}} \pgfkeys{ /curlybrace/.cd, tip angle/.code = \def\cb@angle{#1}, /curlybrace/.unknown/.code ={\let\searchname=\pgfkeyscurrentname \pgfkeysalso{\searchname/.try=#1, /tikz/\searchname/.retry=#1}}} \def\curlybrace{\pgfutil@ifnextchar[{\curly@brace}{\curly@brace[]}} \def\curly@brace[#1]#2#3#4{ \pgfkeys{/curlybrace/.cd, tip angle = 0.75} \pgfqkeys{/curlybrace}{#1} \ifnum 1>#4 \def\cbrd{0.05} \else \def\cbrd{0.075} \fi \draw[/curlybrace/.cd,curlybrace,#1] (#2:#4-\cbrd) -- (#2:#4) arc (#2:{(#2+#3)/2-\cb@angle}:#4) --({(#2+#3)/2}:#4+\cbrd) coordinate (curlybracetipn); \draw[/curlybrace/.cd,curlybrace,#1] ({(#2+#3)/2}:#4+\cbrd) -- ({(#2+#3)/2+\cb@angle}:#4) arc ({(#2+#3)/2+\cb@angle} :#3:#4) --(#3:#4-\cbrd); } \makeatother \begin{document} \centering \begin{tikzpicture}[scale=1.5, myline/.style={line width=1.5} ] \foreach \n in {1,...,8}{ \coordinate (P\n) at (\n*45:1); } \coordinate (P9) at ($.5*(P3)+.5*(P8)$); \coordinate (P10) at ($.5*(P4)+.5*(P7)$); \draw[myline,blue!70] (P7) -- (P8) -- (P9); \draw[myline,red!70] (P3) -- (P4) -- (P10); \draw[myline,green!70!black] (P1) -- (P9) -- (P2); \draw[myline] (P5) -- (P10); \draw[myline] (P6) -- (P7); \draw[myline] (P2) -- (P3); \draw[dashed, very thick] (0,0) circle (1.55); \curlybrace[tip angle=-2,thick]{90}{-45}{1.7} \draw[green!70!black, very thick] (45:1.25) arc (45:90:1.25) arc (90:190:.25) -- ($(P9)+(-170:.25)$) arc (-170:-55:.25) -- ($(P1)+(-55:.25)$) arc (-55:45:.25); \draw[red!70, very thick] (135:1.25) arc (135:180:1.25) arc (180:250:.25) -- ($(P10)+(250:.25)$) arc (250:380:.25) -- ($(P3)+(20:.25)$) arc (20:135:.25); \draw[blue!70, very thick] (-45:1.2) arc (-45:0:1.2) arc (0:70:.2) -- ($(P9)+(70:.2)$) arc (70:215:.2) -- ($(P7)+(215:.2)$) arc (215:315:.2); \draw[yellow!70, very thick] ($(P5)+(70:.2)$) arc (70:250:.2) -- ($(P6)+(250:.2)$) arc (250:430:.2) -- cycle; \foreach \n in {1,...,10}{ \fill (P\n) circle (.1); } \end{tikzpicture} \end{document}
computer_layout
\documentclass[tikz,border=5]{standalone} \usetikzlibrary{positioning, matrix, arrows.meta,calc} \begin{document} \begin{tikzpicture}[ myline/.style={draw=green!40!black, thick}, box/.style={myline, minimum height=1cm, minimum width=1cm, font=\sffamily, inner sep=.3333em}, >=Stealth] \matrix (CPU) [matrix of nodes, inner ysep=3mm, nodes=box, myline, column sep=1mm] {|(CU)|CU & |[draw=none]|CPU & |(ALU)| ALU \\}; \node[box, above left=5mm of CPU] (input) {INPUT}; \node[box, below left=5mm of CPU] (output) {OUTPUT}; \node[box, at=(CPU|-output)] (memory) {MEMORY}; \node[box, below left=5mm of memory, anchor=north] (storage) {STORAGE}; \draw[<->, myline] (storage)-|(memory); \draw[->,myline] (input)-|(CU); \draw[->,myline] (CU)|-(output); \draw[<->, myline] ($(CU.south west)!.2!(CU.south east)$) coordinate (aux)--(aux|-storage.north); \draw[<->, myline] ($(CU.south west)!.8!(CU.south east)$) coordinate (aux)--(aux|-memory.north); \draw[<->, myline] ($(ALU.south west)!.2!(ALU.south east)$) coordinate (aux)--(aux|-memory.north); \end{tikzpicture} \end{document}
Change the layout, so that the memory and storage are above the CPU, and the input is on the left of it. Adapt the arrow so that they don't overlap with elements.
\documentclass[tikz,border=5]{standalone} \usetikzlibrary{positioning, matrix, arrows.meta,calc} \begin{document} \begin{tikzpicture}[ myline/.style={draw=green!40!black, thick}, box/.style={myline, minimum height=1cm, minimum width=1cm, font=\sffamily, inner sep=.3333em}, >=Stealth] \matrix (CPU) [matrix of nodes, inner ysep=3mm, nodes=box, myline, column sep=1mm] {|(CU)|CU & |[draw=none]|CPU & |(ALU)| ALU \\}; \node[box, left=5mm of CPU] (input) {INPUT}; \node[box, below left=5mm of CPU] (output) {OUTPUT}; \node[box, above=5mm of CPU] (memory) {MEMORY}; \node[box, above left=5mm of memory, anchor=south] (storage) {STORAGE}; \draw[<->, myline] (storage)-|(memory); \draw[->,myline] (input)--(CU); \draw[->,myline] (CU)|-(output); \draw[<->, myline] ($(CU.north west)!.2!(CU.north east)$) coordinate (aux)--(aux|-storage.south); \draw[<->, myline] ($(CU.north west)!.8!(CU.north east)$) coordinate (aux)--(aux|-memory.south); \draw[<->, myline] ($(ALU.north west)!.2!(ALU.north east)$) coordinate (aux)--(aux|-memory.south); \end{tikzpicture} \end{document}
cow_brown_white_dots
\documentclass[tikz,border=5]{standalone} \usepackage[prefix=]{xcolor-material} \tikzset{ half clip/.code={ \clip (0, -256) rectangle (256, 256); }, color/.code=\colorlet{fill color}{#1}, color alias/.code args={#1 as #2}{\colorlet{#1}{#2}}, on left/.style={.. on left/.style={#1}}, on right/.style={.. on right/.style={#1}}, split/.style args={#1 and #2}{ on left ={color alias=fill color as #1}, on right={color alias=fill color as #2, half clip} } } \newcommand\reflect[2][]{ \begin{scope}[#1]\foreach \side in {-1, 1}{\begin{scope} \ifnum\side=-1 \tikzset{.. on left/.try}\else\tikzset{.. on right/.try}\fi \begin{scope}[xscale=\side]#2\end{scope} \end{scope}}\end{scope}} \tikzset{ cow/.pic={ \begin{scope}[x=3cm/480,y=3cm/480] \reflect[]{ \tikzset{shift={(32,140)}, rotate=-45} \fill [BlueGrey100] (0,0) arc (0:90:32 and 96) arc (90:0:96); \fill [BlueGrey200] (32,0) arc (0:90:64 and 96) arc (90:0:96); } \foreach \i in {-1, 1}\foreach \j in {0, 1} \fill \ifnum\j=0 \ifnum \i=-1 [BlueGrey700] \else [BlueGrey800] \fi\else [BlueGrey900] \fi [xscale=\i, shift={(128,88)}, rotate=10, scale=1-\j/3] (-72,0) .. controls ++( 90: 8) and ++(180:16) .. ( 0, 48) .. controls ++( 0:16) and ++( 90:12) .. (88, 0) .. controls ++(270:12) and ++( 0: 8) .. ( 0,-48) .. controls ++(180: 8) and ++(270: 8) .. cycle; \reflect[split={BlueGrey700 and BlueGrey800}]{ \fill [fill color] (-64,-160) .. controls ++( 90:144) and ++(270: 64) .. (-120, 64) arc (180:0: 120 and 112) .. controls ++(270: 64) and ++( 90:144) .. ( 64,-160) -- cycle; } \reflect[split=Grey50 and Grey200]{ \fill [fill color](-64,-160) .. controls ++( 75:144) and ++(270: 64) .. (-16, 64) .. controls ++( 90: 32) and ++(180: 72) .. ( 0, 168) .. controls ++( 0: 72) and ++( 90: 32) .. ( 16, 64) .. controls ++(270: 64) and ++(105:144) .. ( 64,-160) -- cycle; } \reflect[split=Pink100 and Pink200]{ \fill [fill color] (0,-160) ellipse [x radius=64, y radius=56]; } \fill [Pink300] (0, -160) ellipse [x radius=48, y radius=40]; \reflect[split=Pink100 and Pink200]{ \fill [fill color] (0,-128) ellipse [x radius=80, y radius=56]; } \fill [Pink300] (-32, -128) ellipse [radius=16] ( 32, -128) ellipse [radius=16]; \fill [BlueGrey900] (-64, 64) ellipse [radius=24] ( 64, 64) ellipse [radius=24]; \end{scope} } } \begin{document} \begin{tikzpicture} \fill [fill=LightBlue300] circle [radius=2]; \pic {cow}; \end{tikzpicture} \end{document}
Make the cow brown, with three white dots on its face under its right eye (the left side of the image)
\documentclass[tikz,border=5]{standalone} \usepackage[prefix=]{xcolor-material} \tikzset{ half clip/.code={ \clip (0, -256) rectangle (256, 256); }, color/.code=\colorlet{fill color}{#1}, color alias/.code args={#1 as #2}{\colorlet{#1}{#2}}, on left/.style={.. on left/.style={#1}}, on right/.style={.. on right/.style={#1}}, split/.style args={#1 and #2}{ on left ={color alias=fill color as #1}, on right={color alias=fill color as #2, half clip} } } \newcommand\reflect[2][]{ \begin{scope}[#1]\foreach \side in {-1, 1}{\begin{scope} \ifnum\side=-1 \tikzset{.. on left/.try}\else\tikzset{.. on right/.try}\fi \begin{scope}[xscale=\side]#2\end{scope} \end{scope}}\end{scope}} \tikzset{ cow/.pic={ \begin{scope}[x=3cm/480,y=3cm/480] \reflect[]{ \tikzset{shift={(32,140)}, rotate=-45} \fill [BlueGrey100] (0,0) arc (0:90:32 and 96) arc (90:0:96); \fill [BlueGrey200] (32,0) arc (0:90:64 and 96) arc (90:0:96); } \foreach \i in {-1, 1}\foreach \j in {0, 1} \fill \ifnum\j=0 \ifnum \i=-1 [Brown600] \else [Brown700] \fi\else [Brown800] \fi [xscale=\i, shift={(128,88)}, rotate=10, scale=1-\j/3] (-72,0) .. controls ++( 90: 8) and ++(180:16) .. ( 0, 48) .. controls ++( 0:16) and ++( 90:12) .. (88, 0) .. controls ++(270:12) and ++( 0: 8) .. ( 0,-48) .. controls ++(180: 8) and ++(270: 8) .. cycle; \reflect[split={Brown600 and Brown700}]{ \fill [fill color] (-64,-160) .. controls ++( 90:144) and ++(270: 64) .. (-120, 64) arc (180:0: 120 and 112) .. controls ++(270: 64) and ++( 90:144) .. ( 64,-160) -- cycle; } \fill [Grey50] (-40,10) circle [radius=15]; \fill [Grey50] (-60,-30) circle [radius=15]; \fill [Grey50] (-80,10) circle [radius=15]; \reflect[split=Grey50 and Grey200]{ \fill [fill color](-64,-160) .. controls ++( 75:144) and ++(270: 64) .. (-16, 64) .. controls ++( 90: 32) and ++(180: 72) .. ( 0, 168) .. controls ++( 0: 72) and ++( 90: 32) .. ( 16, 64) .. controls ++(270: 64) and ++(105:144) .. ( 64,-160) -- cycle; } \reflect[split=Pink100 and Pink200]{ \fill [fill color] (0,-160) ellipse [x radius=64, y radius=56]; } \fill [Pink300] (0, -160) ellipse [x radius=48, y radius=40]; \reflect[split=Pink100 and Pink200]{ \fill [fill color] (0,-128) ellipse [x radius=80, y radius=56]; } \fill [Pink300] (-32, -128) ellipse [radius=16] ( 32, -128) ellipse [radius=16]; \fill [BlueGrey900] (-64, 64) ellipse [radius=24] ( 64, 64) ellipse [radius=24]; \end{scope} } } \begin{document} \begin{tikzpicture} \fill [fill=LightBlue300] circle [radius=2]; \pic {cow}; \end{tikzpicture} \end{document}
cow_downward_ears
\documentclass[tikz,border=5]{standalone} \usepackage[prefix=]{xcolor-material} \tikzset{ half clip/.code={ \clip (0, -256) rectangle (256, 256); }, color/.code=\colorlet{fill color}{#1}, color alias/.code args={#1 as #2}{\colorlet{#1}{#2}}, on left/.style={.. on left/.style={#1}}, on right/.style={.. on right/.style={#1}}, split/.style args={#1 and #2}{ on left ={color alias=fill color as #1}, on right={color alias=fill color as #2, half clip} } } \newcommand\reflect[2][]{ \begin{scope}[#1]\foreach \side in {-1, 1}{\begin{scope} \ifnum\side=-1 \tikzset{.. on left/.try}\else\tikzset{.. on right/.try}\fi \begin{scope}[xscale=\side]#2\end{scope} \end{scope}}\end{scope}} \tikzset{ cow/.pic={ \begin{scope}[x=3cm/480,y=3cm/480] \reflect[]{ \tikzset{shift={(32,140)}, rotate=-45} \fill [BlueGrey100] (0,0) arc (0:90:32 and 96) arc (90:0:96); \fill [BlueGrey200] (32,0) arc (0:90:64 and 96) arc (90:0:96); } \foreach \i in {-1, 1}\foreach \j in {0, 1} \fill \ifnum\j=0 \ifnum \i=-1 [BlueGrey700] \else [BlueGrey800] \fi\else [BlueGrey900] \fi [xscale=\i, shift={(128,88)}, rotate=10, scale=1-\j/3] (-72,0) .. controls ++( 90: 8) and ++(180:16) .. ( 0, 48) .. controls ++( 0:16) and ++( 90:12) .. (88, 0) .. controls ++(270:12) and ++( 0: 8) .. ( 0,-48) .. controls ++(180: 8) and ++(270: 8) .. cycle; \reflect[split={BlueGrey700 and BlueGrey800}]{ \fill [fill color] (-64,-160) .. controls ++( 90:144) and ++(270: 64) .. (-120, 64) arc (180:0: 120 and 112) .. controls ++(270: 64) and ++( 90:144) .. ( 64,-160) -- cycle; } \reflect[split=Grey50 and Grey200]{ \fill [fill color](-64,-160) .. controls ++( 75:144) and ++(270: 64) .. (-16, 64) .. controls ++( 90: 32) and ++(180: 72) .. ( 0, 168) .. controls ++( 0: 72) and ++( 90: 32) .. ( 16, 64) .. controls ++(270: 64) and ++(105:144) .. ( 64,-160) -- cycle; } \reflect[split=Pink100 and Pink200]{ \fill [fill color] (0,-160) ellipse [x radius=64, y radius=56]; } \fill [Pink300] (0, -160) ellipse [x radius=48, y radius=40]; \reflect[split=Pink100 and Pink200]{ \fill [fill color] (0,-128) ellipse [x radius=80, y radius=56]; } \fill [Pink300] (-32, -128) ellipse [radius=16] ( 32, -128) ellipse [radius=16]; \fill [BlueGrey900] (-64, 64) ellipse [radius=24] ( 64, 64) ellipse [radius=24]; \end{scope} } } \begin{document} \begin{tikzpicture} \fill [fill=LightBlue300] circle [radius=2]; \pic {cow}; \end{tikzpicture} \end{document}
Rotate the ears of the cow 45 degrees downward
\documentclass[tikz,border=5]{standalone} \usepackage[prefix=]{xcolor-material} \tikzset{ half clip/.code={ \clip (0, -256) rectangle (256, 256); }, color/.code=\colorlet{fill color}{#1}, color alias/.code args={#1 as #2}{\colorlet{#1}{#2}}, on left/.style={.. on left/.style={#1}}, on right/.style={.. on right/.style={#1}}, split/.style args={#1 and #2}{ on left ={color alias=fill color as #1}, on right={color alias=fill color as #2, half clip} } } \newcommand\reflect[2][]{ \begin{scope}[#1]\foreach \side in {-1, 1}{\begin{scope} \ifnum\side=-1 \tikzset{.. on left/.try}\else\tikzset{.. on right/.try}\fi \begin{scope}[xscale=\side]#2\end{scope} \end{scope}}\end{scope}} \tikzset{ cow/.pic={ \begin{scope}[x=3cm/480,y=3cm/480] \reflect[]{ \tikzset{shift={(32,140)}, rotate=-45} \fill [BlueGrey100] (0,0) arc (0:90:32 and 96) arc (90:0:96); \fill [BlueGrey200] (32,0) arc (0:90:64 and 96) arc (90:0:96); } \foreach \i in {-1, 1}\foreach \j in {0, 1} \fill \ifnum\j=0 \ifnum \i=-1 [BlueGrey700] \else [BlueGrey800] \fi\else [BlueGrey900] \fi [xscale=\i, shift={(128,88)}, rotate=-30, scale=1-\j/3] (-72,0) .. controls ++( 90: 8) and ++(180:16) .. ( 0, 48) .. controls ++( 0:16) and ++( 90:12) .. (88, 0) .. controls ++(270:12) and ++( 0: 8) .. ( 0,-48) .. controls ++(180: 8) and ++(270: 8) .. cycle; \reflect[split={BlueGrey700 and BlueGrey800}]{ \fill [fill color] (-64,-160) .. controls ++( 90:144) and ++(270: 64) .. (-120, 64) arc (180:0: 120 and 112) .. controls ++(270: 64) and ++( 90:144) .. ( 64,-160) -- cycle; } \reflect[split=Grey50 and Grey200]{ \fill [fill color](-64,-160) .. controls ++( 75:144) and ++(270: 64) .. (-16, 64) .. controls ++( 90: 32) and ++(180: 72) .. ( 0, 168) .. controls ++( 0: 72) and ++( 90: 32) .. ( 16, 64) .. controls ++(270: 64) and ++(105:144) .. ( 64,-160) -- cycle; } \reflect[split=Pink100 and Pink200]{ \fill [fill color] (0,-160) ellipse [x radius=64, y radius=56]; } \fill [Pink300] (0, -160) ellipse [x radius=48, y radius=40]; \reflect[split=Pink100 and Pink200]{ \fill [fill color] (0,-128) ellipse [x radius=80, y radius=56]; } \fill [Pink300] (-32, -128) ellipse [radius=16] ( 32, -128) ellipse [radius=16]; \fill [BlueGrey900] (-64, 64) ellipse [radius=24] ( 64, 64) ellipse [radius=24]; \end{scope} } } \begin{document} \begin{tikzpicture} \fill [fill=LightBlue300] circle [radius=2]; \pic {cow}; \end{tikzpicture} \end{document}
cow_opened_mouth
\documentclass[tikz,border=5]{standalone} \usepackage[prefix=]{xcolor-material} \tikzset{ half clip/.code={ \clip (0, -256) rectangle (256, 256); }, color/.code=\colorlet{fill color}{#1}, color alias/.code args={#1 as #2}{\colorlet{#1}{#2}}, on left/.style={.. on left/.style={#1}}, on right/.style={.. on right/.style={#1}}, split/.style args={#1 and #2}{ on left ={color alias=fill color as #1}, on right={color alias=fill color as #2, half clip} } } \newcommand\reflect[2][]{ \begin{scope}[#1]\foreach \side in {-1, 1}{\begin{scope} \ifnum\side=-1 \tikzset{.. on left/.try}\else\tikzset{.. on right/.try}\fi \begin{scope}[xscale=\side]#2\end{scope} \end{scope}}\end{scope}} \tikzset{ cow/.pic={ \begin{scope}[x=3cm/480,y=3cm/480] \reflect[]{ \tikzset{shift={(32,140)}, rotate=-45} \fill [BlueGrey100] (0,0) arc (0:90:32 and 96) arc (90:0:96); \fill [BlueGrey200] (32,0) arc (0:90:64 and 96) arc (90:0:96); } \foreach \i in {-1, 1}\foreach \j in {0, 1} \fill \ifnum\j=0 \ifnum \i=-1 [BlueGrey700] \else [BlueGrey800] \fi\else [BlueGrey900] \fi [xscale=\i, shift={(128,88)}, rotate=10, scale=1-\j/3] (-72,0) .. controls ++( 90: 8) and ++(180:16) .. ( 0, 48) .. controls ++( 0:16) and ++( 90:12) .. (88, 0) .. controls ++(270:12) and ++( 0: 8) .. ( 0,-48) .. controls ++(180: 8) and ++(270: 8) .. cycle; \reflect[split={BlueGrey700 and BlueGrey800}]{ \fill [fill color] (-64,-160) .. controls ++( 90:144) and ++(270: 64) .. (-120, 64) arc (180:0: 120 and 112) .. controls ++(270: 64) and ++( 90:144) .. ( 64,-160) -- cycle; } \reflect[split=Grey50 and Grey200]{ \fill [fill color](-64,-160) .. controls ++( 75:144) and ++(270: 64) .. (-16, 64) .. controls ++( 90: 32) and ++(180: 72) .. ( 0, 168) .. controls ++( 0: 72) and ++( 90: 32) .. ( 16, 64) .. controls ++(270: 64) and ++(105:144) .. ( 64,-160) -- cycle; } \reflect[split=Pink100 and Pink200]{ \fill [fill color] (0,-160) ellipse [x radius=64, y radius=56]; } \fill [Pink300] (0, -160) ellipse [x radius=48, y radius=40]; \reflect[split=Pink100 and Pink200]{ \fill [fill color] (0,-128) ellipse [x radius=80, y radius=56]; } \fill [Pink300] (-32, -128) ellipse [radius=16] ( 32, -128) ellipse [radius=16]; \fill [BlueGrey900] (-64, 64) ellipse [radius=24] ( 64, 64) ellipse [radius=24]; \end{scope} } } \begin{document} \begin{tikzpicture} \fill [fill=LightBlue300] circle [radius=2]; \pic {cow}; \end{tikzpicture} \end{document}
Make the mouth of the cow wide open vertically
\documentclass[tikz,border=5]{standalone} \usepackage[prefix=]{xcolor-material} \tikzset{ half clip/.code={ \clip (0, -256) rectangle (256, 256); }, color/.code=\colorlet{fill color}{#1}, color alias/.code args={#1 as #2}{\colorlet{#1}{#2}}, on left/.style={.. on left/.style={#1}}, on right/.style={.. on right/.style={#1}}, split/.style args={#1 and #2}{ on left ={color alias=fill color as #1}, on right={color alias=fill color as #2, half clip} } } \newcommand\reflect[2][]{ \begin{scope}[#1]\foreach \side in {-1, 1}{\begin{scope} \ifnum\side=-1 \tikzset{.. on left/.try}\else\tikzset{.. on right/.try}\fi \begin{scope}[xscale=\side]#2\end{scope} \end{scope}}\end{scope}} \tikzset{ cow/.pic={ \begin{scope}[x=3cm/480,y=3cm/480] \reflect[]{ \tikzset{shift={(32,140)}, rotate=-45} \fill [BlueGrey100] (0,0) arc (0:90:32 and 96) arc (90:0:96); \fill [BlueGrey200] (32,0) arc (0:90:64 and 96) arc (90:0:96); } \foreach \i in {-1, 1}\foreach \j in {0, 1} \fill \ifnum\j=0 \ifnum \i=-1 [BlueGrey700] \else [BlueGrey800] \fi\else [BlueGrey900] \fi [xscale=\i, shift={(128,88)}, rotate=10, scale=1-\j/3] (-72,0) .. controls ++( 90: 8) and ++(180:16) .. ( 0, 48) .. controls ++( 0:16) and ++( 90:12) .. (88, 0) .. controls ++(270:12) and ++( 0: 8) .. ( 0,-48) .. controls ++(180: 8) and ++(270: 8) .. cycle; \reflect[split={BlueGrey700 and BlueGrey800}]{ \fill [fill color] (-64,-160) .. controls ++( 90:144) and ++(270: 64) .. (-120, 64) arc (180:0: 120 and 112) .. controls ++(270: 64) and ++( 90:144) .. ( 64,-160) -- cycle; } \reflect[split=Grey50 and Grey200]{ \fill [fill color](-64,-160) .. controls ++( 75:144) and ++(270: 64) .. (-16, 64) .. controls ++( 90: 32) and ++(180: 72) .. ( 0, 168) .. controls ++( 0: 72) and ++( 90: 32) .. ( 16, 64) .. controls ++(270: 64) and ++(105:144) .. ( 64,-160) -- cycle; } \reflect[split=Pink100 and Pink200]{ \fill [fill color] (0,-180) ellipse [x radius=64, y radius=90]; } \fill [Pink300] (0, -180) ellipse [x radius=48, y radius=70]; \reflect[split=Pink100 and Pink200]{ \fill [fill color] (0,-128) ellipse [x radius=80, y radius=56]; } \fill [Pink300] (-32, -128) ellipse [radius=16] ( 32, -128) ellipse [radius=16]; \fill [BlueGrey900] (-64, 64) ellipse [radius=24] ( 64, 64) ellipse [radius=24]; \end{scope} } } \begin{document} \begin{tikzpicture} \fill [fill=LightBlue300] circle [radius=2]; \pic {cow}; \end{tikzpicture} \end{document}
cylinder_mirrored
\documentclass[tikz,border=5]{standalone} \usepackage{amsmath} \usepackage{amssymb} \usepackage{tikz} \usetikzlibrary{calc,fit,patterns,decorations.markings,matrix,3d} \begin{document} \begin{tikzpicture}[scale=1] \def\Anglei{-67.5} \def\Angleii{233} \def\Angleiii{170} \draw[thin,->] (-2,0) -- (5,0); \draw[thin,->] (0,-2) -- (0,3); \begin{scope}[canvas is zx plane at y=0] \coordinate (circmb) at ( $ (0,2.5) + (\Angleii:2cm) $ ); \coordinate (circma) at ( $ (0,2.5) + (\Angleiii:2cm) $ ); \draw[dashed] (circmb) arc [start angle=\Angleii,end angle=\Angleiii,radius=2cm]; \draw (circma) arc [start angle=\Angleiii,end angle=\Angleii-360,radius=2cm]; \fill[fill=gray,opacity=0.5] (0,2.5) circle (1cm); \coordinate (circm1) at ( $ (0,2.5) + (\Anglei:1cm) $ ); \coordinate (circm2) at ( $ (0,2.5) + (180+\Anglei:1cm) $ ); \draw (circm1) arc [start angle=\Anglei,end angle=180+\Anglei,radius=1cm]; \draw[dashed] (circm2) arc [start angle=180+\Anglei,end angle=360+\Anglei,radius=1cm]; \draw[->] (-2,0) -- (3,0); \end{scope} \begin{scope}[canvas is zx plane at y=1.5] \path (0,2.5) circle (1cm); \coordinate (circ1a) at ( $ (0,2.5) + (\Anglei:1cm) $ ); \coordinate (circ1b) at ( $ (0,2.5) + (180+\Anglei:1cm) $ ); \end{scope} \begin{scope}[canvas is zx plane at y=-1.5] \path (0,2.5) circle (1cm); \coordinate (circ2a) at ( $ (0,2.5) + (\Anglei:1cm) $ ); \coordinate (circ2b) at ( $ (0,2.5) + (180+\Anglei:1cm) $ ); \end{scope} \begin{scope}[canvas is xy plane at z=0] \draw (circ1a) -- (circ2a); \draw (circ1b) -- (circ2b); \end{scope} \begin{scope}[canvas is zx plane at y=1.5] \draw (0,2.5) circle (1cm); \end{scope} \begin{scope}[canvas is zx plane at y=-1.5] \draw (circ2a) arc [start angle=\Anglei,end angle=180+\Anglei,radius=1cm]; \draw[dashed] (circ2b) arc [start angle=180+\Anglei,end angle=360+\Anglei,radius=1cm]; \end{scope} \begin{scope}[every node/.append style={ xslant=1,sloped} ] \node at (2.4,-.2) {\scalebox{1}[.7]{$T_0$}}; \node at (4,.4) {\scalebox{1}[.7]{$T$}}; \node at (-.8,-.2) {\scalebox{1}[.7]{$\mathbb{R}^n$}}; \end{scope} \end{tikzpicture} \end{document}
Mirror the cylinder on the other side of the z axis. Mirror only the cylinder without the T and T0 circles, and adapt the length of the coordinate axe(s).
\documentclass[tikz,border=5]{standalone} \usepackage{amsmath} \usepackage{amssymb} \usepackage{tikz} \usetikzlibrary{calc,fit,patterns,decorations.markings,matrix,3d} \begin{document} \begin{tikzpicture}[scale=1] \def\Anglei{-67.5} \def\Angleii{233} \def\Angleiii{170} \draw[thin,->] (-5,0) -- (5,0); \draw[thin,->] (0,-2) -- (0,3); \begin{scope}[canvas is zx plane at y=0] \coordinate (circmb) at ( $ (0,2.5) + (\Angleii:2cm) $ ); \coordinate (circma) at ( $ (0,2.5) + (\Angleiii:2cm) $ ); \draw[dashed] (circmb) arc [start angle=\Angleii,end angle=\Angleiii,radius=2cm]; \draw (circma) arc [start angle=\Angleiii,end angle=\Angleii-360,radius=2cm]; \fill[fill=gray,opacity=0.5] (0,2.5) circle (1cm); \coordinate (circm1) at ( $ (0,2.5) + (\Anglei:1cm) $ ); \coordinate (circm2) at ( $ (0,2.5) + (180+\Anglei:1cm) $ ); \draw (circm1) arc [start angle=\Anglei,end angle=180+\Anglei,radius=1cm]; \draw[dashed] (circm2) arc [start angle=180+\Anglei,end angle=360+\Anglei,radius=1cm]; \draw[->] (-2,0) -- (3,0); \end{scope} \begin{scope}[canvas is zx plane at y=1.5] \path (0,2.5) circle (1cm); \coordinate (circ1a) at ( $ (0,2.5) + (\Anglei:1cm) $ ); \coordinate (circ1b) at ( $ (0,2.5) + (180+\Anglei:1cm) $ ); \end{scope} \begin{scope}[canvas is zx plane at y=-1.5] \path (0,2.5) circle (1cm); \coordinate (circ2a) at ( $ (0,2.5) + (\Anglei:1cm) $ ); \coordinate (circ2b) at ( $ (0,2.5) + (180+\Anglei:1cm) $ ); \end{scope} \begin{scope}[canvas is xy plane at z=0] \draw (circ1a) -- (circ2a); \draw (circ1b) -- (circ2b); \end{scope} \begin{scope}[canvas is zx plane at y=1.5] \draw (0,2.5) circle (1cm); \end{scope} \begin{scope}[canvas is zx plane at y=-1.5] \draw (circ2a) arc [start angle=\Anglei,end angle=180+\Anglei,radius=1cm]; \draw[dashed] (circ2b) arc [start angle=180+\Anglei,end angle=360+\Anglei,radius=1cm]; \end{scope} \begin{scope}[canvas is zx plane at y=1.5] \path (0,-2.5) circle (1cm); \coordinate (circ3a) at ( $ (0,-2.5) + (\Anglei:1cm) $ ); \coordinate (circ3b) at ( $ (0,-2.5) + (180+\Anglei:1cm) $ ); \end{scope} \begin{scope}[canvas is zx plane at y=-1.5] \path (0,-2.5) circle (1cm); \coordinate (circ4a) at ( $ (0,-2.5) + (\Anglei:1cm) $ ); \coordinate (circ4b) at ( $ (0,-2.5) + (180+\Anglei:1cm) $ ); \end{scope} \begin{scope}[canvas is xy plane at z=0] \draw (circ3a) -- (circ4a); \draw (circ3b) -- (circ4b); \end{scope} \begin{scope}[canvas is zx plane at y=1.5] \draw (0,-2.5) circle (1cm); \end{scope} \begin{scope}[canvas is zx plane at y=-1.5] \draw (circ4a) arc [start angle=\Anglei,end angle=180+\Anglei,radius=1cm]; \draw[dashed] (circ4b) arc [start angle=180+\Anglei,end angle=360+\Anglei,radius=1cm]; \end{scope} \begin{scope}[every node/.append style={ xslant=1,sloped} ] \node at (2.4,-.2) {\scalebox{1}[.7]{$T_0$}}; \node at (4,.4) {\scalebox{1}[.7]{$T$}}; \node at (-.8,-.2) {\scalebox{1}[.7]{$\mathbb{R}^n$}}; \end{scope} \end{tikzpicture} \end{document}
dog_long_ears
\documentclass[tikz,border=5]{standalone} \usepackage[prefix=]{xcolor-material} \tikzset{ half clip/.code={ \clip (0, -256) rectangle (256, 256); }, color/.code=\colorlet{fill color}{#1}, color alias/.code args={#1 as #2}{\colorlet{#1}{#2}}, on left/.style={.. on left/.style={#1}}, on right/.style={.. on right/.style={#1}}, split/.style args={#1 and #2}{ on left ={color alias=fill color as #1}, on right={color alias=fill color as #2, half clip} } } \newcommand\reflect[2][]{ \begin{scope}[#1]\foreach \side in {-1, 1}{\begin{scope} \ifnum\side=-1 \tikzset{.. on left/.try}\else\tikzset{.. on right/.try}\fi \begin{scope}[xscale=\side]#2\end{scope} \end{scope}}\end{scope}} \tikzset{ dog/.pic={ \begin{scope}[x=3cm/480,y=3cm/480] \useasboundingbox (-256, -256) (256, 256); \reflect[split=Brown400 and Brown500]{ \fill [fill color] (0,-64) ellipse [x radius=160, y radius=144]; \fill [fill color] (0, 32) ellipse [x radius=128, y radius=112]; \fill [fill color] (32,96) .. controls ++( 75:128) and ++(105:128) .. ++(192, 0) .. controls ++(285: 96) and ++(285: 96) .. ++(-80,-32) .. controls ++(105: 64) and ++( 75: 32) .. cycle; } \reflect[split={Grey100 and Grey200}]{ \clip (0,-64) ellipse [x radius=160, y radius=144]; \fill [fill color](0,-224) .. controls ++( 0:64) and ++(270:64) .. ++(96,64) .. controls ++( 90:64) and ++(270:64) .. ++(-96,192) .. controls ++(270:64) and ++( 90:64) .. ++(-96,-192) .. controls ++(270:64) and ++(180:64) .. cycle; } \reflect[split={Pink100 and Pink200}]{ \fill [fill color](0,-192) ellipse [x radius=28, y radius=32]; } \reflect[split={BlueGrey800 and BlueGrey900}]{ \fill [fill color](0,-144) .. controls ++( 0:20) and ++(315:20) .. ++( 40,64) .. controls ++(135:20) and ++( 45:20) .. ++(-80, 0) .. controls ++(225:20) and ++(180:20) .. cycle; \fill [BlueGrey900] (56, 0) circle [radius=20]; \fill [fill color] (-8,-112) -- ++(16,0) -- ++(0,-32) arc (180:360:24) arc (180:0:8) arc (360:180:40); } \end{scope}} } \begin{document} \begin{tikzpicture} \fill [fill=LightBlue300] circle [radius=2]; \pic {dog}; \end{tikzpicture} \end{document}
Make the ears of the dog longer
\documentclass[tikz,border=5]{standalone} \usepackage[prefix=]{xcolor-material} \tikzset{ half clip/.code={ \clip (0, -256) rectangle (256, 256); }, color/.code=\colorlet{fill color}{#1}, color alias/.code args={#1 as #2}{\colorlet{#1}{#2}}, on left/.style={.. on left/.style={#1}}, on right/.style={.. on right/.style={#1}}, split/.style args={#1 and #2}{ on left ={color alias=fill color as #1}, on right={color alias=fill color as #2, half clip} } } \newcommand\reflect[2][]{ \begin{scope}[#1]\foreach \side in {-1, 1}{\begin{scope} \ifnum\side=-1 \tikzset{.. on left/.try}\else\tikzset{.. on right/.try}\fi \begin{scope}[xscale=\side]#2\end{scope} \end{scope}}\end{scope}} \tikzset{ dog/.pic={ \begin{scope}[x=3cm/480,y=3cm/480] \useasboundingbox (-256, -256) (256, 256); \reflect[split=Brown400 and Brown500]{ \fill [fill color] (0,-64) ellipse [x radius=160, y radius=144]; \fill [fill color] (0, 32) ellipse [x radius=128, y radius=112]; \fill [fill color] (32,96) .. controls ++( 75:160) and ++(105:190) .. ++(210, -100) .. controls ++(285: 96) and ++(285: 96) .. ++(-70,-32) .. controls ++(105: 140) and ++( 75: 75) .. cycle; } \reflect[split={Grey100 and Grey200}]{ \clip (0,-64) ellipse [x radius=160, y radius=144]; \fill [fill color](0,-224) .. controls ++( 0:64) and ++(270:64) .. ++(96,64) .. controls ++( 90:64) and ++(270:64) .. ++(-96,192) .. controls ++(270:64) and ++( 90:64) .. ++(-96,-192) .. controls ++(270:64) and ++(180:64) .. cycle; } \reflect[split={Pink100 and Pink200}]{ \fill [fill color](0,-192) ellipse [x radius=28, y radius=32]; } \reflect[split={BlueGrey800 and BlueGrey900}]{ \fill [fill color](0,-144) .. controls ++( 0:20) and ++(315:20) .. ++( 40,64) .. controls ++(135:20) and ++( 45:20) .. ++(-80, 0) .. controls ++(225:20) and ++(180:20) .. cycle; \fill [BlueGrey900] (56, 0) circle [radius=20]; \fill [fill color] (-8,-112) -- ++(16,0) -- ++(0,-32) arc (180:360:24) arc (180:0:8) arc (360:180:40); } \end{scope}} } \begin{document} \begin{tikzpicture} \fill [fill=LightBlue300] circle [radius=2]; \pic {dog}; \end{tikzpicture} \end{document}
dog_winking
\documentclass[tikz,border=5]{standalone} \usepackage[prefix=]{xcolor-material} \tikzset{ half clip/.code={ \clip (0, -256) rectangle (256, 256); }, color/.code=\colorlet{fill color}{#1}, color alias/.code args={#1 as #2}{\colorlet{#1}{#2}}, on left/.style={.. on left/.style={#1}}, on right/.style={.. on right/.style={#1}}, split/.style args={#1 and #2}{ on left ={color alias=fill color as #1}, on right={color alias=fill color as #2, half clip} } } \newcommand\reflect[2][]{ \begin{scope}[#1]\foreach \side in {-1, 1}{\begin{scope} \ifnum\side=-1 \tikzset{.. on left/.try}\else\tikzset{.. on right/.try}\fi \begin{scope}[xscale=\side]#2\end{scope} \end{scope}}\end{scope}} \tikzset{ dog/.pic={ \begin{scope}[x=3cm/480,y=3cm/480] \useasboundingbox (-256, -256) (256, 256); \reflect[split=Brown400 and Brown500]{ \fill [fill color] (0,-64) ellipse [x radius=160, y radius=144]; \fill [fill color] (0, 32) ellipse [x radius=128, y radius=112]; \fill [fill color] (32,96) .. controls ++( 75:128) and ++(105:128) .. ++(192, 0) .. controls ++(285: 96) and ++(285: 96) .. ++(-80,-32) .. controls ++(105: 64) and ++( 75: 32) .. cycle; } \reflect[split={Grey100 and Grey200}]{ \clip (0,-64) ellipse [x radius=160, y radius=144]; \fill [fill color](0,-224) .. controls ++( 0:64) and ++(270:64) .. ++(96,64) .. controls ++( 90:64) and ++(270:64) .. ++(-96,192) .. controls ++(270:64) and ++( 90:64) .. ++(-96,-192) .. controls ++(270:64) and ++(180:64) .. cycle; } \reflect[split={Pink100 and Pink200}]{ \fill [fill color](0,-192) ellipse [x radius=28, y radius=32]; } \reflect[split={BlueGrey800 and BlueGrey900}]{ \fill [fill color](0,-144) .. controls ++( 0:20) and ++(315:20) .. ++( 40,64) .. controls ++(135:20) and ++( 45:20) .. ++(-80, 0) .. controls ++(225:20) and ++(180:20) .. cycle; \fill [BlueGrey900] (56, 0) circle [radius=20]; \fill [fill color] (-8,-112) -- ++(16,0) -- ++(0,-32) arc (180:360:24) arc (180:0:8) arc (360:180:40); } \end{scope}} } \begin{document} \begin{tikzpicture} \fill [fill=LightBlue300] circle [radius=2]; \pic {dog}; \end{tikzpicture} \end{document}
Make the dog wink with its right eye.
\documentclass[tikz,border=5]{standalone} \usepackage[prefix=]{xcolor-material} \tikzset{ half clip/.code={ \clip (0, -256) rectangle (256, 256); }, color/.code=\colorlet{fill color}{#1}, color alias/.code args={#1 as #2}{\colorlet{#1}{#2}}, on left/.style={.. on left/.style={#1}}, on right/.style={.. on right/.style={#1}}, split/.style args={#1 and #2}{ on left ={color alias=fill color as #1}, on right={color alias=fill color as #2, half clip} } } \newcommand\reflect[2][]{ \begin{scope}[#1]\foreach \side in {-1, 1}{\begin{scope} \ifnum\side=-1 \tikzset{.. on left/.try}\else\tikzset{.. on right/.try}\fi \begin{scope}[xscale=\side]#2\end{scope} \end{scope}}\end{scope}} \tikzset{ dog/.pic={ \begin{scope}[x=3cm/480,y=3cm/480] \useasboundingbox (-256, -256) (256, 256); \reflect[split=Brown400 and Brown500]{ \fill [fill color] (0,-64) ellipse [x radius=160, y radius=144]; \fill [fill color] (0, 32) ellipse [x radius=128, y radius=112]; \fill [fill color] (32,96) .. controls ++( 75:128) and ++(105:128) .. ++(192, 0) .. controls ++(285: 96) and ++(285: 96) .. ++(-80,-32) .. controls ++(105: 64) and ++( 75: 32) .. cycle; } \reflect[split={Grey100 and Grey200}]{ \clip (0,-64) ellipse [x radius=160, y radius=144]; \fill [fill color](0,-224) .. controls ++( 0:64) and ++(270:64) .. ++(96,64) .. controls ++( 90:64) and ++(270:64) .. ++(-96,192) .. controls ++(270:64) and ++( 90:64) .. ++(-96,-192) .. controls ++(270:64) and ++(180:64) .. cycle; } \reflect[split={Pink100 and Pink200}]{ \fill [fill color](0,-192) ellipse [x radius=28, y radius=32]; } \reflect[split={BlueGrey800 and BlueGrey900}]{ \fill [fill color](0,-144) .. controls ++( 0:20) and ++(315:20) .. ++( 40,64) .. controls ++(135:20) and ++( 45:20) .. ++(-80, 0) .. controls ++(225:20) and ++(180:20) .. cycle; \fill [fill color] (-8,-112) -- ++(16,0) -- ++(0,-32) arc (180:360:24) arc (180:0:8) arc (360:180:40); } \fill [BlueGrey900] (56, 0) circle [radius=20]; \draw[BlueGrey900, line width=3pt] (-35, 5) -- (-80, 5); \end{scope}} } \begin{document} \begin{tikzpicture} \fill [fill=LightBlue300] circle [radius=2]; \pic {dog}; \end{tikzpicture} \end{document}
donkey_angled_nostrils
\documentclass[tikz,border=5]{standalone} \usepackage[prefix=]{xcolor-material} \tikzset{ half clip/.code={ \clip (0, -256) rectangle (256, 256); }, color/.code=\colorlet{fill color}{#1}, color alias/.code args={#1 as #2}{\colorlet{#1}{#2}}, on left/.style={.. on left/.style={#1}}, on right/.style={.. on right/.style={#1}}, split/.style args={#1 and #2}{ on left ={color alias=fill color as #1}, on right={color alias=fill color as #2, half clip} } } \newcommand\reflect[2][]{ \begin{scope}[#1]\foreach \side in {-1, 1}{\begin{scope} \ifnum\side=-1 \tikzset{.. on left/.try}\else\tikzset{.. on right/.try}\fi \begin{scope}[xscale=\side]#2\end{scope} \end{scope}}\end{scope}} \tikzset{ donkey/.pic={ \begin{scope}[x=3cm/480,y=3cm/480] \reflect[ on left ={color alias=ears as BlueGrey500}, on right={color alias=ears as BlueGrey700}, outer ear/.style={fill=ears}, inner ear/.style={fill=BlueGrey900} ]{ \foreach \s [count=\j from 0] in {outer ear, inner ear} \fill [style=\s] [shift={(88,120)}, rotate=75, scale=9/10-\j/3, xscale=3/2] (-72,0) .. controls ++( 90: 8) and ++(180:16) .. ( 0, 48) .. controls ++( 0:16) and ++( 90:12) .. (88, 0) .. controls ++(270:12) and ++( 0: 8) .. ( 0,-48) .. controls ++(180: 8) and ++(270: 8) .. cycle; } \reflect[split=BlueGrey500 and BlueGrey700]{ \fill [fill color] (-56,-160) .. controls ++( 90:112) and ++(270: 128) .. (-112, 48) arc (180:0:112 and 96) .. controls ++(270: 128) and ++( 90:112) .. ( 56,-160) -- cycle; } \reflect[split=Grey500 and Grey600]{ \fill [fill color] (0,-164) ellipse [x radius=56, y radius=56]; } \reflect[split=Grey700 and Grey800]{ \fill [fill color] (0,-164) ellipse [x radius=48, y radius=40]; } \reflect[split=Grey500 and Grey600]{ \fill [fill color] (0,-144) ellipse [x radius=64, y radius=48]; \fill [fill color] (36, -128) ellipse [x radius=24, y radius=40]; \fill [BlueGrey900] (36, -128) ellipse [x radius=12, y radius=24]; } \fill [BlueGrey900] (-72, 40) ellipse [radius=20] ( 72, 40) ellipse [radius=20] (-8,160) to [bend left] ++( 16, 32) to [bend right] ++( 16,-48) to [bend left] ++( 16, 32) to [bend right] ++( 16,-48) to [bend right] ++(-32,-48) to [bend left] ++(-16, 32) to [bend right] ++(-32,-32) to [bend left] ++( 0, 32) to [bend right] ++(-32,-16) to [bend left] ++( 16, 40) to [bend right] ++(-16, 32) to [bend left] cycle; \end{scope}} } \begin{document} \begin{tikzpicture} \fill [fill=LightBlue300] circle [radius=2]; \pic {donkey}; \end{tikzpicture} \end{document}
Tilt the nostrils of the donkey, so that they are both angled inward. i.e. the top of each nostril is towards the center, and the bottom toward the exterior.
\documentclass[tikz,border=5]{standalone} \usepackage[prefix=]{xcolor-material} \tikzset{ half clip/.code={ \clip (0, -256) rectangle (256, 256); }, color/.code=\colorlet{fill color}{#1}, color alias/.code args={#1 as #2}{\colorlet{#1}{#2}}, on left/.style={.. on left/.style={#1}}, on right/.style={.. on right/.style={#1}}, split/.style args={#1 and #2}{ on left ={color alias=fill color as #1}, on right={color alias=fill color as #2, half clip} } } \newcommand\reflect[2][]{ \begin{scope}[#1]\foreach \side in {-1, 1}{\begin{scope} \ifnum\side=-1 \tikzset{.. on left/.try}\else\tikzset{.. on right/.try}\fi \begin{scope}[xscale=\side]#2\end{scope} \end{scope}}\end{scope}} \tikzset{ donkey/.pic={ \begin{scope}[x=3cm/480,y=3cm/480] \reflect[ on left ={color alias=ears as BlueGrey500}, on right={color alias=ears as BlueGrey700}, outer ear/.style={fill=ears}, inner ear/.style={fill=BlueGrey900} ]{ \foreach \s [count=\j from 0] in {outer ear, inner ear} \fill [style=\s] [shift={(88,120)}, rotate=75, scale=9/10-\j/3, xscale=3/2] (-72,0) .. controls ++( 90: 8) and ++(180:16) .. ( 0, 48) .. controls ++( 0:16) and ++( 90:12) .. (88, 0) .. controls ++(270:12) and ++( 0: 8) .. ( 0,-48) .. controls ++(180: 8) and ++(270: 8) .. cycle; } \reflect[split=BlueGrey500 and BlueGrey700]{ \fill [fill color] (-56,-160) .. controls ++( 90:112) and ++(270: 128) .. (-112, 48) arc (180:0:112 and 96) .. controls ++(270: 128) and ++( 90:112) .. ( 56,-160) -- cycle; } \reflect[split=Grey500 and Grey600]{ \fill [fill color] (0,-164) ellipse [x radius=56, y radius=56]; } \reflect[split=Grey700 and Grey800]{ \fill [fill color] (0,-164) ellipse [x radius=48, y radius=40]; } \reflect[split=Grey500 and Grey600]{ \fill [fill color] (0,-144) ellipse [x radius=64, y radius=48]; \fill [fill color] (36, -128) ellipse [x radius=24, y radius=40, rotate=20]; \fill [BlueGrey900] (36, -128) ellipse [x radius=12, y radius=24, rotate=20]; } \fill [BlueGrey900] (-72, 40) ellipse [radius=20] ( 72, 40) ellipse [radius=20] (-8,160) to [bend left] ++( 16, 32) to [bend right] ++( 16,-48) to [bend left] ++( 16, 32) to [bend right] ++( 16,-48) to [bend right] ++(-32,-48) to [bend left] ++(-16, 32) to [bend right] ++(-32,-32) to [bend left] ++( 0, 32) to [bend right] ++(-32,-16) to [bend left] ++( 16, 40) to [bend right] ++(-16, 32) to [bend left] cycle; \end{scope}} } \begin{document} \begin{tikzpicture} \fill [fill=LightBlue300] circle [radius=2]; \pic {donkey}; \end{tikzpicture} \end{document}
donkey_higher_mane
\documentclass[tikz,border=5]{standalone} \usepackage[prefix=]{xcolor-material} \tikzset{ half clip/.code={ \clip (0, -256) rectangle (256, 256); }, color/.code=\colorlet{fill color}{#1}, color alias/.code args={#1 as #2}{\colorlet{#1}{#2}}, on left/.style={.. on left/.style={#1}}, on right/.style={.. on right/.style={#1}}, split/.style args={#1 and #2}{ on left ={color alias=fill color as #1}, on right={color alias=fill color as #2, half clip} } } \newcommand\reflect[2][]{ \begin{scope}[#1]\foreach \side in {-1, 1}{\begin{scope} \ifnum\side=-1 \tikzset{.. on left/.try}\else\tikzset{.. on right/.try}\fi \begin{scope}[xscale=\side]#2\end{scope} \end{scope}}\end{scope}} \tikzset{ donkey/.pic={ \begin{scope}[x=3cm/480,y=3cm/480] \reflect[ on left ={color alias=ears as BlueGrey500}, on right={color alias=ears as BlueGrey700}, outer ear/.style={fill=ears}, inner ear/.style={fill=BlueGrey900} ]{ \foreach \s [count=\j from 0] in {outer ear, inner ear} \fill [style=\s] [shift={(88,120)}, rotate=75, scale=9/10-\j/3, xscale=3/2] (-72,0) .. controls ++( 90: 8) and ++(180:16) .. ( 0, 48) .. controls ++( 0:16) and ++( 90:12) .. (88, 0) .. controls ++(270:12) and ++( 0: 8) .. ( 0,-48) .. controls ++(180: 8) and ++(270: 8) .. cycle; } \reflect[split=BlueGrey500 and BlueGrey700]{ \fill [fill color] (-56,-160) .. controls ++( 90:112) and ++(270: 128) .. (-112, 48) arc (180:0:112 and 96) .. controls ++(270: 128) and ++( 90:112) .. ( 56,-160) -- cycle; } \reflect[split=Grey500 and Grey600]{ \fill [fill color] (0,-164) ellipse [x radius=56, y radius=56]; } \reflect[split=Grey700 and Grey800]{ \fill [fill color] (0,-164) ellipse [x radius=48, y radius=40]; } \reflect[split=Grey500 and Grey600]{ \fill [fill color] (0,-144) ellipse [x radius=64, y radius=48]; \fill [fill color] (36, -128) ellipse [x radius=24, y radius=40]; \fill [BlueGrey900] (36, -128) ellipse [x radius=12, y radius=24]; } \fill [BlueGrey900] (-72, 40) ellipse [radius=20] ( 72, 40) ellipse [radius=20] (-8,160) to [bend left] ++( 16, 32) to [bend right] ++( 16,-48) to [bend left] ++( 16, 32) to [bend right] ++( 16,-48) to [bend right] ++(-32,-48) to [bend left] ++(-16, 32) to [bend right] ++(-32,-32) to [bend left] ++( 0, 32) to [bend right] ++(-32,-16) to [bend left] ++( 16, 40) to [bend right] ++(-16, 32) to [bend left] cycle; \end{scope}} } \begin{document} \begin{tikzpicture} \fill [fill=LightBlue300] circle [radius=2]; \pic {donkey}; \end{tikzpicture} \end{document}
Make the mane of the donkey go upward a little more
\documentclass[tikz,border=5]{standalone} \usepackage[prefix=]{xcolor-material} \tikzset{ half clip/.code={ \clip (0, -256) rectangle (256, 256); }, color/.code=\colorlet{fill color}{#1}, color alias/.code args={#1 as #2}{\colorlet{#1}{#2}}, on left/.style={.. on left/.style={#1}}, on right/.style={.. on right/.style={#1}}, split/.style args={#1 and #2}{ on left ={color alias=fill color as #1}, on right={color alias=fill color as #2, half clip} } } \newcommand\reflect[2][]{ \begin{scope}[#1]\foreach \side in {-1, 1}{\begin{scope} \ifnum\side=-1 \tikzset{.. on left/.try}\else\tikzset{.. on right/.try}\fi \begin{scope}[xscale=\side]#2\end{scope} \end{scope}}\end{scope}} \tikzset{ donkey/.pic={ \begin{scope}[x=3cm/480,y=3cm/480] \reflect[ on left ={color alias=ears as BlueGrey500}, on right={color alias=ears as BlueGrey700}, outer ear/.style={fill=ears}, inner ear/.style={fill=BlueGrey900} ]{ \foreach \s [count=\j from 0] in {outer ear, inner ear} \fill [style=\s] [shift={(88,120)}, rotate=75, scale=9/10-\j/3, xscale=3/2] (-72,0) .. controls ++( 90: 8) and ++(180:16) .. ( 0, 48) .. controls ++( 0:16) and ++( 90:12) .. (88, 0) .. controls ++(270:12) and ++( 0: 8) .. ( 0,-48) .. controls ++(180: 8) and ++(270: 8) .. cycle; } \reflect[split=BlueGrey500 and BlueGrey700]{ \fill [fill color] (-56,-160) .. controls ++( 90:112) and ++(270: 128) .. (-112, 48) arc (180:0:112 and 96) .. controls ++(270: 128) and ++( 90:112) .. ( 56,-160) -- cycle; } \reflect[split=Grey500 and Grey600]{ \fill [fill color] (0,-164) ellipse [x radius=56, y radius=56]; } \reflect[split=Grey700 and Grey800]{ \fill [fill color] (0,-164) ellipse [x radius=48, y radius=40]; } \reflect[split=Grey500 and Grey600]{ \fill [fill color] (0,-144) ellipse [x radius=64, y radius=48]; \fill [fill color] (36, -128) ellipse [x radius=24, y radius=40]; \fill [BlueGrey900] (36, -128) ellipse [x radius=12, y radius=24]; } \fill [BlueGrey900] (-72, 40) ellipse [radius=20] ( 72, 40) ellipse [radius=20] (-8,160) to [bend left] ++( 16, 70) to [bend right] ++( 16,-75) to [bend left] ++( 16, 70) to [bend right] ++( 16,-70) to [bend right] ++(-32,-48) to [bend left] ++(-16, 32) to [bend right] ++(-32,-32) to [bend left] ++( 0, 32) to [bend right] ++(-32,-16) to [bend left] ++( 16, 40) to [bend right] ++(-28, 32) to [bend left] cycle; \end{scope}} } \begin{document} \begin{tikzpicture} \fill [fill=LightBlue300] circle [radius=2]; \pic {donkey}; \end{tikzpicture} \end{document}
duck_long_feet
\documentclass[tikz,border=5]{standalone} \usepackage[prefix=]{xcolor-material} \tikzset{ half clip/.code={ \clip (0, -256) rectangle (256, 256); }, color/.code=\colorlet{fill color}{#1}, color alias/.code args={#1 as #2}{\colorlet{#1}{#2}}, on left/.style={.. on left/.style={#1}}, on right/.style={.. on right/.style={#1}}, split/.style args={#1 and #2}{ on left ={color alias=fill color as #1}, on right={color alias=fill color as #2, half clip} } } \newcommand\reflect[2][]{ \begin{scope}[#1]\foreach \side in {-1, 1}{\begin{scope} \ifnum\side=-1 \tikzset{.. on left/.try}\else\tikzset{.. on right/.try}\fi \begin{scope}[xscale=\side]#2\end{scope} \end{scope}}\end{scope}} \tikzset{ duck/.pic={ \tikzset{x=3cm/100,y=3cm/100, shift={(-50,-50)}} \fill [Amber800] (58,28) .. controls (56,28) and (55,27) .. (55,26) .. controls (55,25) and (56,16) .. (55,15) .. controls (54,14) and (54,12) .. (55,11) .. controls (56,10) and (66, 7) .. (68, 7) .. controls (70, 7) and (75,15) .. (73,15) .. controls (71,15) and (62,13) .. (60,15) .. controls (58,17) and (60,25) .. (60,26) .. controls (60,27) and (59,28) .. (58,28) -- cycle; \fill [BlueGrey900] (1,57) .. controls ( 0,51) and ( 4,44) .. (10,42) .. controls (16,40) and (23,40) .. (24,47) -- cycle; \begin{scope} \clip [preaction={fill=LightGreen}] (74,96) .. controls (66,96) and (62,92) .. (60,88) .. controls (58,84) and (58,76) .. (61,68) -- (76,68) .. controls (72,72) and (74,74) .. (75,75) .. controls (82,75) and (88,76) .. (88,84) .. controls (88,92) and (82,96) .. (74,96) -- cycle; \fill [Grey100] (57,68) rectangle +(20,4); \end{scope} \fill [BlueGrey50] (14,48) .. controls (14,34) and (32,21) .. (53,21) .. controls (55,21) and (57,21) .. (61,22) .. controls (81,27) and (92,36) .. (92,48) -- cycle; \fill [Brown500] (61,68) .. controls (65,52) and (68,40) .. (61,22) .. controls (84,26) and (92,36) .. (92,48) .. controls (92,60) and (82,65) .. (76,68) -- cycle; \fill [BlueGrey400] (56,64) .. controls (45,64) and (40,60) .. (32,56) .. controls (24,52) and ( 8,52) .. ( 8,48) .. controls (8, 44) and (24,36) .. (40,36) .. controls (56,36) and (68,44) .. (72,48) .. controls (76,52) and (72,56) .. (68,60) .. controls (64,64) and (60,64) .. (56,64) -- cycle; \fill [Amber500] (88,84) .. controls (86,84) and ( 87,82) .. (86,81) .. controls (85,80) and ( 80,79) .. (83,76) .. controls (86,73) and ( 95,71) .. (97,71) .. controls (99,71) and (100,72) .. (99,73) .. controls (98,74) and ( 92,77) .. (91,80) .. controls (90,83) and ( 90,84) .. (88,84) -- cycle; \fill (78,87) .. controls (77,85) and (80,82) .. (83,84) .. controls (83,87) and (80,88) .. (78,87) -- cycle; \fill [Amber700] (50,25) .. controls (48,25) and (47,24) .. (47,23) .. controls (47,22) and (48,13) .. (47,12) .. controls (46,11) and (46, 9) .. (47, 8) .. controls (48, 7) and (58, 4) .. (60, 4) .. controls (62, 4) and (67,12) .. (65,12) .. controls (63,12) and (54,10) .. (52,12) .. controls (50,14) and (52,22) .. (52,23) .. controls (52,24) and (51,25) .. (50,25) -- cycle;} } \begin{document} \begin{tikzpicture} \fill [fill=LightBlue300] circle [radius=2]; \pic {duck}; \end{tikzpicture} \end{document}
Make the feet of the duck longer (not the legs)
\documentclass[tikz,border=5]{standalone} \usepackage[prefix=]{xcolor-material} \tikzset{ half clip/.code={ \clip (0, -256) rectangle (256, 256); }, color/.code=\colorlet{fill color}{#1}, color alias/.code args={#1 as #2}{\colorlet{#1}{#2}}, on left/.style={.. on left/.style={#1}}, on right/.style={.. on right/.style={#1}}, split/.style args={#1 and #2}{ on left ={color alias=fill color as #1}, on right={color alias=fill color as #2, half clip} } } \newcommand\reflect[2][]{ \begin{scope}[#1]\foreach \side in {-1, 1}{\begin{scope} \ifnum\side=-1 \tikzset{.. on left/.try}\else\tikzset{.. on right/.try}\fi \begin{scope}[xscale=\side]#2\end{scope} \end{scope}}\end{scope}} \tikzset{ duck/.pic={ \tikzset{x=3cm/100,y=3cm/100, shift={(-50,-50)}} \fill [Amber800] (58,28) .. controls (56,28) and (55,27) .. (55,26) .. controls (55,25) and (56,16) .. (55,15) .. controls (54,14) and (54,12) .. (55,11) .. controls (66,10) and (76, 7) .. (78, 7) .. controls (80, 7) and (85,15) .. (83,15) .. controls (71,15) and (62,13) .. (60,15) .. controls (58,17) and (60,25) .. (60,26) .. controls (60,27) and (59,28) .. (58,28) -- cycle; \fill [BlueGrey900] (1,57) .. controls ( 0,51) and ( 4,44) .. (10,42) .. controls (16,40) and (23,40) .. (24,47) -- cycle; \begin{scope} \clip [preaction={fill=LightGreen}] (74,96) .. controls (66,96) and (62,92) .. (60,88) .. controls (58,84) and (58,76) .. (61,68) -- (76,68) .. controls (72,72) and (74,74) .. (75,75) .. controls (82,75) and (88,76) .. (88,84) .. controls (88,92) and (82,96) .. (74,96) -- cycle; \fill [Grey100] (57,68) rectangle +(20,4); \end{scope} \fill [BlueGrey50] (14,48) .. controls (14,34) and (32,21) .. (53,21) .. controls (55,21) and (57,21) .. (61,22) .. controls (81,27) and (92,36) .. (92,48) -- cycle; \fill [Brown500] (61,68) .. controls (65,52) and (68,40) .. (61,22) .. controls (84,26) and (92,36) .. (92,48) .. controls (92,60) and (82,65) .. (76,68) -- cycle; \fill [BlueGrey400] (56,64) .. controls (45,64) and (40,60) .. (32,56) .. controls (24,52) and ( 8,52) .. ( 8,48) .. controls (8, 44) and (24,36) .. (40,36) .. controls (56,36) and (68,44) .. (72,48) .. controls (76,52) and (72,56) .. (68,60) .. controls (64,64) and (60,64) .. (56,64) -- cycle; \fill [Amber500] (88,84) .. controls (86,84) and ( 87,82) .. (86,81) .. controls (85,80) and ( 80,79) .. (83,76) .. controls (86,73) and ( 95,71) .. (97,71) .. controls (99,71) and (100,72) .. (99,73) .. controls (98,74) and ( 92,77) .. (91,80) .. controls (90,83) and ( 90,84) .. (88,84) -- cycle; \fill (78,87) .. controls (77,85) and (80,82) .. (83,84) .. controls (83,87) and (80,88) .. (78,87) -- cycle; \fill [Amber700] (50,25) .. controls (48,25) and (47,24) .. (47,23) .. controls (47,22) and (48,13) .. (47,12) .. controls (46,11) and (46, 9) .. (47, 8) .. controls (58, 7) and (68, 4) .. (70, 4) .. controls (72, 4) and (77,12) .. (75,12) .. controls (63,12) and (54,10) .. (52,12) .. controls (50,14) and (52,22) .. (52,23) .. controls (52,24) and (51,25) .. (50,25) -- cycle;} } \begin{document} \begin{tikzpicture} \fill [fill=LightBlue300] circle [radius=2]; \pic {duck}; \end{tikzpicture} \end{document}
duck_opened_wings
\documentclass[tikz,border=5]{standalone} \usepackage[prefix=]{xcolor-material} \tikzset{ half clip/.code={ \clip (0, -256) rectangle (256, 256); }, color/.code=\colorlet{fill color}{#1}, color alias/.code args={#1 as #2}{\colorlet{#1}{#2}}, on left/.style={.. on left/.style={#1}}, on right/.style={.. on right/.style={#1}}, split/.style args={#1 and #2}{ on left ={color alias=fill color as #1}, on right={color alias=fill color as #2, half clip} } } \newcommand\reflect[2][]{ \begin{scope}[#1]\foreach \side in {-1, 1}{\begin{scope} \ifnum\side=-1 \tikzset{.. on left/.try}\else\tikzset{.. on right/.try}\fi \begin{scope}[xscale=\side]#2\end{scope} \end{scope}}\end{scope}} \tikzset{ duck/.pic={ \tikzset{x=3cm/100,y=3cm/100, shift={(-50,-50)}} \fill [Amber800] (58,28) .. controls (56,28) and (55,27) .. (55,26) .. controls (55,25) and (56,16) .. (55,15) .. controls (54,14) and (54,12) .. (55,11) .. controls (56,10) and (66, 7) .. (68, 7) .. controls (70, 7) and (75,15) .. (73,15) .. controls (71,15) and (62,13) .. (60,15) .. controls (58,17) and (60,25) .. (60,26) .. controls (60,27) and (59,28) .. (58,28) -- cycle; \fill [BlueGrey900] (1,57) .. controls ( 0,51) and ( 4,44) .. (10,42) .. controls (16,40) and (23,40) .. (24,47) -- cycle; \begin{scope} \clip [preaction={fill=LightGreen}] (74,96) .. controls (66,96) and (62,92) .. (60,88) .. controls (58,84) and (58,76) .. (61,68) -- (76,68) .. controls (72,72) and (74,74) .. (75,75) .. controls (82,75) and (88,76) .. (88,84) .. controls (88,92) and (82,96) .. (74,96) -- cycle; \fill [Grey100] (57,68) rectangle +(20,4); \end{scope} \fill [BlueGrey50] (14,48) .. controls (14,34) and (32,21) .. (53,21) .. controls (55,21) and (57,21) .. (61,22) .. controls (81,27) and (92,36) .. (92,48) -- cycle; \fill [Brown500] (61,68) .. controls (65,52) and (68,40) .. (61,22) .. controls (84,26) and (92,36) .. (92,48) .. controls (92,60) and (82,65) .. (76,68) -- cycle; \fill [BlueGrey400] (56,64) .. controls (45,64) and (40,60) .. (32,56) .. controls (24,52) and ( 8,52) .. ( 8,48) .. controls (8, 44) and (24,36) .. (40,36) .. controls (56,36) and (68,44) .. (72,48) .. controls (76,52) and (72,56) .. (68,60) .. controls (64,64) and (60,64) .. (56,64) -- cycle; \fill [Amber500] (88,84) .. controls (86,84) and ( 87,82) .. (86,81) .. controls (85,80) and ( 80,79) .. (83,76) .. controls (86,73) and ( 95,71) .. (97,71) .. controls (99,71) and (100,72) .. (99,73) .. controls (98,74) and ( 92,77) .. (91,80) .. controls (90,83) and ( 90,84) .. (88,84) -- cycle; \fill (78,87) .. controls (77,85) and (80,82) .. (83,84) .. controls (83,87) and (80,88) .. (78,87) -- cycle; \fill [Amber700] (50,25) .. controls (48,25) and (47,24) .. (47,23) .. controls (47,22) and (48,13) .. (47,12) .. controls (46,11) and (46, 9) .. (47, 8) .. controls (48, 7) and (58, 4) .. (60, 4) .. controls (62, 4) and (67,12) .. (65,12) .. controls (63,12) and (54,10) .. (52,12) .. controls (50,14) and (52,22) .. (52,23) .. controls (52,24) and (51,25) .. (50,25) -- cycle;} } \begin{document} \begin{tikzpicture} \fill [fill=LightBlue300] circle [radius=2]; \pic {duck}; \end{tikzpicture} \end{document}
Make the duck open its wings
\documentclass[tikz,border=5]{standalone} \usepackage[prefix=]{xcolor-material} \tikzset{ half clip/.code={ \clip (0, -256) rectangle (256, 256); }, color/.code=\colorlet{fill color}{#1}, color alias/.code args={#1 as #2}{\colorlet{#1}{#2}}, on left/.style={.. on left/.style={#1}}, on right/.style={.. on right/.style={#1}}, split/.style args={#1 and #2}{ on left ={color alias=fill color as #1}, on right={color alias=fill color as #2, half clip} } } \newcommand\reflect[2][]{ \begin{scope}[#1]\foreach \side in {-1, 1}{\begin{scope} \ifnum\side=-1 \tikzset{.. on left/.try}\else\tikzset{.. on right/.try}\fi \begin{scope}[xscale=\side]#2\end{scope} \end{scope}}\end{scope}} \tikzset{ duck/.pic={ \tikzset{x=3cm/100,y=3cm/100, shift={(-50,-50)}} \fill [Amber800] (58,28) .. controls (56,28) and (55,27) .. (55,26) .. controls (55,25) and (56,16) .. (55,15) .. controls (54,14) and (54,12) .. (55,11) .. controls (56,10) and (66, 7) .. (68, 7) .. controls (70, 7) and (75,15) .. (73,15) .. controls (71,15) and (62,13) .. (60,15) .. controls (58,17) and (60,25) .. (60,26) .. controls (60,27) and (59,28) .. (58,28) -- cycle; \fill [BlueGrey900] (1,57) .. controls ( 0,51) and ( 4,44) .. (10,42) .. controls (16,40) and (23,40) .. (24,47) -- cycle; \begin{scope} \clip [preaction={fill=LightGreen}] (74,96) .. controls (66,96) and (62,92) .. (60,88) .. controls (58,84) and (58,76) .. (61,68) -- (76,68) .. controls (72,72) and (74,74) .. (75,75) .. controls (82,75) and (88,76) .. (88,84) .. controls (88,92) and (82,96) .. (74,96) -- cycle; \fill [Grey100] (57,68) rectangle +(20,4); \end{scope} \fill [BlueGrey50] (30,60) .. controls (-15,40) and (32,21) .. (53,21) .. controls (55,21) and (57,21) .. (61,22) .. controls (81,27) and (92,36) .. (92,48) -- cycle; \fill [Brown500] (61,68) .. controls (65,52) and (68,40) .. (61,22) .. controls (84,26) and (92,36) .. (92,48) .. controls (92,60) and (82,65) .. (76,68) -- cycle; \fill [BlueGrey400 , rotate=-40, shift={(-50,25)}] (56,64) .. controls (45,64) and (40,60) .. (32,56) .. controls (24,52) and ( 8,52) .. ( 8,48) .. controls (8, 44) and (24,36) .. (40,36) .. controls (56,36) and (68,44) .. (72,48) .. controls (76,52) and (72,56) .. (68,60) .. controls (64,64) and (60,64) .. (56,64) -- cycle; \fill [Amber500] (88,84) .. controls (86,84) and ( 87,82) .. (86,81) .. controls (85,80) and ( 80,79) .. (83,76) .. controls (86,73) and ( 95,71) .. (97,71) .. controls (99,71) and (100,72) .. (99,73) .. controls (98,74) and ( 92,77) .. (91,80) .. controls (90,83) and ( 90,84) .. (88,84) -- cycle; \fill (78,87) .. controls (77,85) and (80,82) .. (83,84) .. controls (83,87) and (80,88) .. (78,87) -- cycle; \fill [Amber700] (50,25) .. controls (48,25) and (47,24) .. (47,23) .. controls (47,22) and (48,13) .. (47,12) .. controls (46,11) and (46, 9) .. (47, 8) .. controls (48, 7) and (58, 4) .. (60, 4) .. controls (62, 4) and (67,12) .. (65,12) .. controls (63,12) and (54,10) .. (52,12) .. controls (50,14) and (52,22) .. (52,23) .. controls (52,24) and (51,25) .. (50,25) -- cycle;} } \begin{document} \begin{tikzpicture} \fill [fill=LightBlue300] circle [radius=2]; \pic {duck}; \end{tikzpicture} \end{document}
duck_wide_eyes
\documentclass[tikz,border=5]{standalone} \usepackage[prefix=]{xcolor-material} \tikzset{ half clip/.code={ \clip (0, -256) rectangle (256, 256); }, color/.code=\colorlet{fill color}{#1}, color alias/.code args={#1 as #2}{\colorlet{#1}{#2}}, on left/.style={.. on left/.style={#1}}, on right/.style={.. on right/.style={#1}}, split/.style args={#1 and #2}{ on left ={color alias=fill color as #1}, on right={color alias=fill color as #2, half clip} } } \newcommand\reflect[2][]{ \begin{scope}[#1]\foreach \side in {-1, 1}{\begin{scope} \ifnum\side=-1 \tikzset{.. on left/.try}\else\tikzset{.. on right/.try}\fi \begin{scope}[xscale=\side]#2\end{scope} \end{scope}}\end{scope}} \tikzset{ duck/.pic={ \tikzset{x=3cm/100,y=3cm/100, shift={(-50,-50)}} \fill [Amber800] (58,28) .. controls (56,28) and (55,27) .. (55,26) .. controls (55,25) and (56,16) .. (55,15) .. controls (54,14) and (54,12) .. (55,11) .. controls (56,10) and (66, 7) .. (68, 7) .. controls (70, 7) and (75,15) .. (73,15) .. controls (71,15) and (62,13) .. (60,15) .. controls (58,17) and (60,25) .. (60,26) .. controls (60,27) and (59,28) .. (58,28) -- cycle; \fill [BlueGrey900] (1,57) .. controls ( 0,51) and ( 4,44) .. (10,42) .. controls (16,40) and (23,40) .. (24,47) -- cycle; \begin{scope} \clip [preaction={fill=LightGreen}] (74,96) .. controls (66,96) and (62,92) .. (60,88) .. controls (58,84) and (58,76) .. (61,68) -- (76,68) .. controls (72,72) and (74,74) .. (75,75) .. controls (82,75) and (88,76) .. (88,84) .. controls (88,92) and (82,96) .. (74,96) -- cycle; \fill [Grey100] (57,68) rectangle +(20,4); \end{scope} \fill [BlueGrey50] (14,48) .. controls (14,34) and (32,21) .. (53,21) .. controls (55,21) and (57,21) .. (61,22) .. controls (81,27) and (92,36) .. (92,48) -- cycle; \fill [Brown500] (61,68) .. controls (65,52) and (68,40) .. (61,22) .. controls (84,26) and (92,36) .. (92,48) .. controls (92,60) and (82,65) .. (76,68) -- cycle; \fill [BlueGrey400] (56,64) .. controls (45,64) and (40,60) .. (32,56) .. controls (24,52) and ( 8,52) .. ( 8,48) .. controls (8, 44) and (24,36) .. (40,36) .. controls (56,36) and (68,44) .. (72,48) .. controls (76,52) and (72,56) .. (68,60) .. controls (64,64) and (60,64) .. (56,64) -- cycle; \fill [Amber500] (88,84) .. controls (86,84) and ( 87,82) .. (86,81) .. controls (85,80) and ( 80,79) .. (83,76) .. controls (86,73) and ( 95,71) .. (97,71) .. controls (99,71) and (100,72) .. (99,73) .. controls (98,74) and ( 92,77) .. (91,80) .. controls (90,83) and ( 90,84) .. (88,84) -- cycle; \fill (78,87) .. controls (77,85) and (80,82) .. (83,84) .. controls (83,87) and (80,88) .. (78,87) -- cycle; \fill [Amber700] (50,25) .. controls (48,25) and (47,24) .. (47,23) .. controls (47,22) and (48,13) .. (47,12) .. controls (46,11) and (46, 9) .. (47, 8) .. controls (48, 7) and (58, 4) .. (60, 4) .. controls (62, 4) and (67,12) .. (65,12) .. controls (63,12) and (54,10) .. (52,12) .. controls (50,14) and (52,22) .. (52,23) .. controls (52,24) and (51,25) .. (50,25) -- cycle;} } \begin{document} \begin{tikzpicture} \fill [fill=LightBlue300] circle [radius=2]; \pic {duck}; \end{tikzpicture} \end{document}
Make the eyes of the duck longer
\documentclass[tikz,border=5]{standalone} \usepackage[prefix=]{xcolor-material} \tikzset{ half clip/.code={ \clip (0, -256) rectangle (256, 256); }, color/.code=\colorlet{fill color}{#1}, color alias/.code args={#1 as #2}{\colorlet{#1}{#2}}, on left/.style={.. on left/.style={#1}}, on right/.style={.. on right/.style={#1}}, split/.style args={#1 and #2}{ on left ={color alias=fill color as #1}, on right={color alias=fill color as #2, half clip} } } \newcommand\reflect[2][]{ \begin{scope}[#1]\foreach \side in {-1, 1}{\begin{scope} \ifnum\side=-1 \tikzset{.. on left/.try}\else\tikzset{.. on right/.try}\fi \begin{scope}[xscale=\side]#2\end{scope} \end{scope}}\end{scope}} \tikzset{ duck/.pic={ \tikzset{x=3cm/100,y=3cm/100, shift={(-50,-50)}} \fill [Amber800] (58,28) .. controls (56,28) and (55,27) .. (55,26) .. controls (55,25) and (56,16) .. (55,15) .. controls (54,14) and (54,12) .. (55,11) .. controls (56,10) and (66, 7) .. (68, 7) .. controls (70, 7) and (75,15) .. (73,15) .. controls (71,15) and (62,13) .. (60,15) .. controls (58,17) and (60,25) .. (60,26) .. controls (60,27) and (59,28) .. (58,28) -- cycle; \fill [BlueGrey900] (1,57) .. controls ( 0,51) and ( 4,44) .. (10,42) .. controls (16,40) and (23,40) .. (24,47) -- cycle; \begin{scope} \clip [preaction={fill=LightGreen}] (74,96) .. controls (66,96) and (62,92) .. (60,88) .. controls (58,84) and (58,76) .. (61,68) -- (76,68) .. controls (72,72) and (74,74) .. (75,75) .. controls (82,75) and (88,76) .. (88,84) .. controls (88,92) and (82,96) .. (74,96) -- cycle; \fill [Grey100] (57,68) rectangle +(20,4); \end{scope} \fill [BlueGrey50] (14,48) .. controls (14,34) and (32,21) .. (53,21) .. controls (55,21) and (57,21) .. (61,22) .. controls (81,27) and (92,36) .. (92,48) -- cycle; \fill [Brown500] (61,68) .. controls (65,52) and (68,40) .. (61,22) .. controls (84,26) and (92,36) .. (92,48) .. controls (92,60) and (82,65) .. (76,68) -- cycle; \fill [BlueGrey400] (56,64) .. controls (45,64) and (40,60) .. (32,56) .. controls (24,52) and ( 8,52) .. ( 8,48) .. controls (8, 44) and (24,36) .. (40,36) .. controls (56,36) and (68,44) .. (72,48) .. controls (76,52) and (72,56) .. (68,60) .. controls (64,64) and (60,64) .. (56,64) -- cycle; \fill [Amber500] (88,84) .. controls (86,84) and ( 87,82) .. (86,81) .. controls (85,80) and ( 80,79) .. (83,76) .. controls (86,73) and ( 95,71) .. (97,71) .. controls (99,71) and (100,72) .. (99,73) .. controls (98,74) and ( 92,77) .. (91,80) .. controls (90,83) and ( 90,84) .. (88,84) -- cycle; \fill (76,88) .. controls (77,85) and (80,82) .. (85,83) .. controls (83,87) and (80,88) .. (75,88) -- cycle; \fill [Amber700] (50,25) .. controls (48,25) and (47,24) .. (47,23) .. controls (47,22) and (48,13) .. (47,12) .. controls (46,11) and (46, 9) .. (47, 8) .. controls (48, 7) and (58, 4) .. (60, 4) .. controls (62, 4) and (67,12) .. (65,12) .. controls (63,12) and (54,10) .. (52,12) .. controls (50,14) and (52,22) .. (52,23) .. controls (52,24) and (51,25) .. (50,25) -- cycle;} } \begin{document} \begin{tikzpicture} \fill [fill=LightBlue300] circle [radius=2]; \pic {duck}; \end{tikzpicture} \end{document}
featmodel_moved_4g
\documentclass[tikz,border=5]{standalone} \usetikzlibrary{matrix,arrows,positioning,shadows} \tikzset{ feature/.style={draw, inner sep=1.5mm, font=\small\sffamily, fill=white, drop shadow}, opt/.style={fill=white}} \begin{document} \begin{tikzpicture}[ node distance=.8cm, legendtext/.style={text width=2cm}] \node[feature] (phone) {Phone}; \matrix (sub)[matrix of nodes, below=of phone, column sep=3mm, row sep=0mm, nodes=feature]{ Processor & NFC & Camera & 4G \\ }; \matrix (group)[matrix of nodes, below=of sub-1-1, column sep=3mm, row sep=0mm, nodes=feature]{ ARM & OMAP & Snapdragon \\ }; \draw (phone.south) -- (sub-1-1.north); \draw (phone.south) -- (sub-1-2.north); \draw (phone.south) -- (sub-1-3.north); \draw (phone.south) -- (sub-1-4.north); \draw (sub-1-1.south) -- (group-1-1); \draw (sub-1-1.south) -- (group-1-2); \draw (sub-1-1.south) -- (group-1-3); \draw[-triangle 45,dashed] (sub-1-4) |- (group-1-3) node[pos=.6,anchor=south east] {implies}; \draw[opt] (sub-1-2.north) circle (.8mm); \draw[opt] (sub-1-4.north) circle (.8mm); \fill[draw] (sub-1-1.north) circle (.8mm); \fill[draw] (sub-1-3.north) circle (.8mm); \begin{scope} \path[clip] (sub-1-1.south) -- (group-1-1.center) -- (group-1-3.center) -- cycle; \draw (sub-1-1.south) circle (.5cm); \end{scope} \matrix [draw=black,fill=brown!20,left=1.5cm of phone] { \node[fill=black,draw,circle,inner sep=2pt,outer sep=0pt] (m) at (0,0){}; \draw (m) -- +(0,0.4); & \node[legendtext]{Mandatory}; & \filldraw[fill=white,draw=black] (0,0.2) -- ++(225:0.2) arc[start angle=225,end angle=315,radius=0.2]; \draw (0,0.2) ++(225:0.5) -- (0,0.2) -- ++(315:0.5);& \node[legendtext]{Alternative}; \\ \node[fill=white,draw=black,circle,inner sep=2pt,outer sep=0pt] (o) at (0,0){}; \draw (m) -- +(0,0.4); & \node[legendtext]{Optional}; & \draw (0,0.2) ++(225:0.5) -- (0,0.2) -- ++(315:0.5); \filldraw[black] (0,0.2) -- ++(225:0.2) arc[start angle=225,end angle=315,radius=0.2]; & \node[legendtext]{Or}; \\ }; \end{tikzpicture} \end{document}
Move the 4g feature in place of the NFC feature. Adapt the connections accordingly.
\documentclass[tikz,border=5]{standalone} \usetikzlibrary{matrix,arrows,positioning,shadows} \tikzset{ feature/.style={draw, inner sep=1.5mm, font=\small\sffamily, fill=white, drop shadow}, opt/.style={fill=white}} \begin{document} \begin{tikzpicture}[ node distance=.8cm, legendtext/.style={text width=2cm}] \node[feature] (phone) {Phone}; \matrix (sub)[matrix of nodes, below=of phone, column sep=3mm, row sep=0mm, nodes=feature]{ Processor & 4g & Camera & NFC \\ }; \matrix (group)[matrix of nodes, below=of sub-1-1, column sep=3mm, row sep=0mm, nodes=feature]{ ARM & OMAP & Snapdragon \\ }; \draw (phone.south) -- (sub-1-1.north); \draw (phone.south) -- (sub-1-2.north); \draw (phone.south) -- (sub-1-3.north); \draw (phone.south) -- (sub-1-4.north); \draw (sub-1-1.south) -- (group-1-1); \draw (sub-1-1.south) -- (group-1-2); \draw (sub-1-1.south) -- (group-1-3); \draw[-triangle 45,dashed] (sub-1-2) -- (group-1-3) node[pos=.6,anchor=south west] {implies}; \draw[opt] (sub-1-2.north) circle (.8mm); \draw[opt] (sub-1-4.north) circle (.8mm); \fill[draw] (sub-1-1.north) circle (.8mm); \fill[draw] (sub-1-3.north) circle (.8mm); \begin{scope} \path[clip] (sub-1-1.south) -- (group-1-1.center) -- (group-1-3.center) -- cycle; \draw (sub-1-1.south) circle (.5cm); \end{scope} \matrix [draw=black,fill=brown!20,left=1.5cm of phone] { \node[fill=black,draw,circle,inner sep=2pt,outer sep=0pt] (m) at (0,0){}; \draw (m) -- +(0,0.4); & \node[legendtext]{Mandatory}; & \filldraw[fill=white,draw=black] (0,0.2) -- ++(225:0.2) arc[start angle=225,end angle=315,radius=0.2]; \draw (0,0.2) ++(225:0.5) -- (0,0.2) -- ++(315:0.5);& \node[legendtext]{Alternative}; \\ \node[fill=white,draw=black,circle,inner sep=2pt,outer sep=0pt] (o) at (0,0){}; \draw (m) -- +(0,0.4); & \node[legendtext]{Optional}; & \draw (0,0.2) ++(225:0.5) -- (0,0.2) -- ++(315:0.5); \filldraw[black] (0,0.2) -- ++(225:0.2) arc[start angle=225,end angle=315,radius=0.2]; & \node[legendtext]{Or}; \\ }; \end{tikzpicture} \end{document}
featmodel_moved_legend
\documentclass[tikz,border=5]{standalone} \usetikzlibrary{matrix,arrows,positioning,shadows} \tikzset{ feature/.style={draw, inner sep=1.5mm, font=\small\sffamily, fill=white, drop shadow}, opt/.style={fill=white}} \begin{document} \begin{tikzpicture}[ node distance=.8cm, legendtext/.style={text width=2cm}] \node[feature] (phone) {Phone}; \matrix (sub)[matrix of nodes, below=of phone, column sep=3mm, row sep=0mm, nodes=feature]{ Processor & NFC & Camera & 4G \\ }; \matrix (group)[matrix of nodes, below=of sub-1-1, column sep=3mm, row sep=0mm, nodes=feature]{ ARM & OMAP & Snapdragon \\ }; \draw (phone.south) -- (sub-1-1.north); \draw (phone.south) -- (sub-1-2.north); \draw (phone.south) -- (sub-1-3.north); \draw (phone.south) -- (sub-1-4.north); \draw (sub-1-1.south) -- (group-1-1); \draw (sub-1-1.south) -- (group-1-2); \draw (sub-1-1.south) -- (group-1-3); \draw[-triangle 45,dashed] (sub-1-4) |- (group-1-3) node[pos=.6,anchor=south east] {implies}; \draw[opt] (sub-1-2.north) circle (.8mm); \draw[opt] (sub-1-4.north) circle (.8mm); \fill[draw] (sub-1-1.north) circle (.8mm); \fill[draw] (sub-1-3.north) circle (.8mm); \begin{scope} \path[clip] (sub-1-1.south) -- (group-1-1.center) -- (group-1-3.center) -- cycle; \draw (sub-1-1.south) circle (.5cm); \end{scope} \matrix [draw=black,fill=brown!20,left=1.5cm of phone] { \node[fill=black,draw,circle,inner sep=2pt,outer sep=0pt] (m) at (0,0){}; \draw (m) -- +(0,0.4); & \node[legendtext]{Mandatory}; & \filldraw[fill=white,draw=black] (0,0.2) -- ++(225:0.2) arc[start angle=225,end angle=315,radius=0.2]; \draw (0,0.2) ++(225:0.5) -- (0,0.2) -- ++(315:0.5);& \node[legendtext]{Alternative}; \\ \node[fill=white,draw=black,circle,inner sep=2pt,outer sep=0pt] (o) at (0,0){}; \draw (m) -- +(0,0.4); & \node[legendtext]{Optional}; & \draw (0,0.2) ++(225:0.5) -- (0,0.2) -- ++(315:0.5); \filldraw[black] (0,0.2) -- ++(225:0.2) arc[start angle=225,end angle=315,radius=0.2]; & \node[legendtext]{Or}; \\ }; \end{tikzpicture} \end{document}
Move the legend to the bottom right of the image.
\documentclass[tikz,border=5]{standalone} \usetikzlibrary{matrix,arrows,positioning,shadows} \tikzset{ feature/.style={draw, inner sep=1.5mm, font=\small\sffamily, fill=white, drop shadow}, opt/.style={fill=white}} \begin{document} \begin{tikzpicture}[ node distance=.8cm, legendtext/.style={text width=2cm}] \node[feature] (phone) {Phone}; \matrix (sub)[matrix of nodes, below=of phone, column sep=3mm, row sep=0mm, nodes=feature]{ Processor & NFC & Camera & 4G \\ }; \matrix (group)[matrix of nodes, below=of sub-1-1, column sep=3mm, row sep=0mm, nodes=feature]{ ARM & OMAP & Snapdragon \\ }; \draw (phone.south) -- (sub-1-1.north); \draw (phone.south) -- (sub-1-2.north); \draw (phone.south) -- (sub-1-3.north); \draw (phone.south) -- (sub-1-4.north); \draw (sub-1-1.south) -- (group-1-1); \draw (sub-1-1.south) -- (group-1-2); \draw (sub-1-1.south) -- (group-1-3); \draw[-triangle 45,dashed] (sub-1-4) |- (group-1-3) node[pos=.6,anchor=south east] {implies}; \draw[opt] (sub-1-2.north) circle (.8mm); \draw[opt] (sub-1-4.north) circle (.8mm); \fill[draw] (sub-1-1.north) circle (.8mm); \fill[draw] (sub-1-3.north) circle (.8mm); \begin{scope} \path[clip] (sub-1-1.south) -- (group-1-1.center) -- (group-1-3.center) -- cycle; \draw (sub-1-1.south) circle (.5cm); \end{scope} \matrix [draw=black,fill=brown!20,below=2cm of sub-1-4] { \node[fill=black,draw,circle,inner sep=2pt,outer sep=0pt] (m) at (0,0){}; \draw (m) -- +(0,0.4); & \node[legendtext]{Mandatory}; & \filldraw[fill=white,draw=black] (0,0.2) -- ++(225:0.2) arc[start angle=225,end angle=315,radius=0.2]; \draw (0,0.2) ++(225:0.5) -- (0,0.2) -- ++(315:0.5);& \node[legendtext]{Alternative}; \\ \node[fill=white,draw=black,circle,inner sep=2pt,outer sep=0pt] (o) at (0,0){}; \draw (m) -- +(0,0.4); & \node[legendtext]{Optional}; & \draw (0,0.2) ++(225:0.5) -- (0,0.2) -- ++(315:0.5); \filldraw[black] (0,0.2) -- ++(225:0.2) arc[start angle=225,end angle=315,radius=0.2]; & \node[legendtext]{Or}; \\ }; \end{tikzpicture} \end{document}
flex_third_force
\documentclass[tikz,border=5]{standalone} \usepackage{stanli} \usetikzlibrary{decorations.pathreplacing,intersections} \newcommand\inscription[4][]{ \draw let \p1=(#2),\p2=(#3),\n1={atan2(\y2-\y1,\x2-\x1)+90} in [inscription,#1] (#2) -- (#3) node[rotate=\n1] {#4}; } \begin{document} \begin{tikzpicture}[ inscription/.style={ decoration = {brace,raise=0.5pt}, decorate, red, shorten >=0.8pt, shorten <=0.8pt, every node/.style={midway,right,font=\scriptsize} }, arcs/.style={blue,dotted} ] \point{begin}{0}{0}; \point{middle}{2.5}{0}; \point{end}{5}{0}; \beam{2}{begin}{end}; \support{3}{begin}[-90]; \load{1}{middle}[90]; \load{1}{end}[90]; \notation{1}{middle}{$F_1$}; \notation{1}{end}{$F_2$}; \foreach [evaluate = {\in = 180 - \angle * 2}] \angle in {20, 40} \draw [-, ultra thick,name path=defl\angle] (begin) to [out = 0, in = \in] (-\angle : 5) coordinate (ang\angle); \draw [arcs,name path=arc1] (begin) -- (middle) arc (0 : -90 : 2.5) -- cycle; \draw [arcs] (begin) -- (end) arc (0 : -90 : 5) -- cycle; \path [ name intersections={of=defl20 and arc1,by={,D1}}, name intersections={of=defl40 and arc1,by={,D2}}]; \inscription{middle}{D1}{$w_{11}$} \inscription{D1}{D2}{$w_{12}$} \inscription{end}{ang20}{$w_{21}$} \inscription{ang20}{ang40}{$w_{22}$} \end{tikzpicture} \end{document}
Add a third force F3 between F2 and F1, and the corresponding annotations.
\documentclass[tikz,border=5]{standalone} \usepackage{stanli} \usetikzlibrary{decorations.pathreplacing,intersections} \newcommand\inscription[4][]{ \draw let \p1=(#2),\p2=(#3),\n1={atan2(\y2-\y1,\x2-\x1)+90} in [inscription,#1] (#2) -- (#3) node[rotate=\n1] {#4}; } \begin{document} \begin{tikzpicture}[ inscription/.style={ decoration = {brace,raise=0.5pt}, decorate, red, shorten >=0.8pt, shorten <=0.8pt, every node/.style={midway,right,font=\scriptsize} }, arcs/.style={blue,dotted} ] \point{begin}{0}{0}; \point{middle}{2.5}{0}; \point{tquarter}{3.75}{0}; \point{end}{5}{0}; \beam{2}{begin}{end}; \support{3}{begin}[-90]; \load{1}{middle}[90]; \load{1}{tquarter}[90]; \load{1}{end}[90]; \notation{1}{middle}{$F_1$}; \notation{1}{tquarter}{$F_3$}; \notation{1}{end}{$F_2$}; \foreach [evaluate = {\in = 180 - \angle * 2}] \angle in {20, 40} \draw [-, ultra thick,name path=defl\angle] (begin) to [out = 0, in = \in] (-\angle : 5) coordinate (ang\angle); \draw [arcs,name path=arc1] (begin) -- (middle) arc (0 : -90 : 2.5) -- cycle; \draw [arcs,name path=arc3] (begin) -- (tquarter) arc (0 : -90 : 3.75) -- cycle; \draw [arcs] (begin) -- (end) arc (0 : -90 : 5) -- cycle; \path [ name intersections={of=defl20 and arc1,by={,D1}}, name intersections={of=defl40 and arc1,by={,D2}}, name intersections={of=defl20 and arc3,by={,D3}}, name intersections={of=defl40 and arc3,by={,D4}}]; \inscription{middle}{D1}{$w_{11}$} \inscription{D1}{D2}{$w_{12}$} \inscription{tquarter}{D3}{$w_{31}$} \inscription{D3}{D4}{$w_{32}$} \inscription{end}{ang20}{$w_{21}$} \inscription{ang20}{ang40}{$w_{22}$} \end{tikzpicture} \end{document}
gaussian_grouped_correlation
\documentclass[tikz,border=5]{standalone} \usepackage[utf8]{inputenc} \usepackage[T1]{fontenc} \usepackage{amsmath} \usepackage{amssymb} \usepackage{tikz} \usetikzlibrary{shapes,arrows} \begin{document} \begin{tikzpicture} \tikzset{vertex/.style = {shape=circle,draw,minimum size=1.5em}} \tikzset{vertex_obs/.style = {shape=rectangle,draw,minimum size=2em}} \tikzset{vertex_text/.style = {draw=white!80,minimum size=2em}} \tikzset{group/.style = {shape=rectangle,draw,minimum height=5.2em, minimum width=7em}} \tikzset{edge/.style = {->,> = latex'}} \node[vertex_obs,fill=blue!20] (x1) at (0,0) {$t_{C_1}$}; \node[vertex] (f1) at (0,2) {$u_{C_1}$}; \node[vertex_obs] (y1) at (0,4) {$\delta_{C_1}^j$}; \node[group,text height=0.5em] (y1group) at (0,3.6) {}; \node[above right,text height=0.5em] at (y1group.south west) {$\mathcal{C}_1$}; \node[vertex_text] (fdots) at (2,2) {$\dots$}; \node[vertex_obs,fill=blue!20] (x2) at (4,0) {$t_{C_C}$}; \node[vertex] (f2) at (4,2) {$u_{C_C}$}; \node[vertex_obs] (y2) at (4,4) {$\delta_{C_C}^j$}; \node[group,text height=0.5em] (y2group) at (4,3.6) {}; \node[above right,text height=0.5em] at (y2group.south west) {$\mathcal{C}_C$}; \node[vertex_obs,fill=orange!10] (xM1) at (7,0) {$t_{M_1}$}; \node[vertex] (fM1) at (7,2) {$u_{M_1}$}; \node[vertex] (yM1) at (7,4) {$y_{M_1}$}; \node[vertex_obs,fill=orange!10] (xM2) at (11,0) {$t_{M_2}$}; \node[vertex] (fM2) at (11,2) {$u_{M_2}$}; \node[vertex] (yM2) at (11,4) {$y_{M_2}$}; \node[vertex_text] (fdots2) at (9,2) {$\dots$}; \draw[edge] (x1) to node [font=\small,left]{} (f1); \draw[edge] (f1) to node [font=\small,right]{$\sigma_{C1}^j$} (y1); \draw[edge] (x2) to node [font=\small,left]{} (f2); \draw[edge] (f2) to node [font=\small,right]{$\sigma_{C_c}^j$} (y2); \draw[edge] (xM1) to node [font=\small,left]{} (fM1); \draw[edge] (fM1) to node [font=\small,left]{} (yM1); \draw[edge] (xM2) to node [font=\small,left]{} (fM2); \draw[edge] (fM2) to node [font=\small,left]{} (yM2); \draw[very thick] (f1) edge[-] (fdots); \draw[very thick] (fdots) edge[-] (f2); \draw[very thick] (f2) edge[-] (fM1); \draw[very thick] (fM1) edge[-] (fdots2); \draw[very thick] (fdots2) edge[-] (fM2); \end{tikzpicture} \end{document}
Add a dashed rectangle containing uC1 and uCC, and everything over and under these nodes, with a label "Correlation" on the bottom right. This rectangle essentialy contains everything on the left side of the image.
\documentclass[tikz,border=5]{standalone} \usepackage[utf8]{inputenc} \usepackage[T1]{fontenc} \usepackage{amsmath} \usepackage{amssymb} \usepackage{tikz} \usetikzlibrary{shapes,arrows} \begin{document} \begin{tikzpicture} \tikzset{vertex/.style = {shape=circle,draw,minimum size=1.5em}} \tikzset{vertex_obs/.style = {shape=rectangle,draw,minimum size=2em}} \tikzset{vertex_text/.style = {draw=white!80,minimum size=2em}} \tikzset{group/.style = {shape=rectangle,draw,minimum height=5.2em, minimum width=7em}} \tikzset{edge/.style = {->,> = latex'}} \node[vertex_obs,fill=blue!20] (x1) at (0,0) {$t_{C_1}$}; \node[vertex] (f1) at (0,2) {$u_{C_1}$}; \node[vertex_obs] (y1) at (0,4) {$\delta_{C_1}^j$}; \node[group,text height=0.5em] (y1group) at (0,3.6) {}; \node[above right,text height=0.5em] at (y1group.south west) {$\mathcal{C}_1$}; \node[vertex_text] (fdots) at (2,2) {$\dots$}; \node[vertex_obs,fill=blue!20] (x2) at (4,0) {$t_{C_C}$}; \node[vertex] (f2) at (4,2) {$u_{C_C}$}; \node[vertex_obs] (y2) at (4,4) {$\delta_{C_C}^j$}; \node[group,text height=0.5em] (y2group) at (4,3.6) {}; \node[above right,text height=0.5em] at (y2group.south west) {$\mathcal{C}_C$}; \node[vertex_obs,fill=orange!10] (xM1) at (7,0) {$t_{M_1}$}; \node[vertex] (fM1) at (7,2) {$u_{M_1}$}; \node[vertex] (yM1) at (7,4) {$y_{M_1}$}; \node[vertex_obs,fill=orange!10] (xM2) at (11,0) {$t_{M_2}$}; \node[vertex] (fM2) at (11,2) {$u_{M_2}$}; \node[vertex] (yM2) at (11,4) {$y_{M_2}$}; \node[vertex_text] (fdots2) at (9,2) {$\dots$}; \draw[edge] (x1) to node [font=\small,left]{} (f1); \draw[edge] (f1) to node [font=\small,right]{$\sigma_{C1}^j$} (y1); \draw[edge] (x2) to node [font=\small,left]{} (f2); \draw[edge] (f2) to node [font=\small,right]{$\sigma_{C_c}^j$} (y2); \draw[edge] (xM1) to node [font=\small,left]{} (fM1); \draw[edge] (fM1) to node [font=\small,left]{} (yM1); \draw[edge] (xM2) to node [font=\small,left]{} (fM2); \draw[edge] (fM2) to node [font=\small,left]{} (yM2); \draw[very thick] (f1) edge[-] (fdots); \draw[very thick] (fdots) edge[-] (f2); \draw[very thick] (f2) edge[-] (fM1); \draw[very thick] (fM1) edge[-] (fdots2); \draw[very thick] (fdots2) edge[-] (fM2); \draw[dashed] (-1.5,-0.5) rectangle (5.5,5); \node[below right] at (5.5,-0.5) {Correlation}; \end{tikzpicture} \end{document}
graphset_node_in_S
\documentclass[tikz,border=5]{standalone} \usepackage{tikz} \usetikzlibrary{positioning} \usetikzlibrary{arrows} \usetikzlibrary{shapes,trees,hobby,calc} \usepackage{xinttools} \begin{document} \tikzstyle{block}=[rectangle, draw=black, rounded corners, ultra thick, text centered, anchor=north, text=white, text width=1cm, text height=.3cm] \tikzstyle{bblock}=[block, fill=blue!50] \begin{tikzpicture} \path[draw,green,fill=red,thick,use Hobby shortcut,closed=true, opacity=0.2] (-.5,.3) .. (1.5,2.5) .. (2.8,3.6) .. (4,3) .. (4.2,0) .. (4,-3) .. (2.8,-3.6) .. (1.5,-2.5) .. (-.5,-.3) ; \path[draw,red,fill=green,thick,use Hobby shortcut,closed=true, opacity=0.2] (12.5,.3) .. (10.5,2.5) .. (9.2,3.6) .. (8,3) .. (7.8,0) .. (8,-3) .. (9.2,-3.6) .. (10.5,-2.5) .. (12.5,-.3) ; \node[text=red] at (1.8,0) {\Huge S}; \node[text=green] at (10.2,0) {\Huge T}; \xintForthree #1#2#3 in { ( {(0,-1)} , S1 , $ $ ), ( {(0,1)} , S2 , $ $ ), ( {(3,-2)} , T1 , $B$ ), ( {(3,1)} , T2 , $ $ ), ({(6,-3)}, U1, $ $ ), ({(6,0)} , U2, $B_{DP}$ ), ({(6,2)} , U3, $ $ ), ({(9,-2.5)}, V1, $ $ ), ({(9,-1)} , V2, $ $ ), ({(9,1.5)} , V3, $ $ ) } \do { \node[bblock] (#2) at #1 {#3}; } \xintForthree #1 #2 #3 in { (S1, T1, 0), (S2, T2, 0), (S2, T1, 0), (S1, T2, 0), (T1, U1, 0), (T1, U2, 0), (T2, U3, 0), (U1, V1, 0), (U2, V2, 0), (U2, V3, 0), (U3, V3, 0) } \do { \draw[->, >=stealth', thick] (#1) edge[bend right=#3] (#2); } \xintFor #1 in { S1, S2 } \do { \draw[->, >=stealth', thick] ($ (#1) + (-1.5,.4) $) -- (#1); \draw[->, >=stealth', thick] ($ (#1) + (-1.5,-.4) $) -- (#1); } \xintFor #1 in { V1, V2, V3 } \do { \draw[->, >=stealth', thick] (#1) -- ($ (#1) + (1.5,.4) $); \draw[->, >=stealth', thick] (#1) -- ($ (#1) + (1.5,-.4) $); } \end{tikzpicture} \end{document}
Increase the size of S, so that the B_DP node and the node over it are also contained in S.
\documentclass[tikz,border=5]{standalone} \usepackage{tikz} \usetikzlibrary{positioning} \usetikzlibrary{arrows} \usetikzlibrary{shapes,trees,hobby,calc} \usepackage{xinttools} \begin{document} \tikzstyle{block}=[rectangle, draw=black, rounded corners, ultra thick, text centered, anchor=north, text=white, text width=1cm, text height=.3cm] \tikzstyle{bblock}=[block, fill=blue!50] \begin{tikzpicture} \path[draw,green,fill=red,thick,use Hobby shortcut,closed=true, opacity=0.2] (-.5,.3) .. (1.5,2.5) .. (2.8,3.6) .. (6,3) .. (7.2,0) .. (4,-3) .. (2.8,-3.6) .. (1.5,-2.5) .. (-.5,-.3) ; \path[draw,red,fill=green,thick,use Hobby shortcut,closed=true, opacity=0.2] (12.5,.3) .. (10.5,2.5) .. (9.2,3.6) .. (8,3) .. (7.8,0) .. (8,-3) .. (9.2,-3.6) .. (10.5,-2.5) .. (12.5,-.3) ; \node[text=red] at (1.8,0) {\Huge S}; \node[text=green] at (10.2,0) {\Huge T}; \xintForthree #1#2#3 in { ( {(0,-1)} , S1 , $ $ ), ( {(0,1)} , S2 , $ $ ), ( {(3,-2)} , T1 , $B$ ), ( {(3,1)} , T2 , $ $ ), ({(6,-3)}, U1, $ $ ), ({(6,0)} , U2, $B_{DP}$ ), ({(6,2)} , U3, $ $ ), ({(9,-2.5)}, V1, $ $ ), ({(9,-1)} , V2, $ $ ), ({(9,1.5)} , V3, $ $ ) } \do { \node[bblock] (#2) at #1 {#3}; } \xintForthree #1 #2 #3 in { (S1, T1, 0), (S2, T2, 0), (S2, T1, 0), (S1, T2, 0), (T1, U1, 0), (T1, U2, 0), (T2, U3, 0), (U1, V1, 0), (U2, V2, 0), (U2, V3, 0), (U3, V3, 0) } \do { \draw[->, >=stealth', thick] (#1) edge[bend right=#3] (#2); } \xintFor #1 in { S1, S2 } \do { \draw[->, >=stealth', thick] ($ (#1) + (-1.5,.4) $) -- (#1); \draw[->, >=stealth', thick] ($ (#1) + (-1.5,-.4) $) -- (#1); } \xintFor #1 in { V1, V2, V3 } \do { \draw[->, >=stealth', thick] (#1) -- ($ (#1) + (1.5,.4) $); \draw[->, >=stealth', thick] (#1) -- ($ (#1) + (1.5,-.4) $); } \end{tikzpicture} \end{document}
model_treatment_2
\documentclass[tikz,border=5]{standalone} \usepackage{amsmath} \usepackage{amssymb} \usepackage{amsmath,amsthm,amssymb,amscd} \usepackage{xcolor} \usepackage{tikz} \usepackage{pgfplots} \pgfplotsset{compat=newest} \usepgfplotslibrary{groupplots} \usepgfplotslibrary{dateplot} \tikzset{ causalvar/.style = {draw, circle, node distance = 2cm} } \usepackage{amsmath} \usetikzlibrary{matrix} \usetikzlibrary{shapes,arrows} \usepackage{amsmath} \usepackage{amsmath,amsthm,amssymb,amscd} \usepackage{xcolor} \usepackage{tikz} \usepackage{pgfplots} \pgfplotsset{compat=newest} \usepgfplotslibrary{groupplots} \usepgfplotslibrary{dateplot} \tikzset{ causalvar/.style = {draw, circle, node distance = 2cm} } \usetikzlibrary{matrix} \usetikzlibrary{shapes,arrows} \usepackage{amssymb} \begin{document} \begin{tikzpicture}[auto, thick, node distance=1cm, >=triangle 45] \tikzstyle{unobserved}=[thick, dashed, fill=gray!0] \tikzstyle{squared}=[thick, fill=gray!10, rounded corners=5pt] \tikzstyle{norn}=[thick, fill=gray!0, minimum size=1cm] \draw[squared] (-2.9,-2.7) rectangle (-1.1,0.7); \draw[squared, fill=blue!20] (-0.9,-2.7) rectangle (0.9,0.7); \draw[squared, fill=blue!30] (1.1,-2.7) rectangle (2.9,0.7); \draw[squared] (3.1,-2.7) rectangle (4.9,0.7); \draw node[norn] at (2,0)[causalvar](A){$A_t$} node[norn] at (4,0)[causalvar](Y){$Y_t$} node[norn] at (4,-1.5)[causalvar](Yp){$Y_{t+1}$} node[norn] at (-2,0)[causalvar](X){$X_t$} node[norn] at (-2,-1.5)[causalvar](Xp){$X_{t+1}$} node[squared, minimum size=1cm] at (0,0)[causalvar](theta_t){$\theta_t$} node[squared] at (0,-1.5)[causalvar](theta_t_p){$\theta_{t+1}$} node[norn] at (2,-1.5)[causalvar](A2){$A_{t+1}$}; \draw (0,-2.5)node[scale=0.7]{model}; \draw (2,-2.5)node[scale=0.7]{treatment}; \draw (-2.,-2.5)node[scale=0.7]{context}; \draw (4,-2.5)node[scale=0.7]{outcome}; \draw[->](X) -- (theta_t) node[midway, near end] {}; \draw[->](theta_t) to node {} (A); \draw[->](A) to node {} (Y); \draw[->](X) to [out=45,in=135] node {} (Y); \draw[->](Xp) to [out=-45,in=-135] node {} (Yp); \draw[->](Xp) -- (theta_t_p) node[midway, near end] {}; \draw[->](theta_t_p) to node {} (A2); \draw[->](A2) to node {} (Yp); \draw[->](A) to node {} (theta_t_p); \draw[->](Y) to node {} (theta_t_p); \end{tikzpicture} \end{document}
Add a second treatment named "second treatment", with nodes named B, and with the same color as the first treatment. The existing treatment should be renamed "first treatment". The new added treatment should be between first treatment and outcome, and the nodes Bt and Bt+1 must be linked the same way the nodes At and At+1 are.
\documentclass[tikz,border=5]{standalone} \usepackage{amsmath} \usepackage{amssymb} \usepackage{amsmath,amsthm,amssymb,amscd} \usepackage{xcolor} \usepackage{tikz} \usepackage{pgfplots} \pgfplotsset{compat=newest} \usepgfplotslibrary{groupplots} \usepgfplotslibrary{dateplot} \tikzset{ causalvar/.style = {draw, circle, node distance = 2cm} } \usepackage{amsmath} \usetikzlibrary{matrix} \usetikzlibrary{shapes,arrows} \usepackage{amsmath} \usepackage{amsmath,amsthm,amssymb,amscd} \usepackage{xcolor} \usepackage{tikz} \usepackage{pgfplots} \pgfplotsset{compat=newest} \usepgfplotslibrary{groupplots} \usepgfplotslibrary{dateplot} \tikzset{ causalvar/.style = {draw, circle, node distance = 2cm} } \usetikzlibrary{matrix} \usetikzlibrary{shapes,arrows} \usepackage{amssymb} \begin{document} \begin{tikzpicture}[auto, thick, node distance=1cm, >=triangle 45] \tikzstyle{unobserved}=[thick, dashed, fill=gray!0] \tikzstyle{squared}=[thick, fill=gray!10, rounded corners=5pt] \tikzstyle{norn}=[thick, fill=gray!0, minimum size=1cm] \draw[squared] (-2.9,-2.7) rectangle (-1.1,0.7); \draw[squared, fill=blue!20] (-0.9,-2.7) rectangle (0.9,0.7); \draw[squared, fill=blue!30] (1.1,-2.7) rectangle (2.9,0.7); \draw[squared, fill=blue!30] (3.1,-2.7) rectangle (4.9,0.7); \draw[squared] (5.1,-2.7) rectangle (6.9,0.7); \draw node[norn] at (2,0)[causalvar](A){$A_t$} node[norn] at (4,0)[causalvar](B){$B_t$} node[norn] at (6,0)[causalvar](Y){$Y_t$} node[norn] at (6,-1.5)[causalvar](Yp){$Y_{t+1}$} node[norn] at (-2,0)[causalvar](X){$X_t$} node[norn] at (-2,-1.5)[causalvar](Xp){$X_{t+1}$} node[squared, minimum size=1cm] at (0,0)[causalvar](theta_t){$\theta_t$} node[squared] at (0,-1.5)[causalvar](theta_t_p){$\theta_{t+1}$} node[norn] at (2,-1.5)[causalvar](A2){$A_{t+1}$} node[norn] at (4,-1.5)[causalvar](B2){$B_{t+1}$}; \draw (0,-2.5)node[scale=0.7]{model}; \draw (2,-2.5)node[scale=0.7]{first treatment}; \draw (4,-2.5)node[scale=0.7]{second treatment}; \draw (-2.,-2.5)node[scale=0.7]{context}; \draw (6,-2.5)node[scale=0.7]{outcome}; \draw[->](X) -- (theta_t) node[midway, near end] {}; \draw[->](theta_t) to node {} (A); \draw[->](A) to node {} (B); \draw[->](B) to node {} (Y); \draw[->](X) to [out=45,in=135] node {} (Y); \draw[->](Xp) to [out=-45,in=-135] node {} (Yp); \draw[->](Xp) -- (theta_t_p) node[midway, near end] {}; \draw[->](theta_t_p) to node {} (A2); \draw[->](A2) to node {} (B2); \draw[->](B2) to node {} (Yp); \draw[->](A) to node {} (theta_t_p); \draw[->](B) to node {} (theta_t_p); \draw[->](Y) to node {} (theta_t_p); \end{tikzpicture} \end{document}
monkey_sad
\documentclass[tikz,border=5]{standalone} \usepackage[prefix=]{xcolor-material} \tikzset{ half clip/.code={ \clip (0, -256) rectangle (256, 256); }, color/.code=\colorlet{fill color}{#1}, color alias/.code args={#1 as #2}{\colorlet{#1}{#2}}, on left/.style={.. on left/.style={#1}}, on right/.style={.. on right/.style={#1}}, split/.style args={#1 and #2}{ on left ={color alias=fill color as #1}, on right={color alias=fill color as #2, half clip} } } \newcommand\reflect[2][]{ \begin{scope}[#1]\foreach \side in {-1, 1}{\begin{scope} \ifnum\side=-1 \tikzset{.. on left/.try}\else\tikzset{.. on right/.try}\fi \begin{scope}[xscale=\side]#2\end{scope} \end{scope}}\end{scope}} \tikzset{ monkey/.pic={ \begin{scope}[x=3cm/448,y=3cm/448] \useasboundingbox (-256, -256) (256, 256); \reflect[ on left ={ color alias/.list={skin as Brown700, ears as Pink100}}, on right={ color alias/.list={skin as Brown900, ears as Pink200}, half clip } ]{ \fill [skin] (140, 80) circle [radius=56]; \fill [ears] (140, 80) circle [radius=32]; \fill [skin] ( 0, 72) ellipse [x radius=140, y radius=112]; \fill [skin] ( 0,-64) ellipse [x radius=172, y radius=112]; } \reflect[ on left ={color alias/.list={face as Pink100}}, on right={color alias/.list={face as Pink200}, half clip} ]{ \fill [face] (0,-64) ellipse [x radius=140, y radius=88]; \fill [face] (40,64) ellipse [radius=64]; } \reflect{ \fill [BlueGrey900] (40, 64) circle [radius=24]; \fill [Pink300] (24,-16) circle [radius=16]; } \fill [Pink300] (-96,-72) arc (180:360:96 and 32) arc (360:180:96 and 56); \end{scope} } } \begin{document} \begin{tikzpicture} \fill [fill=LightBlue300] circle [radius=2]; \pic {monkey}; \end{tikzpicture} \end{document}
Turn the shape of the mouth upside down
\documentclass[tikz,border=5]{standalone} \usepackage[prefix=]{xcolor-material} \tikzset{ half clip/.code={ \clip (0, -256) rectangle (256, 256); }, color/.code=\colorlet{fill color}{#1}, color alias/.code args={#1 as #2}{\colorlet{#1}{#2}}, on left/.style={.. on left/.style={#1}}, on right/.style={.. on right/.style={#1}}, split/.style args={#1 and #2}{ on left ={color alias=fill color as #1}, on right={color alias=fill color as #2, half clip} } } \newcommand\reflect[2][]{ \begin{scope}[#1]\foreach \side in {-1, 1}{\begin{scope} \ifnum\side=-1 \tikzset{.. on left/.try}\else\tikzset{.. on right/.try}\fi \begin{scope}[xscale=\side]#2\end{scope} \end{scope}}\end{scope}} \tikzset{ monkey/.pic={ \begin{scope}[x=3cm/448,y=3cm/448] \useasboundingbox (-256, -256) (256, 256); \reflect[ on left ={ color alias/.list={skin as Brown700, ears as Pink100}}, on right={ color alias/.list={skin as Brown900, ears as Pink200}, half clip } ]{ \fill [skin] (140, 80) circle [radius=56]; \fill [ears] (140, 80) circle [radius=32]; \fill [skin] ( 0, 72) ellipse [x radius=140, y radius=112]; \fill [skin] ( 0,-64) ellipse [x radius=172, y radius=112]; } \reflect[ on left ={color alias/.list={face as Pink100}}, on right={color alias/.list={face as Pink200}, half clip} ]{ \fill [face] (0,-64) ellipse [x radius=140, y radius=88]; \fill [face] (40,64) ellipse [radius=64]; } \reflect{ \fill [BlueGrey900] (40, 64) circle [radius=24]; \fill [Pink300] (24,-16) circle [radius=16]; } \begin{scope}[yscale=-1] \fill [Pink300] (-96,110) arc (180:360:96 and 32) arc (360:180:96 and 56); \end{scope} \end{scope} } } \begin{document} \begin{tikzpicture} \fill [fill=LightBlue300] circle [radius=2]; \pic {monkey}; \end{tikzpicture} \end{document}
monkey_tongue
\documentclass[tikz,border=5]{standalone} \usepackage[prefix=]{xcolor-material} \tikzset{ half clip/.code={ \clip (0, -256) rectangle (256, 256); }, color/.code=\colorlet{fill color}{#1}, color alias/.code args={#1 as #2}{\colorlet{#1}{#2}}, on left/.style={.. on left/.style={#1}}, on right/.style={.. on right/.style={#1}}, split/.style args={#1 and #2}{ on left ={color alias=fill color as #1}, on right={color alias=fill color as #2, half clip} } } \newcommand\reflect[2][]{ \begin{scope}[#1]\foreach \side in {-1, 1}{\begin{scope} \ifnum\side=-1 \tikzset{.. on left/.try}\else\tikzset{.. on right/.try}\fi \begin{scope}[xscale=\side]#2\end{scope} \end{scope}}\end{scope}} \tikzset{ monkey/.pic={ \begin{scope}[x=3cm/448,y=3cm/448] \useasboundingbox (-256, -256) (256, 256); \reflect[ on left ={ color alias/.list={skin as Brown700, ears as Pink100}}, on right={ color alias/.list={skin as Brown900, ears as Pink200}, half clip } ]{ \fill [skin] (140, 80) circle [radius=56]; \fill [ears] (140, 80) circle [radius=32]; \fill [skin] ( 0, 72) ellipse [x radius=140, y radius=112]; \fill [skin] ( 0,-64) ellipse [x radius=172, y radius=112]; } \reflect[ on left ={color alias/.list={face as Pink100}}, on right={color alias/.list={face as Pink200}, half clip} ]{ \fill [face] (0,-64) ellipse [x radius=140, y radius=88]; \fill [face] (40,64) ellipse [radius=64]; } \reflect{ \fill [BlueGrey900] (40, 64) circle [radius=24]; \fill [Pink300] (24,-16) circle [radius=16]; } \fill [Pink300] (-96,-72) arc (180:360:96 and 32) arc (360:180:96 and 56); \end{scope} } } \begin{document} \begin{tikzpicture} \fill [fill=LightBlue300] circle [radius=2]; \pic {monkey}; \end{tikzpicture} \end{document}
Make the monkey open its mouth to stick out his tongue, on the left side of his mouth(right side of the image)
\documentclass[tikz,border=5]{standalone} \usepackage[prefix=]{xcolor-material} \tikzset{ half clip/.code={ \clip (0, -256) rectangle (256, 256); }, color/.code=\colorlet{fill color}{#1}, color alias/.code args={#1 as #2}{\colorlet{#1}{#2}}, on left/.style={.. on left/.style={#1}}, on right/.style={.. on right/.style={#1}}, split/.style args={#1 and #2}{ on left ={color alias=fill color as #1}, on right={color alias=fill color as #2, half clip} } } \newcommand\reflect[2][]{ \begin{scope}[#1]\foreach \side in {-1, 1}{\begin{scope} \ifnum\side=-1 \tikzset{.. on left/.try}\else\tikzset{.. on right/.try}\fi \begin{scope}[xscale=\side]#2\end{scope} \end{scope}}\end{scope}} \tikzset{ monkey/.pic={ \begin{scope}[x=3cm/448,y=3cm/448] \useasboundingbox (-256, -256) (256, 256); \reflect[ on left ={ color alias/.list={skin as Brown700, ears as Pink100}}, on right={ color alias/.list={skin as Brown900, ears as Pink200}, half clip } ]{ \fill [skin] (140, 80) circle [radius=56]; \fill [ears] (140, 80) circle [radius=32]; \fill [skin] ( 0, 72) ellipse [x radius=140, y radius=112]; \fill [skin] ( 0,-64) ellipse [x radius=172, y radius=112]; } \reflect[ on left ={color alias/.list={face as Pink100}}, on right={color alias/.list={face as Pink200}, half clip} ]{ \fill [face] (0,-64) ellipse [x radius=140, y radius=88]; \fill [face] (40,64) ellipse [radius=64]; } \reflect{ \fill [BlueGrey900] (40, 64) circle [radius=24]; \fill [Pink300] (24,-16) circle [radius=16]; } \fill [Pink300] (-96,-72) arc (180:360:96 and 10) arc (360:180:96 and 56); \fill [Pink300, rotate=20](0,-135) ellipse [x radius=28, y radius=40]; \end{scope} } } \begin{document} \begin{tikzpicture} \fill [fill=LightBlue300] circle [radius=2]; \pic {monkey}; \end{tikzpicture} \end{document}
plane_intersection
\documentclass[tikz,border=5]{standalone} \usepackage{tikz} \usetikzlibrary{calc} \usepackage{physics} \begin{document} \def\t{0.9} \def\s{0.04} \def\tt{0.3} \def\ss{0.7} \def\ttt{0.5} \def\sss{0.5} \begin{tikzpicture}[x={(1cm,0.4cm)}, y={(8mm, -3mm)}, z={(0cm,1cm)}, line cap=round, line join=round] \coordinate (x1) at (-2,2,3); \coordinate (x2) at (2,2,5); \coordinate (x3) at (2,-2,5); \coordinate (x4) at (-2,-2,3); \coordinate (n1) at ($(x2) - (x1)$); \coordinate (n2) at ($(x2) - (x3)$); \coordinate (x5) at ($(x1) + \s*(n1) - \t*(n2)$); \node[outer sep = 1pt, inner sep = 1pt] (x6) at ($(x1) + \ss*(n1) - \tt*(n2)$) {}; \coordinate (x7) at ($(x1) + \sss*(n1) - \ttt*(n2)$); \coordinate (O) at (0,0,0); \node[outer sep = 1pt, inner sep = 1pt] (P) at (2.5,1,5.5) {}; \draw[-latex] (-2.5,0,0) -- (2.5,0,0) node[pos = 1.05] {$x$}; \draw[-latex] (0,-3.5,0) -- (0,3.5,0) node[pos = 1.05] {$y$}; \draw[-latex] (0,0,0) -- (0,0,7) node[pos = 1.05] {$z$}; \draw[draw=black, fill=black] (O) circle (1pt) node[below] {${O}$}; \draw[-latex, thick] (O) -- (x6) node[pos=0.45, shift={(0.1,0.3)}] {$\vb{r_o}$}; \path[draw=black, fill=black!20, thick, opacity = 0.8] (x1) -- (x2) -- (x3) -- (x4) -- (x1); \node[shift={(-0.45,0.6)}] at (x3) {$\Pi$}; \draw[-latex, thick] (x5) -- ($(x5)!0.07!(-8,0,24)$) node[pos=0.5, shift={(-0.2,-0.1)}] {$\vb{u}$}; \draw[draw=black, fill=black] (x6) circle (1pt) node[above right] {${P_o}$}; \draw[draw=black, fill=black] (x7) circle (0.5pt); \draw (x7) -- (0,0,6.5); \end{tikzpicture} \end{document}
Add a second plane Pi_2, parallel to the x-y-plane. This plane should intersect with the existing plane, and their intersection should cross the z-axis. Make sure to adjust the overlapping layers between PI and PI_2.
\documentclass[tikz,border=5]{standalone} \usepackage{tikz} \usetikzlibrary{calc} \usepackage{physics} \begin{document} \def\t{0.9} \def\s{0.04} \def\tt{0.3} \def\ss{0.7} \def\ttt{0.5} \def\sss{0.5} \begin{tikzpicture}[x={(1cm,0.4cm)}, y={(8mm, -3mm)}, z={(0cm,1cm)}, line cap=round, line join=round] \coordinate (x1) at (-2,2,3); \coordinate (x2) at (2,2,5); \coordinate (x3) at (2,-2,5); \coordinate (x4) at (-2,-2,3); \coordinate (x8) at (-2,2,4); \coordinate (x9) at (2,2,4); \coordinate (x10) at (2,-2,4); \coordinate (x11) at (-2,-2,4); \coordinate (n1) at ($(x2) - (x1)$); \coordinate (n2) at ($(x2) - (x3)$); \coordinate (x5) at ($(x1) + \s*(n1) - \t*(n2)$); \node[outer sep = 1pt, inner sep = 1pt] (x6) at ($(x1) + \ss*(n1) - \tt*(n2)$) {}; \coordinate (x7) at ($(x1) + \sss*(n1) - \ttt*(n2)$); \coordinate (O) at (0,0,0); \node[outer sep = 1pt, inner sep = 1pt] (P) at (2.5,1,5.5) {}; \draw[-latex] (-2.5,0,0) -- (2.5,0,0) node[pos = 1.05] {$x$}; \draw[-latex] (0,-3.5,0) -- (0,3.5,0) node[pos = 1.05] {$y$}; \draw[-latex] (0,0,0) -- (0,0,7) node[pos = 1.05] {$z$}; \draw[draw=black, fill=black] (O) circle (1pt) node[below] {${O}$}; \draw[-latex, thick] (O) -- (x6) node[pos=0.45, shift={(0.1,0.3)}] {$\vb{r_o}$}; \path[draw=black, fill=black!20, thick, opacity = 0.8] (x1) -- (x2) -- (x3) -- (x4) -- (x1); \node[shift={(-0.45,0.6)}] at (x3) {$\Pi$}; \draw[-latex, thick] (x5) -- ($(x5)!0.07!(-8,0,24)$) node[pos=0.5, shift={(-0.2,-0.1)}] {$\vb{u}$}; \draw[draw=black, fill=black] (x6) circle (1pt) node[above right] {${P_o}$}; \path[draw=black, fill=black!20, thick, opacity = 0.8] (x8) -- (x9) -- (x10) -- (x11) -- (x8); \node[shift={(-0.45,0.6)}] at (x10) {$\Pi_2$}; \draw[draw=gray!50, thick] (0,-2,4) -- (x10); \draw[draw=gray!50, thick] (2,-2,4) -- (2,1,4); \draw[draw=black, thick] (0,2,4) -- (x2); \draw[draw=black, fill=black] (x7) circle (0.5pt); \draw (x7) -- (0,0,6.5); \end{tikzpicture} \end{document}
ray_closer_observer
\documentclass[tikz,border=5]{standalone} \usepackage{tikz} \usetikzlibrary{angles, quotes, decorations.markings} \tikzset{midarrow1/.style = {postaction=decorate, decoration={markings,mark=at position .8 with \arrow{stealth}}}} \tikzset{midarrow2/.style = {postaction=decorate, decoration={markings,mark=at position .4 with \arrow{stealth}}}} \tikzset{midarrow/.style={midarrow1, midarrow2}} \definecolor{lust}{rgb}{0.9, 0.13, 0.13} \definecolor{richelectricblue}{rgb}{0.03, 0.57, 0.82} \begin{document} \begin{tikzpicture} \draw[line width = 2, color = richelectricblue] (4,7.5) -- ++(0,1); \draw[color = lust, line width = 0.7, midarrow1] (-1,8) -- (4,8); \draw[color = lust, line width = 0.7, midarrow2] (4,8) -- +(3,-5) coordinate (C); \path[fill = richelectricblue!40] (2,8.25) ..controls +(0.1,0) and +(0.1,0).. ++(0,-0.5) ; \draw[line width = 0.5] (0, 8.1) -- (0,8.25) -- ++(2,0) ..controls +(0.1,0) and +(0.1,0).. ++(0,-0.5) -- ++(-2,0) -- +(0, 0.15); \path[fill = richelectricblue!40, rotate = 121] (0.96,-7.3) ..controls +(0.1,0) and +(0.1,0).. ++(0,-0.5) ; \draw[line width = 0.5, rotate = 121] (-1.04,-7.3) -- ++(2,0) ..controls +(0.1,0) and +(0.1,0).. ++(0,-0.5) -- ++(-2,0) -- +(0,0.50); \draw [fill = lust, draw = lust] (-1,8) circle [radius=0.1]; \draw[dashed, line width = 0.5] (4,8)coordinate(A) -- ++(3,0)coordinate(B); \pic[draw , "\small$\theta$", line width = 0.5, angle radius=0.5cm, angle eccentricity = 1.5] {angle=C--A--B}; \node[above] at (-1,8.2) {\scriptsize Source}; \node[above] at (1,8.5) {\scriptsize Guide}; \node at (4,9) {\scriptsize Barrier}; \node[rotate=32] at (7.15,2.7) {\scriptsize Observer}; \end{tikzpicture} \end{document}
Move the Diopter and the observer much closer to the barrier, as close as it can be without interfering with other existing drawings.
\documentclass[tikz,border=5]{standalone} \usepackage{tikz} \usetikzlibrary{angles, quotes, decorations.markings} \tikzset{midarrow1/.style = {postaction=decorate, decoration={markings,mark=at position .8 with \arrow{stealth}}}} \tikzset{midarrow2/.style = {postaction=decorate, decoration={markings,mark=at position .4 with \arrow{stealth}}}} \tikzset{midarrow/.style={midarrow1, midarrow2}} \definecolor{lust}{rgb}{0.9, 0.13, 0.13} \definecolor{richelectricblue}{rgb}{0.03, 0.57, 0.82} \begin{document} \begin{tikzpicture} \draw[line width = 2, color = richelectricblue] (4,7.5) -- ++(0,1); \draw[color = lust, line width = 0.7, midarrow1] (-1,8) -- (4,8); \draw[color = lust, line width = 0.7, midarrow2] (4,8) -- +(1.44,-2.4) coordinate (C); \path[fill = richelectricblue!40] (2,8.25) ..controls +(0.1,0) and +(0.1,0).. ++(0,-0.5) ; \draw[line width = 0.5] (0, 8.1) -- (0,8.25) -- ++(2,0) ..controls +(0.1,0) and +(0.1,0).. ++(0,-0.5) -- ++(-2,0) -- +(0, 0.15); \path[fill = richelectricblue!40, rotate = 121] (4,-7.3) ..controls +(0.1,0) and +(0.1,0).. ++(0,-0.5) ; \draw[line width = 0.5, rotate = 121] (2,-7.3) -- ++(2,0) ..controls +(0.1,0) and +(0.1,0).. ++(0,-0.5) -- ++(-2,0) -- +(0,0.50); \draw [fill = lust, draw = lust] (-1,8) circle [radius=0.1]; \draw[dashed, line width = 0.5] (4,8)coordinate(A) -- ++(3,0)coordinate(B); \pic[draw , "\small$\theta$", line width = 0.5, angle radius=0.5cm, angle eccentricity = 1.5] {angle=C--A--B}; \node[above] at (-1,8.2) {\scriptsize Source}; \node[above] at (1,8.5) {\scriptsize Guide}; \node at (4,9) {\scriptsize Barrier}; \node[rotate=32] at (5.6,5.3) {\scriptsize Observer}; \end{tikzpicture} \end{document}
shark_bigger_dorsal_fin
\documentclass[tikz,border=5]{standalone} \usepackage[prefix=]{xcolor-material} \tikzset{ shark/.pic={ \tikzset{x=3cm/22,y=3cm/22,shift={(-8,-11)}} \fill [BlueGrey200] (2,16.75) -- ++(0.5,-1) -- ++(0.5,1) -- cycle (3,16.25) -- ++(0.5,-1) -- ++(0.5,1) -- cycle (1,17) -- ++(0.5,-1) -- ++(0.5,1) -- cycle (2,15.5) -- ++(-.5,-1) -- ++(1,0) -- cycle (3,15) -- ++(-.5,-1) -- ++(1,0) -- cycle; \fill [BlueGrey700] (6,12) .. controls (5,11) and (5,8) .. (6,7) .. controls (7,8) and (7,9) .. (8,10) .. controls (8,11) and (7,12) .. (6,12)-- cycle; \fill [BlueGrey500] (0,20) .. controls (0,19) and (0,18) .. (1,17) .. controls (3,16) and (4,16) .. (4,15) .. controls (4,14) and (2,15) .. (1,15) .. controls (2,13) and (3,12) .. (5,10) .. controls (7,8) and (11,6) .. (14,5) .. controls (14,3) and (14,1) .. (15,0) .. controls (15,2) and (15,3) .. (16,4) .. controls (17,5) and (18,6) .. (20,6) .. controls (19,7) and (16,7) .. (15,6) .. controls (14,10) and (11,15) .. (9,17) .. controls (7,19) and (3,20) .. (0,20) -- cycle; \fill [BlueGrey100] (0,20) .. controls (0,19) and (0,18) .. (1,17) .. controls (3,16) and (4,16) .. (4,15) .. controls (4,14) and (2,15) .. (1,15) .. controls (2,13) and (3,12) .. (5,10) .. controls (7,8) and (11,6) .. (14,5) .. controls (13,8) and (7,8) .. (6,12) .. controls (5,16) and (2,19) .. (0,20) -- cycle; \fill [BlueGrey500] (3,13) .. controls (2,12) and (2,9) .. (3,8) .. controls (4,9) and (4,10) .. (5,11) .. controls (5,12) and (4,13) .. (3,13) -- cycle; \fill [BlueGrey500] (9,18) .. controls (8,18) and (7.5,17.5) .. (7,17) .. controls (7,16) and (9,14) .. (10,14) .. controls (10,15) and (11,17) .. (12,17) .. controls (11,18) and (10,18) .. (9,18) -- cycle; \fill [BlueGrey800] (6,17.5) circle [radius=0.5]; } } \begin{document} \begin{tikzpicture} \fill [fill=LightBlue300] circle [radius=2]; \pic {shark}; \end{tikzpicture} \end{document}
Make the dorsal fin of the shark longer and pointy
\documentclass[tikz,border=5]{standalone} \usepackage[prefix=]{xcolor-material} \tikzset{ shark/.pic={ \tikzset{x=3cm/22,y=3cm/22,shift={(-8,-11)}} \fill [BlueGrey200] (2,16.75) -- ++(0.5,-1) -- ++(0.5,1) -- cycle (3,16.25) -- ++(0.5,-1) -- ++(0.5,1) -- cycle (1,17) -- ++(0.5,-1) -- ++(0.5,1) -- cycle (2,15.5) -- ++(-.5,-1) -- ++(1,0) -- cycle (3,15) -- ++(-.5,-1) -- ++(1,0) -- cycle; \fill [BlueGrey700] (6,12) .. controls (5,11) and (5,8) .. (6,7) .. controls (7,8) and (7,9) .. (8,10) .. controls (8,11) and (7,12) .. (6,12)-- cycle; \fill [BlueGrey500] (0,20) .. controls (0,19) and (0,18) .. (1,17) .. controls (3,16) and (4,16) .. (4,15) .. controls (4,14) and (2,15) .. (1,15) .. controls (2,13) and (3,12) .. (5,10) .. controls (7,8) and (11,6) .. (14,5) .. controls (14,3) and (14,1) .. (15,0) .. controls (15,2) and (15,3) .. (16,4) .. controls (17,5) and (18,6) .. (20,6) .. controls (19,7) and (16,7) .. (15,6) .. controls (14,10) and (11,15) .. (9,17) .. controls (7,19) and (3,20) .. (0,20) -- cycle; \fill [BlueGrey100] (0,20) .. controls (0,19) and (0,18) .. (1,17) .. controls (3,16) and (4,16) .. (4,15) .. controls (4,14) and (2,15) .. (1,15) .. controls (2,13) and (3,12) .. (5,10) .. controls (7,8) and (11,6) .. (14,5) .. controls (13,8) and (7,8) .. (6,12) .. controls (5,16) and (2,19) .. (0,20) -- cycle; \fill [BlueGrey500] (3,13) .. controls (2,12) and (2,9) .. (3,8) .. controls (4,9) and (4,10) .. (5,11) .. controls (5,12) and (4,13) .. (3,13) -- cycle; \fill [BlueGrey500] (9,18) .. controls (8,18) and (7.5,17.5) .. (7,17) .. controls (7,16) and (9,14) .. (10,14) .. controls (10,15) and (13,17) .. (14.5,17) .. controls (11,18) and (10,18) .. (9,18) -- cycle; \fill [BlueGrey800] (6,17.5) circle [radius=0.5]; } } \begin{document} \begin{tikzpicture} \fill [fill=LightBlue300] circle [radius=2]; \pic {shark}; \end{tikzpicture} \end{document}
shark_other_set_pectoral_fin
\documentclass[tikz,border=5]{standalone} \usepackage[prefix=]{xcolor-material} \tikzset{ shark/.pic={ \tikzset{x=3cm/22,y=3cm/22,shift={(-8,-11)}} \fill [BlueGrey200] (2,16.75) -- ++(0.5,-1) -- ++(0.5,1) -- cycle (3,16.25) -- ++(0.5,-1) -- ++(0.5,1) -- cycle (1,17) -- ++(0.5,-1) -- ++(0.5,1) -- cycle (2,15.5) -- ++(-.5,-1) -- ++(1,0) -- cycle (3,15) -- ++(-.5,-1) -- ++(1,0) -- cycle; \fill [BlueGrey700] (6,12) .. controls (5,11) and (5,8) .. (6,7) .. controls (7,8) and (7,9) .. (8,10) .. controls (8,11) and (7,12) .. (6,12)-- cycle; \fill [BlueGrey500] (0,20) .. controls (0,19) and (0,18) .. (1,17) .. controls (3,16) and (4,16) .. (4,15) .. controls (4,14) and (2,15) .. (1,15) .. controls (2,13) and (3,12) .. (5,10) .. controls (7,8) and (11,6) .. (14,5) .. controls (14,3) and (14,1) .. (15,0) .. controls (15,2) and (15,3) .. (16,4) .. controls (17,5) and (18,6) .. (20,6) .. controls (19,7) and (16,7) .. (15,6) .. controls (14,10) and (11,15) .. (9,17) .. controls (7,19) and (3,20) .. (0,20) -- cycle; \fill [BlueGrey100] (0,20) .. controls (0,19) and (0,18) .. (1,17) .. controls (3,16) and (4,16) .. (4,15) .. controls (4,14) and (2,15) .. (1,15) .. controls (2,13) and (3,12) .. (5,10) .. controls (7,8) and (11,6) .. (14,5) .. controls (13,8) and (7,8) .. (6,12) .. controls (5,16) and (2,19) .. (0,20) -- cycle; \fill [BlueGrey500] (3,13) .. controls (2,12) and (2,9) .. (3,8) .. controls (4,9) and (4,10) .. (5,11) .. controls (5,12) and (4,13) .. (3,13) -- cycle; \fill [BlueGrey500] (9,18) .. controls (8,18) and (7.5,17.5) .. (7,17) .. controls (7,16) and (9,14) .. (10,14) .. controls (10,15) and (11,17) .. (12,17) .. controls (11,18) and (10,18) .. (9,18) -- cycle; \fill [BlueGrey800] (6,17.5) circle [radius=0.5]; } } \begin{document} \begin{tikzpicture} \fill [fill=LightBlue300] circle [radius=2]; \pic {shark}; \end{tikzpicture} \end{document}
Add another set of pectoral fin to the shark, lower on its body
\documentclass[tikz,border=5]{standalone} \usepackage[prefix=]{xcolor-material} \tikzset{ shark/.pic={ \tikzset{x=3cm/22,y=3cm/22,shift={(-8,-11)}} \fill [BlueGrey200] (2,16.75) -- ++(0.5,-1) -- ++(0.5,1) -- cycle (3,16.25) -- ++(0.5,-1) -- ++(0.5,1) -- cycle (1,17) -- ++(0.5,-1) -- ++(0.5,1) -- cycle (2,15.5) -- ++(-.5,-1) -- ++(1,0) -- cycle (3,15) -- ++(-.5,-1) -- ++(1,0) -- cycle; \fill [BlueGrey700] (6,12) .. controls (5,11) and (5,8) .. (6,7) .. controls (7,8) and (7,9) .. (8,10) .. controls (8,11) and (7,12) .. (6,12)-- cycle; \fill [BlueGrey700] (11,8) .. controls (10.5,7) and (10.5,5) .. (11,4) .. controls (11.5,5) and (11.5,6) .. (12,6.5) .. controls (12,7) and (11.5,8) .. (11,8) -- cycle; \fill [BlueGrey500] (0,20) .. controls (0,19) and (0,18) .. (1,17) .. controls (3,16) and (4,16) .. (4,15) .. controls (4,14) and (2,15) .. (1,15) .. controls (2,13) and (3,12) .. (5,10) .. controls (7,8) and (11,6) .. (14,5) .. controls (14,3) and (14,1) .. (15,0) .. controls (15,2) and (15,3) .. (16,4) .. controls (17,5) and (18,6) .. (20,6) .. controls (19,7) and (16,7) .. (15,6) .. controls (14,10) and (11,15) .. (9,17) .. controls (7,19) and (3,20) .. (0,20) -- cycle; \fill [BlueGrey100] (0,20) .. controls (0,19) and (0,18) .. (1,17) .. controls (3,16) and (4,16) .. (4,15) .. controls (4,14) and (2,15) .. (1,15) .. controls (2,13) and (3,12) .. (5,10) .. controls (7,8) and (11,6) .. (14,5) .. controls (13,8) and (7,8) .. (6,12) .. controls (5,16) and (2,19) .. (0,20) -- cycle; \fill [BlueGrey500] (3,13) .. controls (2,12) and (2,9) .. (3,8) .. controls (4,9) and (4,10) .. (5,11) .. controls (5,12) and (4,13) .. (3,13) -- cycle; \fill [BlueGrey500] (8,9) .. controls (7.5,8) and (7.5,6) .. (8,5) .. controls (8.5,6) and (8.5,7) .. (9.5,7.5) .. controls (9.5,8) and (8.5,9) .. (8,9) -- cycle; \fill [BlueGrey500] (9,18) .. controls (8,18) and (7.5,17.5) .. (7,17) .. controls (7,16) and (9,14) .. (10,14) .. controls (10,15) and (11,17) .. (12,17) .. controls (11,18) and (10,18) .. (9,18) -- cycle; \fill [BlueGrey800] (6,17.5) circle [radius=0.5]; } } \begin{document} \begin{tikzpicture} \fill [fill=LightBlue300] circle [radius=2]; \pic {shark}; \end{tikzpicture} \end{document}
shark_smile
\documentclass[tikz,border=5]{standalone} \usepackage[prefix=]{xcolor-material} \tikzset{ shark/.pic={ \tikzset{x=3cm/22,y=3cm/22,shift={(-8,-11)}} \fill [BlueGrey200] (2,16.75) -- ++(0.5,-1) -- ++(0.5,1) -- cycle (3,16.25) -- ++(0.5,-1) -- ++(0.5,1) -- cycle (1,17) -- ++(0.5,-1) -- ++(0.5,1) -- cycle (2,15.5) -- ++(-.5,-1) -- ++(1,0) -- cycle (3,15) -- ++(-.5,-1) -- ++(1,0) -- cycle; \fill [BlueGrey700] (6,12) .. controls (5,11) and (5,8) .. (6,7) .. controls (7,8) and (7,9) .. (8,10) .. controls (8,11) and (7,12) .. (6,12)-- cycle; \fill [BlueGrey500] (0,20) .. controls (0,19) and (0,18) .. (1,17) .. controls (3,16) and (4,16) .. (4,15) .. controls (4,14) and (2,15) .. (1,15) .. controls (2,13) and (3,12) .. (5,10) .. controls (7,8) and (11,6) .. (14,5) .. controls (14,3) and (14,1) .. (15,0) .. controls (15,2) and (15,3) .. (16,4) .. controls (17,5) and (18,6) .. (20,6) .. controls (19,7) and (16,7) .. (15,6) .. controls (14,10) and (11,15) .. (9,17) .. controls (7,19) and (3,20) .. (0,20) -- cycle; \fill [BlueGrey100] (0,20) .. controls (0,19) and (0,18) .. (1,17) .. controls (3,16) and (4,16) .. (4,15) .. controls (4,14) and (2,15) .. (1,15) .. controls (2,13) and (3,12) .. (5,10) .. controls (7,8) and (11,6) .. (14,5) .. controls (13,8) and (7,8) .. (6,12) .. controls (5,16) and (2,19) .. (0,20) -- cycle; \fill [BlueGrey500] (3,13) .. controls (2,12) and (2,9) .. (3,8) .. controls (4,9) and (4,10) .. (5,11) .. controls (5,12) and (4,13) .. (3,13) -- cycle; \fill [BlueGrey500] (9,18) .. controls (8,18) and (7.5,17.5) .. (7,17) .. controls (7,16) and (9,14) .. (10,14) .. controls (10,15) and (11,17) .. (12,17) .. controls (11,18) and (10,18) .. (9,18) -- cycle; \fill [BlueGrey800] (6,17.5) circle [radius=0.5]; } } \begin{document} \begin{tikzpicture} \fill [fill=LightBlue300] circle [radius=2]; \pic {shark}; \end{tikzpicture} \end{document}
Make the shark smile.
\documentclass[tikz,border=5]{standalone} \usepackage[prefix=]{xcolor-material} \tikzset{ shark/.pic={ \tikzset{x=3cm/22,y=3cm/22,shift={(-8,-11)}} \fill [BlueGrey200] (2,16.75) -- ++(0.5,-1) -- ++(0.5,1) -- cycle (3,16.25) -- ++(0.5,-1) -- ++(0.5,1) -- cycle (1,17) -- ++(0.5,-1) -- ++(0.5,1) -- cycle (2,15.5) -- ++(-.5,-1) -- ++(1,0) -- cycle (3,15) -- ++(-.5,-1) -- ++(1,0) -- cycle; \fill [BlueGrey700] (6,12) .. controls (5,11) and (5,8) .. (6,7) .. controls (7,8) and (7,9) .. (8,10) .. controls (8,11) and (7,12) .. (6,12)-- cycle; \fill [BlueGrey500] (0,20) .. controls (0,19) and (0,18) .. (1,17) .. controls (3,16) and (4,16) .. (4,16) .. controls (4,14) and (2,15) .. (1,15) .. controls (2,13) and (3,12) .. (5,10) .. controls (7,8) and (11,6) .. (14,5) .. controls (14,3) and (14,1) .. (15,0) .. controls (15,2) and (15,3) .. (16,4) .. controls (17,5) and (18,6) .. (20,6) .. controls (19,7) and (16,7) .. (15,6) .. controls (14,10) and (11,15) .. (9,17) .. controls (7,19) and (3,20) .. (0,20) -- cycle; \fill [BlueGrey100] (0,20) .. controls (0,19) and (0,18) .. (1,17) .. controls (3,16) and (4,16) .. (4,16) .. controls (4,14) and (2,15) .. (1,15) .. controls (2,13) and (3,12) .. (5,10) .. controls (7,8) and (11,6) .. (14,5) .. controls (13,8) and (7,8) .. (6,12) .. controls (5,16) and (2,19) .. (0,20) -- cycle; \fill [BlueGrey500] (3,13) .. controls (2,12) and (2,9) .. (3,8) .. controls (4,9) and (4,10) .. (5,11) .. controls (5,12) and (4,13) .. (3,13) -- cycle; \fill [BlueGrey500] (9,18) .. controls (8,18) and (7.5,17.5) .. (7,17) .. controls (7,16) and (9,14) .. (10,14) .. controls (10,15) and (11,17) .. (12,17) .. controls (11,18) and (10,18) .. (9,18) -- cycle; \fill [BlueGrey800] (6,17.5) circle [radius=0.5]; } } \begin{document} \begin{tikzpicture} \fill [fill=LightBlue300] circle [radius=2]; \pic {shark}; \end{tikzpicture} \end{document}
torustube_hole_increase
\documentclass[tikz,border=5]{standalone} \usepackage{amsmath,amssymb} \usepackage{color} \usepackage{tikz} \usetikzlibrary{fadings} \usetikzlibrary{patterns} \usetikzlibrary{shadows.blur} \usetikzlibrary{shapes} \begin{document} \begin{tikzpicture}[x=0.75pt,y=0.75pt,yscale=-1,xscale=1] \draw (28.5,53.5) .. controls (28.5,30.03) and (48.43,11) .. (73,11) .. controls (97.58,11) and (117.5,30.03) .. (117.5,53.5) .. controls (117.5,76.97) and (97.58,96) .. (73,96) .. controls (48.43,96) and (28.5,76.97) .. (28.5,53.5) -- cycle ; \draw (50,25.5) .. controls (64,-10.56) and (66,-10.69) .. (80.5,25.5) ; \draw (55,25.5) .. controls (64,-4.56) and (66,-4.69) .. (75.5,25.5) ; \draw (50,25.5) .. controls (52,23) and (53,23) .. (55,25.5) ; \draw (50,25.5) .. controls (52,28) and (53,28) .. (55,25.5) ; \draw (75.5,25.5) .. controls (77.5,23) and (78.5,23) .. (80.5,25.5) ; \draw (75.5,25.5) .. controls (77.5,28) and (78.5,28) .. (80.5,25.5) ; \draw (178.5,53.5) .. controls (178.5,30.03) and (198.43,11) .. (223,11) .. controls (247.58,11) and (267.5,30.03) .. (267.5,53.5) .. controls (267.5,76.97) and (247.58,96) .. (223,96) .. controls (198.43,96) and (178.5,76.97) .. (178.5,53.5) -- cycle ; \draw (200,45) .. controls (200,65) and (250,65) .. (250,45) ; \draw (205,55.5) .. controls (205,50) and (245,50) .. (245,55.5) ; \draw (135.5,50) node [anchor=north west][inner sep=0.75pt] [rotate=0] [align=left] {{\fontsize{18pt}{18pt}\selectfont $\ll$}}; \draw (200,-30) node [anchor=north west][inner sep=0.75pt] {$\textcolor[rgb]{0.82,0.01,0.11}{\sim A^{-1}}$}; \draw (50,-30) node [anchor=north west][inner sep=0.75pt] {$\textcolor[rgb]{0.82,0.01,0.11}{\sim A^{-b+1}}$}; \end{tikzpicture} \end{document}
Increase the size of the hole in the torus
\documentclass[tikz,border=5]{standalone} \usepackage{amsmath,amssymb} \usepackage{color} \usepackage{tikz} \usetikzlibrary{fadings} \usetikzlibrary{patterns} \usetikzlibrary{shadows.blur} \usetikzlibrary{shapes} \begin{document} \begin{tikzpicture}[x=0.75pt,y=0.75pt,yscale=-1,xscale=1] \draw (28.5,53.5) .. controls (28.5,30.03) and (48.43,11) .. (73,11) .. controls (97.58,11) and (117.5,30.03) .. (117.5,53.5) .. controls (117.5,76.97) and (97.58,96) .. (73,96) .. controls (48.43,96) and (28.5,76.97) .. (28.5,53.5) -- cycle ; \draw (50,25.5) .. controls (64,-10.56) and (66,-10.69) .. (80.5,25.5) ; \draw (55,25.5) .. controls (64,-4.56) and (66,-4.69) .. (75.5,25.5) ; \draw (50,25.5) .. controls (52,23) and (53,23) .. (55,25.5) ; \draw (50,25.5) .. controls (52,28) and (53,28) .. (55,25.5) ; \draw (75.5,25.5) .. controls (77.5,23) and (78.5,23) .. (80.5,25.5) ; \draw (75.5,25.5) .. controls (77.5,28) and (78.5,28) .. (80.5,25.5) ; \draw (178.5,53.5) .. controls (178.5,30.03) and (198.43,11) .. (223,11) .. controls (247.58,11) and (267.5,30.03) .. (267.5,53.5) .. controls (267.5,76.97) and (247.58,96) .. (223,96) .. controls (198.43,96) and (178.5,76.97) .. (178.5,53.5) -- cycle ; \draw (200,50) .. controls (200,80) and (250,80) .. (250,50) ; \draw (201,57) .. controls (201,25) and (249,25) .. (249,57) ; \draw (135.5,50) node [anchor=north west][inner sep=0.75pt] [rotate=0] [align=left] {{\fontsize{18pt}{18pt}\selectfont $\ll$}}; \draw (200,-30) node [anchor=north west][inner sep=0.75pt] {$\textcolor[rgb]{0.82,0.01,0.11}{\sim A^{-1}}$}; \draw (50,-30) node [anchor=north west][inner sep=0.75pt] {$\textcolor[rgb]{0.82,0.01,0.11}{\sim A^{-b+1}}$}; \end{tikzpicture} \end{document}
torustube_rotation
\documentclass[tikz,border=5]{standalone} \usepackage{amsmath,amssymb} \usepackage{color} \usepackage{tikz} \usetikzlibrary{fadings} \usetikzlibrary{patterns} \usetikzlibrary{shadows.blur} \usetikzlibrary{shapes} \begin{document} \begin{tikzpicture}[x=0.75pt,y=0.75pt,yscale=-1,xscale=1] \draw (28.5,53.5) .. controls (28.5,30.03) and (48.43,11) .. (73,11) .. controls (97.58,11) and (117.5,30.03) .. (117.5,53.5) .. controls (117.5,76.97) and (97.58,96) .. (73,96) .. controls (48.43,96) and (28.5,76.97) .. (28.5,53.5) -- cycle ; \draw (50,25.5) .. controls (64,-10.56) and (66,-10.69) .. (80.5,25.5) ; \draw (55,25.5) .. controls (64,-4.56) and (66,-4.69) .. (75.5,25.5) ; \draw (50,25.5) .. controls (52,23) and (53,23) .. (55,25.5) ; \draw (50,25.5) .. controls (52,28) and (53,28) .. (55,25.5) ; \draw (75.5,25.5) .. controls (77.5,23) and (78.5,23) .. (80.5,25.5) ; \draw (75.5,25.5) .. controls (77.5,28) and (78.5,28) .. (80.5,25.5) ; \draw (178.5,53.5) .. controls (178.5,30.03) and (198.43,11) .. (223,11) .. controls (247.58,11) and (267.5,30.03) .. (267.5,53.5) .. controls (267.5,76.97) and (247.58,96) .. (223,96) .. controls (198.43,96) and (178.5,76.97) .. (178.5,53.5) -- cycle ; \draw (200,45) .. controls (200,65) and (250,65) .. (250,45) ; \draw (205,55.5) .. controls (205,50) and (245,50) .. (245,55.5) ; \draw (135.5,50) node [anchor=north west][inner sep=0.75pt] [rotate=0] [align=left] {{\fontsize{18pt}{18pt}\selectfont $\ll$}}; \draw (200,-30) node [anchor=north west][inner sep=0.75pt] {$\textcolor[rgb]{0.82,0.01,0.11}{\sim A^{-1}}$}; \draw (50,-30) node [anchor=north west][inner sep=0.75pt] {$\textcolor[rgb]{0.82,0.01,0.11}{\sim A^{-b+1}}$}; \end{tikzpicture} \end{document}
Rotate the torus 90° clockwise.
\documentclass[tikz,border=5]{standalone} \usepackage{amsmath,amssymb} \usepackage{color} \usepackage{tikz} \usetikzlibrary{fadings} \usetikzlibrary{patterns} \usetikzlibrary{shadows.blur} \usetikzlibrary{shapes} \begin{document} \begin{tikzpicture}[x=0.75pt,y=0.75pt,yscale=-1,xscale=1] \draw (28.5,53.5) .. controls (28.5,30.03) and (48.43,11) .. (73,11) .. controls (97.58,11) and (117.5,30.03) .. (117.5,53.5) .. controls (117.5,76.97) and (97.58,96) .. (73,96) .. controls (48.43,96) and (28.5,76.97) .. (28.5,53.5) -- cycle ; \draw (50,25.5) .. controls (64,-10.56) and (66,-10.69) .. (80.5,25.5) ; \draw (55,25.5) .. controls (64,-4.56) and (66,-4.69) .. (75.5,25.5) ; \draw (50,25.5) .. controls (52,23) and (53,23) .. (55,25.5) ; \draw (50,25.5) .. controls (52,28) and (53,28) .. (55,25.5) ; \draw (75.5,25.5) .. controls (77.5,23) and (78.5,23) .. (80.5,25.5) ; \draw (75.5,25.5) .. controls (77.5,28) and (78.5,28) .. (80.5,25.5) ; \begin{scope}[rotate around={90:(223,53.5)}] \draw (178.5,53.5) .. controls (178.5,30.03) and (198.43,11) .. (223,11) .. controls (247.58,11) and (267.5,30.03) .. (267.5,53.5) .. controls (267.5,76.97) and (247.58,96) .. (223,96) .. controls (198.43,96) and (178.5,76.97) .. (178.5,53.5) -- cycle ; \draw (200,45) .. controls (200,65) and (250,65) .. (250,45) ; \draw (205,55.5) .. controls (205,50) and (245,50) .. (245,55.5) ; \end{scope} \draw (135.5,50) node [anchor=north west][inner sep=0.75pt] [rotate=0] [align=left] {{\fontsize{18pt}{18pt}\selectfont $\ll$}}; \draw (200,-30) node [anchor=north west][inner sep=0.75pt] {$\textcolor[rgb]{0.82,0.01,0.11}{\sim A^{-1}}$}; \draw (50,-30) node [anchor=north west][inner sep=0.75pt] {$\textcolor[rgb]{0.82,0.01,0.11}{\sim A^{-b+1}}$}; \end{tikzpicture} \end{document}
vr_two_motors
\documentclass[tikz,border=5]{standalone} \usepackage[utf8]{inputenc} \usepackage{xcolor} \usepackage{tikz} \usetikzlibrary{patterns,positioning,arrows,arrows.meta,calc,shapes,pgfplots.groupplots,fit,backgrounds} \begin{document} \begin{tikzpicture}[squarednode/.style={rectangle, draw=black!60, very thick, minimum size=5mm},every text node part/.style={align=center}, dot/.style={ circle, minimum size=3pt}, ellipsenode/.style={ellipse, draw=black!60, very thick, minimum size=5mm}] \node[squarednode] (realworld) {Sensor \\ data}; \node[ellipsenode] (sensors) [below=of realworld] {Sensors}; \node[ellipsenode] (motors) [left= 0.2cm of sensors] {Motors}; \node[squarednode] (DNN) [above=of realworld] {Deep Learning \\ module}; \node[squarednode] (tcp) [right= 0.5cm of DNN] {Data\\transfer\\node}; \node[squarednode] (vr) [right = 0.5cm of tcp] {VR \\ environment}; \node[squarednode] (user) [below=of vr] {User}; \node[dot] (e) at (-3.2,1.5) {}; \node[dot] (f) at (0.8,-3) {}; \node[squarednode] (motion) [below=of motors] {Robot \\ controller}; \node (box) [draw=orange,rounded corners,fit = (realworld) (DNN) (motion) (e) (f)] {}; \node (box) [draw=blue,rounded corners,fit = (user) (vr)] {}; \node (box) [draw=green,rounded corners,fit = (sensors) (motors)] {}; \draw[-latex] (sensors.north) -- (realworld.south); \draw[-latex] (realworld.north) -- (DNN.south); \draw[-latex] (DNN.east) -- (tcp.west); \draw[latex-latex] (tcp.east) -- (vr.west); \draw[-latex] (user.north) -- (vr.south); \draw[latex-latex] (tcp.south) |- (motion.east); \draw[-latex] (motion.north) -| (motors.south); \end{tikzpicture} \end{document}
Split the motors into two motors next to eachother (Motor 1 and Motor 2), that are linked to the robot controller the same way motors was. update the containers accordingly
\documentclass[tikz,border=5]{standalone} \usepackage[utf8]{inputenc} \usepackage{xcolor} \usepackage{tikz} \usetikzlibrary{patterns,positioning,arrows,arrows.meta,calc,shapes,pgfplots.groupplots,fit,backgrounds} \begin{document} \begin{tikzpicture}[squarednode/.style={rectangle, draw=black!60, very thick, minimum size=5mm},every text node part/.style={align=center}, dot/.style={ circle, minimum size=3pt}, ellipsenode/.style={ellipse, draw=black!60, very thick, minimum size=5mm}] \node[squarednode] (realworld) {Sensor \\ data}; \node[ellipsenode] (sensors) [below=of realworld] {Sensors}; \node[ellipsenode] (motor2) [left= 0.2cm of sensors] {Motor 2}; \node[ellipsenode] (motor1) [left= 0.2cm of motor2] {Motor 1}; \node[squarednode] (DNN) [above=of realworld] {Deep Learning \\ module}; \node[squarednode] (tcp) [right= 0.5cm of DNN] {Data\\transfer\\node}; \node[squarednode] (vr) [right = 0.5cm of tcp] {VR \\ environment}; \node[squarednode] (user) [below=of vr] {User}; \node[dot] (e) at (-5.6,1.5) {}; \node[dot] (f) at (0.8,-3) {}; \node[squarednode] (motion) [below=of motor2] {Robot \\ controller}; \node (box) [draw=orange,rounded corners,fit = (realworld) (DNN) (motion) (e) (f)] {}; \node (box) [draw=blue,rounded corners,fit = (user) (vr)] {}; \node (box) [draw=green,rounded corners,fit = (sensors) (motor1) (motor2)] {}; \draw[-latex] (sensors.north) -- (realworld.south); \draw[-latex] (realworld.north) -- (DNN.south); \draw[-latex] (DNN.east) -- (tcp.west); \draw[latex-latex] (tcp.east) -- (vr.west); \draw[-latex] (user.north) -- (vr.south); \draw[latex-latex] (tcp.south) |- (motion.east); \draw[-latex] (motion.north) -| (motor1.south); \draw[-latex] (motion.north) -| (motor2.south); \end{tikzpicture} \end{document}
README.md exists but content is empty.
Downloads last month
9