summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/tex/generic/pst-perspective/pst-perspective.tex
blob: 70477a811888b0ae6f7d4d24432c1bb2a635da87 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
%% COPYRIGHT 2014 by Thomas Soell
%
% This work may be distributed and/or modified under the
% conditions of the LaTeX Project Public License, either version 1.3
% of this license or (at your option) any later version.
% The latest version of this license is in
%   http://www.latex-project.org/lppl.txt
% and version 1.3 or later is part of all distributions of LaTeX
% version 2003/12/01 or later.
%
% This work consists of the file pstricks.tex, PostScript macros
% for Generic TeX.
% See the PSTricks User's Guide for description.
%
\csname PSTperspectiveLoaded\endcsname
\let\PSTperspectiveLoaded\endinput
%\ifx\PSTEuclideLoaded\endinput \else\input pst-eucl     \fi
%\ifx\PSTricksAddLoaded\endinput\else\input pstricks-add \fi
%
\def\fileversion{0.01}
\def\filedate{2014/02/21}
\message{ v\fileversion, \filedate (ts)}
\message{ v\fileversion, \filedate}
\edef\TheAtCode{\the\catcode`\@}
\catcode`\@=11
\pst@addfams{pst-perspective}
\define@boolkey[psset]{pst-perspective}[Pst@]{translineA}[false]{} % showtransline
\define@boolkey[psset]{pst-perspective}[Pst@]{translineB}[false]{} % showtransline
\define@boolkey[psset]{pst-perspective}[Pst@]{translineK}[true]{} % show transline
\define@boolkey[psset]{pst-perspective}[Pst@]{LowPoint}[false]{} % Basis durch z.B. tief liegenden Pkt
\define@boolkey[psset]{pst-perspective}[Pst@]{symX}[true]{} % Symmetrieachse bei spiegelverkehrten Bildern
\define@key[psset]{pst-perspective}{transcolor}[blue]{\def\psk@transTS@transcolor{#1}}
\define@key[psset]{pst-perspective}{transAcolor}[green]{\def\psk@transTS@transAcolor{#1}}
\define@key[psset]{pst-perspective}{transBcolor}[blue]{\def\psk@transTS@transBcolor{#1}}
\define@key[psset]{pst-perspective}{translinestyle}[solid]{\def\psk@transTS@translinestyle{#1}}
\define@key[psset]{pst-perspective}{transAlinestyle}[dashed]{\def\psk@transTS@transAlinestyle{#1}}
\define@key[psset]{pst-perspective}{transBlinestyle}[dashed]{\def\psk@transTS@transBlinestyle{#1}}
\define@key[psset]{pst-perspective}{translinewidth}[0.8pt]{\def\psk@transTS@translinewidth{#1}}
\define@key[psset]{pst-perspective}{transAlinewidth}[0.7pt]{\def\psk@transTS@transAlinewidth{#1}}
\define@key[psset]{pst-perspective}{transBlinewidth}[0.7pt]{\def\psk@transTS@transBlinewidth{#1}}
\define@key[psset]{pst-perspective}{LowP}[{0|0}]{\def\psk@transTS@LowP{#1 }}
\define@key[psset]{pst-perspective}{originT}[{0|0}]{\def\psk@transTS@originT{#1 }}
\define@key[psset]{pst-perspective}{base}[0]{\def\psk@transTS@base{#1 }} % y-Wert der Basis f\"{u}r die Transformation
\define@key[psset]{pst-perspective}{symline}[0]{\def\psk@transTS@symline{#1 }} % Symmetrieachse
\define@key[psset]{pst-perspective}{phi}[45]{\def\psk@transTS@phi{#1 }}% Winkel f\"{u}r das Schr\"{a}gbild
\define@key[psset]{pst-perspective}{deltaphi}[0]{\def\psk@transTS@deltaphi{#1 }}% zus\"{a}tzlicher Winkel f\"{u}r das Schr\"{a}gbild
\define@key[psset]{pst-perspective}{vkf}[0.5]{\def\psk@transTS@vkf{#1 }} % Verk\"{u}rzungsfaktor
\psset[pst-perspective]{phi=45,vkf=0.5,base=0,translineA=false,translineB=false,transAcolor=green,transBcolor=blue,%
transAlinewidth=0.7pt,transBlinewidth=0.7pt,transAlinestyle=dashed,transBlinestyle=dashed,deltaphi=0,symline=0,symX=true,%
translineK=true,transcolor=blue,translinewidth=0.8pt,translinestyle=solid,LowPoint=false,LowP={0,0},originT={0,0}}%
\SpecialCoor%
\def\ba{\psk@transTS@base}
\def\pstransTS{\pst@object{pstpstransTS}}%
%
\def\pstpstransTS@i(#1)#2#3{%
\begingroup%
% (#1) Punkt 1
% #2 Node-Name des Startpunktes % #3 Node-Name des transformierten Punktes
\pst@killglue
\use@par
\rput(\psk@transTS@originT){\pnode(#1){#2}}%
\pst@getcoor{#1}\pst@tempA%
\pst@getcoor{\psk@transTS@LowP}\pst@tempB
\rput(\psk@transTS@originT){\pnode(! %
\pst@tempA \tx@UserCoor /y1 ED /x1 ED
\ifPst@LowPoint
\pst@tempB \tx@UserCoor /y2 ED /x2 ED
\else
/y2 \psk@transTS@base def \fi
/lang y2 y1 sub abs \psk@transTS@vkf mul def
/lang2 y2 y1 sub def
lang2 0 ge {/alph2 \psk@transTS@phi \psk@transTS@deltaphi add 180 sub def} {/alph2 \psk@transTS@phi \psk@transTS@deltaphi add def} ifelse
lang alph2 PtoC exch x1 add exch y2 add){#3}
\ifPst@translineA
\ifPst@LowPoint
\pcline[linecolor=\psk@transTS@transAcolor,linestyle=\psk@transTS@transAlinestyle,linewidth=\psk@transTS@transAlinewidth](! \pst@tempA \tx@UserCoor pop \pst@tempB \tx@UserCoor exch pop)(#2)
\else
\pcline[linecolor=\psk@transTS@transAcolor,linestyle=\psk@transTS@transAlinestyle,linewidth=\psk@transTS@transAlinewidth](! \pst@tempA \tx@UserCoor pop \psk@transTS@base)(#2)
\fi
\else \fi%
\ifPst@translineB
\ifPst@LowPoint
\pcline[linecolor=\psk@transTS@transBcolor,linestyle=\psk@transTS@transBlinestyle,linewidth=\psk@transTS@transBlinewidth](! \pst@tempA \tx@UserCoor pop \pst@tempB \tx@UserCoor exch pop)(#3)
\else
\pcline[linecolor=\psk@transTS@transBcolor,linestyle=\psk@transTS@transBlinestyle,linewidth=\psk@transTS@transBlinewidth](! \pst@tempA \tx@UserCoor pop \psk@transTS@base)(#3)
\fi
\else \fi%
}%
\endgroup
\ignorespaces
}
\def\pstransTSX{\pst@object{pstpstransTSX}}%
%
\def\pstpstransTSX@i(#1)#2#3{%
\begingroup%
% (#1) Punkt 1
% #2 Node-Name des Startpunktes % #3 Node-Name des transformierten Punktes
\pst@killglue
\use@par
\rput(\psk@transTS@originT){\pnode(#1){#2}}%
\pst@getcoor{#1}\pst@tempA%
\pst@getcoor{\psk@transTS@LowP}\pst@tempB
\rput(\psk@transTS@originT){\pnode(! %
\pst@tempA \tx@UserCoor /y1 ED /x1 ED
\ifPst@LowPoint
\pst@tempB \tx@UserCoor /y2 ED /x2 ED
\else
/x2 \psk@transTS@base def \fi
/x3 \psk@transTS@symline def
\ifPst@symX
/lang x2 x1 sub x1 x3 sub 2 mul add abs \psk@transTS@vkf mul def
\else
/lang x2 x1 sub abs \psk@transTS@vkf mul def \fi
/lang2 x2 x1 sub def
x2 x1 ge {/alph2 \psk@transTS@phi \psk@transTS@deltaphi add def} {/alph2 \psk@transTS@phi \psk@transTS@deltaphi add 180 sub def} ifelse
lang alph2 PtoC exch x2 add exch y1 add){#3}
\ifPst@translineA
\ifPst@LowPoint
\pcline[linecolor=\psk@transTS@transAcolor,linestyle=\psk@transTS@transAlinestyle,linewidth=\psk@transTS@transAlinewidth](! \pst@tempB \tx@UserCoor pop \pst@tempA \tx@UserCoor exch pop)(#2)
\else
\pcline[linecolor=\psk@transTS@transAcolor,linestyle=\psk@transTS@transAlinestyle,linewidth=\psk@transTS@transAlinewidth](! \psk@transTS@base \pst@tempA \tx@UserCoor exch pop)(#2)
\fi
\else \fi%
\ifPst@translineB
\ifPst@LowPoint
\pcline[linecolor=\psk@transTS@transBcolor,linestyle=\psk@transTS@transBlinestyle,linewidth=\psk@transTS@transBlinewidth](! \pst@tempB \tx@UserCoor pop \pst@tempA \tx@UserCoor exch pop)(#3)
\else
\pcline[linecolor=\psk@transTS@transBcolor,linestyle=\psk@transTS@transBlinestyle,linewidth=\psk@transTS@transBlinewidth](! \psk@transTS@base \pst@tempA \tx@UserCoor exch pop )(#3)
\fi
\else \fi%
}%
\endgroup
\ignorespaces
}
%------------------------------------------------------------------
\def\pstransTSK{\pst@object{pstpstransTSK}}%
\def\pstpstransTSK@i(#1)#2#3#4{%
\begingroup%
% (#1) Koordinaten des Punktes (kartesisch oder Polarkoordinaten)
%  #2  Originall\"{a}nge #3  Node-Name des Startpunktes %  #4   Node-Name des transformierten Punktes
\pst@killglue
\use@par
\rput(#1){\pnode(0,0){#3}}
\rput(#1){\pnode(! %
/l1 #2 def
/l2 l1 \psk@transTS@vkf mul def
l2 \psk@transTS@phi PtoC){#4}}
\ifPst@translineK
\pcline[linecolor=\psk@transTS@transcolor,linestyle=\psk@transTS@translinestyle,linewidth=\psk@transTS@translinewidth](#3)(#4)
\else \fi%
\endgroup
\ignorespaces
}
\catcode`\@=\TheAtCode\relax
\endinput
%%
%% END pst-perspective.tex