CLONE(nged)

Deep-copy an object (optionally in a geometric pattern) and place the copies in the database with automatically generated names.

πŸ“… published 7.44.0, from nixpkgs unstable

πŸ’… CLONE β€” the nged glow-up edition ✨

Okay bestie, buckle up β€” clone lives in the nged manual, and it's honestly iconic. It deep-copies an object (optionally in a geometric pattern) and places the copies in the database with automatically generated names. Copy-paste but make it fashion. πŸ¦‹


🌸 NAME 🌸

clone β€” deep-copy an object (optionally in a geometric pattern) and place the copies in the database with automatically generated names. No cap, that's the whole vibe.


✨ SYNOPSIS ✨

clone [pattern] [options]... {object}...

The optional positional pattern keyword selects the geometric layout of the produced copies:

  • lin β€” linear (single-axis) β€” this is the default πŸ’…
  • rect β€” rectangular grid
  • sph β€” spherical pattern
  • cyl β€” cylindrical pattern

The pattern keyword may appear anywhere on the command line; option position relative to it does not matter. Omitting the keyword is literally identical to using lin. Periodt.


πŸŽ€ DESCRIPTION πŸŽ€

The clone command creates new database objects by copying an existing object hierarchy and placing the copies in a regular spatial pattern. It can produce a simple linear series, a rectangular grid, or radial layouts on spherical and cylindrical coordinate systems. It's giving assembly line but make it geometry. πŸ”₯


🧚 AXIS-AWARE OPTIONS 🧚

Each pattern publishes a fixed list of axes that any of the four axis-keyed options below operate on:

  • lin β†’ step
  • rect β†’ x, y, z
  • sph β†’ az, el, r
  • cyl β†’ az, r, h

These axis names are the only per-shape vocabulary you have to learn. Each of the four options below accepts either a bare value (which becomes the default for every axis whose attribute is otherwise unset) or an AXIS=value form (which binds to that axis only). All four are repeatable; later occurrences override earlier ones. Yes bestie, override is the main character.

  • -n, --copies N | AXIS=N β€” number of copies along the named axis (or every axis when bare).
  • -d, --delta D | AXIS=D β€” step size between copies along the axis. Degrees for az and el; model-space distance otherwise.
  • --start V | AXIS=V β€” starting value for the named axis. Defaults to 0 for non-angular axes; defaults to -90Β° for the el axis (south pole) so that a single elevation produces a layer at the equator only when explicitly set. That detail matters, don't skip it πŸ™ˆ.
  • --list AXIS=v1 v2... β€” provide an explicit list of values for the named axis. Overrides -n, -d, and --start for that axis. Only the AXIS= form is accepted. No bare values here, sorry queen.

🌈 SPATIAL & ORIENTATION OPTIONS 🌈

  • -O, --origin x y z β€” pattern origin in model space. Per-pattern interpretation, so pay attention:
    • lin: starting position offset (no-op when 0,0,0).
    • rect: grid origin.
    • sph: centre of the sphere.
    • cyl: centre of the cylinder base.
  • -p, --pivot x y z β€” pivot point baked into each copy when any rotation is applied β€” that is -r in lin, or --align in sph/cyl. Defaults to the model origin (0,0,0). In lin mode, this option doubles as the legacy rotation centre for -r (formerly --rpoint). Throwback moment πŸ’€.
  • --align KEYS β€” comma-separated list of orientation keys. Each copy is rotated so that the listed direction(s) follow its position. Valid keys per pattern:
    • sph: az (yaw to azimuth), el (pitch to elevation).
    • cyl: az (yaw β€” also accepts the alias tan).
    • lin, rect: not applicable.
  • --dir AXIS x y z β€” direction vector for the named axis. Defaults:
    • rect: x β†’ (1,0,0), y β†’ (0,1,0), z β†’ (0,0,1).
    • sph: az β†’ (1,0,0) reference for azimuth=0.
    • cyl: az β†’ (1,0,0); h β†’ (0,0,1) (cylinder axis).
    • lin: step axis (overrides the direction implied by -t).

