4

if I combine \psline and \pscurve to create an object and put it into \pscustom, the object gets deformed. To me it looks like the bezier curve gets some additional boundary conditions due to closing the paths, but I might be completly mistaken there.

This example is part of a bigger scetch (therefore the maybe strange numbers), I tried to scetch a concave lense:

 \begin{pspicture}(.2,1)
    \pscustom[fillstyle=solid, fillcolor=lightgray, linestyle=dashed]{
        \psline(2.9,2.15)(3.1,2.15)
        \pscurve(3.1,2.15)(3.03,1.65)(3.1,1.15)
        \psline(3.1,1.15)(2.9,1.15)
        \pscurve(2.9,1.15)(2.97,1.65)(2.9,2.15)}

    \psline(2.9,2.15)(3.1,2.15)
    \pscurve(3.1,2.15)(3.03,1.65)(3.1,1.15)
    \psline(3.1,1.15)(2.9,1.15)
    \pscurve(2.9,1.15)(2.97,1.65)(2.9,2.15)
 \end{pspicture}

Doubling and linestyle=dashed ofc just for demonstration. Is there anyway to fill the object like I get outside \pscustom?

example output

1 Answer 1

5

\pscustom creates a closed path. It uses the last point of a line/curve also for the next line/curve. This is the reason why you need only 2 points for a curve which follows a line or another curve and only one point for a line. The first point is always the last point from the preceding macro:

\documentclass[a4paper,12pt]{article}
\usepackage{pstricks}
\begin{document}

\psset{unit=10}
 \begin{pspicture}(2.5,1)(4,3)
 \pscustom[fillstyle=solid, fillcolor=lightgray, linestyle=dashed]{
    \psline(2.9,2.15)(3.1,2.15)
    \pscurve(3.03,1.65)(3.1,1.15)
    \psline(2.9,1.15)
    \pscurve(2.97,1.65)(2.9,2.15)}

 \psline(2.9,2.15)(3.1,2.15)
 \pscurve(3.1,2.15)(3.03,1.65)(3.1,1.15)
 \psline(3.1,1.15)(2.9,1.15)
 \pscurve(2.9,1.15)(2.97,1.65)(2.9,2.15)
 \end{pspicture}

\end{document}

enter image description here

Using \psline(0,0)(1,1)\pscurve(1,1)(3,1)(4,2) insinde \pscustom is drawn as \pscurve(1,1)(1,1)(3,1)(4,2) which is different to \pscurve(1,1)(3,1)(4,2)

0

You must log in to answer this question.

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