Home > tikz pgf > Draw a closed liquid-droped shaped curve with TikZ

Draw a closed liquid-droped shaped curve with TikZ

September 22Hits:5
Advertisement

I am trying to draw a closed liquid-droped shaped curve using TikZ, but I don't know how. I tried to draw it using coordinates but I don't think that this is the solution. I am using

\documentclass{article} \usepackage{tikz}  \begin{document}  \begin{figure}[H] \centering \begin{tikzpicture} %\draw[very thick] (0,4) to [out=90,in=195] (0.1,3.9); %\draw [shorten >=-1cm,shorten <=-1cm] (0,3) to [bend right=5](0.1,2.9); \draw[orange, very thick] (0,4) -- (-0.1,3.5) -- (-0.3,3) -- (-0.65,2.7) -- (-0.55,2) -    - (-0.2,1.2) -- (0,0) -- (0.2,0.4) -- (1,1) -- (0.8,2.3) -- (0.5,2.8) -- (0.25,3.5) -- (0.1,4); \end{tikzpicture} \caption{Avalanche Multiplication}% \label{fig:avalanche}% \end{figure} \end{document} 

Draw a closed liquid-droped shaped curve with TikZ

Answers

\documentclass{article}
\usepackage{tikz}
\begin{document}

\begin{figure}[h]
\centering
\begin{tikzpicture}

\draw[very thick, orange] (-0.1,5) .. controls (-4,-2) and (4,-2) .. (0.1,5);
\node at (0,3) {$+$};
\node at (0,2) {$+$};
\node at (0.5,2.5) {$-$};
\node at (-0.5,2.5) {$+$};
\node at (0.5,.5) {$-$};
\node at (-0.5,1.5) {$-$};
\node at (0.5,1) {$-$};
\node at (0.5,2.5) {$-$};
\node at (-0.5,.5) {$+$};
\end{tikzpicture}
\caption{Avalanche Multiplication}%
\label{fig:avalanche}%
\end{figure}
\end{document}

Draw a closed liquid-droped shaped curve with TikZ

Are you perhaps interested in something like:

Draw a closed liquid-droped shaped curve with TikZ

Similar results could be achieved by means of the hobby package. Here is the code:

\documentclass{article}
\usepackage{tikz}
\usetikzlibrary{hobby}
\begin{document}

\begin{figure}[H]
\centering
\begin{tikzpicture}[use Hobby shortcut]
\draw[orange, very thick] (0,4) .. (-0.1,3.5) .. (-0.3,3) .. (-0.65,2.7) .. (-0.55,2) .. (-0.2,1.2) .. (0,0) .. (0.2,0.4) .. (1,1) .. (0.8,2.3) .. (0.5,2.8) .. (0.25,3.5) .. cycle;

\foreach \place/\el in {{(0,1.2)/+},{(0,3)/-},{(0.5,2.5)/+},{(0.7,1)/-},{(-0.2,2.5)/-},{(0.1,2)/+},{(0.6,1.5)/+}}
\node at \place {\ensuremath{\el}};
\end{tikzpicture}
\caption{Avalanche Multiplication}%
\label{fig:avalanche}%
\end{figure}
\end{document}



From the comments seems clear I misunderstood the question; a belated attempt to remedy (of course with hobby) :):

\documentclass{article}
\usepackage{tikz}
\usetikzlibrary{hobby}
\begin{document}

Completely closed:
\begin{center}
\begin{tikzpicture}
\draw[orange, very thick] (0,4) to[curve through={(-0.45,2)..(-0.9,0) .. (0.9,0) .. (0.45,2)}] (0,4);

\foreach \place/\el in {{(0,1.2)/-},{(0,2.8)/-},{(-0.5,0.8)/+},{(0.55,1)/-},{(-0.2,1.7)/-},{(0.1,2)/+},{(0.55,1.5)/+},{(0.2,0.5)/+},{(-0.2,0.2)/-}}
\node at \place {\ensuremath{\el}};
\end{tikzpicture}
\end{center}

Not closed:
\begin{center}
\begin{tikzpicture}
\draw[orange, very thick] (-0.035,4) to[curve through={(-0.45,2)..(-0.9,0) .. (0.9,0) .. (0.45,2)}] (0.035,4);

\foreach \place/\el in {{(0,1.2)/-},{(0,2.8)/-},{(-0.5,0.8)/+},{(0.55,1)/-},{(-0.2,1.7)/-},{(0.1,2)/+},{(0.55,1.5)/+},{(0.2,0.5)/+},{(-0.2,0.2)/-}}
\node at \place {\ensuremath{\el}};
\end{tikzpicture}
\end{center}

\end{document}

Result:

Draw a closed liquid-droped shaped curve with TikZ



Since Garbage Collector posted a very nice PSTricks gif animation, it sounds to me that we should have also a TikZ-based version. Basically, the standalone class with the tikz option allows to create several pdf pages, the base of the animation. The + and - signs change position in each page because their coordinates are generated by random numbers, the function rnd which generates number from 0 to 1. That's why each time a random number is created, it is multiplied by a constant factor that amplifies and bounds the positions in which each sign will be placed.

