Draw this with TikZ

tikz-pgf

enter image description here

I want to learn how to draw things like this. Can you show me how to do this, please?

Best Answer

Here's a starting point for you. As always, eat the elephant bite by bite ... Repeat for all relevant fragments of the drawing and join into one drawing, in the end.

So first of all it's enough to focus on one halve, say the right one. You can always mirror it later. To better see the various parts I did some coloration. halve

Next overlay a grid, e.g. via Paint.net, Gimp or other programs. We'll need certain points from the drawing to pave the way. withGrid

For the grid I used this, so it may be a good time to look up the commands in the pgfmanual and its tutorial part:

\documentclass[10pt,border=3mm,tikz]{standalone}
\usepackage{tikz}

\begin{document}
 \begin{tikzpicture}
    \draw (0,0) grid (5,10);
 \end{tikzpicture}
\end{document}

Now, let's try to approximate the golden area. We just need the outlines and don't need to care about precision, overlaps etc. Leave that for later.

golden

Let's try to mimick a very coarse form by approximating the blue and red line. The relevant part is drawing just two pathes:

    % ~~~ blue path ~~~~~~~~~~~
    \draw (0,6.2) -- (1.1,4.1) -- (1.2,2.7) -- (1.7,2.7) -- (1.5,1.9);
    % ~~~ red path ~~~~~~~~~~~
    \draw (0,6.4) -- (1.2,4.2) -- (2.1,3.9) -- (3.5,4.2) -- (1.8,1.9);  

This results in: coarse

To introduce the bends we can specify out- and in-angles, like so: replacing -- by to [out=260,in=95]. The manual mentions even more ways, e.g. Bezier-like controls. Make your choice.

Final result: fine

Code, with some minor coordinate moves (compare coarse and fine) :

\documentclass[10pt,border=3mm,tikz]{standalone}
\usepackage{tikz}

\begin{document}

 \begin{tikzpicture}% ~~~ very coarse ~~~
    % ~~~ comment out or delete grid later ~~~
    \draw [help lines] (0,0) grid (7,13);
    
    % ~~~ blue path ~~~~~~~~~~~
    \draw (0,6.2) -- (1.1,4.1) -- (1.2,2.7) -- (1.7,2.7) -- (1.5,1.9);
    % ~~~ red path ~~~~~~~~~~~
    \draw (0,6.4) -- (1.2,4.2) -- (2.1,3.9) -- (3.5,4.2) -- (1.8,1.9);  
 \end{tikzpicture}


 \begin{tikzpicture}% ~~~ with bends ~~~
    % ~~~ comment out or delete grid later ~~~
    \draw [help lines] (0,0) grid (7,13);
    
    % ~~~ blue path ~~~~~~~~~~~
    \draw (0,6.2)   to [out=260,in=95] (1.1,4.1) 
                    to [out=5,in=55] (1.2,2.7) 
                    to [out=270,in=240](1.8,2.7) 
                    to [out=260,in=220] (1.7,1.9);
    % ~~~ red path ~~~~~~~~~~~
    \draw (0,6.4)   to [out=280,in=85] (1.2,4.2) 
                    to [out=10,in=105] (2.1,3.9) 
                    to [out=50,in=150] (3.5,4.2) 
                    to [out=-200,in=50] (1.8,1.9);  
 \end{tikzpicture}

\end{document}

P.S.: Outlook, how to continue

Let's assume you know how to draw (most) parts of your ornament. How to join everthing?

Let's introduce the \pic element, so that you can write sth. like this: \pic at (0,0) {halve}; This cleans up your code. You'll obtain it by moving everything to a \tikzset{ } statement, where you define, what halve means in this file:

\begin{document}

\tikzset{% ~~~ all drawings needed for one halve ~~~~~~~~~
    halve/.pic={
     % ~~~ blue path ~~~~~~~~~~~
    \draw (0,6.2)   to [out=260,in=95] (1.1,4.1) 
...
    \draw (0,13) to [bend right] (1,12) -- (0,11);
    }
}

To make things easier to see, I included 3 more dummy-shapes, see the final code below. BTW, this is how you obtain closed pathes using cycle, which you might need when it comes to overlaps and perhaps using layers just like in graphic programs:

    % ~~~ rightmost; example for closed path ~~~~
    \draw (5.5,3.8) -- (5.5,5.5) -- (6.5,4.8) -- cycle;

hPic

Now you can place several halves wherever you want, including scaling (which requires transform shape, too), see final code:

someHalves

Finally, what's about the whole symmetrical ornament? As you may guess, we'll define just another \pic, which includes a mirrored halve:

\tikzset{% ~~~ putting two halves together ~~~~~~
    ornmnt/.pic={
        \pic at (0,0) {halve};
        \pic [xscale=-1] at (0,0) {halve};
    }
}

ornmnt

Final code for all of this:

\documentclass[10pt,border=3mm,tikz]{standalone}
\usepackage{tikz}

\begin{document}

\tikzset{% ~~~ all drawings needed for one halve ~~~~~~~~~
    halve/.pic={
     % ~~~ blue path ~~~~~~~~~~~
    \draw (0,6.2)   to [out=260,in=95] (1.1,4.1) 
                    to [out=5,in=55] (1.2,2.7) 
                    to [out=270,in=240](1.8,2.7) 
                    to [out=260,in=220] (1.7,1.9);
    % ~~~ red path ~~~~~~~~~~~
    \draw (0,6.4)   to [out=280,in=85] (1.2,4.2) 
                    to [out=10,in=105] (2.1,3.9) 
                    to [out=50,in=150] (3.5,4.2) 
                    to [out=-200,in=50] (1.8,1.9);  
    % ~~~ simple pattern at origin ~~~~~
    \draw (0,0) to [bend left] (1,1);
    % ~~~ rightmost; example for closed path ~~~~
    \draw (5.5,3.8) -- (5.5,5.5) -- (6.5,4.8) -- cycle;
    % ~~~ top ornament ~~~~~~~~~~~~~~~~~
    \draw (0,13) to [bend right] (1,12) -- (0,11);
    }
}
\tikzset{% ~~~ putting two halves together ~~~~~~
    ornmnt/.pic={
        \pic at (0,0) {halve};
        \pic [xscale=-1] at (0,0) {halve};
    }
}

% ~~~ (1) let's see the \pic {halve} ~~~~~~~~~~
 \begin{tikzpicture}% ~~~ with bends ~~~
    % ~~~ comment out or delete grid later ~~~
    \draw [help lines] (0,0) grid (7,13);   
    \pic at (0,0) {halve}; 
    \node [red] at (5,11.3) {one halve of the ornament};
 \end{tikzpicture}

% ~~~ (2) using \pic {halve} ~~~~~~~~~~~~~
 \begin{tikzpicture}% ~~~ with bends ~~~
    \pic at (0,0) {halve}; 
    
    \node [red] at (5,10) {one pic};
    \draw [dashed,gray] (8,0) -- (8,13);
    
    \pic at (8,0) {halve}; 
    \node [red] at (13,10) {one more pic};
    \draw [dashed,gray] (16,0) -- (16,13);
    
    \pic [scale=.5, transform shape] at (16,0) {halve};
    \node [red] at (19,10) {smaller pic};
 \end{tikzpicture}
 
% ~~~ (3) let's see the full ornament ~~~~~~~~
 \begin{tikzpicture}
    \pic at (0,0) {ornmnt};
 \end{tikzpicture}

\end{document}
Related Question