5 * Revision 1.1.1.1 1999/05/18 15:55:17 fca
8 * Revision 1.1.1.1 1995/10/24 10:20:46 cernlib
12 #include "geant321/pilot.h"
13 *CMZ : 3.21/02 29/03/94 15.41.32 by S.Giani
15 SUBROUTINE GPGSET(PAR)
17 C- Created 26-JUN-1991 Nils Joar Hoimyr
18 C- Modified 21.02.1992 Jouko Vuoskoski
20 C---------------------------------------------------------
21 C- Calculates the sectional face of 1 cell of the PGON shape. This face is
22 C- copied and rotated around the Z-axis to make "the other side" of the first
23 C- cell. A ruled solid is generated between the 2 faces, to created the cell.
24 C- The rest of the cells are created by copying and rotation of the first cell.
25 C- The final result is obtained with a Boolean fusion of the cells. (The whole
26 C- creation history is written to the SET file.)
27 C----------------------------------------------------------
29 #include "geant321/gcsetf.inc"
33 REAL PX,PY,PZ,PHIC,PHI1,RMIN,RMAX
34 REAL R1,R2,R3,R4,R5,R6,R7,R8,R9
36 C----------------------------------------------------------------------
38 C Calculates range of each cell
40 PHI1= (PAR(1)+180)/180*3.14159265359
43 PHIC= (PAR(2)/PAR(3))/180*3.14159265359
44 C Rotation around the Z-axis. Coeffisients of rotation:
54 C Face defined in the yz-plane (x=0)
55 C----------------------------------------------------------------------
59 C---------------------------------------------------------
60 C 1. Definition point for the face:
67 C---------------------------------------------------------
69 WRITE(BLKSTR,10100)PX,PY,PZ
71 C---------------------------------------------------------
72 C Loops over the other definition points:
80 IF (RMIN .GE. RMAX) GOTO 10
83 C---------------------------------------------------------
84 WRITE(BLKSTR,10100)PX,PY,PZ
86 C---------------------------------------------------------
94 C---------------------------------------------------------
95 WRITE(BLKSTR,10100)PX,PY,PZ
97 C----------------------------------------------------------
101 C Geometric Transformation
102 C* WRITE SET @302,N1..#301,R1,R2,R3,R4,R5,R6,R7,R8,R9
106 WRITE(BLKSTR,10200)N1,R1,R2,R3,R4,R5,R6,R7,R8,R9
108 C-------------------------------------------------
110 C* WRITE SET @113,F2..#101,!F1,N1
111 C------------------------------------------------
114 WRITE(BLKSTR,10300)N1,N1-2,N1-1
116 C---------------------------------------------------------
117 C Next step is to obtain the right position of the second face to
119 C Rotation around the Z-axis. Coeffisients of rotation:
130 C Geometric Transformation
131 C* WRITE SET @302,N1..#301,R1,R2,R3,R4,R5,R6,R7,R8,R9
133 C------------------------------------------------------------
136 WRITE(BLKSTR,10200)N1,R1,R2,R3,R4,R5,R6,R7,R8,R9
138 C--------------------------------------------------------------
141 C The first cell of the PGON is defined as a ruled solid between two
142 C faces. The second face is defined as a copy of the first face that is
143 C rotated PHIC degrees around the Z-axis.
145 C* WRITE SET @113,F2..#101,!F1,N1
146 C------------------------------------------------
149 WRITE(BLKSTR,10300)N1,N1-2,N1-1
152 C-------------------------------------------------
153 C* WRITE SET @100,N2..#145,!F1,!F2
154 C------------------------------------------------
157 WRITE(BLKSTR,10400)N1,N1-3,N1-1
160 C--------------------------------------------------------------
161 C The rest of the cells are defined as rotated copies of the first cell:
164 C* WRITE SET @100,N3..#101,!N1-1,!NG
166 C------------------------------------------------
169 WRITE(BLKSTR,10500)N1,N1-1,NG
173 C------------------------------------------------------------
174 C The final shape is a Boolean union of the cells
175 C* WRITE SET @100,N4..#100,2,!N1-NPDV....!N1-1
176 C------------------------------------------------
179 WRITE(BLKSTR,10700)N1
181 C------------------------------------------------
189 10000 FORMAT('@103,',I10,',:5,2#3,3,2')
190 10100 FORMAT(',',G14.7,',',G14.7,',',G14.7)
191 10200 FORMAT('@302,',I10,',:5,2#301,',G14.7,',',G14.7,',',G14.7
192 + ,',',G14.7,',',G14.7,',',G14.7,',',G14.7,',',G14.7,',',G14.7)
193 10300 FORMAT('@113,',I10,',:5,2#101,!',I10,',!',I10)
194 10400 FORMAT('@100,',I10,',:5,2#145,!',I10,',!',I10)
195 10500 FORMAT('@100,',I10,',:5,2#101,!',I10,',!',I10)
196 10600 FORMAT(',!',I10)
197 10700 FORMAT('@100,',I10,',:5,2#100,2')