\documentclass[tikz]{standalone}
\usepackage{tikz}
\usetikzlibrary{hobby}
\begin{document}
\foreach \number in {1,...,20}{
\begin{tikzpicture}[scale=2]
\draw[orange, very thick] (0,4) to[curve through={(-0.45,2)..(-0.9,0) .. (0.9,0) .. (0.45,2)}] (0,4);
\foreach \place/\el in {{(rnd*0.8,rnd*1.05)/-},{(rnd*0.05,rnd*2.8)/-},{(-rnd*0.5,0.8)/+},{(rnd*0.55,rnd*1.1)/-},{(-rnd*0.2,rnd*1.7)/-},{(rnd*0.4,1.8)/+},{(rnd*0.55,1.5)/+},{(rnd*0.9,rnd*0.9)/+},{(-rnd*0.9,rnd*0.4)/-}}
\node at \place {\ensuremath{\el}};
\end{tikzpicture}
}
\end{document}

Result:

Draw a closed liquid-droped shaped curve with TikZ

Just for fun with PSTricks.

Still Version:

Draw a closed liquid-droped shaped curve with TikZ

\documentclass[pstricks,border=3pt]{standalone}
\usepackage{pstricks-add}
\def\N{15}
\begin{document}
\begin{pspicture}[showgrid=false](-2,-2)(2,5)
    \psclip{\psbezier[linestyle=none](0,5)(-6.8,-4.3)(6.8,-4.3)(0,5)}
        \psLoop{\N}{
            \rput(!rand 21 mod 10 div 1 sub rand 51 mod 10 div 1 sub){$+$}
            \rput(!rand 21 mod 10 div 1 sub rand 51 mod 10 div 1 sub){$-$}}%
    \endpsclip
    \psbezier[linecolor=orange](0,5)(-6.8,-4.3)(6.8,-4.3)(0,5)
\end{pspicture}
\end{document}

GIF Version:

Draw a closed liquid-droped shaped curve with TikZ

\documentclass[pstricks,border=3pt]{standalone}
\usepackage{pstricks-add}
\def\N{15}
\begin{document}
\psLoop{20}{%
\begin{pspicture}[showgrid=false](-2,-2)(2,5)
    \psclip{\psbezier[linestyle=none](0,5)(-6.8,-4.3)(6.8,-4.3)(0,5)}
        \psLoop{\N}{
            \rput(!rand 21 mod 10 div 1 sub rand 51 mod 10 div 1 sub){$+$}
            \rput(!rand 21 mod 10 div 1 sub rand 51 mod 10 div 1 sub){$-$}}%
    \endpsclip
    \psbezier[linecolor=orange](0,5)(-6.8,-4.3)(6.8,-4.3)(0,5)
\end{pspicture}}
\end{document}

