head	1.54;
access;
symbols
	ansi-20040405-merged:1.53
	postmerge-20040405-ansi:1.53
	premerge-20040404-ansi:1.53
	postmerge-autoconf:1.53
	autoconf-freeze:1.53
	premerge-autoconf:1.53
	postmerge-20040315-windows:1.53
	premerge-20040315-windows:1.53
	windows-20040315-freeze:1.53
	autoconf-20031203:1.53
	autoconf-20031202:1.53
	autoconf-branch:1.53.0.12
	phong-branch:1.53.0.10
	photonmap-branch:1.53.0.8
	rel-6-1-DP:1.53
	windows-branch:1.53.0.6
	rel-6-0-2:1.53
	ansi-branch:1.53.0.4
	rel-6-0-1-branch:1.53.0.2
	hartley-6-0-post:1.53
	hartley-6-0-pre:1.53
	rel-6-0-1:1.53
	rel-6-0:1.53;
locks; strict;
comment	@# @;


1.54
date	2004.05.19.19.16.08;	author morrison;	state dead;
branches;
next	1.53;

1.53
date	2001.10.12.23.11.20;	author morrison;	state Exp;
branches;
next	1.52;

1.52
date	2001.10.11.20.05.46;	author morrison;	state Exp;
branches;
next	1.51;

1.51
date	2001.10.05.19.31.59;	author morrison;	state Exp;
branches;
next	1.50;

1.50
date	2001.10.05.19.12.53;	author rbowers;	state Exp;
branches;
next	1.49;

1.49
date	2001.10.05.19.02.32;	author butler;	state Exp;
branches;
next	1.48;

1.48
date	2001.10.05.18.59.15;	author jra;	state Exp;
branches;
next	1.47;

1.47
date	2001.10.05.18.38.23;	author rbowers;	state Exp;
branches;
next	1.46;

1.46
date	2001.10.05.18.27.06;	author morrison;	state Exp;
branches;
next	1.45;

1.45
date	2001.10.05.18.18.40;	author morrison;	state Exp;
branches;
next	1.44;

1.44
date	2001.10.05.17.30.52;	author morrison;	state Exp;
branches;
next	1.43;

1.43
date	2001.10.05.16.46.16;	author morrison;	state Exp;
branches;
next	1.42;

1.42
date	2001.10.05.16.37.55;	author kermit;	state Exp;
branches;
next	1.41;

1.41
date	2001.10.05.16.35.54;	author tranese;	state Exp;
branches;
next	1.40;

1.40
date	2001.10.05.16.34.23;	author kermit;	state Exp;
branches;
next	1.39;

1.39
date	2001.10.05.16.27.26;	author morrison;	state Exp;
branches;
next	1.38;

1.38
date	2001.10.05.16.26.53;	author morrison;	state Exp;
branches;
next	1.37;

1.37
date	2001.10.05.16.25.48;	author morrison;	state Exp;
branches;
next	1.36;

1.36
date	2001.10.05.16.24.32;	author morrison;	state Exp;
branches;
next	1.35;

1.35
date	2001.10.05.16.22.42;	author morrison;	state Exp;
branches;
next	1.34;

1.34
date	2001.10.05.16.21.00;	author morrison;	state Exp;
branches;
next	1.33;

1.33
date	2001.10.05.16.15.20;	author morrison;	state Exp;
branches;
next	1.32;

1.32
date	2001.10.05.16.06.05;	author jra;	state Exp;
branches;
next	1.31;

1.31
date	2001.10.05.16.04.57;	author morrison;	state Exp;
branches;
next	1.30;

1.30
date	2001.10.05.15.58.14;	author morrison;	state Exp;
branches;
next	1.29;

1.29
date	2001.10.05.15.52.51;	author morrison;	state Exp;
branches;
next	1.28;

1.28
date	2001.10.05.15.51.59;	author rbowers;	state Exp;
branches;
next	1.27;

1.27
date	2001.10.05.15.47.46;	author morrison;	state Exp;
branches;
next	1.26;

1.26
date	2001.10.05.15.41.27;	author morrison;	state Exp;
branches;
next	1.25;

1.25
date	2001.10.05.15.36.22;	author rbowers;	state Exp;
branches;
next	1.24;

1.24
date	2001.10.05.15.35.38;	author morrison;	state Exp;
branches;
next	1.23;

1.23
date	2001.10.05.15.23.36;	author butler;	state Exp;
branches;
next	1.22;

1.22
date	2001.10.05.15.19.20;	author rbowers;	state Exp;
branches;
next	1.21;

1.21
date	2001.10.05.15.08.36;	author butler;	state Exp;
branches;
next	1.20;

1.20
date	2001.10.05.15.00.28;	author rbowers;	state Exp;
branches;
next	1.19;

1.19
date	2001.10.05.14.54.28;	author morrison;	state Exp;
branches;
next	1.18;

1.18
date	2001.10.05.14.53.45;	author morrison;	state Exp;
branches;
next	1.17;

1.17
date	2001.10.05.14.52.14;	author morrison;	state Exp;
branches;
next	1.16;

1.16
date	2001.10.05.14.51.10;	author morrison;	state Exp;
branches;
next	1.15;

1.15
date	2001.10.05.14.49.59;	author morrison;	state Exp;
branches;
next	1.14;

1.14
date	2001.10.05.14.48.38;	author morrison;	state Exp;
branches;
next	1.13;

1.13
date	2001.10.05.14.47.19;	author butler;	state Exp;
branches;
next	1.12;

1.12
date	2001.10.05.14.46.52;	author morrison;	state Exp;
branches;
next	1.11;

1.11
date	2001.10.05.14.46.06;	author morrison;	state Exp;
branches;
next	1.10;

1.10
date	2001.10.05.14.45.51;	author morrison;	state Exp;
branches;
next	1.9;

1.9
date	2001.10.05.14.45.17;	author morrison;	state Exp;
branches;
next	1.8;

1.8
date	2001.10.05.14.44.54;	author morrison;	state Exp;
branches;
next	1.7;

1.7
date	2001.10.05.14.42.53;	author morrison;	state Exp;
branches;
next	1.6;

1.6
date	2001.10.05.14.42.30;	author morrison;	state Exp;
branches;
next	1.5;

1.5
date	2001.10.05.14.42.07;	author morrison;	state Exp;
branches;
next	1.4;

1.4
date	2001.10.05.14.41.33;	author morrison;	state Exp;
branches;
next	1.3;

1.3
date	2001.10.05.14.40.45;	author morrison;	state Exp;
branches;
next	1.2;

1.2
date	2001.10.05.14.33.11;	author rbowers;	state Exp;
branches;
next	1.1;

1.1
date	2001.10.05.13.53.40;	author morrison;	state Exp;
branches;
next	;


desc
@@


1.54
log
@The old regression test scripts are being replaced by something else.  Likely it'll be Corredor with some unit test framework.  The old scripts are so far out of sync and so inadequate that it's simply not worth it any more.
@
text
@#!/bin/sh
#
# g e o m e t r y
#
# This is the initial brlcad geometry test.  All of the supported primitives
# that have values set for the mged 'in' and 'db put' commands have 
# corresponding geometry created and then the resulting views are 
# raytraced and compared.  Different versions of supported databases may
# also be compared to each other and corresponding differences are
# logged.
#
###
# Source function library
. `dirname $0`/library

# this is not necessary, but including anyways for now
initializeVariable TEST "geometry"

