visual3d:documentation:pipeline: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:overview [2024/06/19 12:49] – sgranger | visual3d:documentation:pipeline:expressions:overview [2024/07/12 13:29] (current) – removed sgranger | ||
|---|---|---|---|
| Line 1: | Line 1: | ||
| - | 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_items ==== | ||
| - | |||
| - | [[visual3d: | ||
| - | [[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. | ||
| - | |||
| - | |reserved_characters | ||
| - | |[[visual3d: | ||
| - | |[[visual3d: | ||
| - | |[[visual3d: | ||
| - | |[[visual3d: | ||
| - | |[[visual3d: | ||
| - | |||
| - | ==== visual3d reserved names ==== | ||
| - | |||
| - | |reserved_names | ||
| - | |[[visual3d: | ||
| - | |[[visual3d: | ||
| - | |[[visual3d: | ||
| - | |||
| - | ==== numbers ==== | ||
| - | |||
| - | |mathematical constants | ||
| - | |pi() |3.14159265358979323846 | ||
| - | |gravity_vector() | ||
| - | |[[visual3d: | ||
| - | |||
| - | ==== mathematical operators ==== | ||
| - | |||
| - | **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.** | ||
| - | |mathematical operators | ||
| - | |[[visual3d: | ||
| - | |[[visual3d: | ||
| - | |[[visual3d: | ||
| - | |[[visual3d: | ||
| - | |[[visual3d: | ||
| - | |[[visual3d: | ||
| - | |[[visual3d: | ||
| - | |[[visual3d: | ||
| - | |[[visual3d: | ||
| - | |[[visual3d: | ||
| - | |[[visual3d: | ||
| - | |[[visual3d: | ||
| - | |[[visual3d: | ||
| - | |[[visual3d: | ||
| - | |||
| - | === the ugly truth of the logical and === | ||
| - | |||
| - | & 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 | ||
| - | / | ||
| - | / | ||
| - | ! / | ||
| - | **;** | ||
| - | ! 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 imbedded in the pipeline to help you out. | ||
| - | 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: | ||
| - | ==== 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: | ||
| - | ==== 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, | ||
| - | => y and x must be one dimensional signals; returns a one dimensional signal | ||
| - | **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, | ||
| - | example | ||
| - | evaluate_expression | ||
| - | / | ||
| - | / | ||
| - | ! / | ||
| - | ! / | ||
| - | **;** | ||
| - | \\ | ||
| - | |||
| - | |||
| - | **dot (a, b)** -- creates the dot product of a and b | ||
| - | **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: | ||
| - | |||
| - | |||
visual3d/documentation/pipeline/expressions/overview.1718801399.txt.gz · Last modified: by sgranger
