#$b001
TEXT(GRID_ON_CIRCLE                     :B544
TITLE
  display
     This Q1 demonstrates the use of 5 operations used
     for the creation of BFC grids, namely:
     * defining points,
     * defining lines,
     * defining frames,
     * setting grid dimensions, and
     * matching a grid to a frame.
 
     Those operations are used here in order to:
     1. create a circle,
     2. dimension a grid,
     3. match the grid to the circle, and
     4. use the Laplace method to improve orthogonality.
 
     The relevant PIL commands will be displayed, then processed.
     The first sets the grid type to BFC
 
CT1=BFC=T
#$b002
     The coordinates of the four points used for defining the
     circle will be taken as:
       A (0,1,1); B(0,2,1); C(0,2,2); D(0,1,2)
real(ya,za,yb,zb,yyc,zzc,yd,zd,side,yp,zp,archite)
side=1;archite=side*(1.414-1)/2
ya=1;za=1;yb=ya+side;zb=za;yyc=yb;zzc=za+side;yd=ya;zd=zzc
mesg(Thus ya=:ya:, za=:za:, yb=:yb:, zb=:zb:
mesg(and  yyc=:yyc:, zzc=:zzc:, yd=:yd:, zd=:zd:
     The command to define point A is:
CT1=GSET(P,A,0,ya,za)
#$b003
     The command to define point B is:
CT1=GSET(P,B,0,yb,zb)
#$b003
     The command to define point C is:
CT1=GSET(P,C,0,yyc,zzc)
#$b003
     The command to define point D is:
CT1=GSET(P,D,0,yd,zd)
#$b003
     The command to draw the arc L1 from A to B which goes through
     (0.5*(ya+yb) ,  is:
CT1=GSET(L,L1,A,B,20,1.0,ARC,0,ya+side/2,za-archite)
#$b003
     The command to draw the arc L2 from B to C
CT1=GSET(L,L2,B,C,20,1.0,ARC,0,yb+archite,zb+side/2)
#$b003
     The command to draw the arc L3 from C to D
CT1=GSET(L,L3,C,D,20,1.0,ARC,0,yyc-side/2,zzc+archite)
#$b003
     The command to draw the arc L4 from A to D
CT1=GSET(L,L4,A,D,20,1.0,ARC,0,ya-archite,za+side/2)
#$b003
     The command to define frame F1 which has corner points
     A,B,C,D is:
CT1=GSET(F,F1,A,-,B,-,C,-,D,-)
#$b003
     The command to set the BFC grid dimension as 1x20x20 is:
CT1=GSET(D,1,20,20)
#$b003
     The command to match grid plane I1 on frame F1 using the
     trans-finite method is:
CT1=GSET(M,F1,+J+K,1,1,1,TRANS)
#$b003
     Now the PIL command to copy to the I2 plane from the I1
     plane by shifting it through a distance (0.5,0,0) is:
CT1=GSET(C,I2,F,I1,1,20,1,20,+,5.0000E-01,0,0)
#$b003
     By this time, the BFC grid has already set, however,
     to make it as orthogonal as possible, a Laplace
     solver is used in the following operations-
 
     The PIL command to match grid plane I1 on frame F1 using
     the Laplace solver with 20 iterations is:
CT1=GSET(M,F1,+J+K,1,1,1,LAP20)
#$b003
     Finally the PIL command to copy to the I2 plane from the I1
     plane by shifting it through a distance (0.5,0,0) is:
CT1=GSET(C,I2,F,I1,1,20,1,20,+,5.0000E-01,0,0)
#$b003
  enddis