# Why don't \pscircle and \psellipse lift the pen before drawing their shapes?

I have tested all PSTricks closed curves:

• \psframe
• \psccurve
• \pspolygon
• \pswedge
• \psellipticwedge
• \pscircle
• \psellipse

and I noticed that only \pscircle and \psellipse do not lift the pen (or liftpen=2) before drawing their shapes.

\documentclass[border=12pt]{standalone}
\usepackage{pstricks}

\psset
{
fillstyle=solid,
fillcolor=cyan,
linewidth=2pt,
linecolor=red,
}

\everypsbox{\color{red}\bfseries\LARGE}
\begin{document}

\begin{pspicture}[showgrid](-4,-5)(4,7)
\pscustom
{
\psframe(-3,4)(3,5)
\psccurve(-3,2)(-1,2)(-1,3)(-1.5,2.5)
\pspolygon(1,2)(3,2)(2,3)
\pswedge(-2,0){1}{0}{270}
\psellipticwedge(2,0)(1,0.5){0}{270}
\pscircle(-2,-3){1}
\psellipse(2,-3)(1,0.5)
}
\rput(0,6.5){Default Behavior}
\end{pspicture}

\begin{pspicture}[showgrid](-4,-5)(4,7)
\pscustom
{
\psframe(-3,4)(3,5)
\psccurve(-3,2)(-1,2)(-1,3)(-1.5,2.5)
\pspolygon(1,2)(3,2)(2,3)
\pswedge(-2,0){1}{0}{270}
\psellipticwedge(2,0)(1,0.5){0}{270}
\moveto(-1,-3)
\pscircle(-2,-3){1}
\moveto(3,-3)
\psellipse(2,-3)(1,0.5)
}
\rput(0,6.5){With \textbackslash moveto()}
\end{pspicture}

\end{document}


Is it a feature by design or a bug?

NOTE:

I intentionally put all objects inside \pscustom to show the current point effect. I am not talking about how to draw a solid rectangle, a solid polygon, a solid wedge, a solid elliptical wedge, a solid circle, and a solid ellipse.

Responding Herbert's comment "it is totally nonsense to use a closed curve inside \pscustom which itself creates a closed path", I show an example where closed curves are sometimes needed inside \pscustom to make a transparent hole. The following edit is necessary to show more complicated scenario rather than just a single simple ring.

\documentclass[pstricks,border=12pt]{standalone}
\usepackage{pstricks}

\begin{document}
\begin{pspicture}[showgrid](4,4)
\pscustom[fillstyle=eofill,fillcolor=red]
{
\pscircle(2,2){2}
\moveto(3.75,2.25)
\pscircle(2.75,2.25){1}
\moveto(1.25,2.5)
\pscircle(0.75,2.5){0.5}
\moveto(2,1)
\pscircle(1.5,1){0.5}
}
\end{pspicture}
\end{document}

-
You can add \pspolygon(-4,-4)(-4,3)(4,3)(4,-4) to show why \pscustom is useful (I don't know how to reverse \psframe)... –  Paul Gaborit Aug 2 '12 at 6:41

I think, \pscustom is the culprit. It wants to draw closed paths. You will get a correct picture if you use \psset instead. Because you use absolute coordinates, there is no need for \moveto.

\documentclass{article}
\usepackage{auto-pst-pdf}
\begin{document}
\begin{pspicture}[showgrid](-4,-4)(4,3)
\psset{fillstyle=solid,fillcolor=cyan}
\psframe(-3,1)(0,2)
\pspolygon(1,1)(3,1)(2,2)
\pswedge(0,0){1}{30}{60}
\pscircle(-2,-2){1}
\psellipse(2,-2)(1,0.5)
\end{pspicture}

\end{document}


-
I am sorry. You might misunderstand my objective. The \pscustom is intentionally used to show the current point effect. –  Stiff Jokes Aug 1 '12 at 20:55
I present my bounty to you because I am in hurry to offer another bounty. –  Stiff Jokes Aug 5 '12 at 19:49
Thank you for the unexpected bounty! –  Peter Breitfeld Aug 5 '12 at 19:50
You are welcome. :-) –  Stiff Jokes Aug 5 '12 at 19:51
Most likely the author forgot to move the current point to the starting point of the circle/ellipses. I mean he forgot to call \moveto(xCenter+radius,yCenter) before drawing the circle/ellipse with the PostScript's arc function.
If my assumption above is wrong then the complement of it should be correct. In other words, \moveto (to move the current point) is accidentally invoked in \psframe, psccurve, \pspolygon, \pswedge and \psellipticwedge before they start constructing their paths.