EDIT_SCALE(nged)
Resize one or more objects in the database by a scale factor.
π EDIT SCALE(nged) β the resize-your-stuff glow-up guide
okay bestie, welcome to EDIT SCALE from the nged manual (BRL-CAD User Commands, if you're keeping track) π this is the page where we learn how to make objects bigger, smaller, and honestly just more. no cap, it's iconic.
β¨ NAME β¨
edit scale, edit sca β resize one or more objects in the database by a scale factor. that's it. that's the whole gig. π¦
β¨ SYNOPSIS β¨
edit [options] geometry scale FACTOR
edit [options] geometry scale X_FACTOR Y_FACTOR Z_FACTOR
edit [options] geometry scale -r FACTOR
edit [options] geometry scale -r X_FACTOR Y_FACTOR Z_FACTOR
edit [options] geometry scale [-k FROM_POS|FROM_OBJ] -a TO_POS|TO_OBJ
edit [options] geometry scale [-k SCALE_FROM] -a SCALE_TO -r FACTOR
edit [options] geometry scale [-k SCALE_FROM] -a SCALE_TO -r X_FACTOR Y_FACTOR Z_FACTOR
edit [options] geometry scale [-c CENTER_POS|CENTER_OBJ] FACTOR
edit [options] geometry scale [-c CENTER_POS|CENTER_OBJ]
X_FACTOR Y_FACTOR Z_FACTOR
quick lil glossary before we go any further, because these placeholders are doing a lot of work:
FROM_POS,TO_POS,SCALE_FROM,SCALE_TO, andCENTER_POSeach accept one to three scalar values (broadcast to a 3-vector when fewer are given) πFROM_OBJ,TO_OBJ,CENTER_OBJare names of existing database objects whose bounding-box centers are used πΈ
β¨ DESCRIPTION β¨
so the whole point: you use this to enlarge or reduce the size of one or more instances of primitive or combination objects by a scaling factor. glow-up or shrink-down, your call π
the rules of the road, and listen closely bestie:
- a scale factor greater than 1 enlarges the object π₯
- a factor between 0 and 1 shrinks it π
- a factor of exactly 0, or any negative factor, gets rejected as invalid π β don't even try it
Uniform scale (all three factors equal) uses the primitive's native scale path and is supported by all primitives. slay. Anisotropic (per-axis) scale β where the X, Y, Z factors differ β applies a diagonal scale matrix via ft_mat and is only available for primitives that provide that function. (remember that, it comes back in Example 5 and it WILL bite you)
π§ the conceptual model: two rulers, one vibe
the mental model behind edit scale uses two independent reference pairs β a SCALE ruler and a FACTOR ruler:
SCALE = vector from SCALE_FROM (-k) to SCALE_TO (-a|-r)
the reference "ruler" β measures a known distance in the scene
FACTOR = the desired result ruler β how large the result should be
expressed as the positional argument(s), or -r when combined
with a -k/-a pair
effective factor[i] = FACTOR[i] / |SCALE[i]| per axis
the three supported calling patterns are, and yes i'm numbering them in my head with sparkles:
- Positional (or explicit
-ralone) β supply 1 or 3 scalar factor values directly. the implicit SCALE ruler is the unit vector(1, 1, 1), so the effective factor equals FACTOR directly.scale 2andscale -r 2both double the object. same energy, different spelling π -k FROM -a TOonly β the effective factor vector is computed asTO - FROM. when FROM is the origin this is simply TO:scale -k 0 0 0 -a 2 2 2yields factors{2, 2, 2}β-k FROM -a SCALE_TO -r FACTOR(two-pair form) β the-k/-apair defines the SCALE reference ruler;-ris the FACTOR ruler. the effective factor isFACTOR / |SCALE|per axis. for example:scale -k 5 10 15 -a 7 11 -2 -r 4 2 34computesSCALE=(2,1,17)andFACTOR=(4,2,34), giving effective factors(2, 2, 2)β a uniform 2Γ scale regardless of the absolute coordinates. this form is the primary motivation for supplying a SCALE ruler: the FROM/TO pair captures a known real-world distance and the-rvalue expresses the desired outcome in the same units. genuinely chef's kiss π
π the pivot
the pivot CENTER defaults to the bounding-box center of the target object when -c is not specified. the batch-marker . is supported as a -c argument to use each target object's own keypoint as the pivot center. (batch mode = main character energy, we love her)
the alias sca is equivalent to scale. same girl, shorter name π«Ά
global options (-S, -f, -F, -i) are described in edit(nged). go read that one too, bestie.
β¨ OPTIONS β¨
-k SCALE_FROM_POS | SCALE_FROM_OBJβ set SCALE_FROM, the tail of the SCALE reference ruler vector. accepts 1β3 scalar values (broadcast to a 3-vector when fewer than three are given) or an object name whose bounding-box center is used. when combined with-a SCALE_TOonly (no-r), the effective scale factor isSCALE_TO - SCALE_FROM. when combined with both-a SCALE_TOand-r FACTOR, the-k/-apair defines the SCALE reference ruler and-rprovides the FACTOR ruler; the effective factor isFACTOR / |SCALE|per axis. if absent, FROM defaults to the origin(0, 0, 0)π¦-a SCALE_TO_POS | SCALE_TO_OBJβ set SCALE_TO as an absolute position, defining the head of the SCALE reference ruler. required when SCALE_TO is specified as an object name. when used alone with-k, effective factors =TO - FROM. when combined with-r FACTOR, it triggers the two-pair ratio model β¨-r FACTOR | X_FACTOR Y_FACTOR Z_FACTORβ provide the FACTOR ruler explicitly. when used without-k/-a, this is the direct scale factor (broadcast or per-axis). when combined with a-k/-aSCALE pair, this becomes the FACTOR ruler and the effective factor isr_vec[i] / |SCALE[i]|per axis. accepts 1 value (broadcast to all three axes) or 3 per-axis values π-c CENTER_POS | CENTER_OBJ | .β set the pivot center from which the scale expands or contracts. defaults to the bounding-box center of the target object. accepts 1β3 scalar values, an object name, or the batch marker.to use each target object's own keypoint as the pivot center π-nβ accepted for compatibility; intended to select natural origin over bounding-box center for an object argument. has minimal effect in the current implementation. (so like... it's there. it vibes. it doesn't do much. π)
β¨ EXAMPLES β¨
π Example 1. Double the size of cube from its center β simple forms
a single scalar factor:
mged> edit cube scale 2
three equal factors (still uniform):
mged> edit cube scale 2 2 2
explicit relative flag:
mged> edit cube scale -r 2
mged> edit cube scale -r 2 2 2
using the FROM/TO reference pair (origin β 2 = factor of 2):
mged> edit cube scale -k 0 0 0 -a 2 2 2
π Example 2. Halve the size of sph.s
mged> edit sph.s scale 0.5
using the FROM/TO reference pair:
mged> edit sph.s scale -k 0 0 0 -a 0.5 0.5 0.5
using explicit -r:
mged> edit sph.s scale -r 0.5
π Example 3. Scale with a fixed pivot center
scale sph.s by 2 but keep its surface nearest the origin fixed (pivot at the origin):
mged> edit sph.s scale -c 0 0 0 2
scale cube from a named object's position as the pivot:
mged> edit cube scale -c sphere1 2
scale from the cube's own center (the default; written explicitly):
mged> edit cube scale -c cube 2
π Example 4. Understanding the -k / -a vector model and the two-pair ratio form
when FROM is the origin and TO is the desired factor, the model is intuitive: scale -k 0 0 0 -a F F F applies a uniform factor F.
mged> edit cube scale -k 0 0 0 -a 3 3 3
the above triples the object. the following halves it:
mged> edit cube scale -k 0 0 0 -a 0.5 0.5 0.5
β οΈ when FROM is not the origin, the effective factor is simplyTO - FROM.scale -k 1 1 1 -a 3 3 3yields factors{2, 2, 2}β it doubles, not triples, because3-1=2. plan your FROM/TO values accordingly, bestie π
two-pair (ratio) form: when -k FROM -a SCALE_TO -r FACTOR are all supplied together, the -k/-a pair is the SCALE reference ruler and -r is the FACTOR ruler. the effective factor is computed as FACTOR / |SCALE| per axis. for example:
mged> edit cube scale -k 0 0 0 -a 1 1 1 -r 2
here SCALE=(1,1,1) and FACTOR=(2,2,2), so effective factor = 2/1 = 2 (doubles the cube). a more complex example illustrating that the sign of SCALE components is ignored (only magnitude matters):
mged> edit cube scale -k 5 10 15 -a 7 11 -2 -r 4 2 34
SCALE vector = (2, 1, -17), |per axis| = (2, 1, 17). FACTOR = (4, 2, 34). effective = (4/2, 2/1, 34/17) = (2, 2, 2) β a uniform 2Γ scale π₯
this form is most useful when the SCALE ruler is derived from known scene measurements: specify FROM and TO as points that span a known reference distance, then use -r to state the desired result size.
π Example 5. Non-uniform (anisotropic) scale: stretch X by 2, shrink Y by 0.5, leave Z unchanged
π¨ only primitives that implementft_matsupport per-axis scale. for primitives withoutft_mat(e.g.arb8,bot,brep) this will return an error.
mged> edit ell.s scale 2 0.5 1
the three values map to X, Y, Z scale factors respectively. a zero in any position is rejected:
mged> edit ell.s scale 0 1 1 β error, zero factor
equal factors are treated as uniform (uses the native scale path):
mged> edit ell.s scale 2 2 2 β uniform, equivalent to scale 2
π Example 6. Scale with an explicit center and an explicit factor
apply a factor of 1.5 to cube, pivoting on sphere1's keypoint:
mged> edit cube scale -c sphere1 1.5
pivot on a world-space coordinate:
mged> edit cube scale -c 10 0 0 1.5
π Example 7. Batch scale: each object scales from its own center using -c .
use -c . to pivot each object on its own keypoint (bounding-box center) in a single command per object:
mged> edit sph.s scale -c . 2
mged> edit other.s scale -c . 2
the . causes each object's own current keypoint to serve as the pivot center, equivalent to naming each object explicitly:
mged> edit sph.s scale -c sph.s 2
mged> edit other.s scale -c other.s 2
π Example 8. Use the intermediate buffer: scale tentatively, then revert if unsatisfied
mged> edit cube checkpoint
mged> edit -i cube scale 2
mged> edit cube revert
try it, hate it, undo it. no commitment, we love a low-stakes experiment π
β¨ SEE ALSO β¨
edit(nged), edit rotate(nged), edit translate(nged), oscale(nged), pscale(nged) β go read the whole family, they're all icons π
β¨ AUTHOR β¨
BRL-CAD Team π«Ά
β¨ BUG REPORTS β¨
reports of bugs or problems should be submitted via electronic mail to devs@brlcad.org β they genuinely want to hear it, bestie, don't be shy π
that's the page! BRL-CAD, EDIT SCALE(nged), straight from the BRL-CAD User Commands set β go forth and resize 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