Skip to documentation
DocumentationAll documentsEnglish

PSCALE(nged)

NAME

pscale - scale a scalar or vector attribute of a primitive

On this page

SYNOPSIS

pscale [-r] obj attribute sf

DESCRIPTION

The pscale command scales a specific attribute of the BRL-CAD primitive obj by the scale factor sf. The attribute is identified by a single letter. The modified object is written back to the database.

The arguments are:

  • -r — Optional. Relative mode: the scale factor is applied relative to the current attribute value (multiplicative). Without -r, the scale factor is an absolute value. The scale factor must be positive and greater than zero in either mode.

  • obj — Name of the primitive to edit. Path prefixes (e.g. comb/part.s) are accepted; the trailing component name is used.

  • attribute — A single letter selecting which attribute of the primitive to scale (see table below).

  • sf — The scale factor. Must be positive (greater than zero).

Supported primitives and attributes

Primitive Attributes Description

EHY (Elliptical Hyperboloid)

h/H, a/A, b/B, c/C

Height, semi-major axis, semi-minor axis, neck-to-base distance.

ELL / SPH (Ellipsoid / Sphere)

a/A, b/B, c/C

A, B, and C semi-axis vectors. Scaling A with no sub-attribute scales all three uniformly.

EPA (Elliptical Paraboloid)

h/H, a/A, b/B

Height, semi-major axis, semi-minor axis.

ETO (Elliptical Torus)

r/R, d/D, c/C

Major radius, tube diameter, semi-minor cross-section axis.

EXTRUDE

h/H

Extrusion height vector magnitude.

HYP (Hyperboloid)

h/H, a/A, b/B, c/C

Height, semi-major, semi-minor, and c-value. h accepts v/V sub-attribute.

PARTICLE

h/H, v, h (lowercase)

Total length, vertex radius, head radius.

RHC (Right Hyperbolic Cylinder)

b/B, h/H, c/C, r/R

Half-width, height, c-distance, radius.

RPC (Right Parabolic Cylinder)

b/B, h/H, r/R

Half-width, height, radius.

SUPERELL

a/A, b/B, c/C

A, B, C semi-axis vectors.

TGC (Truncated General Cone)

a/A, b/B, c/C, d/D, h/H

Top/bottom radii, cross-section axes, height vector.

TOR (Torus)

a/A, h/H

Major radius, tube (minor) radius.

PIPE

b/B, r/R, i/I, o/O

Bend radius, radius, inner radius, outer radius.

METABALL

f/F, s/S

Field strength, strength value.

Other primitive types return an error.

EXAMPLES

Example 1. Scale the height of a TGC

mged> pscale cone.s h 1.5

Sets the height of the TGC primitive cone.s to 1.5 times its current absolute value.

Example 2. Scale a TOR major radius relatively

mged> pscale -r ring.s a 0.8

Multiplies the major radius of the torus ring.s by 0.8, shrinking it to 80% of its current size.

Example 3. Scale the A axis of an ellipsoid

mged> pscale sphere.s a 50

Sets the A semi-axis of sphere.s to 50 (in local units).

AUTHOR

BRL-CAD Team

BUG REPORTS

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