MODEL2GRID_LU(nged)
convert model xyz to grid coordinates (local units)
π MODEL2GRID_LU (nged) π
okay bestie, so this is a page from the BRL-CAD User Commands manual β yes, that BRL-CAD β and today's main character is model2grid_lu. she's the one who translates your 3D model vibes into 2D grid vibes. let's get into it π«Ά
β¨ NAME β¨
model2grid_lu β convert model xyz to grid coordinates (local units)
like, literally what it says on the tin π
π¦ SYNOPSIS π¦
model2grid_lu x y z
three args, no more no less. slay.
πΈ DESCRIPTION πΈ
okay so here's the lore π« the model2grid_lu command converts a 3D model-space point (in local units) into a 2D grid offset (also in local units). the three arguments x y z are the model-space coordinates in local units.
and what do you get back? a 2-element u v string representing the horizontal and vertical grid displacement from the projected model origin. that's the whole tea β and here's the crucial bit β only the X and Y components of the view-projected difference are returned, not Z. Z is not invited to this party π
now for the behind-the-scenes, because the pipeline is kinda iconic ngl:
- it converts the input point to base units
- it projects it and the model origin into view space
- it subtracts to get the view-space displacement
- then it scales by
gv_scaleand the unit conversion factor to get the final grid-space offset in local units
that's the whole glow-up from model space to grid space, step by step π₯
and if you ever need to go backwards? the inverse operation is grid2model_lu. they're giving matched set energy π
π EXAMPLES π
Example 1. Convert a model point to a 2D grid offset
mged> model2grid_lu 100 50 0
Returns a 2-element u v grid offset in local units representing the screen-space position of model point (100, 50, 0) relative to the projected model origin. like, it literally tells you where that point lands on screen π
β¨
π AUTHOR π
BRL-CAD Team β the collective. the squad. the ones who built all this π«Ά
π BUG REPORTS π
found a bug? a problem? something acting sus? π© reports of bugs or problems should be submitted via electronic mail to devs@brlcad.org β they genuinely want to hear it, no cap.
ok that's the whole page bestie, every flag-free, option-free, argument-having detail of it π she's a short one but she works.
mwah π this has been MODEL2GRID_LU(nged) from BRL-CAD β go forth and project your points responsibly, 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