10

I am lacking these fruits:

enter image description here enter image description here enter image description here

MWE from Mark Wibrow

\documentclass[tikz,border=5]{standalone}
\usepackage{xcolor-material}
\usetikzlibrary{fit}
\tikzset{%
   apple/.pic={
\fill [MaterialBrown] (-1/8,0) 
  arc (180:120:1 and 3/2) coordinate [pos=3/5] (@)-- ++(1/6,-1/7) 
  arc (120:180:5/4 and 3/2) -- cycle;
\fill [MaterialLightGreen500] (0,-9/10) 
  .. controls ++(180:1/8) and ++(  0:1/4) .. (-1/3,  -1)
  .. controls ++(180:1/3) and ++(270:1/2) .. (  -1,   0)
  .. controls ++( 90:1/3) and ++(180:1/3) .. (-1/2, 3/4)
  .. controls ++(  0:1/8) and ++(135:1/8) .. (   0, 4/7)
  .. controls ++( 45:1/8) and ++(180:1/8) .. ( 1/2, 3/4)
  .. controls ++(  0:1/3) and ++( 90:1/3) .. (   1,   0)
  .. controls ++(270:1/2) and ++(  0:1/3) .. ( 1/3,  -1)
  .. controls ++(180:1/4) and ++(  0:1/8) .. cycle;
\fill [MaterialLightGreen600] (0, 4/7)
  .. controls ++( 45:1/8) and ++(180:1/8) .. ( 1/2, 3/4)
  .. controls ++(  0:1/3) and ++( 90:1/3) .. (   1,   0)
  .. controls ++(270:1/2) and ++(  0:1/3) .. ( 1/3,  -1)
  .. controls ++(180:1/4) and ++(  0:1/8) .. (   0,-9/10);
\fill [MaterialGreen500, shift={(@)}, rotate=-30] 
  (0,0) arc (45:135:3/4 and 3/5) arc (225:315:3/4 and 3/5);
\fill [MaterialGreen700, shift={(@)}, rotate=-30] 
  (0,0) arc (315:225:3/4 and 3/5) -- cycle;
},
  orange/.pic={
\fill [MaterialOrange500] (0,0) circle [radius=1];
\fill [MaterialOrange600] (0,0) -- (45:1) arc (45:-135:1) -- cycle;
\fill [MaterialOrange700, shift={(0,3/4)}] coordinate (@)
ellipse [x radius=1/4, y radius=1/8];
\begin{scope}
\clip (0,0) circle [radius=1];
\fill [MaterialOrange700, shift=(@)] (90:1/4 and 1/8) 
  \foreach \i [evaluate={\j=mod(\i,2)+1/4;}]in {0,...,12}{
  -- (90+\i*30:\j*3/4 and \j*3/8) } -- cycle;
\end{scope}
\fill [MaterialBrown] (-1/16, 3/4) -- ++(0,1/4) arc (180:0:1/16 and 1/32)
   -- ++(0,-1/4) arc (360:180:1/16 and 1/32) -- cycle;
\fill [MaterialGreen500, shift=(@), rotate=-150] 
  (0,0) arc (45:135:1/2 and 4/5) arc (225:315:1/2 and 3/5);
\fill [MaterialGreen700, shift=(@), rotate=-150] 
  (0,0) arc (45:135:1/2 and 4/5) -- cycle;
},
lemon/.pic={
\tikzset{rotate=-45}
\fill [MaterialYellow500] (0, 0) ellipse [x radius=1/3, y radius=  1];
\fill [MaterialYellow500] (0, 0) ellipse [x radius=3/4, y radius=7/8];
\fill [MaterialYellow600] (270:1/3 and   1) arc (270:450:1/3 and   1);
\fill [MaterialYellow600] (270:3/4 and 7/8) arc (270:450:3/4 and 7/8);
\begin{scope}[shift=(90:9/10), rotate=-135]
\fill [MaterialGreen500] 
  (0,0) arc (45:135:1/2 and 4/5) arc (225:315:1/2 and 3/5);
\fill [MaterialGreen700] 
  (0,0) arc (45:135:1/2 and 4/5) -- cycle;
\tikzset{rotate=90, scale=3/4}
\fill [MaterialGreen500] 
  (0,0) arc (45:135:1/2 and 4/5) arc (225:315:1/2 and 3/5);
\fill [MaterialGreen700] 
  (0,0) arc (45:135:1/2 and 4/5) -- cycle;
\end{scope}
},
cherry/.pic={
\foreach \i in {1,2}{
\tikzset{shift={(-1+\i*3/4, -3/5+\i/5)},scale=1/2, rotate=15-\i*10}
\fill [MaterialRed700] (0,19/20) 
  .. controls ++(180:1/8) and ++(  0:1/4) .. (-1/3,  1)
  .. controls ++(180:1/3) and ++( 90:1/2) .. (  -1,  0)
  .. controls ++(270:1/2) and ++(180:1/2) .. (   0, -1)
  .. controls ++(  0:1/2) and ++(270:1/2) .. (   1,  0)
  .. controls ++( 90:1/2) and ++(  0:1/3) .. ( 1/3,  1)
  .. controls ++(180:1/4) and ++(  0:1/8) .. cycle;
\fill [MaterialRed800] (0, -1)
  .. controls ++(  0:1/2) and ++(270:1/2) .. (   1,  0)
  .. controls ++( 90:1/2) and ++(  0:1/3) .. ( 1/3,  1)
  .. controls ++(180:1/4) and ++(  0:1/8) .. (   0,19/20) -- cycle;
\fill [MaterialRed900] (0,3/4) coordinate (@\i) 
  ellipse [x radius=1/4, y radius=1/8];
}
\fill [MaterialBrown]
  (1/4,11/8) -- (3/8,11/8) coordinate (@)
  .. controls ++(270:1/2) and ++(135:1/3) .. (@1)
  .. controls ++(135:1/2) and ++(270:1/2) .. cycle;
\fill [MaterialBrown]
  (1/4,11/8) -- (3/8,11/8)
  .. controls ++(315:1/2) and ++(45:1/2) .. (@2)
  .. controls ++(60:1/2) and ++(315:1/2) .. cycle;
\fill [MaterialGreen500, shift={(@)}, rotate=20] 
  (0,0) arc (45:135:3/4 and 3/5) arc (225:315:3/4 and 3/5);
\fill [MaterialGreen700, shift={(@)}, rotate=20] 
  (0,0) arc (315:225:3/4 and 3/5) -- cycle;
}}
\begin{document}
\tikz\foreach \i [evaluate={\j=int(mod(\i, 4));}] in {0,...,11}
  \path  (\i*30:5) 
    \ifcase\j pic {apple} \or pic {orange} 
          \or pic {lemon} \or pic {cherry}\fi;