start ( ) {
    
#
# these should be the brlcad "database names" that are used to create geometry in a geometry editor
#
PRIMITIVES="arb5 arb6 arb7 arb8 arbn ars bot cline dsp ebm ehy ell epa eto extrude grip half hf nmg nurb part pg pipe rec rhc rpc sketch sph submodel tgc tor vol xxx"
#
# these are the versions that are supported and considered valid
#
VER="4 5"

#
# Start of Primitive Arguments
###

#
# Arbitrary Regular Polyhedron with 4-faces (arb4) Arguments
# 
# in args =>
#
arb4_IN_ARGS="50 -50 -50 50 50 -50 50 50 50 -50 50 -50"
arb4_DB_ARGS="V1 {50 -50 -50} V2 {50 50 -50} V3 {50 50 50} V4 {50 50 50} V5 {-50 50 -50} V6 {-50 50 -50} V7 {-50 50 -50} V8 {-50 50 -50}"

#
# Arbitrary Regular Polyhedron with 5-faces (arb5) Arguments
# 
# in args =>
#
arb5_IN_ARGS="50 -50 -50 50 50 -50 50 50 50 50 -50 50 -50 0 0"
arb5_DB_ARGS="V1 {50 -50 -50} V2 {50 50 -50} V3 {50 50 50} V4 {50 -50 50} V5 {-50 0 0} V6 {-50 0 0} V7 {-50 0 0} V8 {-50 0 0}"

#
# Arbitrary Regular Polyhedron with 6-faces (arb6) Arguments
# 
# in args =>
#
arb6_IN_ARGS="50 -50 -50 50 50 -50 50 50 50 50 -50 50 -50 0 -50 -50 0 50"
arb6_DB_ARGS="V1 {50 -50 -50} V2 {50 50 -50} V3 {50 50 50} V4 {50 -50 50} V5 {-50 0 -50} V6 {-50 0 -50} V7 {-50 0 50} V8 {-50 0 50}"

#
# Arbitrary Regular Polyhedron with 7-faces (arb7) Arguments
# 
# in args =>
#
arb7_IN_ARGS="50 -50 -25 50 50 -25 50 50 75 50 -50 25 -50 -50 -25 -50 50 -25 -50 50 25"
arb7_DB_ARGS="V1 {50 -50 -25} V2 {50 50 -25} V3 {50 50 75} V4 {50 -50 25} V5 {-50 -50 -25} V6 {-50 50 -25} V7 {-50 50 25} V8 {-50 -50 -25}"

#
# Arbitrary Regular Polyhedron with 8-faces (arb8) Arguments
# 
# in args =>
#
arb8_IN_ARGS="50 -50 -50 50 50 -50 50 50 50 50 -50 50 -50 -50 -50 -50 50 -50 -50 50 50 -50 -50 50"
arb8_DB_ARGS="V1 {50 -50 -50} V2 {50 50 -50} V3 {50 50 50} V4 {50 -50 50} V5 {-50 -50 -50} V6 {-50 50 -50} V7 {-50 50 50} V8 {-50 -50 50}"

#
# (arbn) Arguments
# 
# in args =>
#
arbn_IN_ARGS=""
arbn_DB_ARGS=""

#
# (ars) Arguments
# 
# in args =>
#
ars_IN_ARGS="4 4 0 0 0 0 0 1 1 0 1 1 1 1 0 1 1 0 0 2 1 0 2 1 1 2 0 1 2 0 0 2.5"
ars_DB_ARGS="NC 4 PPC 4 C0 { { 0 0 0 } { 0 0 0 } { 0 0 0 } { 0 0 0 } } C1 { { 0 0 1 } { 1 0 1 } { 1 1 1 } { 0 1 1 } } C2 { { 0 0 2 } { 1 0 2 } { 1 1 2 } { 0 1 2 } } C3 { { 0 0 2.5 } { 0 0 2.5 } { 0 0 2.5 } { 0 0 2.5 } }"

#
# Bag O'Triangles (bot) Arguments
# 
# in args => name num_vertices num_triangles mode orientation vertex1 vertex2... face1 face2 ...
#
bot_IN_ARGS="4 4 2 1 0 0 0 50 0 0 50 50 0 50 50 50 0 1 2 1 2 3 0 1 3 0 2 3 "
bot_DB_ARGS="mode volume orient no V { { 0 0 0 } { 50 0 0 } { 50 50 0 } { 50 50 50 } } F { { 0 1 2 } { 1 2 3 } { 0 1 3 } { 0 2 3 } }"

#
# (cline) Arguments
# 
# in args =>
#
cline_IN_ARGS=""
cline_DB_ARGS=""

#
# (dsp) Arguments
# 
# in args =>
#
dsp_IN_ARGS=""
dsp_DB_ARGS=""

#
# Extruded Bitmap (ebm) Arguments
# 
# in args => bw_file width height extrusion_distance
#
ebm_IN_ARGS="${TEST}.ebm.bw 32 32 10"
ebm_DB_ARGS="F ${TEST}.ebm.bw W 32 N 32 H 10 M { 1 0 0 0 0 1 0 0 0 0 1 0 0 0 0 1 }"

#
# (ehy) Arguments
# 
# in args =>
#
ehy_IN_ARGS="0 0 0 0 0 180 75 0 0 50 80"
ehy_DB_ARGS="V {0 0 0} H {0 0 180} A {1 0 0} r_1 75 r_2 50 c 80"

#
# Ellipsoid (ell) Arguments
#
# in args => name type xvertex yvertex zvertex radius1 radius2 radius3
#
ell_IN_ARGS="0 0 0  45 0 0  0 30 0  0 0 15"
ell_DB_ARGS="V { 0 0 0 } A {45 0 0} B {0 30 0} C {0 0 15}"

#
# Elliptical Paraboloid (epa) Arguments
# 
# in args =>
#
epa_IN_ARGS="0 0 0  0 0 10  5 0 0 2"
epa_DB_ARGS="V {0 0 0} H {0 0 10} A {1 0 0} r_1 5 r_2 2"

#
# Elliptical Toroid (eto) Arguments
# 
# in args =>
#
eto_IN_ARGS="0 0 0 0 0 1 8 0 0 4 1 "
eto_DB_ARGS="V {0 0 0} N {0 0 1} C {0 0 4} r 8 r_d 1"

#
# (extrude) Arguments
# 
# in args =>
#
extrude_IN_ARGS=""
extrude_DB_ARGS=""

#
# (grip) Arguments
# 
# in args =>
#
grip_IN_ARGS=""
grip_DB_ARGS=""

#
# HALFSPACE (half) Arguments
# 
# in args => name type outward-pointing-normal distance-from-origin
#
half_IN_ARGS="0 0 1  0"
half_DB_ARGS="N {0 0 1} d 0"

#
# (hf) Arguments
# 
# in args =>
#
hf_IN_ARGS=""
hf_DB_ARGS=""

#
# (nmg) Arguments
# 
# in args =>
#
nmg_IN_ARGS=""
nmg_DB_ARGS=""

#
# (nurb) Arguments
# 
# in args =>
#
nurb_IN_ARGS=""
nurb_DB_ARGS=""

#
# (part) Arguments
# 
# in args => vertex vectorH v_radius h_radius
#
part_IN_ARGS="0 0 0  0 0 50  10 20"
part_DB_ARGS="V {0 0 0} H {0 0 50} r_v 10 r_h 20"

#
# (pg) Arguments
# 
# in args =>
#
pg_IN_ARGS=""
pg_DB_ARGS=""

#
# (pipe) Arguments
# 
# in args =>
#
pipe_IN_ARGS="6 0 0 0 10 12 25 100 0 0 10 12 25 100 100 0 10 12 25 100 100 100 10 12 25 100 100 200 10 12 25 100 200 200 10 12 25"
pipe_DB_ARGS="V0 { 0 0 0 } O0 12 I0 10 R0 25 V1 { 100 0 0 } O1 12 I1 10 R1 25 V2 { 100 100 0 } O2 12 I2 10 R2 25 V3 { 100 100 100 } O3 12 I3 10 R3 25 V4 { 100 100 200 } O4 12 I4 10 R4 25 V5 { 100 200 200 } O5 12 I5 10 R5 25"

#
# (rec) Arguments
# 
# in args => xvertex yvertex zvertex xheight yheight zheight
#            xradius1 yradius1 zradius1 xradius2 yradius2 zradius2
#
rec_IN_ARGS="0 0 0  0 0 50  40 0 0  0 10 0"
rec_DB_ARGS="V {0 0 0} H {0 0 50} A {40 0 0} B {0 10 0} C {40 0 0} D {0 10 0}"

#
# (rhc) Arguments
# 
# in args => xvertex yvertex zvertex xheight yheight zheight 
#            rect. half-width apex-to-asymptopes dist.
#
rhc_IN_ARGS="0 0 0 0 0 100 100 0 0 10 50"
rhc_DB_ARGS="V {0 0 0} H {0 0 100} B {100 0 0} r 10 c 50"

#
# (rpc) Arguments
# 
# in args =>
#
rpc_IN_ARGS="0 0 0  10 0 0 0 0 10 2"
rpc_DB_ARGS="V {0 0 0} H {10 0 0} B {0 0 10} r 2"

#
# (sketch) Arguments
# 
# in args =>
#
sketch_IN_ARGS=""
sketch_DB_ARGS=""

#
# Sphere (sph) Arguments
#
# Note that the sph is really an ell with all radii equal.
# 
# in args => name type xvertex yvertex zvertex radius1
#
sph_IN_ARGS="0 0 0 45"
sph_DB_ARGS="V { 0 0 0 } A {45 0 0} B {0 45 0} C {0 0 45}"

#
# (submodel) Arguments
# 
# in args =>
#
submodel_IN_ARGS=""
submodel_DB_ARGS=""

#
# (tgc) Arguments
#
# in args => xvertex yvertex zvertex xheight yheight zheight
#            xradiusA yradiusA zradiusA xradiusB yradiusB zradiusB
#            radiusC radiusD
tgc_IN_ARGS="0 0 0  0 0 50  40 0 0  0 10 0  20 5"
tgc_DB_ARGS="V {0 0 0} H {0 0 50} A {40 0 0} B {0 10 0} C {20 0 0} D {0 5 0}"
 
#
# Torus (tor) Arguments
#
# in args => name type xvertex yvertex zvertex xnormal ynormal znormal radius1 radius2
#
tor_IN_ARGS="0 0 0 0 0 1 30 20"
tor_DB_ARGS="V { 0 0 0 } H { 1 0 0 } r_a 50 r_h 25"

#
# (vol) Arguments
# 
# in args => file xNcells yNcells zNcells lower_threshold upper_threshold
#            xvoxelsize yvoxelsize zvoxelsize
#
vol_IN_ARGS="${TEST}.vol.bw 32 32 8 128 255 10 10 10"
vol_DB_ARGS="file ${TEST}.vol.bw w 32 n 32 d 8 lo 128 hi 255 size {10 10 10} mat {1 0 0 0 0 1 0 0 0 0 1 0 0 0 0 1}"

#
# (xxx) Arguments
# 
# in args =>
#
xxx_IN_ARGS=""
xxx_DB_ARGS=""

#
# End of Primitive Arguments
###

clean

PATH=$BRLCAD_ROOT/bin:$PATH

#
# iterate over primitives
#
for PRIM in $PRIMITIVES ; do

    unset IN_ARGS ; IN_ARGS="echo \$${PRIM}_IN_ARGS" ; IN_ARGS=`eval $IN_ARGS`
    unset DB_ARGS ; DB_ARGS="echo \$${PRIM}_DB_ARGS" ; DB_ARGS=`eval $DB_ARGS`

    if [ "x$IN_ARGS" = "x" ] && [ "x$DB_ARGS" = "x" ]  ; then
        warn "Primitive ${PRIM} has no arguments set, skipping"
    else

        log ""
        log "Evaluating $PRIM"
        log "===================="


        #
        # primitive specific tests and initialization
        #
	if [ "x${PRIM}" = "xebm" ]; then
            #
            # If the solid is an ebm, create the bitmap to extrude
	    #
	    gencolor -r205 0 16 32 64 128 | \
                dd of=${TEST}.ebm.bw bs=1024 count=1 >/dev/null 2>&1

            if [ $? != 0 ] ; then
                warn "gencolor failed to create ebm primitive bitmap datafile properly"
            fi

	elif [ "x${PRIM}" = "xvol" ]; then
	    #
	    # Create a 32x32x8 element voxel map by
	    # concatenating 8 bw files.
	    #
	    gencolor -r205 0 16 32 64 128 | \
                dd of=${TEST}.tmp.bw bs=1024 count=1 >/dev/null 2>&1
	    cat ${TEST}.tmp.bw > ${TEST}.vol.bw
	    gencolor -r205 16 32 64 128 0 | \
                dd of=${TEST}.tmp.bw bs=1024 count=1 >/dev/null 2>&1
	    cat ${TEST}.tmp.bw >> ${TEST}.vol.bw
	    gencolor -r205 32 64 128 0 16 | \
                dd of=${TEST}.tmp.bw bs=1024 count=1 >/dev/null 2>&1
	    cat ${TEST}.tmp.bw >> ${TEST}.vol.bw
	    gencolor -r205 64 128 0 16 32 | \
                dd of=${TEST}.tmp.bw bs=1024 count=1 >/dev/null 2>&1
	    cat ${TEST}.tmp.bw >> ${TEST}.vol.bw
	    gencolor -r205 128 0 16 32 64 | \
                dd of=${TEST}.tmp.bw bs=1024 count=1 >/dev/null 2>&1
	    cat ${TEST}.tmp.bw >> ${TEST}.vol.bw
	    gencolor -r205 0 16 32 64 128 | \
                dd of=${TEST}.tmp.bw bs=1024 count=1 >/dev/null 2>&1
	    cat ${TEST}.tmp.bw >> ${TEST}.vol.bw
	    gencolor -r205 16 32 64 128 0 | \
                dd of=${TEST}.tmp.bw bs=1024 count=1 >/dev/null 2>&1
	    cat ${TEST}.tmp.bw >> ${TEST}.vol.bw
	    gencolor -r205 32 64 128 0 16 | \
                dd of=${TEST}.tmp.bw bs=1024 count=1 >/dev/null 2>&1
	    cat ${TEST}.tmp.bw >> ${TEST}.vol.bw

            if expr "`ls -s ${TEST}.vol.bw | awk '{print $1}'`" = "0" ; then
                warn "failed to create vol primitive volume map datafile properly"
            fi
            rm ${TEST}.tmp.bw
	fi


        # make sure mged will run
        mged -c > /dev/null 2>&1 <<EOF
q
EOF
[ $? != 0 ] && bomb "MGED fails to run"


        #
        # Test 'in' command
        #
        for VERSION in $VER ; do
            mged -c > ${TEST}.${PRIM}.${VERSION}.mged.log 2>&1 <<EOF
# Start MGED script

set glob_compat_mode 0

set mged_default(db_version) $VERSION

puts "Opening database \[${TEST}.${PRIM}.${VERSION}.g\]"
opendb ${TEST}.${PRIM}.${VERSION}.g

set autosize 0
units mm

Z
viewsize 100 
ae 35 25

set inval "in ${PRIM}.in.s $PRIM $IN_ARGS"
puts "Running \[\$inval\]"
eval \$inval
saveview ${TEST}.${PRIM}.${VERSION}.in.rt

q

# End MGED script
EOF
            if [ $? != 0 ] ; then
                warn "v$VERSION $PRIM 'in' command failed"
            fi
        done
        # end loop over versions for in command



        #
        # Test 'putmat' command
        #
        for VERSION in $VER ; do
            mged -c > ${TEST}.${PRIM}.${VERSION}.mged.log 2>&1 <<EOF
###################
# Start MGED script

set glob_compat_mode 0

set mged_default(db_version) $VERSION

puts "Opening database \[${TEST}.${PRIM}.${VERSION}.g\]"
opendb ${TEST}.${PRIM}.${VERSION}.g

set autosize 0
units mm

Z
viewsize 100 
ae 35 25

set inval "in ${PRIM}.putmat.s $PRIM $IN_ARGS"
puts "Running \[\$inval\]"
eval \$inval

Z
viewsize 100 
ae 35 25
r ${PRIM}.putmat.r u ${PRIM}.putmat.s
# sca .5, rot 10 10 -10, tra 20 -20 20
set putmatval "putmat ${PRIM}.putmat.r/${PRIM}.putmat.s { 0.969846 -0.17101 -0.173648 19.3442  0.200706 0.96461 0.17101 -11.8579  0.138258 -0.200706 0.969846 26.1762  0 0 0 1 }"
puts "Running \[\$putmatval\]"
eval \$putmatval

push ${PRIM}.putmat.r
shader ${PRIM}.putmat.r {checker {s 4}}

Z
viewsize 100 
ae 35 25
e ${PRIM}.putmat.r
saveview ${TEST}.${PRIM}.${VERSION}.putmat.rt

q

# End MGED script
###################
EOF
            if [ $? != 0 ] ; then
                warn "v$VERSION $PRIM 'putmat' command failed"
            fi
        done
        # end loop over versions for putmat command


        #
        # Test make' command
        #
        for VERSION in $VER ; do
            mged -c > ${TEST}.${PRIM}.${VERSION}.mged.log 2>&1 <<EOF
###################
# Start MGED script

set glob_compat_mode 0

set mged_default(db_version) $VERSION

puts "Opening database \[${TEST}.${PRIM}.${VERSION}.g\]"
opendb ${TEST}.${PRIM}.${VERSION}.g

set autosize 0
units mm

Z
viewsize 100 
ae 35 25

set makeval "make ${PRIM}.make.s $PRIM"
puts "Running \[\$makeval\]"
eval \$makeval
saveview ${TEST}.${PRIM}.${VERSION}.make.rt

q

# End MGED script
###################
EOF
            if [ $? != 0 ] ; then
                warn "v$VERSION $PRIM 'make' command failed"
            fi
        done
        # end loop over versions for make command


        #
        # Test 'db put' command
        #
        for VERSION in $VER ; do
            mged -c > ${TEST}.${PRIM}.${VERSION}.mged.log 2>&1 <<EOF
###################
# Start MGED script

set glob_compat_mode 0

set mged_default(db_version) $VERSION

puts "Opening database \[${TEST}.${PRIM}.${VERSION}.g\]"
opendb ${TEST}.${PRIM}.${VERSION}.g

set autosize 0
units mm

Z
viewsize 100 
ae 35 25

set dbputval "db put ${PRIM}.dbput.s $PRIM $DB_ARGS"
puts "Running \[\$dbputval\]"
eval \$dbputval
e ${PRIM}.dbput.s
saveview ${TEST}.${PRIM}.${VERSION}.dbput.rt

q

# End MGED script
###################
EOF
            if [ $? != 0 ] ; then
                warn "v$VERSION $PRIM 'db put' command failed"
            fi
        done
        # end loop over versions for db put command

        #
        # Version databases are now created, so we test them
        #


        for VERSION in $VER ; do
            if [ -f ${TEST}.${PRIM}.${VERSION}.g ] ; then
            
                log "Raytracing"

                [ -f ./${TEST}.${PRIM}.${VERSION}.in.rt ] && ./${TEST}.${PRIM}.${VERSION}.in.rt -B
                [ $? != 0 ] && warn "v$VERSION $PRIM 'in' rt failed"

                [ -f ./${TEST}.${PRIM}.${VERSION}.putmat.rt ] && ./${TEST}.${PRIM}.${VERSION}.putmat.rt -B
                [ $? != 0 ] && warn "v$VERSION $PRIM 'putmat' rt failed"

                [ -f ./${TEST}.${PRIM}.${VERSION}.make.rt ] && ./${TEST}.${PRIM}.${VERSION}.make.rt -B
                [ $? != 0 ] && warn "v$VERSION $PRIM 'make' rt failed"

                [ -f ./${TEST}.${PRIM}.${VERSION}.dbput.rt ] && ./${TEST}.${PRIM}.${VERSION}.dbput.rt -B
                [ $? != 0 ] && warn "v$VERSION $PRIM 'db put' rt failed"

                log "Converting to ascii (g2asc)"
                g2asc ${TEST}.${PRIM}.${VERSION}.g ${TEST}.${PRIM}.${VERSION}.g2asc.asc > ${TEST}.${PRIM}.${VERSION}.g2asc.log 2>&1
                [ $? != 0 ] && warn "v$VERSION $PRIM 'g2asc' failed"
 
                log "Converting to binary (asc2g)"
                asc2g ${TEST}.${PRIM}.${VERSION}.g2asc.asc ${TEST}.${PRIM}.${VERSION}.g2asc.asc2g.g > ${TEST}.${PRIM}.${VERSION}.asc2g.log 2>&1
                [ $? != 0 ] && warn "v$VERSION $PRIM 'asc2g' failed"

                log "Database diffing (g_diff) v${VERSION} against current"
                g_diff -f ${TEST}.${PRIM}.${VERSION}.g2asc.asc2g.g ${TEST}.${PRIM}.${VERSION}.g
                [ $? != 0 ] && warn "v$VERSION $PRIM 'g_diff' failed"
            else
                warn "No v$VERSION database was created for ${PRIM}"
            fi
            
        done  
        # end loop over vers

        log "Done with ${PRIM}"

    fi
    # end of test if primitive has values set

done  
# end loop over primitives


    return 0
}