πŸ’– HOUSEKEEPING OPTIONS πŸ’–

  • -h, --help β€” display help and exit. Our little safe space 🫢.
  • -i, --increment # β€” increment used when generating copy names. The first numeric run found in each source name is incremented by this value; if no number is present the increment is appended. Default 100.
  • -c, --second-number β€” move the naming cursor to the next numeric run in object names. May be repeated for the third, fourth, etc. number. Repeatable queen πŸ‘‘.
  • --depth top|regions|primitives β€” controls how deeply the copy hierarchy is constructed. Default is top for any pattern that produces more than one copy, primitives for the single-copy linear case.
    • top β€” wrapper combination, source geometry shared.
    • regions β€” every combination down to (and including) the first region copied; primitives shared.
    • primitives β€” full recursive deep copy, placement matrix baked in.
  • --xpush β€” before producing the final clone, flatten any matrices that hang above the combination members of the source object.
  • -g, --group name β€” collect the produced clones into a top-level combination called name.
  • -s, --subs sstr rstr β€” substitute the first occurrence of sstr with rstr in every generated object name.

πŸ’€ LINEAR-ONLY (FROZEN) OPTIONS πŸ’€

The compact short forms below are accepted only in lin mode. They exist so that any rel-7-42-2 invocation continues to parse identically. Frozen in time, still slaying. 🧊

  • -t, --translate x y z β€” per-copy translation vector. Equivalent to --dir step x y z -d step |x y z|.
  • -r, --rotate x y z β€” per-copy rotation in degrees about the X, Y, Z axes (in that order). Replaced by --align in pattern modes.
  • -a, --atrans n x y z β€” total translation x y z, split over n copies. Equivalent to -n n -t x/n y/n z/n.
  • -b, --arot n x y z β€” total rotation x y z in degrees, split over n copies.
  • -m, --mirror axis d β€” mirror the source about the plane perpendicular to axis (x, y, or z) at distance d.

πŸ“ EXAMPLES πŸ“

Example 1. Clone an object into a rectangular 4x3 array.

mged>clone rect -n x=4 -d x=9000 -n y=3 -d y=6000 rib.s

Creates twelve copies of rib.s arranged in a 4 by 3 grid, which is useful for repeated structural parts, bolt patterns, or ribs. Twelve ribs, twelve vibes. ✨

Linear (the original behaviour):

clone -n 4 -t 100 0 0 widget        # 4 copies along X, 100 apart
clone -a 4 100 0 0 widget           # equivalent
clone -m x 0 widget                 # mirror about the YZ plane

Rectangular grid:

clone rect -n 3 -d 100 widget                       # 3Γ—3Γ—3 grid, 100 apart
clone rect -n x=4 -d x=9000 -n y=3 -d y=6000 widget # 4Γ—3 grid in XY plane

Spherical pattern:

clone sph -n az=8 -d az=45 -n el=3 -d el=30 \
          --start el=-60 -n r=1 -d r=9000 widget
clone sph -n az=4 -d az=90 -n r=1 -d r=300 --align az widget

Cylindrical pattern:

clone cyl -n az=8 -d az=45 -n r=1 -d r=7000 \
          -n h=3 -d h=7000 widget
clone cyl -n az=4 -d az=90 -n r=1 -d r=300 \
          -n h=2 -d h=200 --align az widget

The pattern keyword position is irrelevant:

clone -n 4 rect -d 100 widget       # equivalent to:
clone rect -n 4 -d 100 widget
Lowkey the most freeing thing about this command: the keyword can go anywhere and it just works. Vibe check passed. βœ…

πŸ’œ AUTHOR πŸ’œ

BRL-CAD Team β€” icons, honestly.


This software is Copyright (c) 1995-2025 by the United States Government as represented by U.S. Army Research Laboratory.


πŸ¦‹ BUG REPORTS πŸ¦‹

Reports of bugs or problems should be submitted via electronic mail to <devs@brlcad.org>


Okay that's the whole page, bestie β€” and if you made it this far, you officially understand clone better than most people understand their own group chats. Go forth and duplicate responsibly. 🌸

β€” sign-off from the BRL-CAD girlies, page CLONE(nged), no date drama because we're timeless πŸ’…πŸ«Ά

πŸ“¦ where this page comes from