2

Consider the following picture:

chess-pawn

I would like to draw this picture using LaTeX (preferably PSTricks but TikZ is also fine).

The space between the two curves should be completely yellow.

P.S. I know that this is a "please do it for me" question (sorry for that!) but I really don't know how to draw this at all.

  • @CroCo Did you even read the question? He even explains himself. – Henri Menke Sep 11 '17 at 01:39
  • @CroCo And the OP is being picky about application and colouring. If you have no clue how to do it why would you care whether it is pstricks, MetaPost or picture? – cfr Sep 11 '17 at 01:39
  • @HenriMenke So if new users write that 'explanation', you won't vote to close their questions as duplicates of 'what packages are there ...?' – cfr Sep 11 '17 at 01:41
  • 1
    @cfr Sometimes you just get stuck and don't know where to start, see this question of mine. I agree that the phrasing could be improved though. – Henri Menke Sep 11 '17 at 01:42
  • 1
    @HenriMenke So why do you close all the newbies' questions? Only high rep users are allowed to get stuck? I think there is something to be said for being more tolerant of do-it-for-mes from new users than established users. But, apparently, you think the right to not have a clue has to be earned by accumulating points by having a clue what to do, which seems like catch-22 for beginners. – cfr Sep 11 '17 at 01:54
  • @cfr Because newbies have not contributed anything. Svend has 331 answers. – Henri Menke Sep 11 '17 at 02:01
  • @HenriMenke And they never will if you have your way. – cfr Sep 11 '17 at 02:04
  • @HenriMenke and yet in this post Wind Turbine drive train model in TikZ, you've written this comment Member for 5 years and no MWE? -1. I consider this as a double standard. – CroCo Sep 11 '17 at 02:07
  • @CroCo Go to account »Newest Answers (0)«... – Henri Menke Sep 11 '17 at 02:09
  • 1
    @cfr, when some people like posts, they will search for any excuses to not downvote or close a post, something like He even explains himself. :) – CroCo Sep 11 '17 at 02:11
  • @HenriMenke, why do I have to go there? Also, in your first comment, how did you know that I haven't read the question? Accusing me not read the question is some sort of searching for excuses. No need for this kind of double standard. Experienced users should provide some MWE. – CroCo Sep 11 '17 at 02:23

3 Answers3

4

Just for fun, with pstricks

I feel there ought to be (surely) an easier way of continuing an arc from the previous point, but I couldn't find it.

\documentclass[pstricks,border=5]{standalone}
\usepackage{pgffor}
\def\lstxy{!CP \csname tx@UserCoor\endcsname}
\newcommand\psrarcn[4][]{%
  \psarcn[#1](\lstxy exch #3 cos #2 mul sub exch #3 sin #2 mul sub){#2}{#3}{#4}
}
\begin{document}
\begin{pspicture}(-8,-1)(8,20)
\foreach \lnwd/\lncl in {30pt/black, 25pt/yellow}{
  \pscustom[linewidth=\lnwd,linecolor=\lncl,linejoin=1]{
    \psline(0,0)(!220 cos 5 mul 220 cos 2 mul add 0)
    \psrarcn{5}{220}{90}
    \psrarcn{3}{270}{90}
    \psrarcn{2}{225}{-45}
    \psrarcn{3}{90}{-90}
    \psrarcn{5}{90}{-40}
    \psline(\lstxy)(0,0)
}}
\end{pspicture}
\end{document}

enter image description here

Mark Wibrow
  • 70,437
3

I think this comes somewhat close.

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

\begin{tikzpicture}[yscale=3]
  \draw[double=yellow,double distance=2pt,line join=round,looseness=3]
  (0,0)
  -- (1,0)
  to[out=70,in=-10,looseness=1] (.5,.5)
  to[out=10,in=-10] (.25,.75)
  to[out=10,in=0] (0,1)
  to[out=180,in=170] (-.25,.75)
  to[out=190,in=170] (-.5,.5)
  to[out=190,in=120,looseness=1] (-1,0)
  -- cycle;
\end{tikzpicture}

\end{document}

enter image description here

Henri Menke
  • 109,596
3
\documentclass[pstricks,border=5]{standalone}

\usepackage{pstricks}
\def\fig#1#2{\pscustom[arrows=c-c,linewidth=#1,linecolor=#2,linejoin=1]{%
    \psline(-4.9,0)(4.9,0)
    \psarc(0,1){5}{-10}{73}
    \psarc(0,7.5){2.15}{-50}{70}
    \psarc(0,11){1.6}{-60}{240}
    \psarc(0,7.5){2.15}{110}{230}
    \psarc(0,1){5}{107}{190}}}
\begin{document}

\begin{pspicture}(-6,-1)(6,13)
\fig{6mm}{black}
\fig{5mm}{yellow}
\end{pspicture}
\end{document}

enter image description here