clean ( ) {
    if [ ! "x$TEST" = "x" ] ; then
        rm -f ${TEST}.* > /dev/null 2>&1
    fi

    return 0
}


regress $1

exit $?
@


1.53
log
@*** empty log message ***
@
text
@@


1.52
log
@added better geometry handling, more modular structure
so now we can detect if a certain mged command fails (and/or is not supported)
also added a lot more error detection and cleaned up the output to be more simple
most everything now logs to a file as well
@
text
@a18 22
# initialize some variables, if not already set, to expected brlcadish values
initializeVariable PACKAGE_NAME brlcad
if [ "x$REGRESS_DIR" = "x" ] ; then
    if [ -d "$LPWD/../../$PACKAGE_NAME" ] ; then
        initializeVariable REGRESS_DIR "$LPWD/../.."
    elif [ -d "$LPWD/../$PACKAGE_NAME" ] ; then
        initializeVariable REGRESS_DIR "$LPWD/.."
    elif [ -d "$LPWD/$PACKAGE_NAME" ] ; then
        initializeVariable REGRESS_DIR "$LPWD"
    else
        warn "Unable to locate $PACKAGE_NAME (set REGRESS_DIR), using $LPWD anyways"
        initializeVariable REGRESS_DIR "$LPWD"
    fi
