CNT3DX is a simple 3-d contour plotting routine. A 3-d surface is contoured by plotting slices through the surface parallel to the x-z plane of the surface which have the same y value. The input consists of a 2 dimensional grid of y values. For each contour level the input array is scanned cell-by-cell. A segment of the contour is determined by linearily interpolating the edges of the square formed by 4 adjacent points (a cell). For example, if the current contour value is 1, and y(1,1)=0, y(1,2)=2, y(2,2)=3, and y(1,2)=4, a contour line is assumed to exist for this cell as shown:
y(1,2) y(2,2) * * + \ * + * y(1,1) y(1,2)This line segment is plotted using the same approach as VAX3DXNo hidden line removal is provided. The calling sequence is nearly identical for both CNT3DX and VAX3DX. The height of plotted contours relative to the y axis is calibrated to z axis so that scale can be taken from the plot. No perspective is used. Options exist to vary the plotting angle and to plot axes. Contour values can be distinguished by color and/or line type.
Origin of the plot is in the lower-left corner. The x axis runs plotted left to right along the plot bottom. The y axis is plotted as a vertical displacement offset by the z axis value. The z axis appears to point into the screen. This gives the illusion of depth in the plot. See AXIS2 for detailed discription of axis parameters.
The pathological case of two contour lines within a cell may case the routine to incorrectly trace the contour through that cell.
CALL CNT3DX(d,ndx,ndz,nx,nz,a,b,xh,yh,zh,nl,as,ae,ie,iflag,iax, <xt,nxt,xs,xe,nmx,nnx,mlx,tsx,ndx,smx, yt,nyt,nmy,nny,mly,tsy,ndy,smy, zt,nzt,zs,ze,nmz,nnz,mlz,tsz,ndz,smz, <dm,dx<,ic>,l>>>) d (R): array of y values dimensioned d(ndx,ndz) ndx,ndz (I): x and z dimensions of d array nx,nz (I): x and z sizes of surface to plot d array a (R): angle of x axis from horizontal 0-85 degrees b (R): angle of z axis from horizontal 0-90 degrees note: origin d(1,1) is in lower-left corner x axis runs left to right on screen y axis runs up to down on screen z axis appears to run into the screen but is angled to the right xh,yh,zh (R): length of each axis nl (I): number of uniformly spaced contour levels, < 0 : max and min of v are used for as, ae (j)th contour is (j-1)*(ae-as)/(nl-1)+as = 0 : int(ae) specifies the number of contour values where as is an array of the contour values > 0 : number of uniformly space contour levels, (j)th contour is (j-1)*(ae-as)/(nl-1)+as as (R): first contour level (nl > 0) array of contour levels (nl=0) dimensioned as(int(ae)) ae (R): last contour level (nl > 0) number of contour levels in as (nl=0) ae>0 ie (I): contour edge option flag < 0 contour edge added when surface below contour = 0 no contour edges added > 0 contour edge added when surface above contour iflag (I): option flag < 0 : do not close LONGLIB after plotting = 0 : close LONGLIB--no plot produced > 0 : close LONGLIB after plotting (magnitude) >10000: do not initialize LONGLIB before plotting (1's digit) = 1 : ignor color and line type arrays 2 : use color array but not line type array 3 : ignore color array, use line type array 4 : use color and line type arrays (10's digit)= 0 : Ask which screen device to use <> 0 : Screen Device Number (see FRAME) iax (I): axis format control < 0 : plot axis, using input scale factors dm and dx = 0 : do not plot axis, optional axis parameters not used input scaling is computed from input array > 0 : plot axis, using scaling computed from input array, need optional axis parameters (1's digit) = 1 : Plot actual max/min or input values for Y axis = 2 : Plot smoothed values for Y axis (10's digit) = 0 : Use default axis type = 1 : Use input AXIS2-type axis parameters (NOTE: the following optional parameters are used only if iax<0 or mod(iflag,10)=1) xt (C): title of x axis (width) nxt (I): number of characters in xt = 0 : no axis plotted > 0 : normal xs,xe (R): starting and ending values displayed on x axis (see AXIS2 for detailed description of axis parameters) nmx (I): number of minor ticks between major ticks on x axis nnx (I): highlight length of nnx-th minor tick on x axis mlx (I): number of major tick marks on x axis tsx (R): size of title and numbers on x axis < 0 auto exponent scaling (x10 to power) disabled > 0 auto exponent scaling (x10 to power) enabled ndx (I): number of digits to right of decimal point on x axis smx (R): major tick length on x axis yt (C): title of y axis (depth) nyt (I): number of characters in yt = 0 : no y axis plotted > 0 : normal nmy (I): number of minor ticks between major ticks on y axis nny (I): highlight length of nny-th minor tick on y axis mly (I): number of major tick marks on y axis tsy (R): size of title and numbers on y axis < 0 auto exponent scaling (x10 to power) disabled > 0 auto exponent scaling (x10 to power) enabled ndy (I): number of digits to right of decimal point on y axis smy (R): major tick length on y axis zt (C): title of z axis (height) nzt (I): number of characters in zt = 0 : no z axis plotted > 0 : normal ze,ze (R): starting and ending valued displayed on z axis nmz (I): number of minor ticks between major ticks on z axis nnz (I): highlight length of nnz-th minor tick on z axis mlz (I): number of major tick marks on z axis tsz (R): size of title and numbers on z axis < 0 auto exponent scaling (x10 to power) disabled > 0 auto exponent scaling (x10 to power) enabled ndz (I): number of digits to right of decimal point on z axis smz (R): major tick length on z axis (NOTE: the following are accessed only if iax<0 or mod(iflag,10)<>0) dm,dx (R): minimum and maximum values of d array (NOTE: the following is accessed only if mod(iflag,10) <> 0) ic (I): color array ic(1) : color for axis lines ic(2) : color for axis numbers ic(3) : color for axis titles ic(4) : color for axis exponents ic(5) : color for contour line 1 ic(6) : color for contour line 2, etc. ... ... l (I): contour linetype list