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:43] – removed sgranger | visual3d:documentation:pipeline:expressions:expressions_overview [2025/01/22 14:06] (current) – [Intersection Functions] wikisysop | ||
---|---|---|---|
Line 1: | Line 1: | ||
+ | ====== Expressions Overview ====== | ||
+ | |||
+ | 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 ===== | ||
+ | |||
+ | The Evaluate_Expression command allows the users to include expressions for defining the processing of the signals. | ||
+ | < | ||
+ | Evaluate_Expression | ||
+ | / | ||
+ | !/ | ||
+ | !/ | ||
+ | !/ | ||
+ | / | ||
+ | / | ||
+ | / | ||
+ | !/ | ||
+ | ; | ||
+ | </ | ||
+ | |||
+ | ===== Expression Syntax ===== | ||
+ | |||
+ | Expressions are incredibly flexible and capable of ingesting most data types in Visual3D. The key to using expressions is to understand the syntax used for each data type: | ||
+ | -[[visual3d: | ||
+ | -[[visual3d: | ||
+ | -[[visual3d: | ||
+ | -[[visual3d: | ||
+ | -[[visual3d: | ||
+ | -[[visual3d: | ||
+ | -[[Visual3D: | ||
+ | |||
+ | ===== Visual3D Reserved Characters ===== | ||
+ | |||
+ | 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 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: | ||
+ | |||
+ | ===== Numbers ===== | ||
+ | |||
+ | We have introduced three number-related functions to aid in the construction of expressions. | ||
+ | |||
+ | ^Numerical Functions | ||
+ | |pi() |3.14159265358979323846 | ||
+ | |gravity_vector() | ||
+ | |[[Visual3D: | ||
+ | |||
+ | ===== Mathematical Operators ===== | ||
+ | |||
+ | In its simplest use, the Evaluate_Expression command can be used to evaluate arbitrary mathematical expressions. Use the following characters for your mathematical operators. | ||
+ | |||
+ | ^Mathematical Operators | ||
+ | |[[Visual3D: | ||
+ | |[[Visual3D: | ||
+ | |[[Visual3D: | ||
+ | |[[Visual3D: | ||
+ | |[[Visual3D: | ||
+ | |[[Visual3D: | ||
+ | |[[Visual3D: | ||
+ | |[[Visual3D: | ||
+ | |[[Visual3D: | ||
+ | |[[Visual3D: | ||
+ | |[[Visual3D: | ||
+ | |[[Visual3D: | ||
+ | |[[Visual3D: | ||
+ | |[[Visual3D: | ||
+ | |||
+ | **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 AND==== | ||
+ | |||
+ | 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 | ||
+ | |||
+ | Select_Active_File | ||
+ | / | ||
+ | / | ||
+ | ! / | ||
+ | ; | ||
+ | |||
+ | ! But what if you want to generalize and use another pipeline parameter for TEST2 | ||
+ | Set_Pipeline_Parameter | ||
+ | / | ||
+ | / | ||
+ | ; | ||
+ | |||
+ | Select_Active_File | ||
+ | / | ||
+ | / | ||
+ | ! / | ||
+ | ; | ||
+ | </ | ||
+ | |||
+ | ===== Brackets ===== | ||
+ | |||
+ | ^Brackets | ||
+ | |[[Visual3D: | ||
+ | |[[Visual3D: | ||
+ | |||
+ | ===== Functions ===== | ||
+ | |||
+ | Visual3D has pre-defined functions embedded in the pipeline to help you construct your expressions. 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: | ||
+ | |||
+ | ==== Signal Functions ==== | ||
+ | |||
+ | *[[Visual3D: | ||
+ | *[[Visual3D: | ||
+ | *[[Visual3D: | ||
+ | *[[Visual3D: | ||
+ | *[[Visual3D: | ||
+ | *[[Visual3D: | ||
+ | *[[Visual3D: | ||
+ | *[[Visual3D: | ||
+ | *[[Visual3D: | ||
+ | *[[Visual3D: | ||
+ | *[[Visual3D: | ||
+ | *[[Visual3D: | ||
+ | *[[Visual3D: | ||
+ | *[[Visual3D: | ||
+ | *[[Visual3D: | ||
+ | *[[Visual3D: | ||
+ | |||
+ | ==== String Data ==== | ||
+ | |||
+ | *[[Visual3D: | ||
+ | *[[Visual3D: | ||
+ | *[[Visual3D: | ||
+ | *[[Visual3D: | ||
+ | *[[Visual3D: | ||
+ | *[[Visual3D: | ||
+ | *[[Visual3D: | ||
+ | *[[Visual3D: | ||
+ | *[[Visual3D: | ||
+ | *[[Visual3D: | ||
+ | *[[Visual3D: | ||
+ | |||
+ | ==== Least Squares Fitting of Data ==== | ||
+ | |||
+ | *[[Visual3D: | ||
+ | *[[Visual3D: | ||
+ | *[[Visual3D: | ||
+ | *[[Visual3D: | ||
+ | |||
+ | ==== Intersection Functions ==== | ||
+ | |||
+ | *[[Visual3D: | ||
+ | *[[Visual3D: | ||
+ | *[[Visual3D: | ||
+ | *[[Visual3D: | ||
+ | *[[Visual3D: | ||
+ | *[[Visual3D: | ||
+ | *[[Visual3D: | ||
+ | *[[Visual3D: | ||
+ | |||
+ | |||
+ | ==== Assigned Force Functions ==== | ||
+ | |||
+ | *[[Visual3D: | ||
+ | *[[Visual3D: | ||
+ | *[[Visual3D: | ||
+ | |||
+ | ==== Trigonometric Functions ==== | ||
+ | |||
+ | *[[Visual3D: | ||
+ | *[[Visual3D: | ||
+ | *[[Visual3D: | ||
+ | *[[Visual3D: | ||
+ | *[[Visual3D: | ||
+ | *[[Visual3D: | ||
+ | *[[Visual3D: | ||
+ | *[[Visual3D: | ||
+ | *[[Visual3D: | ||
+ | |||
+ | ==== Array and Matrix Functions ==== | ||
+ | |||
+ | *[[Visual3D: | ||
+ | *[[Visual3D: | ||
+ | *[[Visual3D: | ||
+ | *[[Visual3D: | ||
+ | *[[Visual3D: | ||
+ | *[[Visual3D: | ||
+ | *[[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 | ||
+ | |||
+ | ===== Expression Examples ===== | ||
+ | |||
+ | Examples of using Evaluate_Expressions can be found here: **[[Visual3D: | ||
+ | |||
+ | |||
visual3d/documentation/pipeline/expressions/expressions_overview.1721230995.txt.gz · Last modified: 2024/07/17 15:43 by sgranger