summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/tex/generic/pst-cox/pst-coxcoor.tex
blob: 1cb59e7d97879f2bf005d0bff4e269e46f24e946 (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
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%    polygonesCoordinate\pst-coxcoor.tex
%    Authors:      J.-G. Luque and M. Luque
%    Purpose:      Library pst-coxcoor.tex
%    Created:      02/02/2008
%    License:      LGPL
%    Project:      PST-Cox V1.00
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% Copyright © 2008 Jean-Gabriel Luque, Manuel Luque.
% This work may be distributed and/or modified  under the condition of
% the Lesser GPL.
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% This file is part of PST-Cox V1.00.
%
%    PST-Cox V1.00 is free software: you can redistribute it and/or modify
%    it under the terms of the Lesser GNU General Public License as published by
%    the Free Software Foundation, either version 3 of the License, or
%    (at your option) any later version.
%
%    PST-Cox V1.00 is distributed in the hope that it will be useful,
%    but WITHOUT ANY WARRANTY; without even the implied warranty of
%    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
%    Lesser GNU General Public License for more details.
%
%    You should have received a copy of the Lesser GNU General Public License
%    along with PST-Cox V1.00.  If not, see <http://www.gnu.org/licenses/>.
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\def\fileversion{0.98 Beta}
\def\filedate{2008/14/01}

\message{`Pst-Coxeter-Coordinates' v\fileversion, \filedate\space
(Jean-Gabriel Luque and Manuel Luque)}

\csname PstCoxeterCoordinatesLoaded\endcsname
\let\PstCoxeterCoordinatesLoaded\endinput
% Require PSTricks and pst-xkey
\ifx\PSTnodeLoaded\endinput\else\input pstricks.tex\fi
\ifx\PSTXKeyLoaded\endinput\else\input pst-xkey.tex\fi
%
% Catcodes changes.
\edef\PstAtCode{\the\catcode`\@}
\catcode`\@=11\relax

\pst@addfams{pst-coxeter}
 %%% Parameter choice. Allows to choice the polytope. To each integer
 %%% 0<i<74 corresponds a polytope.
\define@key[psset]{pst-coxeter}{choice}{%
\pst@cntg=#1\relax \ifnum\pst@cntg>80 \typeout{choice < or = 80 and
not `\the\pst@cntg'. Value 1 forced.} \pst@cntg=1
 \fi
\edef\psk@pstCoxeter@choice{#1}}
\psset{choice=1}
%
%
% Graphical parameters
%
% Colors
% Color of Vertices
% Example: \CoxeterCoordinates[colorVertices=blue,choice=5]
\define@key[psset]{pst-coxeter}{colorVertices}{%
\pst@getcolor{#1}\pscolorVertices}
% by default the color of the vertices is green
\psset{colorVertices=green}
% Color of centers
% Example: \CoxeterCoordinates[colorCenters=blue,choice=5]
\define@key[psset]{pst-coxeter}{colorCenters}{%
\pst@getcolor{#1}\pscolorCenters}
 \psset{colorCenters=blue}
% Color of centers of the faces
% Example: \CoxeterCoordinates[colorCentersFaces=blue,choice=5]
\define@key[psset]{pst-coxeter}{colorCentersFaces}{%
\pst@getcolor{#1}\pscolorCentersFaces}
 \psset{colorCentersFaces=red}
%
% Color of centers of the Cells
% Example: \CoxeterCoordinates[colorCentersCells=blue,choice=5]
\define@key[psset]{pst-coxeter}{colorCentersCells}{%
\pst@getcolor{#1}\pscolorCentersCells}
% by default the color of the centers is red.
\psset{colorCentersCells=magenta}
%
%
% Dot styles
% style of Vertices
% Example: \CoxeterCoordinates[styleVertices=*pentagon,P=5]
\def\psset@styleVertices#1{%
\@ifundefined{psds@#1}%
{\@pstrickserr{styleVertices `#1' not defined}\@eha}%
{\edef\psk@styleVertices{#1}}}
% by default the vertices are represented by a (empty) circle (styleVertices=o)
 \psset@styleVertices{o}
% style of Centers
% Example: \CoxeterCoordinates[styleCenters=*pentagon,choice=5]
\def\psset@styleCenters#1{%
\@ifundefined{psds@#1}%
{\@pstrickserr{styleCenters `#1' not defined}\@eha}%
{\edef\psk@styleCenters{#1}}}
% by default the vertices are represented by a disk (styleVertices=*)
 \psset@styleCenters{*}
%
% style of Centers of the faces
% Example: \CoxeterCoordinates[styleCentersFaces=*pentagon,choice=5]
%
\def\psset@styleCentersFaces#1{%
\@ifundefined{psds@#1}%
{\@pstrickserr{styleCentersFaces `#1' not defined}\@eha}%
{\edef\psk@styleCentersFaces{#1}}}
%
% by default the centers of the faces are represented by a disk (styleCentersFaces=*)
%
 \psset@styleCentersFaces{*}
 % style of Centers of the Cells
% Example: \CoxeterCoordinates[styleCentersCells=*pentagon,choice=5]
\def\psset@styleCentersCells#1{%
\@ifundefined{psds@#1}%
{\@pstrickserr{styleCentersCells `#1' not defined}\@eha}%
{\edef\psk@styleCentersCells{#1}}}
% by default the centers of the cells are represented by a disk (stylesCentersCells=*)
 \psset@styleCentersCells{*}
%
%
% Dot sizes
% Size of vertices
% Example: \CoxeterCoordinates[sizeVertices=0.1,choice=5]
\newdimen\pssizeVertices
\def\psset@sizeVertices#1{\pssetlength\pssizeVertices{#1}}
\psset@sizeVertices{0.05}
% Sizes of centers
% Example: \CoxeterCoordinates[sizeCenters=0.1,choice=5]
\newdimen\pssizeCenters
\def\psset@sizeCenters#1{\pssetlength\pssizeCenters{#1}}
\psset@sizeCenters{0.05}
%
% Sizes of centers of the faces
% Example: \CoxeterCoordinates[sizeCentersFaces=0.1,choice=5]
%
\newdimen\pssizeCentersFaces
\def\psset@sizeCentersFaces#1{\pssetlength\pssizeCentersFaces{#1}}
\psset@sizeCentersFaces{0.05}
%
% Sizes of centers of the cells
% Example: \CoxeterCoordinates[sizeCentersCells=0.1,choice=5]
%
\newdimen\pssizeCentersCells
\def\psset@sizeCentersCells#1{\pssetlength\pssizeCentersCells{#1}}
\psset@sizeCentersCells{0.05}%
%
\newif\ifPst@drawvertices
\define@key[psset]{pst-coxeter}{drawvertices}[true]{%
\@nameuse{Pst@drawvertices#1}}
%
\newif\ifPst@drawedges
\define@key[psset]{pst-coxeter}{drawedges}[true]{%
\@nameuse{Pst@drawedges#1}}
%
\newif\ifPst@drawcenters
\define@key[psset]{pst-coxeter}{drawcenters}[true]{%
\@nameuse{Pst@drawcenters#1}}
%
%
\newif\ifPst@drawcentersfaces
\define@key[psset]{pst-coxeter}{drawcentersfaces}[false]{%
\@nameuse{Pst@drawcentersfaces#1}}
%
%
\newif\ifPst@drawcenterscells
\define@key[psset]{pst-coxeter}{drawcenterscells}[false]{%
\@nameuse{Pst@drawcenterscells#1}}
%
\psset{drawvertices=true,drawedges=true,drawcenters=true}
%
%% Prologue for postscript
\pstheader{pst-coxeter.pro}
%
% definition if the macro \CoxeterCoordinates
%
\def\CoxeterCoordinates{\pst@object{CoxeterCoordinates}}
\def\CoxeterCoordinates@i{\@ifnextchar[{\CoxeterCoordinates@do}{\CoxeterCoordinates@do[]}}
\def\CoxeterCoordinates@do[#1]{{%
\psset{#1}%
\begin@ClosedObj
\addto@pscode{%
%
% List of the polytopes
% The option choice allows to choice the polytope
% Each values of choice corresponds to a variable cox***datas
% The variables cox***datas are defined in the file pst-coxcoor.pro
%
/choice \the\pst@cntg\space def
 choice 1 eq {cox233datas} if
 choice 2 eq {cox332datas} if
 choice 3 eq {cox333datas} if
 choice 4 eq {cox342datas} if
 choice 5 eq {cox344datas} if
 choice 6 eq {cox343datas} if
 choice 7 eq {cox434datas} if
 choice 8 eq {cox24333datas} if
 choice 9 eq {cox33333datas} if
 choice 10 eq {cox33342datas} if
 choice 11 eq {cox3333333datas} if
 choice 12 eq {cox382datas} if
 choice 13 eq {cox283datas} if
 choice 14 eq {cox353datas} if
 choice 15 eq {cox443datas} if
 choice 16 eq {cox432datas} if
 choice 17 eq {cox234datas} if
 choice 18 eq {cox264datas} if
 choice 19 eq {cox462datas} if
 choice 20 eq {cox535datas} if
 choice 21 eq {cox2103datas} if
 choice 22 eq {cox3102datas} if
 choice 23 eq {cox253datas} if
 choice 24 eq {cox352datas} if
 choice 25 eq {cox243datas} if
 choice 26 eq {cox23243datas} if
 choice 27 eq {cox34232datas} if
 choice 28 eq {cox3423232datas} if
 choice 29 eq {cox2323243datas} if
 choice 30 eq {cox23252datas} if
 choice 31 eq {cox25232datas} if
 choice 32 eq {cox2323242datas} if
 choice 33 eq {cox2423232datas} if
 choice 34 eq {cox2324232datas} if
 choice 35 eq {cox2323252datas} if
 choice 36 eq {cox2523232datas} if
 choice 37 eq {cox3523datas} if %
 choice 38 eq {cox5525datas} if
 choice 39 eq {cox2523datas} if
  choice 40 eq {cox3522datas} if
  choice 41 eq {cox31032datas} if
  choice 42 eq {cox21033datas} if
  choice 43 eq {cox3832datas} if
 choice 44 eq {cox2833datas} if
  choice 45 eq {cox562datas} if
  choice 46 eq {cox265datas} if
  choice 47 eq {cox4833datas} if
  choice 48 eq {cox3834datas} if
   choice 49 eq {cox552datas} if
  choice 50 eq {cox255datas} if
   choice 51 eq {cox51032datas} if
  choice 52 eq {cox21035datas} if
   choice 53 eq {cox532datas} if
  choice 54 eq {cox235datas} if
 choice 55 eq {cox542datas} if
  choice 56 eq {cox245datas} if
choice 57 eq {cox51033datas} if
  choice 58 eq {cox31035datas} if
  choice 59 eq {cox543datas} if
  choice 60 eq {cox345datas} if
choice 61 eq {cox533datas} if
  choice 62 eq {cox335datas} if
  choice 63 eq {cox5523datas} if
  choice 64 eq {cox3525datas} if
    choice 65 eq {cox252232datas} if
       choice 66 eq {cox232522datas} if
    choice 67 eq {cox252252datas} if
       choice 68 eq {cox252522datas} if
          choice 69 eq {cox263datas} if
       choice 70 eq {cox362datas} if
       choice 71 eq {cox25223232datas} if
       choice 72 eq {cox23232522datas} if
       choice 73 eq {cox23252252datas} if
      choice 74 eq {cox23252522datas} if
      choice 75 eq {cox25223252datas} if
      choice 76 eq {cox25225232datas} if
      choice 77 eq {cox25232522datas} if
      choice 78 eq {cox25252232datas} if
    choice 79 eq {cox25252252datas} if
    choice 80 eq {cox252252522datas} if
       %%%     <-- add new polytope here
 0 0 translate
 %%% Usefull definitions
/pscolorVertices {\pst@usecolor\pscolorVertices currentrgbcolor} def
/pscolorCenters {\pst@usecolor\pscolorCenters currentrgbcolor} def
 /pscolorCentersFaces {\pst@usecolor\pscolorCentersFaces currentrgbcolor} def
 /pscolorCentersCells {\pst@usecolor\pscolorCentersCells currentrgbcolor} def
/unit \pst@number\psunit\space def % pts -> cm
/unit \pst@number\psunit\space def % pts -> cm
1 setlinejoin
 %%%% Drawing the edges
\ifPst@drawedges
       0 1 NbrEdges 1 sub { % from 0 to nbedges-1 (draw all the edges)
      /CompteurVertices ED
      /CompteurIntermediaireSommets CompteurVertices NbrVerticesInAnEdge mul
      def
newpath ListePoints CompteurIntermediaireSommets get aload pop
  /Y exch def /X exch def
   X unit mul Y unit mul moveto
1 1 NbrVerticesInAnEdge 1 sub { % from 1 to nbvertices in an edge -1
    /CompteurEdges ED
ListePoints CompteurIntermediaireSommets CompteurEdges add get aload
pop
  /Y exch def /X exch def
   X unit mul Y unit mul lineto
  }
  for
closepath stroke } for \fi %
 %%%% Drawing of the Vertices
/DS \pst@number\pssizeVertices\space def
\@nameuse{psds@\psk@styleVertices}%
\ifPst@drawvertices
% We draw all the vertices of all edges
0 1 NbrEdges NbrVerticesInAnEdge mul 1 sub { % From 0 to nbEdges*NbVerticesInEdges-1
/CompteurEdges ED
  ListePoints CompteurEdges get aload pop
  /Y exch def /X exch def
  pscolorVertices
  X unit mul Y unit mul
  Dot
  stroke
} for
 \fi
%
% Drawing of the Centers of the Faces
%
/DS \pst@number\pssizeCentersFaces\space def
\@nameuse{psds@\psk@styleCentersFaces}%
\ifPst@drawcentersfaces
0 1 NbrFaces 1 sub{ % from 0 to NbrFaces-1
/CompteurFaces ED
  ListeFaces CompteurFaces get aload pop
  /Y exch def /X exch def
  pscolorCentersFaces
  X unit mul Y unit mul
 Dot
 stroke
} for
 \fi
%
% Drawing the centers of the Cells
%
/DS \pst@number\pssizeCentersCells\space def
\@nameuse{psds@\psk@styleCentersCells}%
\ifPst@drawcenterscells
0 1 NbrCells 1 sub{ % from 0 to nbCells-1
/CompteurCells ED
  ListeCells CompteurCells get aload pop
  /Y exch def /X exch def
  pscolorCentersCells
  X unit mul Y unit mul
  Dot
  stroke
} for \fi
%
% Drawing the centers of the Edges
%
 /DS \pst@number\pssizeCenters\space def
\@nameuse{psds@\psk@styleCenters}%
\ifPst@drawcenters
0 1 NbrEdges 1 sub { % from 0 to NbrEdges -1
      /CompteurVertices ED
      /CompteurIntermediaireSommets CompteurVertices NbrVerticesInAnEdge mul
      def
      /XM 0 def /YM 0 def
0 1 NbrVerticesInAnEdge 1 sub { %
    /CompteurEdges ED
  ListePoints CompteurEdges CompteurIntermediaireSommets add get aload pop
  /Y ED /X ED
  /XM XM X add def
  /YM YM Y add def
  }
  for
 pscolorCenters
  XM NbrVerticesInAnEdge div unit mul YM NbrVerticesInAnEdge div unit mul %1.5 0 360 arc
   Dot
  stroke
} for \fi
}%
\end@ClosedObj
}}
\catcode`\@=\PstAtCode\relax
\endinput
%%
%% END: pst-coxeter3.tex