Navigation: Optimize Commands > Parameter Pickups

 

Parameter Pickups

 

Contact Us: fredsupport@photonengr.com

 

 

 

Description


Parameter Pickups provide a mechanism for dynamically linking two or more entity parameters together by defining a functional relationship between them.  For a given row in the pickup list, the user specifies a source variable, a destination variable, a functional form, two function parameters and an assignment operation type.  These specifications are used in the following way:

 

1.

The variable value is retrieved from the source entity.

2.

The functional form is applied to the source variable value using the two function parameters, a and b.

3.

The existing destination variable value and functionally modified source variable value are combined according to the assignment operation type.

4.

The resulting value from (3) is assigned to the destination variable.

 

There is an additional flexibility in the pickup list which allows an evaluated destination variable value (step 3 above) to be cascaded down through the pickup list (i.e. a pickup of a pickup value).  For a given pickup entry, the variable value retrieved from the source entity can either come from the current document state or from an previous evaluation of the variable in the pickup list.  If the source variable has been defined earlier in the pickup list as a destination variable, then the variable value retrieved will come from the most recent evaluation in the pickup list and not from the document.  Consider the example pickup table below:

 

 

Destination Variable

Source Variable

Pickup #

Entity

Type

Entity

Type

0

Surface 1

Curvature

Surface 1

Script

1

Surface 2

Curvature

Surface 2

Position

2

Surface 2

Curvature

Surface 1

Curvature

3

Surface 4

Position

Surface 2

Curvature

4

Surface 3

Aspheric Term

Surface 1

Script

 

The table below provides a description of where each pickup entry's source variable value is retrieved from based on the rules described above.

 

Pickup #

 

0

Accesses the document because it is the first entry in the pickup list.

1

Accesses the document because the source variable definition (entity and type) does NOT match the destination variable definition for any entries above it in the pickup list.

2

Accesses the value evaluated by pickup #0 because the source variable definition matches the destination variable definition exactly.

3

Accesses the value evaluated by pickup #2 because the source variable definition matches the destination variable definition exactly.  Although pickup #1 also has a matching destination variable definition, pickup #2 is the most recent evaluation.

4

Accesses the document because the source variable definition is a user script (see below).  Script source variable types always access the document.

 

Given that the source variables can be retrieved from either the document state or the pickup state, keep in mind when constructing the pickup table that the order of the definitions does matter and will affect the final destination variable evaluations.

 

Suppose that in the example above, the Script for pickup #4 was written to retrieve the Curvature from Surface 1.  Would the source variable value then look at the document state or the pickup state?  Because user-defined scripts are arbitrary, there is no way to know in advance that the scripted variable type definition matches any of the destination variable definitions.  In the case of user-defined script variable types, the value will always be retrieved from the document state.

 

 

Navigation


This feature can be accessed by selecting Optimize > Parameter Pickups from the menu.

 

 

Controls


Control

Inputs / Description

Defaults

Pickup Spreadsheet

Active

When updating the document, the Active flag indicates that the pickup row should be included (Checked) or ignored (Unchecked).

Checked

Description

User-defined description string of the pickup row.

 

Entity

For the Destination Variable, this designates the Entity on the object tree whose parameter value is being modified.  For the Source Variable, this designates the entity on the object tree whose parameter value is being retrieved.

 

Type

Specifies the type of parameter whose value is being retrieved (Source) or set (Destination).  A user-defined script type can be designated to access a custom parameter not available in the default list.  Please see the Optimization Variables type list for available options.

 

Index#

For variable types which can contain multiple rows in a spreadsheet style list (ex. position/orientation or NURB control points), the Index# specifies which row contains the variable.  Please see the Optimization Variables Index/Subindex convention list for more details.

 

Use a value of -1 if there are no index values associated with this parameter.

-1

Subindex#

Variables defined using an Index# scheme can also contain a Subindex# specification which points to a specific component of the entity.  In this convention, the Index# can be thought of as the row of a spreadsheet and the Subindex# as the column.  As an example, consider a position orientation specification list (spreadsheet format).  Each row in the position/orientation list is a single operation and a particular operation would be called out in the variable definition by its Index#.  Within each position/orientation operation there are one or more columns that define the operation values (ex. Rotate about X, Shift Y, etc.).  Each column would be called out in the variable definition by its Subindex#.  Please see the Optimization Variables Index/Subindex convention list for more details.

 

Use a value of -1 if there are no subindex values associated with this parameter.

-1

assign op

The assignment operator specifies how the retrieved value, X, and the existing value Y are used in the assignment of the destination variable value.  The retrieved value, X, includes the functional modification.  In the assignment operator list below, Y on the left hand side of the equation is the final destination parameter value and Y on the right hand side of the equation is the current unmodified destination parameter value.  Options are:

=   (equal  y=x)

+=   (plus-equal  y=y+x)

-=   (minus-equal  y=y-x)

*=   (times-equal  y=y*x)

/=   (divide-equal  y=y/x)

 

function

The parameter value retrieved from the source variable is passed through a functional modification before being used in the destination variable value assignment.  Options are:

x   (copy)

a10^(bx)   (exponent base10)

ax+b   (linear)

aLn(bx)   (natural log)

aSqrt(bx)   (square root)

aLog(bx)   (log base10)

ax^b   (power)

aSin(bx)   (sine)

a/(bx)   (divide)

aCos(bx)   (cosine)

aExp(bx)   (natural exponent)

aTan(bx)   (tangent)

aArcsin(bx)   (arcsine)

aArccos(bx)   (arccosine)

aArctan(bx)   (arctangent)

(user script)

1

param a, b

The functional forms which can be used to modify the parameter value retrieved from the source variable are characterized by two parameters, a and b.  The particular meaning of params a and b is dependent on the function being applied.

1

 

 

Application Notes


Linking pickups with user-script source variables

In the Description of pickup variables above, it is discussed that source variable values can be retrieved from either the document state or the currently evaluated pickup state.  In some scenarios it can be useful to have a user-script source variable which access the evaluated state of a previous pickup variable.  However, because of their generality, user-script source variables will always access the document state.  If the goal is to have a user-script source variable type which accesses the pickup state of a previous pickup, try the following implementation:

 

1.

 

Set the source variable definition to match the destination variable definition for the pickup whose value is to be used.

2.

 

Customize the source variable value by using a user-script function definition.

 

Following this procedure allows for a custom source variable value that is linked back to a previous pickup in the table.

 

 

Related Topics


Optimization Overview

Optimization Variables

Pickup Script Commands

 

 

 

 

 

Copyright © Photon Engineering, LLC