Previous: hidses Up: ../plot79_h.html Next: hidsv
SUBROUTINE HIDSK (Z0, Z1,ZE,Z2, MX,MY, NX,NY, LX,LY, S, X SOUTH, EAST, TOP, TILT, PL2) C$ (Corner View - Outline Sketch) C$ Make a hidden-line outline sketch of a surface defined in C$ Cartesian coordinates on a uniform grid. A rather fast C$ algorithm is used to provide orthographic views from any of C$ the four corners, with optional tilt of the surface. C$ C$ Z0......Cutoff value. Only function values, ZE(I,J), above C$ (S .GT. 0.0) or below (S .LT. 0) Z0 are visible. C$ ZE......Array containing the surface. ZE(I,J) = C$ F(X(I),Y(J)), where X(I) = (I-1)*DX and Y(J) = C$ (J-1)*DY both map onto the interval 0..1. C$ Z1,Z2...Span of surface values. C$ MX,MY...Actual declared dimensions of the array ZE(*,*). C$ NX,NY...Sections of ZE(*,*) actually used. C$ LX,LY...Increments in X and Y directions (.GT. 0). Values C$ of LX and LY larger than 1 produce a coarser mesh C$ on the drawing without losing the smoothness of the C$ complete surface. LX should be an integral divisor C$ of NX-1, and LY of NY-1. If this is not the case, C$ the next smallest value which satisfies this C$ requirement is used internally. At present, LX and C$ LY will be adjusted internally to be of equal size. C$ S.......=+1.0, graph positive part of function, C$ =-1.0, graph negative part of function, C$ = 0.0, graph both positive and negative parts. C$ If S = 0.0, the cutoff value Z0 has no effect. C$ SOUTH... .TRUE. - view from southern edge. C$ .FALSE. - view from northern edge. C$ EAST.... .TRUE. - view from eastern edge. C$ .FALSE. - view from western edge. C$ TOP..... .TRUE. - show top of surface. C$ .FALSE. - show bottom of surface. C$ This routine should be called twice, once with each C$ value of top. This allows changing colors between C$ calls to help distinguish the sides. C$ TILT....Angle of tilt in degrees. TILT is positive C$ counterclockwise looking down the horizontal axis C$ to the origin. Thus TILT=0.0 corresponds to an C$ overhead view looking down the positive Z axis C$ toward the origin, and gives a totally C$ uninteresting display of the X-Y grid. Negative C$ TILT angles tip the top part of the rotated surface C$ away from the observer around the horizontal axis. C$ TILT=-90.0 corresponds to an edge-on view of the C$ surface. Recommended values are in the range C$ -20..-70. C$ PL2.....2-D pen movement subroutine C$ C$ The algorithm used here is described by C$ C$ J. Butland, "Surface Drawing Made Simple", Computer Aided C$ Design, Vol. 11, No. 1 (January, 1979). C$ C$ It was discovered and implemented several years earlier at C$ the Bettis Atomic Power Laboratory (pre-1971), and then C$ improved and rewritten by John Halleck at the University of C$ Utah, and the SAFRAS program, as it is called, has received C$ extensive use at the University of Utah Computing Center. C$ The outline sketch idea implemented in this routine appears C$ to be original with J. Butland, however. The C$ Bettis/Halleck version differs from Butland's in that C$ horizons are computed in left-to-right sweeps, rather than C$ in vertical strips, which necessitates substantially larger C$ horizon work areas, but economizes greatly in pen movement. C$ Butland's algorithm incorporates cubic spline C$ interpolation, while the Bettis/Halleck version uses linear C$ interpolation. Provided that a sufficiently dense function C$ grid is available, the difference in quality is not great. C$ C$ Because the scan proceeds in strips from front to back, the C$ Butland algorithm implemented here requires a substantial C$ amount of pen movement, since the pen must be lifted and C$ moved from back to front for each stip. It is therefore C$ not recommended for use on incremental pen plotters, but C$ will perform quite satisfactorily on CRT and dot-matrix C$ displays. C$ C$ (04-FEB-82)