fi
__ARCH="$ARCH"
[ -x "${REGRESS_DIR}/brlcad/sh/machinetype.sh" ] && initializeVariable ARCH `${REGRESS_DIR}/brlcad/sh/machinetype.sh`
initializeVariable ARCH "$__ARCH"
__CADROOT="$BRLCAD_ROOT"
[ -d "${REGRESS_DIR}/${PACKAGE_NAME}.${ARCH}" ] && initializeVariable BRLCAD_ROOT "${REGRESS_DIR}/${PACKAGE_NAME}.${ARCH}"
initializeVariable BRLCAD_ROOT "$__CADROOT"


d381 1
a381 1
            if expr "`ls -s ${TEST}.vol.bw | awk '{print $1}'" = "0" ; then
d388 7
a618 7
stopTest ( ) {
    bomb "stop unimplemented"
}

status ( ) {
    bomb "status unimplemented"
}
d622 1
a622 1
        rm -f ${TEST}.*
d628 2
a629 21
case "$1" in
    start )
        start
        ;;
    stop )
        stopTest
        ;;
    restart )
        stopTest
        start
        ;;
    status )
        status
        ;;
    clean )
        clean
        ;;
    * )
        log "Usage: $0 {start|stop|restart|status|clean}"
        exit 1
esac
a631 1

@


1.51
log
@comment changes
@
text
@d46 1
a46 1
PRIMITIVES="arb4 arb5 arb6 arb7 arb8 arbn ars bot cline dsp ebm ehy ell epa eto extrude grip half hf nmg nurb part pg pipe rec rhc rpc sketch sph submodel tgc tor vol xxx"
d61 2
a62 2
# arb4_IN_ARGS="50 -50 -50 50 50 -50 50 50 50 -50 50 -50"
# arb4_DB_ARGS="V1 {50 -50 -50} V2 {50 50 -50} V3 {50 50 50} V4 {50 50 50} V5 {-50 50 -50} V6 {-50 50 -50} V7 {-50 50 -50} V8 {-50 50 -50}"
d69 2
a70 2
# arb5_IN_ARGS="50 -50 -50 50 50 -50 50 50 50 50 -50 50 -50 0 0"
# arb5_DB_ARGS="V1 {50 -50 -50} V2 {50 50 -50} V3 {50 50 50} V4 {50 -50 50} V5 {-50 0 0} V6 {-50 0 0} V7 {-50 0 0} V8 {-50 0 0}"
d77 2
a78 2
# arb6_IN_ARGS="50 -50 -50 50 50 -50 50 50 50 50 -50 50 -50 0 -50 -50 0 50"
# arb6_DB_ARGS="V1 {50 -50 -50} V2 {50 50 -50} V3 {50 50 50} V4 {50 -50 50} V5 {-50 0 -50} V6 {-50 0 -50} V7 {-50 0 50} V8 {-50 0 50}"
d85 2
a86 2
# arb7_IN_ARGS="50 -50 -25 50 50 -25 50 50 75 50 -50 25 -50 -50 -25 -50 50 -25 -50 50 25"
# arb7_DB_ARGS="V1 {50 -50 -25} V2 {50 50 -25} V3 {50 50 75} V4 {50 -50 25} V5 {-50 -50 -25} V6 {-50 50 -25} V7 {-50 50 25} V8 {-50 -50 -25}"
d141 2
a142 2
ebm_IN_ARGS="ebm.bw 32 32 10"
ebm_DB_ARGS="F ebm.bw W 32 N 32 H 10 M { 1 0 0 0 0 1 0 0 0 0 1 0 0 0 0 1 }"
d323 2
a324 2
vol_IN_ARGS="vol.bw 32 32 8 128 255 10 10 10"
vol_DB_ARGS="file vol.bw w 32 n 32 d 8 lo 128 hi 255 size {10 10 10} mat {1 0 0 0 0 1 0 0 0 0 1 0 0 0 0 1}"
d339 1
d342 3
d350 1
a350 1
    if [ "x$IN_ARGS" = "x" ] ; then
d354 8
d367 5
a371 2
                dd of=ebm.bw bs=1024 count=1 >/dev/null 2>&1
	fi
d373 1
a373 1
	if [ "x${PRIM}" = "xvol" ]; then
d379 2
a380 2
                dd of=tmp.bw bs=1024 count=1 >/dev/null 2>&1
	    cat tmp.bw > vol.bw
d382 2
a383 2
                dd of=tmp.bw bs=1024 count=1 >/dev/null 2>&1
	    cat tmp.bw >> vol.bw
d385 2
a386 2
                dd of=tmp.bw bs=1024 count=1 >/dev/null 2>&1
	    cat tmp.bw >> vol.bw
d388 2
a389 2
                dd of=tmp.bw bs=1024 count=1 >/dev/null 2>&1
	    cat tmp.bw >> vol.bw
d391 2
a392 2
                dd of=tmp.bw bs=1024 count=1 >/dev/null 2>&1
	    cat tmp.bw >> vol.bw
d394 2
a395 2
                dd of=tmp.bw bs=1024 count=1 >/dev/null 2>&1
	    cat tmp.bw >> vol.bw
d397 2
a398 2
                dd of=tmp.bw bs=1024 count=1 >/dev/null 2>&1
	    cat tmp.bw >> vol.bw
d400 7
a406 2
                dd of=tmp.bw bs=1024 count=1 >/dev/null 2>&1
	    cat tmp.bw >> vol.bw
a408 3
        log ""
        log "Evaluating $PRIM"
        log "===================="
d410 44
a453 2
        mged -c <<EOF
