OROTATE(nged)

rotate a database object about a keypoint

๐Ÿ“… published 7.44.0, from nixpkgs unstable

๐ŸŒ€ OROTATE โ€” the glow-up command for your geometry (nged)

Okay bestie, so you're in mged and you want to spin an object around like it's on a rotisserie ๐Ÿ’… โ€” that's orotate. It lives in the nged manual, and it's literally the "rotate a database object about a keypoint" command. No cap.


โœจ SYNOPSIS โœจ

orotate obj rX rY rZ
orotate obj rX rY rZ kX kY kZ

๐ŸŽ€ DESCRIPTION ๐ŸŽ€

So here's the tea โ˜•: orotate rotates the database object obj in place by the Euler angles rX, rY, rZ (in degrees ๐Ÿ˜Œ), applied about a keypoint. The object's geometry gets modified and written straight back to the database. It's giving "permanent makeover," not "temporary filter," iykyk.

The two forms differ only in how the rotation keypoint gets figured out:

  • No keypoint (just rX rY rZ, bestie): the keypoint is automatically computed as the center of the object's bounding box โ€” that's the midpoint of rpp_min and rpp_max. And the bounding box? It's computed by tracing the object's full hierarchy. She did the research. ๐Ÿ”
  • With an explicit keypoint (kX kY kZ): the keypoint is the given model-space coordinate in local units. The object is looked up directly by name, and the identity matrix is used for the path transform. Simple, direct, main character energy. โœจ

The rotation itself is built from the three Euler angles via bn_mat_angles(rmat, rX, rY, rZ), and then it's transformed about the keypoint using bn_mat_xform_about_pnt. That resulting matrix gets applied to the object's internal representation and written back to the database. Math slay. ๐Ÿงฎ๐Ÿ’…


๐ŸŒธ EXAMPLES ๐ŸŒธ

Example 1. Rotate an object about its own center

mged> orotate wheel.s 0 0 45

Rotates wheel.s by 45ยฐ about the Z axis, using the object's bounding box center as the keypoint. She's spinning on her own axis, periodt. ๐Ÿ›ž

Example 2. Rotate about an explicit keypoint

mged> orotate arm.s 0 30 0 0 0 0

Rotates arm.s by 30ยฐ about the Y axis, pivoting about the model origin (0, 0, 0) as the keypoint. Origin pivot, iconic. ๐Ÿ’ซ

Example 3. Rotate about an off-center pivot point

mged> orotate blade.s 15 0 0 0 50 100

Rotates blade.s by 15ยฐ about the X axis, using the point (0, 50, 100) in local units as the pivot. Off-center and unbothered. ๐Ÿ”ชโœจ


๐Ÿ‘‘ AUTHOR ๐Ÿ‘‘

BRL-CAD Team โ€” the whole squad. ๐Ÿซถ


๐Ÿ› BUG REPORTS ๐Ÿ›

Found a bug or a problem? Don't suffer in silence, bestie ๐Ÿ˜ญ โ€” reports of bugs or problems should be submitted via electronic mail to devs@brlcad.org. They want the receipts, fr fr. ๐Ÿ“ง


Heads up, gorgeous: this command modifies the object's geometry and writes it back to the database. So likeโ€ฆ the glow-up is permanent. Maybe double-check your angles before you commit. ๐Ÿ˜…๐Ÿ’€

That's the whole page, angel ๐Ÿ’– โ€” brought to you by BRL-CAD (that's the source/version tagging along at the bottom of the original, along with the OROTATE(nged) label up top). Go forth and rotate responsibly. ๐Ÿฆ‹๐ŸŒˆ

๐Ÿ“ฆ where this page comes from