PSTricks question (clipping and \textpath)

Denis Girou Denis.Girou at idris.fr
Wed Jun 18 23:11:45 CEST 1997


-----------------------------------------------------------------------------
This is the PSTricks mailing list, devoted to discussions about computational
graphics in (La)TeX using the PSTricks package from Timothy van Zandt.
For help using this mailing list, see instructions at the end of message.
-----------------------------------------------------------------------------

The following message is a courtesy copy of an article
that has been posted to comp.text.tex as well.

>>>>> "Jonas.Bofjall" == Jonas Bofjall <m9418 at abc.se> writes:

    Jonas.Bofjall> Is it at all possible to clip an \psbezier line using another \psbezier as
    Jonas.Bofjall> the clipping path? I tried something like:

    Jonas.Bofjall> \psclip{\psbezier{-}(0,1)(.3,1)(.7,.5)(1,.5)}{
    Jonas.Bofjall>   \psbezier{-}(1,1)(.7,1)(.3,.5)(0,.5)}
    Jonas.Bofjall> \endpsclip

    Jonas.Bofjall> but the result is that only the first line (the clipping path)
    Jonas.Bofjall> is displayed? Am I doing something wrong?

  Problem is related to positions of begin and end points for clipping.
Clipping occur for the region delimited by the curve and the line connecting
begin and end points. You can verify that there is nothing to clip in your
region... And it's a general problem not related to \psbezier, as you can
verify that it's occur too with \psline, for instance.

  A workaround is to add an invisible point to the clipping region.

\documentclass{article}

\usepackage{pstricks}

\begin{document}

\psset{unit=4}

\psbezier[showpoints=true](0,1)(.3,1)(.7,.5)(1,.5)
\psline[linecolor=red](0,1)(1,.5)
\psbezier[showpoints=true](1,1)(.7,1)(.3,.5)(0,.5)

\vspace{4cm}
\psbezier[showpoints=true](0,1)(.3,1)(.7,.5)(1,.5)
\psline[linecolor=green](1,.5)(1,1)
\psline[linecolor=red](0,1)(1,1)
\psbezier[showpoints=true](1,1)(.7,1)(.3,.5)(0,.5)

\vspace{4cm}
\psclip{\pscustom[linestyle=none]{%
          \psbezier(0,1)(.3,1)(.7,.5)(1,.5)
          \lineto(1,1)}}
\psbezier(1,1)(.7,1)(.3,.5)(0,.5)
\endpsclip

\vspace{4cm}
\psbezier(1,1)(.7,1)(.3,.5)(0,.5) % To see it
\psclip{\pscustom[linestyle=none]{%
         \psbezier(1,1)(.7,1)(.3,.5)(0,.5)
          \lineto(0,1)}}
\psbezier(0,1)(.3,1)(.7,.5)(1,.5)
\endpsclip

\end{document}

    Jonas.Bofjall> By the way, is there something like \textpath which works on graphics
    Jonas.Bofjall> objects? One that could make a zig-zaged sinewave?

  \textpath work only for few graphic objects, but is not restricted to
\pscurve only. As it's work too with \psplot, you have a lot of possibilities.
Here is an example with a sinus:

\documentclass{article}

\usepackage{pstricks}
\usepackage{pst-text}
\usepackage{pst-plot}

\begin{document}

\pstextpath{\psplot[plotpoints=300,xunit=0.015,yunit=3]{0}{540}{x sin}}
           {\LARGE This text follow exactly the sinusoidal curve...}

\end{document}


Denis Girou
-- 

---------------------------------------------------------------------------
Institut du De'veloppement et des Ressources en Informatique Scientifique |
Centre National de la Recherche Scientifique                              |
Ba^timent 506 - B.P. 167 - 91403 Orsay Cedex - France                     |
Tel. : 01.69.35.85.75 (33.1.69.35.85.75 from foreign countries)           |
Messagerie : Denis.Girou at idris.fr                                         |
---------------------------------------------------------------------------

-----------------------------------------------------------------------------
To [un]subscribe to this list, send mail to pstricks-request at mail.tug.org
Leave the subject line blank and in the body put the line
[un]subscribe <email-address>
For help, put the word "help" in the message body.
To obtain current archive, put the words "get current" in the message body.
-----------------------------------------------------------------------------



More information about the PSTricks mailing list