visual3d:documentation:pipeline:expressions:expressions_overview
Differences
This shows you the differences between two versions of the page.
Both sides previous revisionPrevious revisionNext revision | Previous revision | ||
visual3d:documentation:pipeline:expressions:expressions_overview [2024/07/17 15:45] – created sgranger | visual3d:documentation:pipeline:expressions:expressions_overview [2025/01/22 14:06] (current) – [Intersection Functions] wikisysop | ||
---|---|---|---|
Line 3: | Line 3: | ||
Many (but not all) edit boxes and pipeline command parameters allow the use of expressions instead of numerical values. Visual3D uses a common expression parser, so the following syntax is common across all command parameters that allow expressions. | Many (but not all) edit boxes and pipeline command parameters allow the use of expressions instead of numerical values. Visual3D uses a common expression parser, so the following syntax is common across all command parameters that allow expressions. | ||
- | ==== Evaluate_Expression Command ==== | + | ===== Evaluate_Expression Command |
The Evaluate_Expression command allows the users to include expressions for defining the processing of the signals. | The Evaluate_Expression command allows the users to include expressions for defining the processing of the signals. | ||
+ | < | ||
Evaluate_Expression | Evaluate_Expression | ||
/ | / | ||
Line 16: | Line 16: | ||
/ | / | ||
!/ | !/ | ||
- | **;** | + | ; |
- | === Expression_Items === | + | </ |
- | [[Visual3D: | + | ===== Expression Syntax ===== |
- | [[Visual3D: | + | |
- | [[Visual3D: | + | |
- | [[Visual3D: | + | |
- | [[Visual3D: | + | |
- | [[Visual3D: | + | |
- | [[Visual3D: | + | |
- | === Visual3D Reserved Characters | + | |
- | There are five characters that cause the equation parser considerable trouble. We have introduced reserved pipeline commands that can be used in the place of these characters. | + | Expressions |
+ | -[[visual3d: | ||
+ | -[[visual3d: | ||
+ | -[[visual3d: | ||
+ | -[[visual3d: | ||
+ | -[[visual3d: | ||
+ | -[[visual3d: | ||
+ | -[[Visual3D: | ||
- | |Reserved_Characters | + | ===== Visual3D |
- | |[[Visual3D: | + | |
- | |[[Visual3D: | + | |
- | |[[Visual3D: | + | |
- | |[[Visual3D: | + | |
- | |[[Visual3D: | + | |
- | === Visual3D Reserved Names === | + | There are five characters that cause the expression parser considerable trouble. We have introduced reserved pipeline commands that can be used in the place of these characters. |
- | |Reserved_Names | + | ^Reserved Characters |
+ | |[[Visual3D: | ||
+ | |[[Visual3D: | ||
+ | |[[Visual3D: | ||
+ | |[[Visual3D: | ||
+ | |[[Visual3D: | ||
+ | |||
+ | ===== Visual3D Reserved Names ===== | ||
+ | |||
+ | We have introduced reserved names for a few common ideas that are useful to reference in constructing expressions. | ||
+ | |||
+ | ^Reserved Names ^Usage | ||
|[[Visual3D: | |[[Visual3D: | ||
|[[Visual3D: | |[[Visual3D: | ||
|[[Visual3D: | |[[Visual3D: | ||
- | === Numbers === | + | ===== Numbers |
- | |Mathematical Constants | + | We have introduced three number-related functions to aid in the construction of expressions. |
+ | |||
+ | ^Numerical Functions | ||
|pi() |3.14159265358979323846 | |pi() |3.14159265358979323846 | ||
|gravity_vector() | |gravity_vector() | ||
|[[Visual3D: | |[[Visual3D: | ||
- | === Mathematical Operators === | + | ===== Mathematical Operators |
- | **Note: Visual3D parses | + | In its simplest use, the Evaluate_Expression command can be used to evaluate arbitrary mathematical expressions. Use the following characters for your mathematical |
- | **Also Note the potential conflict between some of the operators | + | |
- | |Mathematical Operators | + | ^Mathematical Operators |
|[[Visual3D: | |[[Visual3D: | ||
|[[Visual3D: | |[[Visual3D: | ||
|[[Visual3D: | |[[Visual3D: | ||
|[[Visual3D: | |[[Visual3D: | ||
- | |[[Visual3D: | + | |[[Visual3D: |
- | |[[Visual3D: | + | |[[Visual3D: |
- | |[[Visual3D: | + | |[[Visual3D: |
|[[Visual3D: | |[[Visual3D: | ||
|[[Visual3D: | |[[Visual3D: | ||
Line 71: | Line 79: | ||
|[[Visual3D: | |[[Visual3D: | ||
- | == The ugly truth of the logical | + | **Note:** Visual3D parses the mathematical operators before it parses the signal names. If you have a signal name that contains a mathematical operator (e.g. R-Foot1), Visual3D will probably not be able to parse the equation expression properly. |
+ | |||
+ | **Also Note the potential conflict between some of the operators and the reserved characters. If the string is obviously an expression, there is no conflict.** | ||
+ | |||
+ | ==== The ugly truth of the logical | ||
+ | |||
+ | The & character is used by Visual3D for concatenating strings. This works quite well, but there is one circumstance where this choice of delimiter is a nuisance. That is when you want & to actually be a logical AND and the parser throws it away. | ||
+ | |||
+ | As of v2024.04.1 you can use the reserved string AMP for these cases. | ||
+ | |||
+ | Example given a file that has TAGS labelled TEST1 and TEST2. | ||
+ | |||
+ | < | ||
+ | ! To select files containing the tags TEST1 and TEST2 | ||
- | & is used by Visual3D for concatenating strings | ||
- | it works quite well, but there is one circumstance where this choice of delimiter is a nuisance. | ||
- | and that is when you want & to actually be a logical and and the parser throws it away | ||
- | in this case you can use the reserved string AMP | ||
- | it was only really ugly before version 2024_04 because it didn't work before then | ||
- | Example given a file that has TAGS labelled TEST1 and TEST2 | ||
- | To select files containing the tags TEST1 and TEST2 | ||
Select_Active_File | Select_Active_File | ||
/ | / | ||
/ | / | ||
! / | ! / | ||
- | **;** | + | ; |
! But what if you want to generalize and use another pipeline parameter for TEST2 | ! But what if you want to generalize and use another pipeline parameter for TEST2 | ||
Set_Pipeline_Parameter | Set_Pipeline_Parameter | ||
/ | / | ||
/ | / | ||
- | **;** | + | ; |
Select_Active_File | Select_Active_File | ||
/ | / | ||
/ | / | ||
! / | ! / | ||
- | **;** | + | ; |
- | === Brackets === | + | </ |
- | |Brackets | + | ===== Brackets ===== |
+ | |||
+ | ^Brackets | ||
|[[Visual3D: | |[[Visual3D: | ||
|[[Visual3D: | |[[Visual3D: | ||
- | ==== Functions ==== | + | ===== Functions |
- | Visual3D has pre-defined functions | + | Visual3D has pre-defined functions |
- | These functions are commonly used or have been added based on customer use. | + | |
- | === Metric Functions === | + | |
- | [[Visual3D: | + | ==== |
- | [[Visual3D: | + | |
- | [[Visual3D: | + | |
- | [[Visual3D: | + | |
- | [[Visual3D: | + | |
- | [[Visual3D: | + | |
- | [[Visual3D: | + | |
- | [[Visual3D: | + | |
- | [[Visual3D: | + | |
- | [[Visual3D: | + | |
- | [[Visual3D: | + | |
- | === | + | |
- | [[Visual3D: | + | *[[Visual3D: |
- | [[Visual3D: | + | *[[Visual3D: |
- | [[Visual3D: | + | *[[Visual3D: |
- | [[Visual3D: | + | *[[Visual3D: |
- | [[Visual3D: | + | *[[Visual3D: |
- | [[Visual3D: | + | *[[Visual3D: |
- | [[Visual3D: | + | *[[Visual3D: |
- | [[Visual3D: | + | *[[Visual3D: |
- | [[Visual3D: | + | *[[Visual3D: |
- | [[Visual3D: | + | *[[Visual3D: |
- | [[Visual3D: | + | *[[Visual3D: |
- | [[Visual3D: | + | |
- | [[Visual3D: | + | |
- | [[Visual3D: | + | |
- | [[Visual3D: | + | |
- | === String Data === | + | |
- | [[Visual3D: | + | ==== Signal Functions ==== |
- | [[Visual3D: | + | |
- | [[Visual3D: | + | |
- | [[Visual3D: | + | |
- | [[Visual3D: | + | |
- | [[Visual3D: | + | |
- | [[Visual3D: | + | |
- | [[Visual3D: | + | |
- | [[Visual3D: | + | |
- | [[Visual3D: | + | |
- | [[Visual3D: | + | |
- | === Least Squares Fitting of Data === | + | |
- | [[Visual3D: | + | *[[Visual3D: |
- | [[Visual3D: | + | *[[Visual3D: |
- | [[Visual3D: | + | *[[Visual3D: |
- | [[Visual3D: | + | *[[Visual3D: |
- | === Intersection Functions === | + | |
+ | *[[Visual3D: | ||
+ | *[[Visual3D: | ||
+ | *[[Visual3D: | ||
+ | *[[Visual3D: | ||
+ | *[[Visual3D: | ||
+ | *[[Visual3D: | ||
+ | *[[Visual3D: | ||
+ | *[[Visual3D: | ||
+ | *[[Visual3D: | ||
+ | *[[Visual3D: | ||
+ | *[[Visual3D: | ||
- | [[Visual3D: | + | ==== String Data ==== |
- | [[Visual3D: | + | |
- | [[Visual3D: | + | |
- | [[Visual3D: | + | |
- | [[Visual3D: | + | |
- | [[Visual3D: | + | |
- | === Assigned Force Functions | + | |
- | [[Visual3D: | + | *[[Visual3D: |
- | [[Visual3D: | + | *[[Visual3D: |
- | [[Visual3D: | + | *[[Visual3D: |
- | === Trigonometric Functions === | + | |
+ | *[[Visual3D: | ||
+ | *[[Visual3D: | ||
+ | *[[Visual3D: | ||
+ | *[[Visual3D: | ||
+ | *[[Visual3D: | ||
+ | *[[Visual3D: | ||
+ | *[[Visual3D: | ||
- | [[Visual3D: | + | ==== Least Squares Fitting of Data ==== |
- | [[Visual3D: | + | |
- | [[Visual3D: | + | |
- | [[Visual3D: | + | |
- | [[Visual3D: | + | |
- | [[Visual3D: | + | |
- | [[Visual3D: | + | |
- | [[Visual3D: | + | |
- | [[Visual3D: | + | |
- | === Array and Matrix Functions | + | |
- | [[Visual3D: | + | *[[Visual3D: |
- | [[Visual3D: | + | *[[Visual3D: |
- | [[Visual3D: | + | *[[Visual3D: |
- | [[Visual3D: | + | *[[Visual3D: |
- | [[Visual3D: | + | |
- | [[Visual3D: | + | |
- | [[Visual3D: | + | |
- | === Common Math Expressions === | + | |
- | **int(a**) - truncate each component to the nearest integer | + | ==== Intersection Functions ==== |
- | **round(a)** - round each component to the nearest integer | + | |
- | **fmod(y, | + | |
- | => y and x must be one dimensional signals; returns a one dimensional signal | + | |
- | **abs(a)** - absolute value | + | |
- | **sign(a)**= sign of the signal ((a<0)=-1, (a>0)=1, (a==0) = 0 | + | |
- | **sqrt(a)** - square root | + | *[[Visual3D: |
- | **exp(a)** - exponent | + | |
- | **log(a)** - natural log | + | |
- | **log10(a)** - log base 10 | + | *[[Visual3D: |
- | **length(x)** -- creates the length (magnitude) of a vector | + | |
- | **distance(a, | + | |
- | Example | + | ==== Assigned Force Functions ==== |
- | Evaluate_Expression | + | |
- | /Expression= distance(LANDMARK::ORIGINAL::RIGHT_HIP , TARGET::ORIGINAL::LHIP) | + | |
- | / | + | |
- | ! / | + | *[[Visual3D: |
- | ! / | + | |
- | **;** | + | ==== Trigonometric Functions |
- | \\ | + | |
+ | *[[Visual3D: | ||
+ | | ||
+ | | ||
+ | | ||
+ | *[[Visual3D: | ||
+ | *[[Visual3D: | ||
+ | *[[Visual3D: | ||
+ | *[[Visual3D: | ||
+ | *[[Visual3D: | ||
+ | |||
+ | ==== Array and Matrix Functions ==== | ||
+ | |||
+ | *[[Visual3D:Documentation:Pipeline:Expressions:Array_and_Matrix_Functions# | ||
+ | *[[Visual3D:Documentation:Pipeline:Expressions:Array_and_Matrix_Functions# | ||
+ | | ||
+ | | ||
+ | | ||
+ | *[[Visual3D: | ||
+ | | ||
+ | |||
+ | ==== Common Math Expressions ==== | ||
+ | * **int(a**) - truncate each component to the nearest integer | ||
+ | * **round(a)** - round each component to the nearest integer | ||
+ | * **fmod(y, | ||
+ | * **abs(a)** - absolute value | ||
+ | * **sign(a)**= sign of the signal ((a< | ||
+ | * **sqrt(a)** - square root | ||
+ | * **exp(a)** - exponent | ||
+ | * **log(a)** - natural log | ||
+ | * **log10(a)** - log base 10 | ||
+ | * **length(x)** -- creates the length (magnitude) of a vector | ||
+ | * **distance(a, | ||
+ | * **dot (a, b)** -- creates the dot product of a and b | ||
+ | * **cross (a, b)** -- creates the cross product of a and b | ||
- | **dot (a, b)** -- creates the dot product of a and b | + | ===== Expression Examples |
- | **cross (a, b)** -- creates the cross product of a and b | + | |
- | **NOTE: Often you will want to do dot (a, b)/ length (b), or cross (a, b) / length (b)** | + | |
- | ==== Expression Examples ==== | + | |
Examples of using Evaluate_Expressions can be found here: **[[Visual3D: | Examples of using Evaluate_Expressions can be found here: **[[Visual3D: |
visual3d/documentation/pipeline/expressions/expressions_overview.1721231143.txt.gz · Last modified: 2024/07/17 15:45 by sgranger