3

I was trying to draw this or this. However, it is really hard for me to create the concave part of these images and seperate the picture into 5 equal parts.

lockstep
  • 250,273
Y_gr
  • 3,322

2 Answers2

3

Drawing with Bézier curves can take a bit of getting used to, and may involve some trial and error when trying to code curves in tikz rather than drawing them using a vector graphics program.

The following shows how I got what appears to be the required shape. The show curve controls decoration is only there to illustrate the control points I used.

\documentclass[tikz,border=0.125cm]{standalone}
\usetikzlibrary{decorations.pathreplacing}

\tikzset{
  show curve controls/.style={
    decoration={
      show path construction,
        curveto code={
          \draw [gray, thick] 
            (\tikzinputsegmentfirst)
            .. controls (\tikzinputsegmentsupporta) and (\tikzinputsegmentsupportb) .. (\tikzinputsegmentlast);
          \draw [red, thick] 
            (\tikzinputsegmentfirst) -- (\tikzinputsegmentsupporta);
          \draw [red, thick] 
            (\tikzinputsegmentsupportb) -- (\tikzinputsegmentlast);
          \fill [black] 
            (\tikzinputsegmentfirst) circle [radius=2pt]
            (\tikzinputsegmentlast)  circle [radius=2pt];
          \fill [blue] 
            (\tikzinputsegmentsupporta) circle [radius=2pt]
            (\tikzinputsegmentsupportb)  circle [radius=2pt];
        }
      },
   decorate}
}

\begin{document}

\begin{tikzpicture}
\draw [help lines] (-5,0) grid (5,10);
\path  [fill=gray!20, fill opacity=0.5, postaction=show curve controls]
    (-5,10) 
    .. controls ++(270:2) and ++(100:4) .. (-1/2,6)
    .. controls ++(280:1) and ++(90:2)  .. (-1/4,0)
    -- (1/4,0)
    .. controls ++(90:2) and ++(260:1) .. (1/2, 6)
    .. controls ++(80:4) and ++(270:2) .. (5,10) -- cycle;
\end{tikzpicture}


\end{document}

enter image description here

Mark Wibrow
  • 70,437
1

You may use some LaTeX/PSTricks packages for chemists as explained by Denis Girou and retransmitted by Benjamin Collas. They may be difficult to integrate in tikz. Here is an example from page 50 (25 of PDF):

\usepackage{pst-labo}
\pstChauffageBallon[glassType=flacon,recuperationGaz,
tubeRecourbeCourt,substance={\pstFilaments[10]{gray}}]

example of package pst-labo by Denis Girou and Benjamin Collas

You may also use pst-plot, or pst-text, see page 49 of same link.

  • 1
    Very nice, but I don't think this answers the OP's question. If you take a look at the two links in the question, you'll see that the OP is after a particular curve that sort of looks like a champagne glass, not after a way of drawing actual glasses. – Jake Nov 27 '13 at 12:52