MAT_SCALE_ABOUT_PNT(nged)
generate a uniform scale matrix centered on a point
π MAT_SCALE_ABOUT_PNT β the nged manual, but make it make sense β¨
okay so bestie, you know how mged has a whole little family of matrix-making commands? This is one of them, and honestly? It's giving "small but mighty." It lives in the BRL-CAD User Commands section of the nged manual, and it's about to be your new fave for scaling stuff around a point that is not the origin. π
πΈ NAME πΈ
mat_scale_about_pnt β generates a uniform scale matrix centered on a point. That's it, that's the whole vibe. π
β¨ SYNOPSIS β¨
mat_scale_about_pnt "x y z" scale
Two args, no drama. Let's go. π«Ά
π¦ DESCRIPTION π¦
So here's the tea: mat_scale_about_pnt generates a 4x4 homogeneous transformation matrix that does a uniform scale by scale, centered on the 3D point "x y z". π₯
Now, lowkey the cool part β scaling about a non-origin point is equivalent to translating to the origin, scaling, then translating back. This command just computes that whole combined matrix in one single step for you, because doing it in three steps is giving extra and we don't do that here. π
The result comes back as a 16-element space-separated matrix string via bn_encode_mat. Also it's the GED wrapper for bn_mat_scale_about_pnt β iykyk, the C function is the main character underneath. π
π Arguments (the whole cast)
"x y z"β the center point for the scaling operation, as a space-separated string decoded bybn_decode_vect. Yes you gotta quote it, bestie, it's a string.scaleβ the uniform scale factor, a floating-point number. Big number = big geometry, small number = smol geometry. Math is math. π
π EXAMPLES π
Example 1. Scale by 2x about a specific point
mged> mat_scale_about_pnt "10 10 0" 2.0
Returns a 4x4 matrix that scales geometry by a factor of 2 relative to the point (10, 10, 0). Objects sitting right at that point stay fixed (iconic, they don't move π ) while all other geometry moves away from it proportionally. It's giving "expansion era." π₯
Example 2. Scale down by half about the origin
mged> mat_scale_about_pnt "0 0 0" 0.5
Returns a uniform 0.5x scale matrix centered at the origin β equivalent to a standard scale-by-half transformation. Simple, clean, no cap. β¨
π AUTHOR π
BRL-CAD Team β legends, honestly. π«Ά
π BUG REPORTS π
Found a bug? Spotted 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 to hear it, fr fr. π
ngl this one's short but she ate. Two arguments, one matrix, zero notes. π
sign-off time, bestie π β this page is from the BRL-CAD manual collection, filed under MAT_SCALE_ABOUT_PNT(nged). Slay your matrices responsibly. πβ¨πΈ
π¦ 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