zauguin / luapstricks

8 stars 0 forks source link

Support for linejoin and linecap #2

Closed pablgonz closed 3 years ago

pablgonz commented 3 years ago

I'm testing the basic drawing elements of pstricks, one of the usual things is to use the parameters linejoin and linecap, the following image shows the output:

salida-1

which I obtain with the following file using latex>dvips>ps2pdf:

% arara: latex
% arara: dvips
% arara: ps2pdf: { options : [ -dALLOWPSTRANSPARENCY ] }
% arara: clean: { extensions : [ aux, log, ps, dvi ] }
\documentclass{article}
\usepackage{luapstricks}
\pagestyle{empty}
\begin{document}
% adapted from visualpstricks
\section*{linejoin and linecap}
\psset{linecolor=blue,linewidth=2pt}
\begin{tabular}{|c|c|c|}
\hline
\multicolumn{3}{|c|}{\textbackslash{}psline[\textcolor{red}{linecap}=0,linewidth=10pt](2,0.5)(2,2.5) } \\
\hline
 \begin{pspicture}(4,3)
   \psline[linecap=0,linewidth=10pt](2,.5)(2,2.5)
   \psline[linecolor=red,linewidth=1pt](2,.5)(2,2.5)
 \end{pspicture}
 &
 \begin{pspicture}(4,3)
   \psline[linecap=1,linewidth=10pt] (2,.5)(2,2.5)
   \psline[linecolor=red,linewidth=1pt](2,.5)(2,2.5)
 \end{pspicture}
 &
 \begin{pspicture}(4,3)
   \psline[linecap=2,linewidth=10pt](2,.5)(2,2.5)
   \psline[linecolor=red,linewidth=1pt](2,.5)(2,2.5)
 \end{pspicture} \\
\hline linecap=0 & linecap=1 & linecap=2 \\
\hline \hline
\multicolumn{3}{|c|}{\textbackslash{}pstriangle[\textcolor{red}{linejoin}=0,linewidth=10pt] (2,0.5)(2,2) } \\
\hline
 \begin{pspicture}(4,3)
   \pstriangle[linejoin=0,linewidth=10pt] (2,.5)(2,2)
   \pstriangle[linecolor=red,linewidth=1pt] (2,.5)(2,2)
 \end{pspicture}
 &
 \begin{pspicture}(4,3)
   \pstriangle[linejoin=1,linewidth=10pt] (2,.5)(2,2)
   \pstriangle[linecolor=red,linewidth=1pt] (2,.5)(2,2)
 \end{pspicture}
 &
 \begin{pspicture}(4,3)
   \pstriangle[linejoin=2,linewidth=10pt] (2,.5)(2,2)
   \pstriangle[linecolor=red,linewidth=1pt] (2,.5)(2,2)
 \end{pspicture} \\
\hline linejoin=0 & linejoin=1 & linejoin=2 \\
\hline
\end{tabular}
\end{document}

when using lualatex the output is:

salida-lua-1

Can this be implemented?

Saludos

PS: I have one more issue left :D in a series of three to make a report, overall this works flawlessly (and fast), the next one I think will be a bit more complex (involves font more less).

zauguin commented 3 years ago

Can this be implemented?

It already was, it was just buggy: If you would have set linecap in your linejoin example it would have worked... :stuck_out_tongue: (Due to a typo both linejoin and linecap set the linejoin and pstricks always sets the linejoin before the linecap, so the linecap (which gets interpreted as linejoin) overwrites the actual linejoin.)

Anyway, the new version fixes this.

zauguin commented 3 years ago

overall this works flawlessly (and fast)

:star_struck:

(involves font more less)

Oh no, I'm afraid already.

pablgonz commented 3 years ago

You really are very fast hehehe