#
a454 1
#
d458 55
d514 1
a514 1
foreach version { 4 5 } { 
d516 2
a517 1
    set mged_default(db_version) \$version
d519 2
a520 2
    puts "Opening database \[${TEST}.${PRIM}.\$version.g\]"
    opendb ${TEST}.${PRIM}.\$version.g
d522 8
a529 52
    set autosize 0
    units mm

    Z
    viewsize 100 
    ae 35 25

    #
    # Edit 'in' args 
    #
    set inval "in ${PRIM}.in.s $PRIM $IN_ARGS"
    puts "Running \[\$inval\]"
    eval \$inval
    saveview ${TEST}.${PRIM}.\$version.in.rt

    Z
    viewsize 100 
    ae 35 25
    set makeval "make ${PRIM}.make.s $PRIM"
    puts "Running \[\$makeval\]"
    eval \$makeval
    saveview ${TEST}.${PRIM}.\$version.make.rt

    Z
    viewsize 100 
    ae 35 25
                
    #
    # Edit 'db put' args 
    #
    set dbputval "db put ${PRIM}.dbput.s $PRIM $DB_ARGS"
    puts "Running \[\$dbputval\]"
    eval \$dbputval
    saveview ${TEST}.${PRIM}.\$version.dbput.rt

    Z
    viewsize 100 
    ae 35 25
    r ${PRIM}.in.r u ${PRIM}.in.s
    # sca .5, rot 10 10 -10, tra 20 -20 20
    set putmatval "putmat ${PRIM}.in.r/${PRIM}.in.s { 0.969846 -0.17101 -0.173648 19.3442  0.200706 0.96461 0.17101 -11.8579  0.138258 -0.200706 0.969846 26.1762  0 0 0 1 }"
    eval \$putmatval

    push ${PRIM}.in.r
    shader ${PRIM}.in.r {checker {s 4}}

    Z
    viewsize 100 
    ae 35 25
    e ${PRIM}.in.r
    saveview ${TEST}.${PRIM}.\$version.trans.rt
} 
a532 1
#
d534 38
a571 1
#
d573 2
d576 15
d592 2
a593 20
    for version in $VER ; do
        log "Testing v$version database for ${PRIM}"
        if [ -f ${TEST}.${PRIM}.${version}.g ] ; then

            [ -f ./${TEST}.${PRIM}.${version}.in.rt ] && ./${TEST}.${PRIM}.${version}.in.rt
            [ -f ./${TEST}.${PRIM}.${version}.make.rt ] && ./${TEST}.${PRIM}.${version}.make.rt
            [ -f ./${TEST}.${PRIM}.${version}.dbput.rt ] && ./${TEST}.${PRIM}.${version}.dbput.rt
            [ -f ./${TEST}.${PRIM}.${version}.trans.rt ] && ./${TEST}.${PRIM}.${version}.trans.rt
            log "	Done raytracing"
        
            log "	Converting to ascii (g2asc)"
            g2asc ${TEST}.${PRIM}.${version}.g ${TEST}.${PRIM}.asc
            log "	Converting to binary (asc2g)"
            asc2g ${TEST}.${PRIM}.asc ${TEST}.${PRIM}.${version}.asc2g.g
            log "	Database diffing (g_diff)"
            g_diff -f ${TEST}.${PRIM}.${version}.asc2g.g ${TEST}.${PRIM}.5.g
        else
            bomb "No v$version database was created for ${PRIM}"
        fi
        log "Done testing $version database for ${PRIM}"
d595 28
a622 2
    done  
    # end loop over vers
