[Tex/LaTex] How to draw oval with FeynMP

feynmf

Is it possible to draw oval shape with FeynMP? Here is a mwe for a blob [which is a a circle]:

\documentclass[10pt,a4paper]{article}
\usepackage[latin1]{inputenc}
\usepackage{amsmath}
\usepackage{amsfonts}
\usepackage{amssymb}
\usepackage{feynmp}
\usepackage{rotating}
\setlength{\unitlength}{1mm}
\pagestyle{empty}

\usepackage{ifpdf}
\ifpdf
  \DeclareGraphicsRule{*}{mps}{*}{}
\fi

\makeatletter
\def\endfmffile{%
  \fmfcmd{\p@rcent\space the end.^^J%
          end.^^J%
          endinput;}%
  \if@fmfio
    \immediate\closeout\@outfmf
  \fi
  \IfFileExists{\thefmffile.mp}{\immediate\write18{mpost \thefmffile}}{}
  \let\thefmffile\relax
}
\makeatother

\begin{document}
\begin{center}
\begin{fmffile}{lower_bloba}
    \begin{fmfgraph*}(50,70)
    \fmfrightn{r}{1}
    \fmfleftn{l}{1}
    \fmftopn{t}{1}
        \fmfblob{.5w}{v1}
        \fmf{fermion}{l1,v1}
        \fmf{fermion}{v1,r1}
        \fmf{photon}{t1,v1}
\end{fmfgraph*}
\end{fmffile}
\end{center} 
\end{document}

Best Answer

I don't think it's possible without modifying the FeynMP sources, or at least I don't know how.

But you can modify the sources of feynmp.sty and feynmp.mp to do what you want. Make sure you put feynmp.sty and feynmp.mp in the same directory where you compile your latex file and do the following. (Edit: see below for an even simpler patch to feynmp.mp)

On the file feynmp.mp:1325 (line 1325) there is the definition of vblob(). Based on it I created another procedure called vblobOval() right below it:

vardef vblobOval (expr bd) (text vl)=
  forsuffixes $=vl:
    if not vexists $: venter $; fi
    vlist[vlookup $]decor.shape := fullcircle xscaled 1.4;
    vlist[vlookup $]decor.size := bd;
    vlist[vlookup $]decor.sty := "shaded";
 endfor
enddef;

where the only difference is the xscaled 1.4 part, which makes the circle oval (you can play with the number; 1.4 seemed nice to me).

On the file feynmp.sty:289 there is the definition of \fmfblob. Based on it I wrote \fmfblobOval

\def\fmfblobOval#1#2{\fmfcmd{vblobOval ((#1), \fmfpfx{#2});}}

below the original \fmfblob, so you still have both.

And now on your latex file instead of using \fmfblob you can use \fmfblobOval,

\fmfblobOval{.5w}{v1}

and you'll have an oval-shaped vertex:

oval-shaped vertex with xscale 1.4

Edit: One can write a one-line patch to feynmp.mp to include an oval style for blobs. If you write

elseif match_prefix (n, "oval"): p := fullcircle xscaled 1.4;

below line 1282 in feynmp.mp you can use the following line to draw an oval-shaped blob in your latex file:

\fmfv{decor.shape=oval, decor.filled=shaded, decor.size=(.5w)}{v1}

The command \fmfv is an equivalent way of drawing a blob (see pag. 17 of the FeynMF manual) which allows one to specify the options explicitly. So you can use the new "oval" shape from the one-line patch above.