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.
Asked
Active
Viewed 487 times
2 Answers
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}

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}}]

You may also use pst-plot, or pst-text, see page 49 of same link.
user2987828
- 345
-
1Very 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
LaTeX) export in your document instead of generating the plot inLaTeX– Habi Nov 27 '13 at 14:07