MAT_SCALE_ABOUT_PNT(nged)

generate a uniform scale matrix centered on a point

πŸ“… published 7.44.0, from nixpkgs unstable

πŸ’… 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 by bn_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