\end{document}

k

NaveganTeX
  • 2,630
  • 11
    You should say that this code actually comes from https://tex.stackexchange.com/questions/413389/how-to-make-a-simple-drawing-of-an-apple-using-only-the-tikz-library/413395#413395 –  Oct 20 '19 at 07:57
  • 6
    @NaveganTEX I wish there was one. However, when you dont cross-refer the code, you are basically showing something as you made. However, in reality, it was created by someone else. Nevertheless, it's a nice gesture to let others know whose code you are using. – Raaja_is_at_topanswers.xyz Oct 20 '19 at 08:32
  • The trouble is that, now openclipart.org has gone, the availability of free fake fruit for conversion is inevitably somewhat thinner on the ground. TeX SE is a less colourful place now its gone. (Though Mark Wilbrow scarcely needs it, I grant you.) – cfr Oct 20 '19 at 20:56

1 Answers1

14

A strawberry.

(Just for fun :)

enter image description here

\documentclass[border=1cm]{standalone}
\usepackage{tikz}
\tikzset{seed/.pic={\draw[red,thick] (0,0) .. controls (-0.2,0.8) and (0.2,0.8) .. (0.3,0.2) ..controls (0.4,-0.6) and (0.2,-0.5).. cycle;},
}

\begin{document} \begin{tikzpicture} \draw[red,line width=1mm,fill=red!30] (3,9.5)node{X} .. controls (2.0,9.3) and (1.0,8.9) .. (0.5,7.0) .. controls (0.2,5.0) and (0.2,3.0) .. (0.4,1.8) .. controls (0.7,0.3) and (1.4,0.3) .. (2.0,0.2) .. controls (3.0,0.3) and (4.0,0.6) .. (5.0,1.3) .. controls (8.4,3.0) and (8.4,4.0) .. (8.2,5.4) .. controls (7.5,8.5) and (5.5,9.9) .. cycle;

