User Tools

Site Tools


operation

Description

Defines properties of a single operation in a formula operation stack.

Parent Objects

Properties

Name Description Default Required
op Specifies the operator for the operation. See Details section. None yes
val Specifies the value to push onto the stack. See Details section. None no
url Specifies the URI of a property to evaluate and push onto the stack. None no

Details

Operator / Operand Pairings

The following operator/operand pairings are supported:

Operator Operand Effect
push url Evaluates the given property and pushes the resulting value onto the stack.
push val Pushes the given value onto the stack. May be one of int, float, float2, or float5 type. See Supported Value Types below.
add None Adds the top two stack entries. Pops the top two entries off of the stack, adds them and pushes the result back on the stack.
sub None Subtracts the top stack entry from the next-to-top entry. Pops two entries off of the stack and pushes the result of the subtraction.
mult None Multiplies the top two stack entries. Pops the top two entries off of the stack, multiplies them and pushes the result back on the stack.
div None Divides the next-to-top stack entry by the top entry. Pops two entries off of the stack and pushes the result of the division.
inv None Inverses the top stack entry. Pops the top entry off the stack and pushes the inverse value (1/n) back onto the stack.
neg None Negates the top stack entry. Pops the top entry off the stack and pushes the negated value (-n) back onto the stack.
spline_linear None Linear interpolation between key values. Pops one entry off of the stack to use as the number of keys to process (N), pops N entries off of the stack to define the linear spline, pops one entry off of the stack to use as the value to evaluate on the spline and pushes the result back onto the stack.
spline_constant None Constant interpolation between key values. Pops one entry off of the stack to use as the number of keys to process (N), pops N entries off of the stack to define the constant spline, pops one entry off of the stack to use as the value to evaluate on the spline and pushes the result back onto the stack.
spline_tcb None TCB (Kochanek-Bartels) Spline interpolation between key values. Pops one entry off of the stack to use as the number of keys to process (N), pops N entries off of the stack to define the TCB spline, pops one entry off of the stack to use as the value to evaluate on the spline and pushes the result back onto the stack.

Supported Value Types (push/val)

The following value types are supported for the “push” (operator) “val” (operand) pairing above:

Type Usage
int A discrete integer value.
float A discrete floating-point value.
knot2 A float2 that defines a knot of a Linear or Constant spline, in the form [ key, value ].
knot5 A float5 that defines a knot of a TCB spline, in the form [ key, value, tension, continuity, bias ].

Push Sequence(s)

The following pairings describe the sequence of “push” operations that precede a given operator:

Operator Sequence
add A URI, int, or float to add.
sub A URI, int, or float to subtract.
mult A URI, int, or float to multiply by.
div A URI, int, or float to divide by.
inv A URI, int, or float to invert.
neg A URI, int, or float to negate.
spline_linear An int indicating the number of knot2 values that define the spline; N.
N number of knot2 values that define the individual knots of the spline.
A URI, int, or float to evaluate on the spline.
spline_constant An int indicating the number of knot2 values that define the spline; N.
N number of knot2 values that define the individual knots of the spline.
A URI, int, or float to evaluate on the spline.
spline_tcb An int indicating the number of knot5 values that define the spline; N.
N number of knot5 values that define the individual knots of the spline.
A URI, int, or float to evaluate on the spline.

Examples

  • Push a property value onto the stack:
    { "op" : "push", "url" : "hips:#hips?rotation/x" }
  • Multiply the top two stack entries:
    { "op" : "mult" }
  • Push the value 1.8 onto the stack:
    { "op" : "push", "val" : 1.8 }