3
\documentclass[border=15pt,pstricks,12pt]{standalone}
\usepackage{pstricks-add}
\begin{document}
\begin{pspicture}[showgrid](-3,-3)(3,3)
\psframe[dimen=m](-3,-3)(3,3)
%%%
\psclip{\parabola(3,3)(0,0)}%
\psrotate(0,0){-90}{\parabola[fillstyle=hlines](3,3)(0,0)}
\psrotate(0,0){90}{\parabola[fillstyle=hlines](3,3)(0,0)}
\endpsclip
\psclip{\parabola(-3,-3)(0,0)}%
\psrotate(0,0){-90}{\parabola[fillstyle=hlines](3,3)(0,0)}
\psrotate(0,0){90}{\parabola[fillstyle=hlines](3,3)(0,0)}%%
\endpsclip%%
\end{pspicture}
\end{document}

enter image description here

Hmm, seem %% and %% are missing!

1
  • 1
    Yes, you need % at the end of every \psrotate line.
    – egreg
    Commented May 11, 2019 at 16:27

3 Answers 3

4

\psrotate is for more complex objects, not for simple rotations around the origin:

\documentclass[border=15pt,pstricks,12pt]{standalone}
\usepackage{pstricks-add}
\begin{document}
\begin{pspicture}[showgrid](-3,-3)(3,3)
    \psframe[dimen=m](-3,-3)(3,3)
    %%%
    \psclip{\parabola(3,3)(0,0)}%
    \rput{-90}(0,0){\parabola[fillstyle=hlines](3,3)(0,0)}
    \rput{90}(0,0){\parabola[fillstyle=hlines](3,3)(0,0)}
    \endpsclip
    \psclip{\parabola(-3,-3)(0,0)}%
    \rput{-90}(0,0){\parabola[fillstyle=hlines](3,3)(0,0)}
    \rput{90}(0,0){\parabola[fillstyle=hlines](3,3)(0,0)}
    \endpsclip
\end{pspicture}
\end{document}

or a shorter version

\documentclass[border=15pt,pstricks,12pt]{standalone}
\usepackage{pstricks-add}
\def\Object{\psclip{\parabola(3,3)(0,0)}%
    \rput{-90}(0,0){\parabola[fillstyle=hlines](3,3)(0,0)}
    \rput{90}(0,0){\parabola[fillstyle=hlines](3,3)(0,0)}
    \endpsclip}
\begin{document}

\begin{pspicture}[showgrid](-3,-3)(3,3)
\psframe[dimen=m](-3,-3)(3,3)
\Object\rput{180}(0,0){\Object}
\end{pspicture}
\end{document}

or without clipping:

\pscustom[fillstyle=hlines]{%
    \psplot{-3}{3}{-x^2/3}
    \psplot{3}{0}{-sqrt(3*x)}\psplot{0}{3}{sqrt(3*x)}
    \psplot{3}{-3}{x^2/3}
    \psplot{-3}{0}{sqrt(3*(-x))}\psplot{0}{-3}{-sqrt(3*(-x))}
}

or

\pscustom[fillstyle=hlines]{%
    \psplot{-3}{3}{-x^2/3}
    \psparametricplot{-3}{3}{t^2/3 | t}
    \psplot{3}{-3}{x^2/3}
    \psparametricplot{3}{-3}{-t^2/3 | t}
}
1
  • Yes, I understood.
    – user173875
    Commented May 11, 2019 at 17:09
3

It's simpler to plot with swapaxes:

\documentclass[border=15pt, pstricks, svgnames, 12pt]{standalone}
\usepackage{pstricks-add}

\begin{document}

\begin{pspicture}[showgrid](-3,-3)(3,3)
\psframe[dimen=m](-3,-3)(3,3)
%%%
\psset{linecolor=LightSlateGrey, hatchwidth=0.5pt, hatchsep=3pt, hatchcolor=LightSteelBlue}
\psclip{\parabola[](3, 3)(0, 0)}%
     \psset{swapaxes=true, fillstyle=vlines}
     \parabola(3,3)(0,0)
     \parabola(3,-3)(0,0)
\endpsclip
     %
\psclip{\parabola(-3, -3)(0, 0)}%
         \psset{swapaxes=true, fillstyle=vlines}
         \parabola(3,3)(0,0)
         \parabola(3,-3)(0,0)
\endpsclip
\end{pspicture}

\end{document} 

enter image description here

1
  • Yes, swapaxes ... I will think about it.
    – user173875
    Commented May 12, 2019 at 1:15
3

Just for fun: a TikZ version.

\documentclass[tikz,border=3.14mm]{standalone}
\usetikzlibrary{patterns}
\begin{document}
\begin{tikzpicture}
 \begin{scope}[every path/.append style={pattern=north west lines}]
  \draw (0,0) parabola (3,3)[rotate=90] parabola[bend pos=1] (0,6);
  \draw (0,0) parabola (-3,-3)[rotate=90] parabola[bend pos=1] (0,-6);
  \draw (0,0) parabola (-3,3)[rotate=-90] parabola[bend pos=1] (0,6);
  \draw (0,0) parabola (3,-3)[rotate=-90] parabola[bend pos=1] (0,-6);
 \end{scope}
 \draw (-3,-3) rectangle (3,3);
\end{tikzpicture}
\end{document}

enter image description here

One can do it in one path, too, but then the rotations and shifts start to accumulate.

\documentclass[tikz,border=3.14mm]{standalone}
\usetikzlibrary{patterns}
\begin{document}
\begin{tikzpicture}
  \draw[pattern=north west lines] (0,0) coordinate (O) parabola (3,3)
  [rotate=90] parabola[bend pos=1] (0,6) [rotate=0]
  parabola (-3,3) [rotate=90] parabola[bend pos=1] (O) [rotate=0]
  parabola (3,3) [rotate=-90] parabola[bend pos=1] (6,0) [rotate=0]
  parabola (9,3)[rotate=-90] parabola[bend pos=1] (12,0);
 \draw (-3,-3) rectangle (3,3);
\end{tikzpicture}
\end{document}
1
  • Thank for your answer.
    – user173875
    Commented May 11, 2019 at 17:04

You must log in to answer this question.