#  This is a model command file called extbvl2.cmd.  It is used to
#  construct a three dimensional beveled object from a two dimensional
#  outline.  If you need to know more about how it does this miraculous
#  thing, read my comments.
#
#
#  Author:     Wesley C. Barris
#              AHPCRC
#              Minnesota Supercomputer Center, Inc.
#  Date:       Sept. 11, 1990
#
#  Copyright @ 1990, Minnesota Supercomputer Center, Inc.
#
#  RESTRICTED RIGHTS LEGEND
#
#  Use, duplication, or disclosure of this software and its documentation
#  by the Government is subject to restrictions as set forth in subdivision
#  { (b) (3) (ii) } of the Rights in Technical Data and Computer Software
#  clause at 52.227-7013.
#
# =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
#
#  Rename the "default" group to "Fface" and copy it -1 unit in the
#  Z direction calling this new copy "Bface".
#
g -r fface
tran -t 0 0 0.25
rep -t 0 0 -0.5
rg 1
g -r bface
revel -g
g repeat
delall
g -d repeat
#
#  Put a border outside the "fface" group.
#
g fface
border 0.04
g border1
g -r Fface
#
#  Put a border outside the "bface" group.
#
g bface
border -0.04
g border1
g -r Bface
g border
delall
g -d border
#
#  Link the "Big" groups to the "small" groups.
#
linkg -f Fface fface
g link1
g -r fbevel
linkg -f Bface bface
g link1
g -r bbevel
g link
delall
g -d link
# =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-extrude part-=-
#
#  Here we must extrude the "Big" face before we delete it.
#
#
#  Repeat the "Fface" group 1 (one) time along Z-axes, created fos then
#  delete the repeat group.
#
g Fface
rep -t 0 0 -0.5
rg -f 1
del -g
g link1
g -r sides
g link
delall
g -d link
g -d repeat
g -d repeat1
# =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=end of extrude part-=-
#
#  We no longer need the "Big" faces.
#
g Fface
del -g
g Bface
del -g
g -d Fface
g -d Bface
#
#  These new elements need to be reversed...
#
g fbevel
revel -g
g bbevel
revel -g
#
#  Make the "small" groups stand out a bit.
#
g fface
tran -t 0 0 0.04
g bface
tran -t 0 0 -0.04
#
#  Triangulate the "small" faces then delete the outlines.
#
g fface
convex
del -g
gm -r convex1 fface
g -d convex1
g bface
revel -g
convex
del -g
gm -r convex1 bface
g -d convex1
g bface
revel -g
#
#  Create a group called "all" and put everything in it.
#
g -a all
addall
setr -me mirror
setr -ml colors.mtl
#
#  Let's try smoothing thing out a bit.
#
autosmooth 30
