VIEW2GRID_LU(nged)

convert view xyz to grid coordinates (local units)

πŸ“… published 7.44.0, from nixpkgs unstable

✨ VIEW2GRID_LU ✨

okay so bestie, welcome to the view2grid_lu glow-up πŸ’… this little icon lives in the BRL-CAD user commands club (nged division), and it's literally here to convert view xyz into grid coordinates in local units. no cap. πŸ¦‹


🌸 SYNOPSIS 🌸

view2grid_lu x y z

πŸ’– DESCRIPTION πŸ’–

so like, view2grid_lu takes your 3D view-space coordinates (in local units, bestie, keep up ✨) and turns them into a 2D grid offset β€” also in local units, because consistency is the moment πŸŽ€.

The three arguments x y z are your view-space coordinates in local units. The result is a 2-element u v string β€” and listen, only the X and Y components of the grid displacement from the projected model origin get returned. Z? discarded. gone. not invited to the party πŸ’€.

Here's the tea on how it actually works, fr fr:

  1. it projects the model origin into view space
  2. it scales it
  3. it subtracts that from the input view point to get the displacement
  4. then it hands back the X and Y components as the 2D grid offset 🫢

and if you ever need to go backwards? the inverse operation is grid2view_lu. iconic symmetry, honestly πŸ‘‘


🌈 EXAMPLES 🌈

⭐ Example 1. Convert a view-space point to a 2D grid offset

mged> view2grid_lu 50 25 0

Returns the 2D grid offset u v corresponding to the view-space point (50, 25, 0) in local units, measured from the projected model origin. slay πŸ’…βœ¨


🧚 AUTHOR 🧚

BRL-CAD Team β€” the main characters, lowkey πŸ‘‘


πŸ’œ BUG REPORTS πŸ’œ

got a bug? a problem? a whole situation? 😭 Reports of bugs or problems should be submitted via electronic mail to devs@brlcad.org β€” they're literally waiting for your email bestie πŸ“§πŸ’–


that's the whole vibe check, bestie β€” BRL-CAD, VIEW2GRID_LU(nged), no cap. go convert some coordinates and eat πŸ“βœ¨

πŸ“¦ where this page comes from