RECT(nged)

manage the rubber band selection rectangle in the view

πŸ“… published 7.44.0, from nixpkgs unstable

πŸŽ€ NAME

rect β€” the command that runs the rubber band selection rectangle in your view, bestie πŸ’…


✨ SYNOPSIS

rect vname subcommand [args]

πŸ’– DESCRIPTION

Okay so picture this: rect is the girl who manages the rubber band rectangle overlay that gets drawn on top of your current view. You can position her, resize her, and style her β€” either by clicking around interactively or by telling her exactly what to do programmatically. She's got range πŸ¦‹

What is she for, you ask? Two iconic jobs, no cap: marquee selection, and raytracing a sub-region of the view. That's it. That's the gig.

The very first argument is always the view name (vname) β€” non-negotiable, she needs to know which view she's serving πŸ’β€β™€οΈ The second argument is the subcommand. And here's the pattern, the way that every single subcommand works the same way: either you give it no extra args and it hands you back the current value, or you give it extra args and it sets that thing. Get/set. That's the whole vibe. Periodt.


πŸ¦‹ Subcommands

  • rect vname bg [r g b] β€” get or set the rectangle's background fill color, as RGB integers in the range (0–255). No extra args? She returns r g b. Three args? She sets the color. Slay 🎨
  • rect vname color [r g b] β€” get or set the rectangle's border/line color as RGB integers. No extra args β†’ returns r g b. Three args β†’ sets the color.
  • rect vname cdim [w h] β€” get or set the canvas dimensions (that's the full window/display size, in pixels ✨). This one's the main character because it's used to compute the normalized view coordinates for the rectangle. No extra args β†’ returns w h. Two args β†’ sets the canvas size and recalculates the rectangle's normalized position and dimensions. She's doing math for you, you're welcome πŸ’…
  • rect vname dim [w h] β€” get or set the rectangle's dimensions in pixels. No extra args β†’ returns w h. Two args β†’ sets the width and height and recalculates the normalized position.
  • rect vname draw [0|1] β€” get or set whether the rectangle is actually drawn. 0 hides, 1 shows πŸ‘€ No extra args β†’ returns the current draw flag.
  • rect vname lstyle [0|1] β€” get or set the line style. 0 = solid (that's the default, iykyk), 1 = dashed. No extra args β†’ returns the current style. Heads up: non-zero values set dashed, and zero or negative values set solid.
  • rect vname lwidth [w] β€” get or set the line width in pixels. No extra args β†’ returns the current width. Non-positive values set the width to 0. Like, all the way to zero. Not a vibe, but it's the rule 🫢
  • rect vname pos [x y] β€” get or set the rectangle's anchor position in pixels (origin is at the top-left, bestie). No extra args β†’ returns x y. Two args β†’ sets the position and recalculates the normalized coordinates.
  • rect vname rt port β€” raytrace the geometry inside the current rectangle area, sending the output to the framebuffer at the given port number πŸ”₯ Requires exactly one argument. Has no effect if the rectangle has zero size (girl can't trace nothing πŸ’€).
  • rect vname zoom β€” zoom the view so the area enclosed by the rectangle fills the screen. She adjusts the rectangle to match the window aspect ratio before zooming, because she's thoughtful like that 🌸 Has no effect if the rectangle has zero size.
  • rect vname vars β€” print all current rectangle parameters as variable = value pairs. Perfect for inspecting the complete rectangle state, like a full vibe check of every setting πŸ‘‘
  • rect vname help β€” print the usage summary for all subcommands. When in doubt, ask for help, no shame 🫢

🌈 EXAMPLES

Example 1. Show the rectangle

mged> rect default draw 1

Enables display of the rubber band rectangle on the default view. She's visible, she's here, she's serving ✨

Example 2. Position and size the rectangle

mged> rect default cdim 1024 768
mged> rect default pos 200 100
mged> rect default dim 400 300

Sets the canvas to 1024Γ—768 pixels, anchors the rectangle at pixel (200, 100), and gives it a 400Γ—300 pixel size. The normalized view coordinates are calculated automatically β€” you don't have to lift a finger πŸ’…

Example 3. Set the rectangle color to red

mged> rect default color 255 0 0

Sets the border color of the rectangle to red. Iconic. Powerful. Red. πŸ“

Example 4. Use dashed lines

mged> rect default lstyle 1

Switches the rectangle border to a dashed line style. A little texture, a little drama πŸŽ€

Example 5. Zoom to the rectangle area

mged> rect default zoom

Adjusts the view so that the area within the rectangle fills the display. Main character energy fr fr πŸ‘‘

Example 6. Inspect all rectangle parameters

mged> rect default vars

Prints all current rectangle settings, e.g. position, dimensions, colors, draw flag, line style, and line width. The full scoop, the whole story πŸ¦‹


πŸ‘‘ AUTHOR

BRL-CAD Team β€” the collective. The girlies. The legends. πŸ’œ


πŸ’€ BUG REPORTS

Spotted a bug? A problem? Something lowkey broken? 🫢 Reports of bugs or problems should be submitted via electronic mail to devs@brlcad.org. Go tell them, they wanna know, I promise 😭


Okay that's the whole page, bestie β€” this was RECT(nged), brought to you by BRL-CAD ✨ mwah, go select something pretty πŸ’–πŸŽ€πŸ¦‹

πŸ“¦ where this page comes from