Contact us Heritage collections Image license terms
HOME ACL Associates Technology Literature Applications Society Software revisited
Further reading □ OverviewNo.1No.2No.3No.4No.5No.8No.9No.11No.12No.13No.14No.15No.17No.19No.21No.22No.23No.24No.25No.26No.27No.28No.29No.30No.31No.32No.33No.37No.38No.39No.40No.41No.43No.44No.45No.46No.47No.48No.49No.50No.51No.52
ACD C&A INF CCD CISD Archives Contact us Heritage archives Image license terms

Search

   
ACLLiteratureProgress ReportsSPROGS Papers
ACLLiteratureProgress ReportsSPROGS Papers
ACL ACD C&A INF CCD CISD Archives
Further reading

Overview
No.1
No.2
No.3
No.4
No.5
No.8
No.9
No.11
No.12
No.13
No.14
No.15
No.17
No.19
No.21
No.22
No.23
No.24
No.25
No.26
No.27
No.28
No.29
No.30
No.31
No.32
No.33
No.37
No.38
No.39
No.40
No.41
No.43
No.44
No.45
No.46
No.47
No.48
No.49
No.50
No.51
No.52

SPROGS Paper No 14: Stroke Drawing

W D Shaw

May 8 1972

CONTENTS

A general stroke drawing routine has been under discussion. This routine would allow simulation of a variety of textures and facilitate graph plotting. It is possible that some special cases such as DOTTED might be absorbed.

The following is a proposal for including the facility in SPROGS:

Two routines, STYPE and STROKE, will receive the necessary parameters. STYPE will associate a filename and expansion factor with successive calls to STROKE.

      STYPE (NAME('FILE'),EXP) 

'FILE' should be a picture file whose horizontal dimension is some constant, SLINTH, which might correspond to standard character size. Two global variables, ISNAME and SEXP, will be necessary to retain the file and expansion factor information.

The routine STROKE will lay down copies of the stroke specified by 'FILE' between a beginning point (BPX,BPY) and an end point (EPX,EPY). .

      STROKE (BPX,BPY,EPX,EPY) 

For clarity, call this series of strokes a 'track'. In general, swapping the beginning and end points will not produce the same track.

Two facts have complicated the implementation of STROKE:

1. Each stroke in the track must be rotated to coincide with the slope of the line, L, between (BPX,BPY) and (EPX,EPY).

2. The last stroke may extend past (EPX,EPY) and so must be clipped, perpendicular to L.

To program these requirements, it appears necessary to have two new facilities: one to define rotated regions and another to define a new region in terms of the current region without specifying the name of the current region. In the following suggestion for the coding of STROKE, the following liberties have been taken for clarity only:

1. Region numbers greater than 1000 are temporary system regions.

2. A negative region number :means 'use the currently active region'.

3. REGROT(NREG,X,Y,THETA) causes region NREG to be defined by rotating it THETA degrees about the point (X,Y).

4. The labelled common block, GLOBAL, holds global program variables such as ISNAME, etc.

      SUBROUTINE STROKE(BEGX,BEGY,ENDX,ENDY) 
      COMMON /GLOBAL/ISNAME,SEXP,SLINTH 
      BPX=BEGX 
      BPY=BEGY 
      EPX= ENDX 
      EPY=ENDY 
      NMBRT= DSRTNM('STROKE') 
      IF(NPRYV .LT. LPRYV) GO TO 100 
      CALL STORE4(NMBRT,BPX,BPY,EPX,EPY) 
      GO TO 500 
 100  DY=EPY-BPY 
      DX=EPX-BPX 
      SLINT2=SLINTH/2.0 
      THETA=ATAN(DY/DX) 
      XLENP=SQRT(DX*DX+DY*DY) 
      XLENR=XLENA/EXP 
      NS=XLENR/SLINTH 
      CALI RGLIM(1001,0.,-SLINT2,XLENR,SLINT2) 
      XPMAX=BPX+XLENP 
      YPMAX=BPY+SLINT2 
      XPMIN=BPX 
      YPMIN=BPY-SLINT2 
      CALL RGPLIM(1001,-1,XPMIN,YPMIN,XPMAX,YPMAX) 
      CALL REGROT(1001,BPX,BPY,THETA) 
      SX=0 
      DO 10 I=1,NS 
      CALL SETXY (SX,0) 
      SX=SX+SLINTH 
10    CALL DRAW(ISNAME) 
500   CALL RESET 
      RETURN 
      END 

By properly setting LPRYV, STROKE can be made to store STROKE calls away in a file, thus allowing the user to switch strokes to compare effect, etc. Some special cases, such as DOTTED, could possibly be handled at the beginning of STROKE. 'DOTTED' would merely be a special name recognised by the routine. This is really not saving much work, but it may make the system look cleaner to the user.

TYPE is presumably a simple routine to code. ISNAME might be set to -1 initially to preclude calling STROKE without having made a call to STYPE. Three sorts of fixes are possible:

1. Let the error filter down to RCNCL2 in DRAW.

2. Produce a diagnostic at the STROKE level.

3. Substitute VEC commands for the DRAW calls.

I favour some combination of 2 and 3. But diagnostics seem to be a bit of an open question at the moment.

⇑ Top of page
© Chilton Computing and UKRI Science and Technology Facilities Council webmaster@chilton-computing.org.uk
Our thanks to UKRI Science and Technology Facilities Council for hosting this site