* * $Id: gtrdse.F,v 1.1.1.1 1995/10/24 10:20:47 cernlib Exp $ * * $Log: gtrdse.F,v $ * Revision 1.1.1.1 1995/10/24 10:20:47 cernlib * Geant * * #include "geant321/pilot.h" *CMZ : 3.21/02 29/03/94 15.41.32 by S.Giani *-- Author : SUBROUTINE GTRDSE(PAR,ISHAPE) C- C---------------------------------------------------------- C- Calculates the coordinates of the corner points of a GEANT shape C- from the shape parameters. The end faces are generated by drawing C- connected polylines between the corner points at each Z-end of the shape. C- A ruled solid is then defined between the 2 faces, and written out in SET. C---------------------------------------------------------- C #include "geant321/gcsetf.inc" C DIMENSION PAR(50) REAL P1X,P1Y,P1Z,P2X,P2Y,P2Z,P3X,P3Y,P3Z,P4X,P4Y,P4Z REAL P5X,P5Y,P5Z,P6X,P6Y,P6Z,P7X,P7Y,P7Z,P8X,P8Y,P8Z C C C---------------------------------------------------------------------- C TRD1&2 C DX1=PAR(1) DX2=PAR(2) DY1=PAR(3) IF (ISHAPE .EQ. 2) THEN DY2=DY1 DZ= PAR(4) ELSE DY2=PAR(4) DZ=PAR(5) ENDIF C FACE parameters: C FACE 1: P1X= -DX1 P1Y= -DY1 P1Z= -DZ C P2X= DX1 P2Y= -DY1 P2Z= -DZ C P3X= DX1 P3Y= DY1 P3Z= -DZ C P4X= -DX1 P4Y= DY1 P4Z= -DZ C Next FACE: P5X= -DX2 P5Y= -DY2 P5Z= DZ C P6X= DX2 P6Y= -DY2 P6Z= DZ C P7X= DX2 P7Y= DY2 P7Z= DZ C P8X= -DX2 P8Y= DY2 P8Z= DZ C DESCRIBED BY 2 FACES represented by polylines C connected by the 4 corners of the shape. C *WRITE SET@103,F1,:5,2#3,3,2,P1X,P1Y,P1Z,P2X,P2Y,P2Z,P3X,P3Y,P3Z,P4X,P4Y,P4Z C *WRITE SET@103,F2,:5,2#3,3,2,P5X,P5Y,P5Z,P6X,P6Y,P6Z,P7X,P7Y,P7Z,P8X,P8Y,P8Z C *WRITE SET @100,N,:5,2,:9,'MATNAM'#145,!F1,!F2, C------------------------------------------------------------------- C WRITE(BLKSTR,10000)N1,P1X,P1Y,P1Z,P2X,P2Y,P2Z, P3X,P3Y,P3Z,P4X, +P4Y,P4Z CALL GJWRIT N1=N1+1 WRITE(BLKSTR,10000)N1,P5X,P5Y,P5Z,P6X,P6Y,P6Z, P7X,P7Y,P7Z,P8X, +P8Y,P8Z CALL GJWRIT N1=N1+1 WRITE(BLKSTR,10100)N1,N1-2,N1-1 CALL GJWRIT C 10000 FORMAT('@103,',I10,',:5,2#3,3,2,',G14.7,',',G14.7,',' + ,G14.7,',',G14.7,',',G14.7,',',G14.7,',',G14.7,',' + ,G14.7,',',G14.7,',',G14.7,',',G14.7,',',G14.7) 10100 FORMAT('@100,',I10,',:5,2#145,!',I10,',!',I10) C END