rtsil [options] model.g [objects...]
RTSIL(1)
NAME
rtsil - ray trace a model and produce a binary silhouette image
On this page
SYNOPSIS
DESCRIPTION
rtsil uses librt(3) to ray trace the listed objects in the database model.g and produce a "Simple Intersection Lightmap" (SIL): a binary hit/miss silhouette of the geometry. One ray is fired per pixel and stops at the first surface struck (one-hit mode); no shading, lighting, or material evaluation is performed.
If no objects are listed, rtsil uses the same automatic default-object selection described in rt(1). If no single usable default can be resolved, it aborts before rendering.
The result is an 8-bit bw(5) image (one byte per pixel) in which a pixel that intersected geometry is given the value 1 and a pixel that missed all geometry is given the value 255. This high-contrast matte isolates the projected outline of the selected object set very cheaply.
The view is selected with the -a (azimuth) and -e (elevation) options, or with -M a model-to-view matrix is read from standard input (convenient when driven by an mged(1) saveview script). By default the image is written to standard output; use -o to write a named file. Because rtsil emits scanlines in order it always runs on a single CPU regardless of -P. Most of the camera, grid, and debugging options accepted by rt(1) are also honored; see that manual page for the complete list.
OPTIONS
- -o file.bw
-
Write the silhouette image to file.bw instead of standard output.
- -s #
-
Set the square grid size to # rays on a side (default 512, i.e. a 512x512 image).
- -w #
-
Set the image width in pixels.
- -n #
-
Set the image height in scanlines.
- -a deg
-
Set the view azimuth in degrees and enable auto-sizing. Use with -e; conflicts with -M.
- -e deg
-
Set the view elevation in degrees and enable auto-sizing. Use with -a; conflicts with -M.
- -M
-
Read a model-to-view transformation matrix (and optional animation script) from standard input instead of using -a/-e.
- -p deg
-
Set the perspective angle in degrees (0 ⇐ deg < 180; 0 is orthographic, the default).
- -V [:]
-
Set the view aspect ratio width/height (e.g. 1.33 or 4:3).
- -g mm
-
Set the grid cell width in millimeters.
- -G mm
-
Set the grid cell height in millimeters.
- -u units
-
Set the display units; -u model uses the database’s local units.
- -i
-
Use incremental (progressive-style) rendering.
- -t
-
Render top-to-bottom (the default is bottom-up).
- -P #
-
Requested processor count. Accepted for compatibility, but rtsil always renders with a single CPU.
- -x #
-
Set librt debug flags as a hexadecimal bit vector (see raytrace.h).
- -X #
-
Set rt program/optical debug flags as a hexadecimal bit vector.
See rt(1) for the remaining shared options (e.g. -T tolerances and -c script commands).
EXAMPLES
rtsil -a 35 -e 25 -s 1024 model.g all > sil.bw
Ray traces the group all in model.g from azimuth 35, elevation 25 degrees on a 1024x1024 grid and writes a bw(5) silhouette to sil.bw, where the object reads 1 and the background reads 255.
rtsil -M -o mask.bw model.g component < component.rt
bw-fb mask.bw
Reuses the camera from an mged(1) saveview script (the matrix is read from standard input via -M) so the matte of component matches a view set up interactively, then displays it on a framebuffer with bw-fb(1). The resulting binary mask can be fed to tools such as bwmod(1) or pixmatte(1) to key the object into a composited image.
SEE ALSO
brlcad(1), mged(1), rt(1), rtedge(1), rthide(1), bw-fb(1), bw(5), librt(3)
AUTHOR
BRL-CAD Team
COPYRIGHT
This software is Copyright (c) 1989-2026 by the United States Government as represented by U.S. Army Research Laboratory.
BUG REPORTS
Reports of bugs or problems should be submitted via electronic mail to devs@brlcad.org