d634 1
a634 1
stop ( ) {
a635 1
    return 0
a639 1
    return 0
d643 3
a645 1
    [ ! "x$TEST" = "x" ] && rm -f ${TEST}.*
d655 1
a655 1
        stop
d658 1
a658 1
        stop
@


1.50
log
@-* added vol support
@
text
@d44 1
a44 1
# these should be the brlcad "database" names that are used to create geometry in a geometry editor
a53 3
#
# Add 1) the full name of the primitive, 2) the 'in' command arg description,
#     3) 'in' command arguments, & 4) 'db put' command arguments.
d335 1
a335 1
# Done
d537 1
a537 1
        log "Usage: $0 {start|stop|restart|status}"
@


1.49
log
@added ars
@
text
@d100 1
a100 1
# Arbitrary Regular Polyhedron with Arbitrary number of Faces (arbn) Arguments
d104 2
a105 2
arbn_IN_ARGS="8 1 0 0 50 -1 0 0 50 0 1 0 50 0 -1 0 50 0 0 1 50 0 0 -1 50 0.57735 0.57735 0.57735 50 -0.57735 -0.57735 -0.57735 50"
arbn_DB_ARGS="N 8 P { {1 0 0 50} {-1 0 0 50} {0 1 0 50} {0 -1 0 50} {0 0 1 50} {0 0 -1 50} {0.57735 0.57735 0.57735 50} {-0.57735 -0.57735 -0.57735 50}}"
d323 2
a324 1
# in args =>
d326 2
a327 2
vol_IN_ARGS=""
vol_DB_ARGS=""
a352 3
        #
        # If the solid is an ebm, create the bitmap to extrude
	#
d354 3
d359 31
@


1.48
log
@Added ARBN
@
text
@d46 1
a46 1
PRIMITIVES="arb4 arb5 arb6 arb7 arb8 arbn arg bot cline dsp ebm ehy ell epa eto extrude grip half hf nmg nurb part pg pipe rec rhc rpc sketch sph submodel tgc tor vol xxx"
d108 1
a108 1
# (arg) Arguments
d112 2
a113 2
arg_IN_ARGS=""
arg_DB_ARGS=""
@


1.47
log
@-* added support for ebm
@
text
@d100 1
a100 1
# (arbn) Arguments
d104 2
a105 2
arbn_IN_ARGS=""
arbn_DB_ARGS=""
@


1.46
log
@partly functional
@
text
@d140 1
a140 1
# (ebm) Arguments
d142 1
a142 1
# in args =>
d144 2
a145 2
ebm_IN_ARGS=""
ebm_DB_ARGS=""
d351 8
@


1.45
log
@partly functional
@
text
@d169 1
a169 1
epa_DB_ARGS="epa V {0 0 0} H {0 0 10} A {1 0 0} r_1 5 r_2 2"
d177 1
a177 1
eto_DB_ARGS="eto V {0 0 0} N {0 0 1} C {0 0 4} r 8 r_d 1"
d275 1
a275 1
rpc_DB_ARGS="rpc V {0 0 0} H {10 0 0} B {0 0 10} r 2"
@


1.44
log
@getting close
@
text
@d29 2
a30 1
        bomb "Unable to locate $PACKAGE_NAME"
d34 1
a34 1
initializeVariable ARCH `${REGRESS_DIR}/brlcad/sh/machinetype.sh`
d36 3
a38 1
initializeVariable BRLCAD_ROOT "${REGRESS_DIR}/${PACKAGE_NAME}.${ARCH}"
d340 3
d345 2
a346 5
    log ""
    log "Evaluating $PRIM"
    log "===================="

    [ ! "x$TEST" = "x" ] && rm -f ${TEST}.*
d348 2
a349 2
    if [ "x${PRIM}_IN_ARGS" = "x" ] ; then
        warn "Primitive ${PRIM}_IN_ARGS has no arguments set, skipping"
d352 3
a354 4
        unset IN_ARGS
        unset DB_ARGS
        initializeVariable IN_ARGS "${PRIM}_IN_ARGS"
        initializeVariable DB_ARGS "${PRIM}_DB_ARGS"
a365 2
    puts "Creating v\$version database"

d368 1
d382 1
d389 3
a391 1
    make ${PRIM}.make.s $PRIM
d401 3
a403 2
    set dbput "db put ${PRIM}.dbput.s $PRIM $DB_ARGS"
    eval \$dbput
d433 1
a433 1
        log "Testing v$version database"
d449 1
a449 1
            bomb "No v$version database was created"
d451 1
a451 1
        log "Done testing $version database"
d476 5
d495 3
@


1.43
log
@*** empty log message ***
@
text
@d61 2
a62 2
arb4_IN_ARGS="50 -50 -50 50 50 -50 50 50 50 -50 50 -50"
arb4_DB_ARGS="V1 {50 -50 -50} V2 {50 50 -50} V3 {50 50 50} V4 {50 50 50} V5 {-50 50 -50} V6 {-50 50 -50} V7 {-50 50 -50} V8 {-50 50 -50}"
d69 2
a70 2
arb5_IN_ARGS="50 -50 -50 50 50 -50 50 50 50 50 -50 50 -50 0 0"
arb5_DB_ARGS="V1 {50 -50 -50} V2 {50 50 -50} V3 {50 50 50} V4 {50 -50 50} V5 {-50 0 0} V6 {-50 0 0} V7 {-50 0 0} V8 {-50 0 0}"
d77 2
a78 2
arb6_IN_ARGS="50 -50 -50 50 50 -50 50 50 50 50 -50 50 -50 0 -50 -50 0 50"
arb6_DB_ARGS="V1 {50 -50 -50} V2 {50 50 -50} V3 {50 50 50} V4 {50 -50 50} V5 {-50 0 -50} V6 {-50 0 -50} V7 {-50 0 50} V8 {-50 0 50}"
d85 2
a86 2
arb7_IN_ARGS="50 -50 -25 50 50 -25 50 50 75 50 -50 25 -50 -50 -25 -50 50 -25 -50 50 25"
arb7_DB_ARGS="V1 {50 -50 -25} V2 {50 50 -25} V3 {50 50 75} V4 {50 -50 25} V5 {-50 -50 -25} V6 {-50 50 -25} V7 {-50 50 25} V8 {-50 -50 -25}"
d343 1
a343 1
    rm -f ${GEOMETRY}.*
@


1.42
log
@Added args for HALFSPACE.
@
text
@d43 4
a46 1
PRIMITIVES="arb arbn arg bot cline dsp ebm ehy ell epa eto extrude grip half hf nmg nurb part pg pipe rec rhc rpc sketch sph submodel tgc tor vol xxx"
d57 33
a89 1
# (arb) Arguments
d93 2
a94 2
arb_IN_ARGS=""
arb_DB_ARGS=""
@


1.41
log
@Added code for part
@
text
@d160 1
a160 1
# in args =>
@


1.40
log
@Put in HALFSPACE info.
@
text
@d192 1
a192 1
# in args =>
d194 2
a195 2
part_IN_ARGS=""
part_DB_ARGS=""
@


1.39
log
@*** empty log message ***
@
text
@d158 1
a158 1
# (half) Arguments
d162 2
a163 2
half_IN_ARGS=""
half_DB_ARGS=""
@


1.38
log
@*** empty log message ***
@
text
@d40 1
a40 1

d42 1
a44 1

@


1.37
log
@*** empty log message ***
@
text
@d58 2
a59 2
arb_IN_ARGS ""
arb_DB_ARGS ""
d66 2
a67 2
arbn_IN_ARGS ""
arbn_DB_ARGS ""
d74 2
a75 2
arg_IN_ARGS ""
arg_DB_ARGS ""
d82 2
a83 2
bot_IN_ARGS "4 4 2 1 0 0 0 50 0 0 50 50 0 50 50 50 0 1 2 1 2 3 0 1 3 0 2 3 "
bot_DB_ARGS "mode volume orient no V { { 0 0 0 } { 50 0 0 } { 50 50 0 } { 50 50 50 } } F { { 0 1 2 } { 1 2 3 } { 0 1 3 } { 0 2 3 } }"
d90 2
a91 2
cline_IN_ARGS ""
cline_DB_ARGS ""
d98 2
a99 2
dsp_IN_ARGS ""
dsp_DB_ARGS ""
d106 2
a107 2
ebm_IN_ARGS ""
ebm_DB_ARGS ""
d114 2
a115 2
ehy_IN_ARGS "0 0 0 0 0 180 75 0 0 50 80"
ehy_DB_ARGS "V {0 0 0} H {0 0 180} A {1 0 0} r_1 75 r_2 50 c 80"
d122 2
a123 2
ell_IN_ARGS "0 0 0  45 0 0  0 30 0  0 0 15"
ell_DB_ARGS "V { 0 0 0 } A {45 0 0} B {0 30 0} C {0 0 15}"
d130 2
a131 2
epa_IN_ARGS "0 0 0  0 0 10  5 0 0 2"
epa_DB_ARGS "epa V {0 0 0} H {0 0 10} A {1 0 0} r_1 5 r_2 2"
d138 2
a139 2
eto_IN_ARGS "0 0 0 0 0 1 8 0 0 4 1 "
eto_DB_ARGS "eto V {0 0 0} N {0 0 1} C {0 0 4} r 8 r_d 1"
d146 2
a147 2
extrude_IN_ARGS ""
extrude_DB_ARGS ""
d154 2
a155 2
grip_IN_ARGS ""
grip_DB_ARGS ""
d162 2
a163 2
half_IN_ARGS ""
half_DB_ARGS ""
@


1.36
log
@*** empty log message ***
@
text
@d58 2
a59 2
    set arb_IN_ARGS ""
    set arb_DB_ARGS ""
d66 2
a67 2
    set arbn_IN_ARGS ""
    set arbn_DB_ARGS ""
d74 2
a75 2
    set arg_IN_ARGS ""
    set arg_DB_ARGS ""
d82 2
a83 2
    set bot_IN_ARGS "4 4 2 1 0 0 0 50 0 0 50 50 0 50 50 50 0 1 2 1 2 3 0 1 3 0 2 3 "
    set bot_DB_ARGS "mode volume orient no V { { 0 0 0 } { 50 0 0 } { 50 50 0 } { 50 50 50 } } F { { 0 1 2 } { 1 2 3 } { 0 1 3 } { 0 2 3 } }"
d90 2
a91 2
    set cline_IN_ARGS ""
    set cline_DB_ARGS ""
d98 2
a99 2
    set dsp_IN_ARGS ""
    set dsp_DB_ARGS ""
d106 2
a107 2
    set ebm_IN_ARGS ""
    set ebm_DB_ARGS ""
d114 2
a115 2
    set ehy_IN_ARGS "0 0 0 0 0 180 75 0 0 50 80"
    set ehy_DB_ARGS "V {0 0 0} H {0 0 180} A {1 0 0} r_1 75 r_2 50 c 80"
d122 2
a123 2
    set ell_IN_ARGS "0 0 0  45 0 0  0 30 0  0 0 15"
    set ell_DB_ARGS "V { 0 0 0 } A {45 0 0} B {0 30 0} C {0 0 15}"
d130 2
a131 2
    set epa_IN_ARGS "0 0 0  0 0 10  5 0 0 2"
    set epa_DB_ARGS "epa V {0 0 0} H {0 0 10} A {1 0 0} r_1 5 r_2 2"
d138 2
a139 2
    set eto_IN_ARGS "0 0 0 0 0 1 8 0 0 4 1 "
    set eto_DB_ARGS "eto V {0 0 0} N {0 0 1} C {0 0 4} r 8 r_d 1"
d146 2
a147 2
    set extrude_IN_ARGS ""
    set extrude_DB_ARGS ""
d154 2
a155 2
    set grip_IN_ARGS ""
    set grip_DB_ARGS ""
d162 2
a163 2
    set half_IN_ARGS ""
    set half_DB_ARGS ""
@


1.35
log
@*** empty log message ***
@
text
@d46 12
a57 12
    #
    # Start of Primitive Arguments
    #
    # Add 1) the full name of the primitive, 2) the 'in' command arg description,
    #     3) 'in' command arguments, & 4) 'db put' command arguments.
    ###

    #
    # (arb) Arguments
    # 
    # in args =>
    #
d61 5
a65 5
    #
    # (arbn) Arguments
    # 
    # in args =>
    #
d69 5
a73 5
    #
    # (arg) Arguments
    # 
    # in args =>
    #
d77 5
a81 5
    #
    # Bag O'Triangles (bot) Arguments
    # 
    # in args => name num_vertices num_triangles mode orientation vertex1 vertex2... face1 face2 ...
    #
d85 5
a89 5
    #
    # (cline) Arguments
    # 
    # in args =>
    #
d93 5
a97 5
    #
    # (dsp) Arguments
    # 
    # in args =>
    #
d101 5
a105 5
    #
    # (ebm) Arguments
    # 
    # in args =>
    #
d109 5
a113 5
    #
    # (ehy) Arguments
    # 
    # in args =>
    #
d117 5
a121 5
    #
    # Ellipsoid (ell) Arguments
    #
    # in args => name type xvertex yvertex zvertex radius1 radius2 radius3
    #
d125 5
a129 5
    #
    # Elliptical Paraboloid (epa) Arguments
    # 
    # in args =>
    #
d133 5
a137 5
    #
    # Elliptical Toroid (eto) Arguments
    # 
    # in args =>
    #
d141 5
a145 5
    #
    # (extrude) Arguments
    # 
    # in args =>
    #
d149 5
a153 5
    #
    # (grip) Arguments
    # 
    # in args =>
    #
d157 5
a161 5
    #
    # (half) Arguments
    # 
    # in args =>
    #
d165 37
a201 37
    #
    # (hf) Arguments
    # 
    # in args =>
    #
    set hf_IN_ARGS ""
    set hf_DB_ARGS ""

    #
    # (nmg) Arguments
    # 
    # in args =>
    #
    set nmg_IN_ARGS ""
    set nmg_DB_ARGS ""

    #
    # (nurb) Arguments
    # 
    # in args =>
    #
    set nurb_IN_ARGS ""
    set nurb_DB_ARGS ""

    #
    # (part) Arguments
    # 
    # in args =>
    #
    set part_IN_ARGS ""
    set part_DB_ARGS ""

    #
    # (pg) Arguments
    # 
    # in args =>
    #
@


1.34
log
@*** empty log message ***
@
text
@d202 2
a203 2
    set pg_IN_ARGS ""
    set pg_DB_ARGS ""
d205 7
a211 7
    #
    # (pipe) Arguments
    # 
    # in args =>
    #
    set pipe_IN_ARGS "6 0 0 0 10 12 25 100 0 0 10 12 25 100 100 0 10 12 25 100 100 100 10 12 25 100 100 200 10 12 25 100 200 200 10 12 25"
    set pipe_DB_ARGS "V0 { 0 0 0 } O0 12 I0 10 R0 25 V1 { 100 0 0 } O1 12 I1 10 R1 25 V2 { 100 100 0 } O2 12 I2 10 R2 25 V3 { 100 100 100 } O3 12 I3 10 R3 25 V4 { 100 100 200 } O4 12 I4 10 R4 25 V5 { 100 200 200 } O5 12 I5 10 R5 25"
@


1.33
log
@*** empty log message ***
@
text
@a44 24
for PRIM in $PRIMITIVES ; do

    log ""
    log "Evaluating $PRIM"
    log "===================="

    rm -f ${GEOMETRY}.*

    if [ "x${PRIM}_IN_ARGS" = "x" ] ; then
        warn "Primitive ${PRIM}_IN_ARGS has no arguments set, skipping"
    else

        unset IN_ARGS
        unset DB_ARGS
        initializeVariable IN_ARGS "${PRIM}_IN_ARGS"
        initializeVariable DB_ARGS "${PRIM}_DB_ARGS"

        mged -c <<EOF
#
# Start MGED script
#

set glob_compat_mode 0

d213 8
a220 8
    #
    # (rec) Arguments
    # 
    # in args => xvertex yvertex zvertex xheight yheight zheight
    #            xradius1 yradius1 zradius1 xradius2 yradius2 zradius2
    #
    set rec_IN_ARGS "0 0 0  0 0 50  40 0 0  0 10 0"
    set rec_DB_ARGS "V {0 0 0} H {0 0 50} A {40 0 0} B {0 10 0} C {40 0 0} D {0 10 0}"
d222 8
a229 8
    #
    # (rhc) Arguments
    # 
    # in args => xvertex yvertex zvertex xheight yheight zheight 
    #            rect. half-width apex-to-asymptopes dist.
    #
    set rhc_IN_ARGS "0 0 0 0 0 100 100 0 0 10 50"
    set rhc_DB_ARGS "V {0 0 0} H {0 0 100} B {100 0 0} r 10 c 50"
d231 7
a237 7
    #
    # (rpc) Arguments
    # 
    # in args =>
    #
    set rpc_IN_ARGS "0 0 0  10 0 0 0 0 10 2"
    set rpc_DB_ARGS "rpc V {0 0 0} H {10 0 0} B {0 0 10} r 2"
d239 7
a245 7
    #
    # (sketch) Arguments
    # 
    # in args =>
    #
    set sketch_IN_ARGS ""
    set sketch_DB_ARGS ""
d247 9
a255 9
    #
    # Sphere (sph) Arguments
    #
    # Note that the sph is really an ell with all radii equal.
    # 
    # in args => name type xvertex yvertex zvertex radius1
    #
    set sph_IN_ARGS "0 0 0 45"
    set sph_DB_ARGS "V { 0 0 0 } A {45 0 0} B {0 45 0} C {0 0 45}"
d257 7
a263 7
    #
    # (submodel) Arguments
    # 
    # in args =>
    #
    set submodel_IN_ARGS ""
    set submodel_DB_ARGS ""
d265 8
a272 8
    #
    # (tgc) Arguments
    #
    # in args => xvertex yvertex zvertex xheight yheight zheight
    #            xradiusA yradiusA zradiusA xradiusB yradiusB zradiusB
    #            radiusC radiusD
    set tgc_IN_ARGS "0 0 0  0 0 50  40 0 0  0 10 0  20 5"
    set tgc_DB_ARGS "V {0 0 0} H {0 0 50} A {40 0 0} B {0 10 0} C {20 0 0} D {0 5 0}"
d274 44
a317 7
    #
    # Torus (tor) Arguments
    #
    # in args => name type xvertex yvertex zvertex xnormal ynormal znormal radius1 radius2
    #
    set tor_IN_ARGS "0 0 0 0 0 1 30 20"
    set tor_DB_ARGS "V { 0 0 0 } H { 1 0 0 } r_a 50 r_h 25"
d319 4
a322 7
    #
    # (vol) Arguments
    # 
    # in args =>
    #
    set vol_IN_ARGS ""
    set vol_DB_ARGS ""
d324 1
a324 7
    #
    # (xxx) Arguments
    # 
    # in args =>
    #
    set xxx_IN_ARGS ""
    set xxx_DB_ARGS ""
a325 3
    #
    # Done
    ###
@


1.32
log
@Added BOT solid
@
text
@d6 5
a10 1
# that have values set for the mged 'in' and 'db put' commands actually 
d158 1
a158 1
    # (eto) Arguments
@


1.31
log
@*** empty log message ***
@
text
@d98 1
a98 1
    # (bot) Arguments
d100 1
a100 1
    # in args =>
d102 2
a103 2
    set bot_IN_ARGS ""
    set bot_DB_ARGS ""
@


1.30
log
@*** empty log message ***
@
text
@d3 1
a3 1
# This is the initial brlcad test template
d5 4
a8 1

d12 3
d37 2
a38 2
TEST="geometry"
PRIMITIVES="tor arb arbn arg bot cline dsp ebm ehy ell epa eto extrude grip half hf nmg nurb part pg pipe rec rhc rpc sketch sph submodel tgc torus vol xxx"
@


1.29
log
@*** empty log message ***
@
text
@d1 30
d37 3
a39 3
    echo ""
    echo "Evaluating $PRIM"
    echo "===================="
d412 32
d445 1
a445 1
exit
@


1.28
log
@-* added pipe
@
text
@d1 1
a1 1

d11 1
a11 1
    rm -f ${PRIM}.*
d23 3
d292 1
a292 1
    opendb ${PRIM}.\$version.g
d306 1
a306 1
    saveview ${PRIM}.\$version.in.rt
d312 1
a312 1
    saveview ${PRIM}.\$version.make.rt
d323 1
a323 1
    saveview ${PRIM}.\$version.dbput.rt
d340 1
a340 1
    saveview ${PRIM}.\$version.trans.rt
d345 4
d352 2
a353 2
        echo "Testing v$version database"
        if [ -f ${PRIM}.${version}.g ] ; then
d355 5
a359 5
            [ -f ./${PRIM}.${version}.in.rt ] && ./${PRIM}.${version}.in.rt
            [ -f ./${PRIM}.${version}.make.rt ] && ./${PRIM}.${version}.make.rt
            [ -f ./${PRIM}.${version}.dbput.rt ] && ./${PRIM}.${version}.dbput.rt
            [ -f ./${PRIM}.${version}.trans.rt ] && ./${PRIM}.${version}.trans.rt
            echo "	Done raytracing"
d361 6
a366 6
            echo "	Converting to ascii (g2asc)"
            g2asc ${PRIM}.${version}.g ${PRIM}.asc
            echo "	Converting to binary (asc2g)"
            asc2g ${PRIM}.asc ${PRIM}.${version}.asc2g.g
            echo "	Database diffing (g_diff)"
            g_diff -f ${PRIM}.${version}.asc2g.g ${PRIM}.5.g
d368 1
a368 1
            echo "ERROR: No v$version database was created"
d370 1
a370 1
        echo "Done testing $version database"
@


1.27
log
@*** empty log message ***
@
text
@d191 2
a192 2
    set pipe_IN_ARGS ""
    set pipe_DB_ARGS ""
@


1.26
log
@*** empty log message ***
@
text
@d283 31
a313 36
    if { ! [ info exists ${PRIM}_IN_ARGS ] } {
        puts "Error: Primitive ${PRIM}_IN_ARGS has no arguments set, skipping"
    } else {

    puts "starting version"
        foreach version { 4 5 } { 

            puts "Creating v\$version database"

            set mged_default(db_version) \$version

            opendb ${PRIM}.\$version.g

            set autosize 0
            units mm

            Z
            viewsize 100 
            ae 35 25

            #
            # Edit 'in' args 
            #
            set inval "in ${PRIM}.in.s $PRIM $IN_ARGS"
            eval \$inval
            saveview ${PRIM}.\$version.in.rt

            Z
            viewsize 100 
            ae 35 25
            make ${PRIM}.make.s $PRIM
            saveview ${PRIM}.\$version.make.rt

            Z
            viewsize 100 
            ae 35 25
d315 24
a338 25
            #
            # Edit 'db put' args 
            #
            set dbput "db put ${PRIM}.dbput.s $PRIM $DB_ARGS"
            eval \$dbput
            saveview ${PRIM}.\$version.dbput.rt

            Z
            viewsize 100 
            ae 35 25
            r ${PRIM}.in.r u ${PRIM}.in.s
            # sca .5, rot 10 10 -10, tra 20 -20 20
            set putmatval "putmat ${PRIM}.in.r/${PRIM}.in.s { 0.969846 -0.17101 -0.173648 19.3442  0.200706 0.96461 0.17101 -11.8579  0.138258 -0.200706 0.969846 26.1762  0 0 0 1 }"
            eval \$putmatval

            push ${PRIM}.in.r
            shader ${PRIM}.in.r {checker {s 4}}

            Z
            viewsize 100 
            ae 35 25
            e ${PRIM}.in.r
            saveview ${PRIM}.\$version.trans.rt
        } 
    } 
d340 1
a340 1
    q
@


1.25
log
@-* added ehy
@
text
@d17 16
a32 1
    mged -c <<EOF
a33 2
    set glob_compat_mode 0
     
d306 1
a306 1
            set inval "in ${PRIM}.in.s $PRIM \$${PRIM}_IN_ARGS"
d323 1
a323 1
            set dbput "db put ${PRIM}.dbput.s $PRIM \$${PRIM}_DB_ARGS"
@


1.24
log
@*** empty log message ***
@
text
@d82 2
a83 2
    set ehy_IN_ARGS ""
    set ehy_DB_ARGS ""
@


1.23
log
@rpc added
@
text
@d13 4
d360 3
@


1.22
log
@-* added rhc
@
text
@d200 2
a201 2
    set rpc_IN_ARGS ""
    set rpc_DB_ARGS ""
@


1.21
log
@added eto
@
text
@d181 1
a181 1
    #            xradius1 yradius1 zradius1
d189 2
a190 1
    # in args =>
d192 2
a193 2
    set rhc_IN_ARGS ""
    set rhc_DB_ARGS ""
a230 2
    # 
    # in args =>
d232 6
a237 3
    set tgc_IN_ARGS ""
    set tgc_DB_ARGS ""

@


1.20
log
@-* added rec
@
text
@d102 2
a103 2
    set eto_IN_ARGS ""
    set eto_DB_ARGS ""
@


1.19
log
@*** empty log message ***
@
text
@d180 2
a181 1
    # in args =>
d183 2
a184 2
    set rec_IN_ARGS ""
    set rec_DB_ARGS ""
@


1.18
log
@*** empty log message ***
@
text
@a17 8
    # Ellipsoid (ell) Arguments
    #
    # in args => name type xvertex yvertex zvertex radius1 radius2 radius3
    #
    set ell_IN_ARGS "0 0 0  45 0 0  0 30 0  0 0 15"
    set ell_DB_ARGS "V { 0 0 0 } A {45 0 0} B {0 30 0} C {0 0 15}"

    #
d80 8
@


1.17
log
@*** empty log message ***
@
text
@a17 18
    # Torus (tor) Arguments
    #
    # in args => name type xvertex yvertex zvertex xnormal ynormal znormal radius1 radius2
    #
    set tor_IN_ARGS "0 0 0 0 0 1 30 20"
    set tor_DB_ARGS "V { 0 0 0 } H { 1 0 0 } r_a 50 r_h 25"

    #
    # Sphere (sph) Arguments
    #
    # Note that the sph is really an ell with all radii equal.
    # 
    # in args => name type xvertex yvertex zvertex radius1
    #
    set sph_IN_ARGS "0 0 0 45"
    set sph_DB_ARGS "V { 0 0 0 } A {45 0 0} B {0 45 0} C {0 0 45}"

    #
d210 10
d234 8
@


1.16
log
@*** empty log message ***
@
text
@d108 1
a108 1
    # Elliptical Paraboloid (EPA) Arguments
@


1.15
log
@*** empty log message ***
@
text
@d176 2
a177 2
    set _IN_ARGS ""
    set _DB_ARGS ""
d184 2
a185 2
    set _IN_ARGS ""
    set _DB_ARGS ""
d192 2
a193 2
    set _IN_ARGS ""
    set _DB_ARGS ""
d200 2
a201 2
    set _IN_ARGS ""
    set _DB_ARGS ""
d208 2
a209 2
    set _IN_ARGS ""
    set _DB_ARGS ""
d216 2
a217 2
    set _IN_ARGS ""
    set _DB_ARGS ""
d224 2
a225 2
    set _IN_ARGS ""
    set _DB_ARGS ""
d232 2
a233 2
    set _IN_ARGS ""
    set _DB_ARGS ""
d240 2
a241 2
    set _IN_ARGS ""
    set _DB_ARGS ""
d248 2
a249 2
    set _IN_ARGS ""
    set _DB_ARGS ""
d256 2
a257 2
    set _IN_ARGS ""
    set _DB_ARGS ""
@


1.14
log
@*** empty log message ***
@
text
@a119 27
    set _IN_ARGS ""
    set _DB_ARGS ""

    #
    # () Arguments
    # 
    # in args =>
    # db args =>
    #
    set _IN_ARGS ""
    set _DB_ARGS ""

    #
    # () Arguments
    # 
    # in args =>
    # db args =>
    #
    set _IN_ARGS ""
    set _DB_ARGS ""

    #
    # () Arguments
    # 
    # in args =>
    # db args =>
    #
@


1.13
log
@Elliptical Paraboloid
@
text
@a86 1
    # db args =>
a94 1
    # db args =>
a102 1
    # db args =>
a110 1
    # db args =>
a118 1
    # db args =>
a153 1
    # db args =>
a161 1
    # db args =>
a169 1
    # db args =>
a177 1
    # db args =>
a185 1
    # db args =>
a193 1
    # db args =>
a201 1
    # db args =>
a209 1
    # db args =>
a217 1
    # db args =>
a225 1
    # db args =>
a233 1
    # db args =>
a241 1
    # db args =>
a249 1
    # db args =>
a257 1
    # db args =>
a265 1
    # db args =>
a273 1
    # db args =>
a281 1
    # db args =>
d285 4
@


1.12
log
@added section for each primitive
@
text
@d111 1
a111 1
    # (epa) Arguments
d116 2
a117 2
    set epa_IN_ARGS ""
    set epa_DB_ARGS ""
d121 27
@


1.11
log
@added section for each primitive
@
text
@a20 1
    # db args => 
a30 1
    # db args =>  
a38 1
    # db args =>  
a46 1
    # db args =>
a54 1
    # db args =>
a62 1
    # db args =>
a70 1
    # db args =>
a78 1
    # db args =>
@


1.10
log
@added section for each primitive
@
text
@d47 1
a47 1
    # () Arguments
d56 1
a56 1
    # () Arguments
d65 1
a65 1
    # () Arguments
@


1.9
log
@added section for each primitive
@
text
@d74 1
a74 1
    # () Arguments
d83 1
a83 1
    # () Arguments
d92 1
a92 1
    # () Arguments
d101 1
a101 1
    # () Arguments
d110 1
a110 1
    # () Arguments
d119 1
a119 1
    # () Arguments
d128 1
a128 1
    # () Arguments
d137 1
a137 1
    # () Arguments
@


1.8
log
@added section for each primitive
@
text
@d146 1
a146 1
    # () Arguments
d155 1
a155 1
    # () Arguments
d164 1
a164 1
    # () Arguments
d173 1
a173 1
    # () Arguments
d182 1
a182 1
    # () Arguments
@


1.7
log
@added section for each primitive
@
text
@d178 2
a179 29
    set _IN_ARGS ""
    set _DB_ARGS ""

    #
    # () Arguments
    # 
    # in args =>
    # db args =>
    #
    set _IN_ARGS ""
    set _DB_ARGS ""

    #
    # () Arguments
    # 
    # in args =>
    # db args =>
    #
    set _IN_ARGS ""
    set _DB_ARGS ""

    #
    # () Arguments
    # 
    # in args =>
    # db args =>
    #
    set _IN_ARGS ""
    set _DB_ARGS ""
d187 2
a188 2
    set _IN_ARGS ""
    set _DB_ARGS ""
d191 1
a191 1
    # () Arguments
d200 1
a200 1
    # () Arguments
d209 1
a209 1
    # () Arguments
d218 1
a218 1
    # () Arguments
d227 1
a227 1
    # () Arguments
d236 1
a236 1
    # () Arguments
d245 1
a245 1
    # () Arguments
d254 1
a254 1
    # () Arguments
d263 1
a263 1
    # () Arguments
d272 1
a272 1
    # () Arguments
d281 1
a281 1
    # () Arguments
@


1.6
log
@added section for each primitive
@
text
@d151 2
a152 2
    set _IN_ARGS ""
    set _DB_ARGS ""
d160 2
a161 2
    set _IN_ARGS ""
    set _DB_ARGS ""
d169 2
a170 2
    set _IN_ARGS ""
    set _DB_ARGS ""
@


1.5
log
@added section for each primitive
@
text
@d133 2
a134 2
    set _IN_ARGS ""
    set _DB_ARGS ""
d142 2
a143 2
    set _IN_ARGS ""
    set _DB_ARGS ""
@


1.4
log
@added section for each primitive
@
text
@d97 2
a98 2
    set _IN_ARGS ""
    set _DB_ARGS ""
d106 2
a107 2
    set _IN_ARGS ""
    set _DB_ARGS ""
d115 2
a116 2
    set _IN_ARGS ""
    set _DB_ARGS ""
d124 2
a125 2
    set _IN_ARGS ""
    set _DB_ARGS ""
@


1.3
log
@added section for each primitive
@
text
@d52 2
a53 2
    set _IN_ARGS ""
    set _DB_ARGS ""
d61 2
a62 2
    set _IN_ARGS ""
    set _DB_ARGS ""
d70 2
a71 2
    set _IN_ARGS ""
    set _DB_ARGS ""
d79 2
a80 2
    set _IN_ARGS ""
    set _DB_ARGS ""
d88 2
a89 2
    set _IN_ARGS ""
    set _DB_ARGS ""
@


1.2
log
@-* added support for sph and ell
@
text
@d18 1
a18 1
    # Torus Arguments
d46 269
@


1.1
log
@new geometry testing test
@
text
@d26 20
d111 1
@

