Take the 2-minute tour ×
TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. It's 100% free, no registration required.

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.

enter image description here

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

\qquad

\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.

enter image description here

\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}
share|improve this question
    
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
add comment

2 Answers

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}
\usepackage{pstricks-add}
\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} 

enter image description here

share|improve this answer
    
I am sorry. You might misunderstand my objective. The \pscustom is intentionally used to show the current point effect. –  I am who I say I am Aug 1 '12 at 20:55
    
I present my bounty to you because I am in hurry to offer another bounty. –  I am who I say I am Aug 5 '12 at 19:49
    
Thank you for the unexpected bounty! –  Peter Breitfeld Aug 5 '12 at 19:50
    
You are welcome. :-) –  I am who I say I am Aug 5 '12 at 19:51
add comment
up vote 0 down vote accepted

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.

And now the maintainers just leave it as is for historical reasons.

Correct me if my opinion is wrong.

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.

share|improve this answer
    
your answer is wrong! –  Herbert Apr 12 '13 at 6:00
1  
Which part of my reasoning, hypothesis, analysis is wrong? –  I am who I say I am Apr 12 '13 at 7:23
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.