Related Articles

  • Draw a closed liquid-droped shaped curve with TikZ

    Draw a closed liquid-droped shaped curve with TikZSeptember 22

    I am trying to draw a closed liquid-droped shaped curve using TikZ, but I don't know how. I tried to draw it using coordinates but I don't think that this is the solution. I am using \documentclass{article} \usepackage{tikz} \begin{document} \begin{f

  • Plotting bell shaped curve in TikZ-PGF

    Plotting bell shaped curve in TikZ-PGFFebruary 6

    I want to create some bell shaped curves for demonstrating hypothesis testing in statistics. Can anybody help me drawing curves like shown in the following picture? --------------Solutions------------- I would use pgfplots for this, as I find it easi

  • How to draw straight lines along a smooth curve in tikz?

    How to draw straight lines along a smooth curve in tikz?February 25

    I want to draw straight lines along a smooth path in tikz. I tried to use the decorations.markings-solution described in Drawing paths/nodes along a path in Tikz and used it like this: \documentclass{article} \usepackage[latin1]{inputenc} \usepackage

  • Shading a bell shaped curve in TikZ

    Shading a bell shaped curve in TikZJuly 17

    I have the following code: \documentclass{article} \usepackage{tikz} \begin{document} \begin{tikzpicture}[scale=1] \def\normalt{\x,{4*1/exp(((\x-3)^2)/2)}} \def\y{2} \def\fy{4*1/exp(((\y-3)^2)/2)} \fill [fill=orange!60] (2.0,0)--(2.0,2.5) plot[domain

  • How to draw a closed smooth curve from a list of nodes?

    How to draw a closed smooth curve from a list of nodes?April 9

    Karl is a list of randomly generated nodes by \curvepnodes using parametric points in RPN (I don't know how to use rand in algebraic expression). The number of elements of the list is \Karlnodecount + 1 or plotpoints. In the documentation, I only see

  • Illustrator Drawing Tools, Part 5: Pen Tool – Curves

    Illustrator Drawing Tools, Part 5: Pen Tool – CurvesJune 8

    This is the final part of the series on drawing tools in Illustrator. In the last post we looked at how to use the Pen tool to draw straight line segments and how to use the Selection tools to edit entire paths and individual points. To conclude the

  • How to draw a curve in tikz?

    How to draw a curve in tikz? December 27

    Possible Duplicate: Easy curves in TikZ I want to draw an equivalent of the following pstricks picture with tikz. \documentclass{article} \usepackage{pstricks} \usepackage{pst-plot} \begin{document} \begin{pspicture} \psaxes[ticks=none,labels=none]{-

  • How to draw a point at a particular location along the curve in TikZ

    How to draw a point at a particular location along the curve in TikZMay 18

    I got a nice code to draw an arrow at the mid position of the curve. From Tikz: Arrowheads in the center \tikzset{->-/.style={decoration={ markings, mark=at position .5 with {\arrow{>}}},postaction={decorate}}} I do not know how to make a dot some w

  • How to draw a closed line in QGIS1.8?December 3

    I want to draw a closed line in QGIS1.8,but I don't know how to make the last point coincide with the first point.What am I supposed to do? --------------Solutions------------- Set the Snapping Options: This is a previous answer on GIS SE How to join

  • Length of curve in TikZ

    Length of curve in TikZNovember 28

    Is it possible to compute the length of a generic curve in TikZ? An answer to this question would solve TikZ dashes and closed curves as follows: Let lc be the length of the curve and lp the desired length of the dash pattern. All we have to do is re

  • How to draw labeled parallel arrows in commutative diagram with TikZ?

    How to draw labeled parallel arrows in commutative diagram with TikZ?March 16

    I want to draw labeled parallel arrow in commutative diagram with TikZ, I searched on google and Tex Stackexchange, however, I found only the method to draw parallel arrow by transform canvas only, I tried to add the labeled but it failed. Here is my

  • How to manually draw horizontal legend and place it correctly in tikz?

    How to manually draw horizontal legend and place it correctly in tikz?March 8

    This is my tikz code to draw some plots. \documentclass{article} \usepackage{tikz,subfig} \begin{document} \begin{figure} \centering \subfloat[Iteration Domain for a Tile]{ \begin{tikzpicture} \draw (0,0) rectangle (3.8,3.8); \end{tikzpicture} } \sub

  • How to draw this 3D H-layout recursive tree with Tikz?

    How to draw this 3D H-layout recursive tree with Tikz? November 18

    Background: This is an extension problem from my last post How to draw the recursive H-Layout tree using Tikz?. The (2D) H-layout tree is actually from the VLSI layout problem in computer science. I have received excellent solutions to the last post.

  • Drawing a peer-to-peer communications model in Tikz

    Drawing a peer-to-peer communications model in TikzMarch 31

    I would like to draw an image illustriting peer-to-peer communications in Tikz. I have previously drawn flowcharts with relative ease based on the Simple Flowchart Example. Here is the image that I would like to recreate in Tikz: My difficulties are:

  • How can one drawing a mirror image of an inductor in TikZ?

    How can one drawing a mirror image of an inductor in TikZ?October 11

    I want to draw the mirror image of an inductor in TikZ so that if the devices is drawn horizontally then the bumps are on the lower side rather than the upper side. Does someone have an idea of how this could be done? Help would be appreciated greatl

  • Drawing a circle on non-plane in 3d - Tikz

    Drawing a circle on non-plane in 3d - TikzDecember 24

    So I'm trying to draw a circle in a nonstandard plane with TikZ, but can't seem to find any documentation. I originally tried what was found here: Drawing a circle on a non xy-plane with TikZ But this doesn't answer my question as this just changes f

  • How to draw a closed curve with a flag-like path and attach some labels to them?

    How to draw a closed curve with a flag-like path and attach some labels to them?November 8

    I'm trying to draw some arbitrary closed two dimensional curve where I'm focusing on only part of the boundary. I want to label the diameter of the part of the boundary I'm focusing on. Last, I'd like to put a tube encompassing this part of the bound

  • How to draw Closed curver with TiKZ?

    How to draw Closed curver with TiKZ?August 21

    I want to draw the following diagram. I have tried with the following Latex command: \documentclass[12pt,twoside,a4paper]{book} \usepackage{graphicx,wrapfig,tikz} \begin{document} \begin{tikzpicture} \draw (0,4) ellipse ( 2cm and .6cm); \draw (2,4) -

  • How to draw a closed curve around a set of points/nodes keeping a minimum distance?

    How to draw a closed curve around a set of points/nodes keeping a minimum distance? September 1

    I'm trying to draw a boundary around a convex set of circular nodes in TikZ. The aim is to have it padded by 1cm, with an arc at the corners between segments, like this: I currently have the following code: \documentclass{article} \usepackage{tikz} \

  • How to draw arbitrary closed surface with TikZ?

    How to draw arbitrary closed surface with TikZ?July 6

    I want to draw an arbitrary closed surface like following figure. How can i do it? Here is the MWE: \documentclass{article} \usepackage{tikz} \begin{document} \begin{tikzpicture} \shade[line width=2pt, color=blue] (0, 0) .. controls(1,2) .. (3, 0) ;

Copyright (C) 2017 ceus-now.com, All Rights Reserved. webmaster#ceus-now.com 14 q. 0.357 s.