EDIT(nged)
Edit objects in the database by translating, rotating, scaling, and other operations.
β¨ NAME β¨
edit β edit objects in the database by translating, rotating, scaling, and other operations. (this is EDIT(nged), straight out of the BRL-CAD User Commands lineup β hiii bestie π)
π SYNOPSIS π
edit [options] [geometry_specifier] subcommand [subcommand_args]
π¦ DESCRIPTION π¦
okay so edit transforms one or more objects in a BRL-CAD database. it's got a whole composable set of subcommands (translate, rotate, scale, and friends) plus a flexible geometry specifier syntax that can name objects by bare name, slash-separated path, URI, or via the active selection state. it's giving swiss army knife, fr fr π
every geometry-altering subcommand follows the exact same lifecycle, no cap:
- identify the object(s) to edit via a geometry specifier or the active selection.
- load the object into a temporary edit buffer (or create a fresh buffer entry if none exists).
- apply the requested transformation.
- commit the result to the database β unless
-iis given, which leaves the buffer entry pending for further operations.
and the checkpoint, revert, reset, and mat subcommands are the ones doing lifecycle management for that temporary buffer. they're the backstage crew, lowkey iconic π«Ά
π GEOMETRY SPECIFIERS π
a geometry specifier tells edit which object to act on. here are the supported forms, bestie:
- bare name β a top-level object name (e.g.
sph.s,assembly). - slash-separated path β a hierarchical path whose rightmost component is the object to edit and the preceding components supply the transformation matrix context (e.g.
assembly/subpart/sph.s). - URI with fragment β a name followed by
#and a feature key (e.g.sph.s#vertex0) whenDbiStateis available. - URI with query β a name followed by
?and a query string (e.g.sph.s?face=top) whenDbiStateis available. .(batch marker) β each object in the target list is used as its own reference point. useful for batch operations where each object moves independently.- selection fallback β if no geometry specifier is given on the command line, the current default selection state (if any) is used automatically. it just knows. main character energy π
π OPTIONS π
-h,--helpβ print help. the classic cry for guidance.-v,--verboseβ increase verbosity. more words, more yap, more info.-S,--selectionβ ignore any explicit command-line geometry specifier and operate on the active selection state instead.-f,--forceβ force: apply the operation, write the result to the database, and clear any pending conflict state. no thoughts, just send it π₯-F,--abandonβ abandon the intermediate buffer state and revert to the on-disk geometry. equivalent torevertfollowed by discarding the buffer entry. it's giving "we don't know her" π-i,--intermediateβ intermediate mode: apply the transformation to the temporary buffer only; do not write to the database. usecheckpoint/revert/resetto manage the buffer lifecycle.- Conflict arbiter β when an explicit geometry specifier is given and the same object also appears in the active selection,
editreports a conflict and requires one of the four arbiter flags (-S,-f,-F, or-i) to resolve it. this prevents accidental divergence between a command-line edit and an interactive selection. it's a vibe check, basically β --list-all-prim-opsβ print a human-readable list of available descriptor-defined edit operations for all primitive types.--list-all-prim-ops=jsonβ print the same information as a JSON array. same tea, machine-readable mug β
π§ PRIMITIVE OPERATION LISTING π§
edit supports both human-readable and JSON forms for descriptor-driven primitive operation discovery. two flavors, both slay.
top-level listing (all primitive types)
edit --list-all-prim-ops
edit --list-all-prim-ops=json
per-primitive listing by type name
edit tor
edit tor --list-ops
edit tor --list-ops=json
per-primitive listing by object name
edit tor.s -h
the general pattern is:
- human-readable:
edit <primitive_type> --list-ops - JSON:
edit <primitive_type> --list-ops=json
π SUBCOMMANDS π
translate (alias: tra)
edit [options] geometry translate [-a|-r] [-x|-y|-z] [-k FROM] TO
edit [options] geometry tra X Y Z
translates the object's position. see edit translate(nged) for the complete option reference and examples. moving day, but make it geometry π
-aβ interpret TO as an absolute position in model space.-rβ interpret TO as a relative delta from the current keypoint (default).-x,-y,-zβ restrict the translation to the specified axis only.-kFROM β set the reference keypoint. FROM may be an object name or a positionx y z.
Example 1. Quick examples
mged> edit sph.s translate -a 15 0 0
mged> edit sph.s translate -r 5 0 0
mged> edit sph.s translate -k sph.s -a other.s
mged> edit sph.s tra 5 0 0
rotate (alias: rot)
edit [options] geometry rotate [X_DEG [Y_DEG [Z_DEG]]]
edit [options] geometry rotate [-x|-y|-z] DEGREES
edit [options] geometry rotate [-R] [-k AXIS_FROM] [-a|-r AXIS_TO]
[-c CENTER] [-O ANGLE_ORIGIN] [-d DEGREES]
rotates the object using Euler angles or an explicit axis of rotation. see edit rotate(nged) for the complete option reference, conceptual model, and examples. spin spin spin π
-Rβ interpret angle values as radians.-x,-y,-zβ restrict the rotation to the specified axis (Euler mode).-kAXIS_FROM,-a/-rAXIS_TO β supply an explicit axis of rotation (axis mode).-cCENTER β set the pivot center (defaults to bounding-box center).-OANGLE_ORIGIN,-dDEGREES β set the angle origin and explicit rotation angle.
Example 2. Quick examples
mged> edit ell.s rotate 0 0 90
mged> edit ell.s rotate -z 90
mged> edit cube rotate -k sphere1 -a sphere2 -d 90
scale (alias: sca)
edit [options] geometry scale FACTOR
edit [options] geometry scale X_FACTOR Y_FACTOR Z_FACTOR
edit [options] geometry scale [-k FROM] [-a|-r TO] [-c CENTER]
scales the object by a uniform or per-axis factor. see edit scale(nged) for the complete option reference, the SCALE reference-frame model, and examples. big mood, literally π
-kFROM β reference "from" position. defaults to the object keypoint.-aTO,-rTO β "to" position (absolute or relative). together with-k, defines the reference scale vector.-cCENTER β center of the scaling operation.
Example 3. Quick examples
mged> edit sph.s scale 2
mged> edit sph.s scale 2 2 2
mged> edit sph.s scale -k 0 0 0 -a 2 2 2
checkpoint
edit [options] geometry checkpoint
loads the named geometry into the temporary edit buffer (creating a new buffer entry if one does not already exist) without applying any transformation. a subsequent -i operation will then modify only the buffer without touching the database, and a revert can undo those changes. it's a save point, bestie π
revert
edit [options] geometry revert
reverts the in-buffer state of the named geometry to its most recent checkpoint state and writes that state back to the database. returns an error if no buffer entry exists for the object. ctrl+z but make it official β©οΈ
reset
edit [options] geometry reset
discards the temporary buffer entry for the named geometry without writing anything to the database. equivalent to abandoning an in-progress edit. we simply do not perceive it π
mat
edit [options] geometry mat M00 M01 ... M33
applies an arbitrary 4Γ4 matrix (16 row-major values) to the geometry. the matrix is passed directly to the underlying librt edit layer. raw math delivered straight to the source π’
Example 4. Example: Apply a 90Β° Z-rotation matrix to ell.s
mged> edit ell.s mat 0 -1 0 0 1 0 0 0 0 0 1 0 0 0 0 1
perturb
edit [options] geometry perturb FACTOR
applies a random perturbation of magnitude FACTOR to the geometry. useful for sensitivity studies and mesh stress-testing. the perturbation is applied once per invocation; the random seed is derived from the session state. chaos, but make it scientific πͺοΈ
requires that the underlying primitive type support ft_perturb.
β EXAMPLES β
these illustrate the most common edit workflows. see edit translate(nged), edit rotate(nged), and edit scale(nged) for comprehensive examples of each subcommand.
Example 5. Translate a sphere to an absolute position
mged> edit sph.s translate -a 15 0 0
Example 6. Rotate a cube 45Β° around the Z-axis
mged> edit cube rotate -z 45
Example 7. Double the size of a sphere
mged> edit sph.s scale 2
Example 8. Intermediate edit workflow: checkpoint, modify, revert if needed
create a checkpoint (snapshot to revert to):
mged> edit tor.s checkpoint
apply a tentative translation (stays in buffer):
mged> edit -i tor.s translate -r 5 0 0
if satisfied, write to disk:
mged> edit tor.s translate -r 0 0 0
if not satisfied, roll back to the checkpoint:
mged> edit tor.s revert
Example 9. Edit based on the active selection
with objects already selected in the viewer:
mged> edit translate -a 10 0 0
force the command-line specifier to override the selection:
mged> edit -f sph.s translate -a 10 0 0
π« SEE ALSO π«
edit translate(nged), edit rotate(nged), edit scale(nged), translate(nged), rotate(nged), scale(nged), protate(nged), pscale(nged), ptranslate(nged), edarb(nged) β go read the whole friend group π«Ά
πΈ AUTHOR πΈ
BRL-CAD Team
π BUG REPORTS π
reports of bugs or problems should be submitted via electronic mail to devs@brlcad.org. tell them everything, they want the tea β
β¨ that's the whole page!! brought to you by BRL-CAD, filing under EDIT(nged), and dated the way the original footer says β go off, you understood the assignment π
π
π¦ 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