PLOT3ROT(1)
β¨ PLOT3ROT(1) β plot3rot: rotate, translate, or scale a UnixPlot file β¨
Okay bestie, this is plot3rot from the BRL-CAD crew, and itβs literally the glow-up button for UnixPlot files. π
πΈ NAME πΈ
plot3rot β rotate, translate, or scale a UnixPlot file (see plot3(5)). π¦
β¨ SYNOPSIS β¨
plot3rot [-x _angle_] [-y _angle_] [-z _angle_] [-X _dist_] [-Y _dist_] [-Z _dist_] [-s _factor_] [-a _az_] [-e _el_] [-g] [-M] [-m _matrix_] [-S _space_] [-v] [_file_ ...] > unix_plot
π DESCRIPTION π
So plot3rot does rotations, translations, and/or scaling on a UnixPlot file (again, plot3(5)). It reads input from the named _file_ arguments β and yes, a file of - means standard input, iconic β or from standard input if no files are given. Then it writes the transformed plot to standard output. π
You can give any number of transformation options. Each operation gets applied left to right in the order it appears on the command line, and all the operations are concatenated into a single transform. Because rotations are not commutative, the order you specify them in matters β periodt, this is not a drill. Invoking the command with no arguments prints a usage summary. π
The lower case -x, -y, and -z options rotate about the X, Y, and Z axes respectively by the given number of degrees; a positive value is a right handed rotation. The upper case -X, -Y, and -Z options translate along those axes in whatever units the plot file uses. The -s option applies a scale factor, up (> 1) or down (< 1). β¨
The -a and -e options are azimuth and elevation about the center point. They are shorthand for a positive Z axis and a negative X axis rotation respectively, and should be given in that order for the proper combined effect. They also cause the plot to be auto-centered based on the "space" command found in the input, with the new "space" command shrunk to fit the rotated plot as tightly as possible. (This differs from -M, which instead fits a sphere to the space; see below.) π
The -M option auto-centers the plot on its "space" command in much the same way that the rt(1) ray tracer treats a model bounding box: a sphere is fit to the space, and the diameter and center of that sphere are used as the width and center of the plot in all three dimensions. This keeps the entire model in view from any angle and is invariant with respect to viewing direction, but the "space" is enlarged on every cascaded pass through plot3rot in which -M is used. π That last bit is important, bestie.
The -g option is a convenient shorthand to transform azimuths and elevations expressed in gift/MGED front-view notation (degrees off the -X view) into the UnixPlot screen coordinate system, where X increases to the right and Y increases up. It should usually appear last, because it modifies the rotation already established, and is exactly equivalent to giving -z -90 -x -90 in the same place. Do not combine -m with -a, -e, or -g. π¨
π OPTIONS π
-xangle β Rotate angle degrees about the X axis. π-yangle β Rotate angle degrees about the Y axis. π-zangle β Rotate angle degrees about the Z axis. π-Xdist β Translate dist units along the X axis. πΌ-Ydist β Translate dist units along the Y axis. πΌ-Zdist β Translate dist units along the Z axis. πΌ-sfactor β Scale by factor (> 1enlarges,< 1shrinks). A factor of zero is rejected. π«-aaz β Apply azimuth az, a positive Z axis rotation. Auto-centers the plot and re-bounds the"space"tightly to the rotated plot; should precede-e. π§-eel β Apply elevation el, a negative X axis rotation. Auto-centers the plot and re-bounds the"space"tightly to the rotated plot. π§-gβ Convert gift/MGED front-view azimuth and elevation into UnixPlot display coordinates. Equivalent to-z -90 -x -90; usually given last. π―-Mβ Auto-center the"space"command like thert(1)model RPP, fitting a sphere so the model stays in view from any angle. π-mmatrix β Apply the 4x4 transformation matrix given as a quoted string of 16 floating point numbers (seeh/vmath.h). Do not combine with-a,-e, or-g. π-Sspace β Force the output"space"to a quoted string of six floats ("min_x min_y min_z max_x max_y max_z"). This is emitted immediately and overrides any space derived from the input or other options. π¦-vβ Verbose mode. Print the initial transformation matrix, and for every"space"command encountered print the old and new bounding RPP. π
π EXAMPLES π
Example 1. Rotate a plot about two axes
plot3rot -z 30 -x 20 < file.plot3 > file2.plot3
Performs a 30 degree positive rotation about the Z axis (counter clockwise as viewed from the top), then a 20 degree rotation about the already-rotated X axis. Reversing the order of the options would not produce the same result, since rotations do not commute. π
Example 2. View a model as a ray tracer would, then frame buffer display it
rthide -a 35 -e 25 -o file.plot3 model.g component
plot3rot -a 35 -e 25 -g < file.plot3 | plot3-fb
rthide(1) renders a hidden-line plot at azimuth 35 and elevation 25. The trailing -g converts that gift-style azimuth/elevation into the conventional UnixPlot screen coordinate system before plot3-fb(1) displays it on a frame buffer. πΌοΈ
π SEE ALSO π
π AUTHOR π
BRL-CAD Team. The actual author credits, no cap. π«Ά
π 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. π§
Brought to you by BRL-CAD, plot3rot(1), copyright 1989-2026 β mwah, bestie πβ¨
π¦ where this page comes from
- nixpkgs unstable: brlcad 7.44.0
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms