1

I want to draw a symmetric object made of a large number of points. To make the code cleaner, I want to use reflection technique. It means I just specify points on one side of the symmetrical axis, the points on the other side will be obtained by reflecting the specified points.

Finally I want to concatenate those parts in \pscustom and do other operations such as filling or stroking.

The following code snippet is just a simple example that has been trimmed off for the sake of simplicity, but it failed to produce the required symmetric object.

\documentclass{article}

\usepackage{pstricks-add}

\usepackage[active,tightpage]{preview}
\PreviewEnvironment{pspicture}
\PreviewBorder=10pt\relax

\begin{document}
\begin{pspicture}[showgrid](-3,-3)(3,3)
    \def\left{\psline(0,2)(2,0)(0,-2)}%
    \pscustom[
        fillstyle=solid,
        fillcolor=yellow,
        linecolor=red
    ]{
        \left
        \psscalebox{-1 1}{\left}
    }
\end{pspicture}
\end{document}

How to concatenate a set of paths and a set of the reflected paths about a certain axis in a single \pscustom?

Note: I also want to get the corners on which the part and its reflected part meet properly glued as usual.

1 Answer 1

1
\documentclass{article}
\usepackage{pstricks}

\begin{document}
\begin{pspicture}[showgrid](-3,-3)(3,3)
\pscustom[fillstyle=solid,
          fillcolor=yellow,
          linecolor=red]{%
  \psline(0,2)(2,0)(0,-2)
  \code{ -1 1 scale }\moveto(0,2)
  \psline(0,2)(2,0)(0,-2)}
\end{pspicture}

\end{document}
3
  • I still don't understand why the top and bottom points look jagged. \pscustom should make the corners nice as usual. I give up! Mar 13, 2012 at 7:27
  • 1
    for the top use linejoin=1 the bottom is a problem, because the path is not really a closed one.
    – user2478
    Mar 13, 2012 at 9:48
  • no, it is a very special case that you want to mirror a path and then filling it. It already works correct for a default path setting.
    – user2478
    Mar 13, 2012 at 12:29

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .