PLOT3LINE2(1)
π PLOT3LINE2(1) β the BRL-CAD girlie's guide to drawing one (1) line
okay bestie, so this is plot3line2, and honestly? it's giving tiny-but-mighty. it's a little command from the BRL-CAD fam that writes out a single plot3(5) (UNIX plot) command to draw a line in the XY plane. one line. that's the whole job. and it does it flawlessly. π
β¨ SYNOPSIS β¨
plot3line2 x1 y1 x2 y2 [r g b] [< unix_plot] > unix_plot
π DESCRIPTION π
so here's the tea: plot3line2 draws a line in the XY plane from the point (x1, y1) to the point (x2, y2). your coordinates can be floating point β yes, decimals, we love that for us β and the segment is always emitted as a double-precision plotting command. fancy. π¦
if you need an integer-format command instead, no worries, just pass your output through plot3-plot3(1). conversion era.
okay now the color part, because this is the fun part. if you supply the optional color triple r g b (each one an integer from 0 to 255, specifying the red, green, and blue intensities), a color command gets written before the line, and the segment is drawn in that color. slay. π otherwise it just uses the current drawing color (which is white by default, iconic).
pipeline behavior, listen up π«Ά β to allow use within a pipeline, if standard input is not a terminal, its entire contents are copied through to standard output first, and then your new line segment is appended at the end. so it just scoops up whatever you feed it and tacks your line on. lowkey brilliant.
β οΈ but fr fr: the command refuses to run when standard output is a terminal. not me getting rejected by a plot utility π β just redirect your output somewhere and you're golden.
and like, why does this exist? mainly as an aid for building plots and graphs from shell scripts. tiny tool, big main character energy. π
πΈ EXAMPLES πΈ
Example 1. draw a red diagonal segment on top of an existing plot
plot3line2 0 0 100 100 255 0 0 < base.plot3 > annotated.plot3
this copies the contents of base.plot3 to annotated.plot3 and appends a red line from the origin to (100, 100). so you're basically overlaying an annotation on an existing UNIX plot file. chef's kiss. π
Example 2. build a plot incrementally in a pipeline
plot3line2 0 0 50 80 |
plot3line2 50 80 100 0 0 255 0 |
plot3-plot3 > graph.plot3
the first plot3line2 emits one segment; the second reads it from standard input, copies it through, and appends a second (green) segment. the way that pipeline just *works*β¦ π§ the combined double-precision stream is then converted to integer plot commands by plot3-plot3(1) and saved as graph.plot3. periodt.
π¦ SEE ALSO π¦
π AUTHOR π
BRL-CAD Team β legends, honestly. π«Ά
β COPYRIGHT β
This software is Copyright (c) 1986-2026 by the United States Government as represented by U.S. Army Research Laboratory.
(yes bestie, that's a long run. 1986 to 2026. longevity icon behavior. π)
π BUG REPORTS π
Reports of bugs or problems should be submitted via electronic mail to devs@brlcad.org. found a gremlin? tell the devs, they wanna know. π
okay that's the whole page, mwah π β brought to you by BRL-CAD, PLOT3LINE2(1), and no date on the footer because this page is timeless, apparently. go draw some lines, 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