GRID2MODEL_LU(nged)

convert grid xy to model coordinates (local units)

πŸ“… published 7.44.0, from nixpkgs unstable

πŸ’… GRID2MODEL_LU πŸ’…

okay bestie, welcome to the grid2model_lu page from the nged manual β€” this one's short and sweet and honestly kind of a little math queen. let's get into it 🫢


✨ NAME ✨

grid2model_lu β€” convert grid xy to model coordinates (local units). that's it, that's the whole vibe πŸŽ€


🌸 SYNOPSIS 🌸

grid2model_lu x y

πŸ¦‹ DESCRIPTION πŸ¦‹

so the grid2model_lu command takes a 2D grid offset β€” in local units β€” and turns it into 3D model-space coordinates, also in local units. no cap, that's the whole job πŸ’–

the two arguments, u and v, are the horizontal and vertical grid offsets from the model origin, projected into the current view's grid plane. and the Z component? treated as 0. flat. grounded. main character energy 🧚

here's the tea on how it actually does it β˜•: the command projects the model origin into view space, adds the scaled grid offset, then inverse-transforms back through the view-to-model matrix. the result is a 3-component model-space point in local units. every single scale factor uses the current view's gv_scale plus the database unit conversions πŸ”₯

and if you ever need to go the other way? the inverse operation is model2grid_lu. they're a matching set, your honor πŸ‘‘


⭐ EXAMPLES ⭐

Example 1. Convert a grid offset to model coordinates

mged> grid2model_lu 50 25

returns the 3D model-space coordinates (in local units) corresponding to a 2D grid position 50 units right and 25 units up from the projected model origin. slay πŸ’…


πŸ‘‘ AUTHOR πŸ‘‘

BRL-CAD Team β€” icons only, we stan πŸ’œ


πŸ’€ BUG REPORTS πŸ’€

found a bug or a problem? don't suffer in silence, bestie 😭 send the details via electronic mail to devs@brlcad.org. they want to hear it fr fr πŸ™ˆ


and that's the page!! source: BRL-CAD, manual entry GRID2MODEL_LU(nged) β€” til next time, go convert something cute πŸŒˆπŸ’–βœ¨

πŸ“¦ where this page comes from