\draw pic at (1,3) {seed} pic[rotate=-10] at (1.0,5.5) {seed} pic[rotate=-30] at (1.5,1.5) {seed} pic[rotate=-45] at (1.8,8.2) {seed} pic[rotate=-25] at (2.6,3.8) {seed} pic[rotate=-40] at (2.5,6) {seed} pic[rotate=-60] at (3,1) {seed} pic[rotate=-55] at (3.3,2.4) {seed} pic[rotate=-34] at (3.7,8) {seed} pic[rotate=-45] at (4.2,2) {seed} pic[rotate=-51] at (4.5,6) {seed} pic[rotate=-22] at (5.5,3.3) {seed} pic[rotate=-45] at (5.4,4.5) {seed} pic[rotate=-45] at (4.5,4.6) {seed} pic[rotate=-10] at (7,3.9) {seed} pic[rotate=5] at (7.5,5.3) {seed} ;

\draw[green!50!black,line width=0.7mm,fill=green] (7.7,10.7) .. controls (7.5,10) and (7.5,9.5) .. (6.6,8.7) .. controls (6.2,9.6) and (5.0,10.6) .. (4.5,10.5) .. controls (4.6,10.2) and (4.7,9.9) .. (4.8,9.7) .. controls (4.5,9.8) and (3,9.8) .. (2.4,9.7) .. controls (4.2,9.4) and (4.6,8.9) .. (4.9,8.7) .. controls (4,7.7) and (4,7) .. (4.2,6.8) .. controls (4.5,6.8) and (5,7.0) .. (6.0,7.0) .. controls (6.0,6.0) and (5.8,5.2) .. (5.6,4.9) .. controls (7,5) and (7.5,6.1) .. (7.5,6.1) .. controls (8.1,5.6) and (8.2,5.1) .. (8.3,5.0) .. controls (8.8,5.7) and (8.3,6.5) .. (8.1,6.7) .. controls (8.5,6.8) and (8.7,6.8) .. (9.0,6.7) .. controls (8.8,7.6) and (7.9,8.2) .. (7.5,8.3) .. controls (7.7,8.5) and (8.4,9.0) .. (8.8,9.3) .. controls (9.0,10.5) and (8,11) .. cycle; \end{tikzpicture} \end{document}

Grapes

enter image description here

