[pstricks] buildcycle in pstricks?

Herbert Voss Herbert.Voss at alumni.TU-Berlin.DE
Tue Feb 22 20:46:50 CET 2005


Jean Magnan de Bornier wrote:

> Pstricks fills several triangles, defined by the intersections and the 
> ends of the lines. How can I restrict the filling to the one triangle 
> defined by the intersections?

Write a new macro

Herbert


\listfiles
\documentclass{article}
\usepackage{pstricks}
\usepackage{pst-3dplot}
\makeatletter
\def\pstriangleA{\pst at object{pstriangleA}}
\def\pstriangleA at i(#1)(#2)(#3)(#4)(#5)(#6){{%
   \use at par
   \psline(#1)(#2)\psline(#3)(#4)\psline(#5)(#6)
   \ABinterCD(#1)(#2)(#3)(#4){A}
   \ABinterCD(#1)(#2)(#5)(#6){B}
   \ABinterCD(#5)(#6)(#3)(#4){C}
   \pspolygon(A)(B)(C)
}}
\makeatother

\begin{document}

\begin{pspicture}(7,7)
   \psaxes[Ox=0.8,Dx=5,Oy=0,Dy=5]{<->}(1,1)(6,6)
   \pstriangleA[fillstyle=solid,fillcolor=red]%
      (1.98,2.38)(1.98,5)(1.98,3.8)(-1,3.8)(1,4)(4,0.8)
\end{pspicture}

\end{document}


-- 
http://TeXnik.de/
http://PSTricks.de/
ftp://ftp.dante.de/tex-archive/info/math/voss/Voss-Mathmode.pdf
http://www.dante.de/faq/de-tex-faq/
http://www.tex.ac.uk/cgi-bin/texfaq2html?introduction=yes




More information about the PSTricks mailing list