MGED CMD saveview

From BRL-CAD

saveview[edit]

Syntax[edit]

saveview file [args]


Argument(s)[edit]

file
Target File
args
Optional.


Return Value(s)[edit]

No Return Values for this command.


Description[edit]

The "saveview" command 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. Scripts saved via saveview can be loaded via loadview.

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.


Example(s)[edit]

mged> saveview rt_script -s1024
Create (or append 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.


See Also[edit]

rt
viewsize
orientation
eye_pt
savekey
preview
loadview

Page Generated by David Loman on: 10/12/2007 at: 7:20:42 AM