home *** CD-ROM | disk | FTP | other *** search
-
- REM Name: sh_oslot.cdl
- REM
- REM Date: 010689 simon izraelevitz
- REM
- REM Task: Constructs an open slot given the width and distance
- REM between center.
- REM The user has the option to create the slot centerline.
- REM
- REM Note: A message is displayed for all error conditions.
- REM
- REM
- REM -----------------------------------------------
-
- CLEAR
-
- REM define icon scale factor
- sc = 1.5 / @scale
-
- REM compute icon oval origin
- xinc = (@xmax - @xmin)/10
- yinc = (@ymax - @ymin)/10
- ox = @xmax - 3*xinc
- oy = @ymax - 3*yinc
-
- REM create icon geometry
- MODE DRAW
-
- x = ox + (-0.64951902*sc)
- y = oy + (-0.3750000*sc)
- r = 0.2500000*sc
- ARC x, y, @depth, r, 120.0000000, 300.0000000, 0, 5
-
- x1 = ox + (-0.5245190*sc)
- y1 = oy + (-0.5915064*sc)
- x2 = ox + ( 0.7745190*sc)
- y2 = oy + ( 0.1584937*sc)
- VLINE x1, y1, @depth, x2, y2, @depth, 0, 5
-
- x1 = ox + ( 0.5245190*sc)
- y1 = oy + ( 0.5915064*sc)
- x2 = ox + (-0.7745190*sc)
- y2 = oy + (-0.1584937*sc)
- VLINE x1, y1, @depth, x2, y2, @depth, 0, 5
-
- x1 = ox + (-0.8245190*sc)
- y1 = oy + (-0.0718912*sc)
- x2 = ox + (-0.4745190*sc)
- y2 = oy + (-0.6781090*sc)
- VLINE x1, y1, @depth, x2, y2, @depth, 0, 5, 0, 3
-
- x1 = ox + (-0.3464102*sc)
- y1 = oy + (-0.2000001*sc)
- x2 = ox + (-0.9526279*sc)
- y2 = oy + (-0.5500001*sc)
- VLINE x1, y1, @depth, x2, y2, @depth, 0, 5, 0, 3
-
- x1 = ox + ( 0.8513851*sc)
- y1 = oy + (-0.3750001*sc)
- x2 = ox + (-1.2303174*sc)
- y2 = oy + (-0.3750001*sc)
- VLINE x1, y1, @depth, x2, y2, @depth, 0, 5, 0, 3
-
- REM draw 'W' dimension
- ARRAY GENDAT[22]
- GENDAT[ 0] = ox + (-0.8394709*sc)
- GENDAT[ 1] = oy + (-0.1959937*sc)
- GENDAT[ 2] = ox + (-1.5536252*sc)
- GENDAT[ 3] = oy + (-0.6083108*sc)
- GENDAT[ 4] = ox + (-0.5894709*sc)
- GENDAT[ 5] = oy + (-0.6290064*sc)
- GENDAT[ 6] = ox + (-1.3036252*sc)
- GENDAT[ 7] = oy + (-1.0413235*sc)
- GENDAT[ 8] = ox + (-1.6711493*sc)
- GENDAT[ 9] = oy + (-0.3297532*sc)
- GENDAT[10] = ox + (-1.5211493*sc)
- GENDAT[11] = oy + (-0.5895608*sc)
- GENDAT[12] = ox + (-1.1211493*sc)
- GENDAT[13] = oy + (-1.2823812*sc)
- GENDAT[14] = ox + (-1.2711493*sc)
- GENDAT[15] = oy + (-1.0225736*sc)
- GENDAT[16] = ox + (-1.5211493*sc)
- GENDAT[17] = oy + (-0.5895608*sc)
- GENDAT[18] = 120.0000000
- GENDAT[19] = ox + (-1.2711493*sc)
- GENDAT[20] = oy + (-1.0225736*sc)
- GENDAT[21] = -60.0000000
-
- x = ox + (-1.4391031*sc)
- y = oy + (-0.8716208*sc)
-
- GENDIM 50, 4, 0, 2, GENDAT, 1, x, y, `W
- `, 0.0000000, 0.1500000*sc, 0.5000000, 0, 5
-
- REM draw 'L' dimension
- ARRAY GENDAT[22]
- GENDAT[ 0] = ox + (-0.8620190*sc)
- GENDAT[ 1] = oy + (-0.0069393*sc)
- GENDAT[ 2] = ox + (-0.9370843*sc)
- GENDAT[ 3] = oy + ( 0.1230775*sc)
- GENDAT[ 4] = ox + ( 0.4370191*sc)
- GENDAT[ 5] = oy + ( 0.7430609*sc)
- GENDAT[ 6] = ox + ( 0.3619539*sc)
- GENDAT[ 7] = oy + ( 0.8730776*sc)
- GENDAT[ 8] = ox + (-0.4089177*sc)
- GENDAT[ 9] = oy + ( 0.3847134*sc)
- GENDAT[10] = ox + (-0.9183342*sc)
- GENDAT[11] = oy + ( 0.0906015*sc)
- GENDAT[12] = ox + (-0.1839177*sc)
- GENDAT[13] = oy + ( 0.5146172*sc)
- GENDAT[14] = ox + ( 0.3807039*sc)
- GENDAT[15] = oy + ( 0.8406017*sc)
- GENDAT[16] = ox + (-0.9183342*sc)
- GENDAT[17] = oy + ( 0.0906015*sc)
- GENDAT[18] = 30.0000000
- GENDAT[19] = ox + ( 0.3807039*sc)
- GENDAT[20] = oy + ( 0.8406017*sc)
- GENDAT[21] = -150.0000000
-
- x = ox + (-0.3339176*sc)
- y = oy + ( 0.3746653*sc)
-
- GENDIM 50, 4, 0, 2, GENDAT, 1, x, y, `L
- `, 0.0000000, 0.1500000*sc, 0.5000000, 0, 5
-
- REM draw 'Rot' dimension
- ARRAY GENDAT[24]
- GENDAT[ 0] = ox + ( 0.9263850*sc)
- GENDAT[ 1] = oy + (-0.3750000*sc)
- GENDAT[ 2] = ox + ( 1.3542095*sc)
- GENDAT[ 3] = oy + (-0.3750000*sc)
- GENDAT[ 4] = ox + ( 1.0175799*sc)
- GENDAT[ 5] = oy + ( 0.5875001*sc)
- GENDAT[ 6] = ox + ( 1.0857607*sc)
- GENDAT[ 7] = oy + ( 0.6268643*sc)
- GENDAT[ 8] = ox + (-0.6495190*sc)
- GENDAT[ 9] = oy + (-0.3750000*sc)
- GENDAT[10] = 1.9662285*sc
- GENDAT[11] = 0.0000000
- GENDAT[12] = 9.4202213
- GENDAT[13] = ox + (-0.6495190*sc)
- GENDAT[14] = oy + (-0.3750000*sc)
- GENDAT[15] = 1.9662285*sc
- GENDAT[16] = 18.4363232
- GENDAT[17] = 30.0000000
- GENDAT[18] = ox + ( 1.3167095*sc)
- GENDAT[19] = oy + (-0.3750000*sc)
- GENDAT[20] = 92.1860275
- GENDAT[21] = ox + ( 1.0532848*sc)
- GENDAT[22] = oy + ( 0.6081143*sc)
- GENDAT[23] = -62.1860237
-
- x = ox + ( 1.1467606*sc)
- y = oy + ( 0.0218207*sc)
-
- GENDIM 53, 2, 2, 2, GENDAT, 1, x, y, `Rot
- `, 0.0000000, 0.1500000*sc, 0.5000000, 0, 5
-
- REM draw label 'PT'
- x1 = ox + ( 0.4239290*sc)
- y1 = oy + (-0.7773314*sc)
- x2 = ox + ( 0.1239290*sc)
- y2 = oy + (-0.7773314*sc)
- x3 = ox + (-0.6495190*sc)
- y3 = oy + (-0.3750000*sc)
- x = ox + ( 0.4989290*sc)
- y = oy + (-0.8523313*sc)
-
- LABEL x1, y1, x2, y2, x3, y3, 1, x, y, `PT
- `, 0.0000000, 0.1500000*sc, 0.5000000, 0, 5
-
- REM get data to create permanent geometry
- REM default values
- length = 3.00
- width = 2.00
- rot = 0
-
- REM get length
- :get_length
- GETFLT "Enter (L) distance from arc center to edge (%f):",length,length
- ON (@key + 3) GOTO exit,exit,
- length = abs(length)
- IF ((length <= .00005) || (length >= 10000))
- GOTO message1
-
- REM get width
- :get_width
- GETFLT "Enter (W) slot width (%f):",width,width
- ON (@key + 3) GOTO exit,get_length,
- rad = abs(width/2)
- IF ((rad <= .00005) || (rad >= 10000))
- GOTO message1
- GOTO get_rot
-
- :message1
- PROMPT "Entered value is out of range ..."
- WAIT 3
- GOTO get_length
-
- :get_rot
- GETFLT "Enter (Rot) rotation angle (%f):",rot,rot
- ON (@key + 3) GOTO exit,get_width,
-
- REM construct slot
- :geom_constr
- MODE NORMAL
- posdef = 1
- GETPOS "Indicate (PT) arc center position",posdef
- ON (@key + 3) GOTO exit,get_rot,geom_constr,
- xc = @XVIEW
- yc = @YVIEW
- zc = @DEPTH
-
- sinrot = sin(rot)
- cosrot = cos(rot)
-
- REM construct lines
- :lines
- ax = 0
- ay = rad
- bx = length
- by = rad
- lntype = 1
- DOSUB sh_drwln
-
- ax = 0
- ay = -rad
- bx = length
- by = -rad
- lntype = 1
- DOSUB sh_drwln
-
- REM arc
- x = xc
- y = yc
- ARC x,y,zc,rad,(90 + rot),(-90 + rot)
-
- :do_ctrlines
- GETMENU "Do you want the slot center lines (YES) ?",\
- "YES",\
- "NO"
- ON (@key + 3) GOTO exit,get_length,yes,do_ctrlines,yes,no,
-
- :yes
- ax = 0
- ay = -(rad + .1)
- bx = 0
- by = rad + .1
- lntype = 3
- DOSUB sh_drwln
-
- ax = -(rad + .1)
- ay = 0
- bx = rad + .1
- by = 0
- lntype = 3
- DOSUB sh_drwln
-
- REM back to the begining
- :no
- GOTO get_length
-
- :exit
- MODE NORMAL
- CHAIN shapes
- exit
-