home *** CD-ROM | disk | FTP | other *** search
/ Global Amiga Experience / globalamigaexperience.iso / compressed / graphic / vertex2.0demo.dms / vertex2.0demo.adf / Vertex / Rexxy / Round_Box.vert < prev    next >
Text File  |  1993-06-24  |  2KB  |  78 lines

  1. /* Arexx */
  2.  
  3. /*
  4.  *  This script will create a rounded box object. You are asked for
  5.  *  the width, height and radius of the corners, and then the number
  6.  *  of points to use for each rounded corner.
  7. */
  8.  
  9. options results                           /* Turn on results */
  10.  
  11. request 100 width 100 height 10 radius    /* Get 3 values from the user*/
  12.  
  13. if result~="RESULT" then do
  14.    parse var result width height radius   /* Parse the result */
  15.  
  16.    getvalue Corner_Resolution 6           /* Get the point res */
  17.    parse var result points
  18.  
  19.    data vtotal                            /* Store current point count */
  20.    parse var result start
  21.    start=start+1
  22.  
  23.    minx = -width / 2                      /* Set centered dimensions */
  24.    miny = -height / 2
  25.  
  26.    hott                                   /* Force the hot spot on */
  27.    x = minx + radius                      /* Computer center of radius */
  28.    y = miny + radius
  29.    shot x y 0                             /* position the hot spot */
  30.  
  31.    x = minx
  32.    y = miny + radius
  33.    vertex x y 0                           /* Create the first point */
  34.  
  35.    extrude 0 0 0 0 0 90 1 1 1 points      /* Extrude first side and arc */
  36.    x = width - (radius*2)
  37.    extrude x 0 0 0 0 0 1 1 1 1
  38.  
  39.    x = -minx - radius                     /* Extrude second arc */
  40.    y = miny + radius
  41.    shot x y 0
  42.    extrude 0 0 0 0 0 90 1 1 1 points      
  43.  
  44.    x = height - (radius*2)
  45.    extrude 0 x 0 0 0 0 1 1 1 1            /* Extrude second edge */
  46.  
  47.    x = -minx - radius
  48.    y = -miny - radius
  49.    shot x y 0
  50.    extrude 0 0 0 0 0 90 1 1 1 points
  51.  
  52.    x = -(width - (radius*2))
  53.    extrude x 0 0 0 0 0 1 1 1 1
  54.  
  55.    x = minx + radius
  56.    y = -miny - radius
  57.    shot x y 0
  58.    extrude 0 0 0 0 0 90 1 1 1 points
  59.  
  60.    x = -(height - (radius*2))
  61.    extrude 0 x 0 0 0 0 1 1 1 1
  62.  
  63.    data vtotal
  64.    parse var result last
  65.  
  66.    deselect all                     /* Fuse first and last points */
  67.    'select vert' start
  68.    'select vert' last
  69.    nott
  70.    fuse
  71.  
  72.  
  73.    'draw'
  74.    'endd'
  75. end
  76.  
  77.  
  78.