Name

saveview — Saves the current viewing parameters in the specified file in the form of a shell script that will run the BRL-CAD rt program as if it had been executed from within MGED using the rt -s512 command.

Synopsis

saveview [-e command] [-l logfile] [-o outputfile] [-e inputfile] {file} [args]

DESCRIPTION

Saves the current viewing parameters in the specified file in the form of a shell script that will run the BRL-CAD rt program as if it had been executed from within MGED using the rt -s512 command. Any args included on the saveview command line will be copied to the file as options to the rt program. If the file already exists, the script will be appended to it. This is useful in setting up images to be raytraced later. The default script produced by "saveview test.rt" looks like:


#!/bin/sh
rt -M \
 -o test.rt.pix\
 $*\
 model.g\
 'object1' 'object2' \
 2>> test.rt.log\
 <<EOF
viewsize 2.780320739746094e+02;
orientation 2.480973490458727e-01 4.765905732660483e-01
7.480973490458729e-01 3.894348305183902e-01;
eye_pt 1.234152656421214e+02 7.220202900588745e+01
3.845765464924686e+01;
start 0; clean;
end;
EOF

When this script is executed, the image will be stored in test.rt.pix, and all messages and errors generated by the rt program will be stored in test.rt.log . The above script will produce an image of object1 and object2 from the BRL-CAD database named model.g. The viewsize, orientation, and eye_pt parameters reproduce the view displayed by MGED when the saveview command was executed. The presence of “$*” in the script causes any additional command-line options given when the script is invoked to be interpreted as additional rt options. Typically, a “-s” option might be used to set the image size (the default is 512 pixels square). See the man page on rt for details on available options.

If you have a saveview script and wish to change MGED to that view, merely cut-and- paste, or source, the viewsize, orientation, and eye_pt lines from the saveview file into MGED.

Related MGED commands are preview, for viewing the effects of an entire animation script, and savekey. Related BRL-CAD programs are tabsub and tabinterp.

The following options are valid for this command:

-e command

Makes the script run the specified command instead of the default of rt

-l logfile

Makes the script direct log output to the specified logfile instead of to the default of file.log (file is the inputfile basename).

-o outputfile

Makes the script output the image to the specified outputfile instead of to the default of file.pix (file is the inputfile basename).

-i inputfile

Makes the script load data from inputfile instead of from the default of the currently opened database.

EXAMPLES

The example shows the use of the saveview command to create a file that will contain a script to run the rt program and create a color-shaded image of the current MGED display.

Example 1. Save current viewing parameters in a specified file in the form of a shell script to run the BRL-CAD rt program.

mged>rt_script -s1024

Creates (or appends to) a file named rt_script that will contain a script to run the rt program and create a color-shaded image of the current MGED display. The image produced will be 1024 pixels square.


AUTHOR

BRL-CAD Team

BUG REPORTS

Reports of bugs or problems should be submitted via electronic mail to <devs@brlcad.org>, or via the "cadbug.sh" script.