\documentclass[border=1cm]{standalone}
\usepackage{tikz}
\definecolor{grapecolor}{rgb}{0.44,0.18,0.66}
\definecolor{leafcolor}{rgb}{0,0.7,0}
\tikzset{
grape/.pic={\draw[black,line width=0.7mm,fill=grapecolor, opacity=1.0] (0,0) circle (0.8);},
leaf/.pic={
\draw[line width=0.7mm,fill=leafcolor] (-0.1,0) 
.. controls (0.2,0.3).. (0.7,0.4)
.. controls (0.6,0.6) .. (0.5,0.75)
.. controls (1,0.7) .. (1.4,0.5)
.. controls (1.4,0.6) .. (1.35,0.9)
.. controls (1.5,0.9) and (2.5,0.9) .. (2.5,0)
.. controls (2.5,-0.9) and (1.5,-0.9) .. (1.35,-0.9)
.. controls (1.4,-0.6) .. (1.4,-0.5)
.. controls (1.0,-0.7) .. (0.5,-0.75)
.. controls (0.6,-0.6) .. (0.7,-0.4)
.. controls (0.2,-0.3) .. cycle;
\draw[black,line width=0.7mm] (0.2,0) -- ++(2.3,0)
(2.1,0) ..controls (2.0,0.3).. (1.6,0.6)
(2.1,0) ..controls (2.0,-0.3).. (1.6,-0.6)
(1.3,0) ..controls (1.2,0.2).. (0.9,0.4)
(1.3,0) ..controls (1.2,-0.2).. (0.9,-0.4);}
}

\begin{document} \begin{tikzpicture} \draw pic[rotate=124] at (7,5.5) {leaf}; \draw[line width=1mm] (5,6.0) ..controls(5.6,7.3)..(5.7,8.5); \draw pic[rotate=-55] at (4.6,6.4) {grape} pic[rotate=-10] at (3.4,3.8) {grape} pic[rotate=-30] at (3.3,5.1) {grape} pic[rotate=-45] at (4.7,4.3) {grape} pic[rotate=-25] at (4.6,5.6) {grape} pic[rotate=-40] at (3.4,6.5) {grape} pic[rotate=-60] at (5.8,5.0) {grape} pic[rotate=-55] at (5.8,6.1) {grape} ; \draw pic[rotate=-4] at (3,7.5) {leaf}; \end{tikzpicture} \end{document}

Grapes again

enter image description here

\documentclass[border=1cm]{standalone}
\usepackage{tikz}
\definecolor{grapecolora}{rgb}{0.44,0.18,0.66}
\definecolor{grapecolorb}{rgb}{0.33,0.12,0.44}
\definecolor{leafcolor}{rgb}{0,0.7,0}
\tikzset{
grape/.pic={\fill[grapecolorb] (0,0) circle (0.8);
\begin{scope}
\clip (0,-0.8) rectangle (0.8,0.8);
\fill[grapecolora] (0,0) circle (0.8);
\end{scope}
},
leaf/.pic={
\fill[leafcolor] (-0.1,0) 
.. controls (0.2,0.3).. (0.7,0.4)
.. controls (0.6,0.6) .. (0.5,0.75)
.. controls (1,0.7) .. (1.4,0.5)
.. controls (1.4,0.6) .. (1.35,0.9)
.. controls (1.5,0.9) and (2.5,0.9) .. (2.5,0)--cycle;

\fill[green] (2.5,0) .. controls (2.5,-0.9) and (1.5,-0.9) .. (1.35,-0.9) .. controls (1.4,-0.6) .. (1.4,-0.5) .. controls (1.0,-0.7) .. (0.5,-0.75) .. controls (0.6,-0.6) .. (0.7,-0.4) .. controls (0.2,-0.3) .. (-0.1,0)--cycle; } }

\begin{document} \begin{tikzpicture} \draw pic[rotate=124] at (7,5.5) {leaf}; \draw[line width=1mm] (5,6.0) ..controls(5.6,7.3)..(5.7,8.5); \draw pic[rotate=-45] at (4.6,6.4) {grape} pic[rotate=-45] at (3.4,3.8) {grape} pic[rotate=-45] at (3.3,5.1) {grape} pic[rotate=-45] at (4.7,4.3) {grape} pic[rotate=-45] at (4.6,5.6) {grape} pic[rotate=-45] at (3.4,6.5) {grape} pic[rotate=-45] at (5.8,5.0) {grape} pic[rotate=-45] at (5.8,6.1) {grape} ; \draw pic[rotate=-4] at (3,7.5) {leaf}; \end{tikzpicture} \end{document}

nidhin
  • 7,932