]> git.uio.no Git - u/mrichter/AliRoot.git/blame - GEANT321/geocad/gtrset.F
Using dlsym to retrieve address of commons
[u/mrichter/AliRoot.git] / GEANT321 / geocad / gtrset.F
CommitLineData
fe4da5cc 1*
2* $Id$
3*
4* $Log$
5* Revision 1.1.1.1 1995/10/24 10:20:47 cernlib
6* Geant
7*
8*
9#include "geant321/pilot.h"
10*CMZ : 3.21/02 29/03/94 15.41.32 by S.Giani
11*-- Author :
12 SUBROUTINE GTRSET(PAR)
13C-
14C- Created 26-JUL-1991 Nils Joar Hoimyr
15C- Modified 21.02.1992 Jouko Vuoskoski
16C-
17C- Calculates the coordinates of the corner points of a GEANT GTRA shape
18C- from the shape parameters. The end faces are generated by drawing
19C- connected polylines between the corner points at each Z-end of the shape.
20C- A ruled solid is then defined between the 2 faces, and written out in SET.
21C----------------------------------------------------------------------
22C
23#include "geant321/gcsetf.inc"
24
25C
26 DIMENSION PAR(50)
27 REAL P1X,P1Y,P1Z,P2X,P2Y,P2Z,P3X,P3Y,P3Z,P4X,P4Y,P4Z
28 REAL P5X,P5Y,P5Z,P6X,P6Y,P6Z,P7X,P7Y,P7Z,P8X,P8Y,P8Z
29C
30C----------------------------------------------------------------------
31C
32C GTRA as TRAP except that the faces are rotated aroud the Z-axis
33C
34C TRAP
35C
36
37 DZ=PAR(1)
38 TX= (PAR(2)*3.14159265359)/180.
39 TY= (PAR(3)*3.14159265359)/180.
40 TWIST=(PAR(4)*3.14159265359)/180.
41 H1=PAR(5)
42 BL1=PAR(6)
43 TL1=PAR(7)
44 H2=PAR(9)
45 BL2=PAR(10)
46 TL2=PAR(11)
47C Parameter conv for faces..
48C FACE parameters:
49C FACE 1:
50 P1X= -BL1-DZ*SIN(TX)
51 P1Y= -H1-DZ*SIN(TY)
52 P1Z= -DZ
53C
54 P2X= BL1-DZ*SIN(TX)
55 P2Y= -H1-DZ*SIN(TY)
56 P2Z= -DZ
57C
58 P3X= TL1-DZ*SIN(TX)
59 P3Y= H1-DZ*SIN(TY)
60 P3Z= -DZ
61C
62 P4X= -TL1-DZ*SIN(TX)
63 P4Y= H1-DZ*SIN(TY)
64 P4Z= -DZ
65C Next FACE:
66 P5X= -BL2+DZ*SIN(TX)
67 P5Y= -H2+DZ*SIN(TY)
68 P5Z= DZ
69C
70 P6X= BL2+DZ*SIN(TX)
71 P6Y= -H2+DZ*SIN(TY)
72 P6Z= DZ
73C
74 P7X= TL2+DZ*SIN(TX)
75 P7Y= H2+DZ*SIN(TY)
76 P7Z= DZ
77C
78 P8X= -TL2+DZ*SIN(TX)
79 P8Y= H2+DZ*SIN(TY)
80 P8Z= DZ
81C DESCRIBED BY 2 FACES represented by polylines
82C connected by the 4 corners of the shape.
83C *WRITE SET@103,F1#3,3,2,P1X,P1Y,P1Z,P2X,P2Y,P2Z,P3X,P3Y,P3Z,P4X,P4Y,P4Z
84C Geometric Transformation
85C*WRITE SET @302,N1..#301,R1,R2,R3,R4,R5,R6,R7,R8,R9
86C *WRITE SET@113,
87C *WRITE SET@103,F2#3,3,2,P5X,P5Y,P5Z,P6X,P6Y,P6Z,P7X,P7Y,P7Z,P8X,P8Y,P8Z
88C
89C *WRITE SET @100,N#145,!F1,!F2,
90C-------------------------------------------------------------------
91C
92 WRITE(BLKSTR,10000)N1,P1X,P1Y,P1Z,P2X,P2Y,P2Z, P3X,P3Y,P3Z,P4X,
93 +P4Y,P4Z
94 CALL GJWRIT
95C Rotation of face:
96C
97C Rotation around the Z-axis. Coeffisients of rotation:
98 R1= COS(-TWIST)
99 R2= -SIN(-TWIST)
100 R3= 0.0
101 R4= SIN(-TWIST)
102 R5= COS(-TWIST)
103 R6= 0.0
104 R7= 0.0
105 R8= 0.0
106 R9= 1.0
107C
108C Twist applied, results in constructed faces.
109 N1=N1+1
110 WRITE(BLKSTR,10100)N1,R1,R2,R3,R4,R5,R6,R7,R8,R9
111 CALL GJWRIT
112 N1=N1+1
113 WRITE(BLKSTR,10200)N1,N1-2,N1-1
114 CALL GJWRIT
115C Second face:
116 N1=N1+1
117 WRITE(BLKSTR,10000)N1,P5X,P5Y,P5Z,P6X,P6Y,P6Z, P7X,P7Y,P7Z,P8X,
118 +P8Y,P8Z
119 CALL GJWRIT
120C Rotation of faces:
121C
122C Rotation around the Z-axis. Coeffisients of rotation:
123 R1= COS(TWIST)
124 R2= -SIN(TWIST)
125 R3= 0.0
126 R4= SIN(TWIST)
127 R5= COS(TWIST)
128 R6= 0.0
129 R7= 0.0
130 R8= 0.0
131 R9= 1.0
132C
133C Twist applied, results in constructed faces.
134 N1=N1+1
135 WRITE(BLKSTR,10100)N1,R1,R2,R3,R4,R5,R6,R7,R8,R9
136 CALL GJWRIT
137 N1=N1+1
138 WRITE(BLKSTR,10200)N1,N1-2,N1-1
139 CALL GJWRIT
140 N1=N1+1
141 WRITE(BLKSTR,10300)N1,N1-4,N1-1
142 CALL GJWRIT
143C
14410000 FORMAT('@103,',I10,',:5,2#3,3,2,',G14.7,',',G14.7,','
145 + ,G14.7,',',G14.7,',',G14.7,',',G14.7,',',G14.7,','
146 + ,G14.7,',',G14.7,',',G14.7,',',G14.7,',',G14.7)
14710100 FORMAT('@302,',I10,'#301,',G14.7,',',G14.7,',',G14.7
148 + ,',',G14.7,',',G14.7,',',G14.7,',',G14.7,',',G14.7,',',G14.7)
14910200 FORMAT('@113,',I10,',:5,2#101,!',I10,',!',I10)
15010300 FORMAT('@100,',I10,',:5,2#145,!',I10,',!',I10)
151C
152C
153 10 RETURN
154 END