5 * Revision 1.1.1.1 1995/10/24 10:20:46 cernlib
9 #include "geant321/pilot.h"
10 *CMZ : 3.21/02 29/03/94 15.41.32 by S.Giani
12 SUBROUTINE GPGSET(PAR)
14 C- Created 26-JUN-1991 Nils Joar Hoimyr
15 C- Modified 21.02.1992 Jouko Vuoskoski
17 C---------------------------------------------------------
18 C- Calculates the sectional face of 1 cell of the PGON shape. This face is
19 C- copied and rotated around the Z-axis to make "the other side" of the first
20 C- cell. A ruled solid is generated between the 2 faces, to created the cell.
21 C- The rest of the cells are created by copying and rotation of the first cell.
22 C- The final result is obtained with a Boolean fusion of the cells. (The whole
23 C- creation history is written to the SET file.)
24 C----------------------------------------------------------
26 #include "geant321/gcsetf.inc"
30 REAL PX,PY,PZ,PHIC,PHI1,RMIN,RMAX
31 REAL R1,R2,R3,R4,R5,R6,R7,R8,R9
33 C----------------------------------------------------------------------
35 C Calculates range of each cell
37 PHI1= (PAR(1)+180)/180*3.14159265359
40 PHIC= (PAR(2)/PAR(3))/180*3.14159265359
41 C Rotation around the Z-axis. Coeffisients of rotation:
51 C Face defined in the yz-plane (x=0)
52 C----------------------------------------------------------------------
56 C---------------------------------------------------------
57 C 1. Definition point for the face:
64 C---------------------------------------------------------
66 WRITE(BLKSTR,10100)PX,PY,PZ
68 C---------------------------------------------------------
69 C Loops over the other definition points:
77 IF (RMIN .GE. RMAX) GOTO 10
80 C---------------------------------------------------------
81 WRITE(BLKSTR,10100)PX,PY,PZ
83 C---------------------------------------------------------
91 C---------------------------------------------------------
92 WRITE(BLKSTR,10100)PX,PY,PZ
94 C----------------------------------------------------------
98 C Geometric Transformation
99 C* WRITE SET @302,N1..#301,R1,R2,R3,R4,R5,R6,R7,R8,R9
103 WRITE(BLKSTR,10200)N1,R1,R2,R3,R4,R5,R6,R7,R8,R9
105 C-------------------------------------------------
107 C* WRITE SET @113,F2..#101,!F1,N1
108 C------------------------------------------------
111 WRITE(BLKSTR,10300)N1,N1-2,N1-1
113 C---------------------------------------------------------
114 C Next step is to obtain the right position of the second face to
116 C Rotation around the Z-axis. Coeffisients of rotation:
127 C Geometric Transformation
128 C* WRITE SET @302,N1..#301,R1,R2,R3,R4,R5,R6,R7,R8,R9
130 C------------------------------------------------------------
133 WRITE(BLKSTR,10200)N1,R1,R2,R3,R4,R5,R6,R7,R8,R9
135 C--------------------------------------------------------------
138 C The first cell of the PGON is defined as a ruled solid between two
139 C faces. The second face is defined as a copy of the first face that is
140 C rotated PHIC degrees around the Z-axis.
142 C* WRITE SET @113,F2..#101,!F1,N1
143 C------------------------------------------------
146 WRITE(BLKSTR,10300)N1,N1-2,N1-1
149 C-------------------------------------------------
150 C* WRITE SET @100,N2..#145,!F1,!F2
151 C------------------------------------------------
154 WRITE(BLKSTR,10400)N1,N1-3,N1-1
157 C--------------------------------------------------------------
158 C The rest of the cells are defined as rotated copies of the first cell:
161 C* WRITE SET @100,N3..#101,!N1-1,!NG
163 C------------------------------------------------
166 WRITE(BLKSTR,10500)N1,N1-1,NG
170 C------------------------------------------------------------
171 C The final shape is a Boolean union of the cells
172 C* WRITE SET @100,N4..#100,2,!N1-NPDV....!N1-1
173 C------------------------------------------------
176 WRITE(BLKSTR,10700)N1
178 C------------------------------------------------
186 10000 FORMAT('@103,',I10,',:5,2#3,3,2')
187 10100 FORMAT(',',G14.7,',',G14.7,',',G14.7)
188 10200 FORMAT('@302,',I10,',:5,2#301,',G14.7,',',G14.7,',',G14.7
189 + ,',',G14.7,',',G14.7,',',G14.7,',',G14.7,',',G14.7,',',G14.7)
190 10300 FORMAT('@113,',I10,',:5,2#101,!',I10,',!',I10)
191 10400 FORMAT('@100,',I10,',:5,2#145,!',I10,',!',I10)
192 10500 FORMAT('@100,',I10,',:5,2#101,!',I10,',!',I10)
193 10600 FORMAT(',!',I10)
194 10700 FORMAT('@100,',I10,',:5,2#100,2')