//----------------------------//
ArtMatic 1 in 2 out components
//----------------------------//


Set Constant
Scale Vector (Ax,Bx)
Add (x+A,x+B)
2D derivative dx,dy
Math tools #
Modulo & int
Indexed Saw
Integer Modulo
Cubic Clip
Index to Array
Linear motion
Circular motion
Random motion
Saw motion
Perlin noise + derivative
Compiled tree (Subtree)

//----------------------------//

Introduction

12 components act as either "dual filters" or "motion functions". Dual filters (such as Modulo & Int) implement two related functions (such as floating point modulo and integer quantize) one of which is passed out the left output and the other of which is passed out the right output. These are useful in cases where you need to perform two calculations on the same value. The Dual Filters versions are computationally more efficient than connecting two different 11 Filters to the same input. A few of the 12 components (such as Circular Motion) are motion functions and translate a value (usually time) into a position. The motion function allow you to set up trees where motion is automatically created by time.
An essential in-depth discussion of ArtMatic structures Trees and components is found in
ArtMatic Designer References and in Building trees.




12 Set Constant

ArtMatic script function :Constant

parameters :
A : x (-16.0 : 16.0)
E9 options
B : y (-16.0 : 16.0) E9 options

discussion :
This component generates a constant vector determined by Parameters 'x' and 'y'. The input value is ignored.

Script examples:
explicit: vec2 va = Constant(A1); //will create a constant tile without parameter, connected to A1
implicit: vec2 va =(1,2); //will create a constant tile with given parameters
you can also write vec2 cc = complex(0.8,0.23) to tag the result as a complex number

algorithms :



12 Scale Vector (Ax,Bx)

ArtMatic script function :Scale_Vector

parameters :
A : A (-16.0 : 16.0)
E9 options
B : B (-16.0 : 16.0) E9 options

discussion :
Scale Vector (Ax,Bx) coming soon



12 Add (x+A,x+B)

ArtMatic script function :Add

parameters :
A : A (-50.0 : 50.0)
E9 options
B : B (-50.0 : 50.0) E9 options

discussion :
This component is sometimes referred to as Add Vector. The outputs are x+A, x+B. Add Vector can be useful for adding offsets to the same axis or to move several objects.



12 2D derivative dx,dy

ArtMatic script function :Derivative_dxdy

parameters :
A : Amplitude (-8.0 : 8.0)
B : Normalize % (0.0 : 1.0)

discussion :
2D derivative dx,dy returns the partial derivatives df/dX, df/dY. When Normalize is at 1 the vector is normalized and will have an unit length.
The derivatives are taken by evaluating the tree above several times using finite differences. The Derivative component has to "see" the function above which means it cannot be used within a CT to compute the derivative of a function depending on values computed outside. Practically if you create a CT for a function and needs its derivative, put the derivative component outside the CT and connect the derivative to the CT output.
When used with loopers the derivative component shall be placed outside the loop, that is, after a memory or accumulating component like
11 Memory Add or 21 Orbit_analyzer # .



12 Math tools #

ArtMatic script function :Math_tools

parameters :
A : Offset A (-50.0 : 50.0)
E9 options
B : Offset B (-50.0 : 50.0) E9 options
C : Thickness N (0.0 : 10.0)
D : Thickness N (0.0 : 10.0)

discussion :
This component provides a few useful math functions selected by the algorithms popup.

algorithms :



12 Modulo & int

ArtMatic script function :Modulo_n_int

parameters :
A : Real Modulo (x) (0.8 : 128.0)
B : Phase (-32.0 : 32.0)
C : Int Modulo (y) (2.0 : 32.0)
E9 options

discussion :
This component provides a few different flavors of Modulo and Integer functions. The left output is a continuous floating point version of the modulo/remainder function (see 11 Modulo). The right output is the discontinuous integer modulo function (which is equivalent to the 11 Quantize component).

algorithms :



12 Indexed Saw

ArtMatic script function :Indexed_Saw

parameters :
A : Period (0.8 : 128.0)
B : Phase (-32.0 : 32.0)

discussion :
Indexed Saw provides a saw wave where each saw is indexed and the index value is returned in output 2. Saw wave is an useful primitive to repeat symetrical shapes. Period sets the space between each repeats. When the index is further passed into random tiles it can be used to modify each saw instance separately or simply the index can give a particular color when passed into a color generating tile like
13 Main Gradient .


Example in Voyager Examples/DF Modelling/Geometry/CubeStar isaw.vy



12 Integer Modulo

ArtMatic script function :Integer_Modulo

parameters :
A : Modulo (2 : 32) integer
B : Freq x (0.0 : 1.0)
C : Freq y (0.0 : 1.0)

discussion :
Integer Modulo essentially packs two 11 Quantize components into a single tile . The left and right outputs share the same number of steps but have independently controllable spacing via the frequency parameters.



12 Cubic Clip

ArtMatic script function :Cubic_Clip

parameters :
A : Input Scale (0.0 : 2.0)
B : Offset (-4.0 : 4.0)
C : Amplitude (0.0 : 32.0)

discussion :
The left output is the Cubic Clip function (see the 11 component description). The right output simply passes through the input value.



12 Index to Array

ArtMatic script function :Index_to_Array

parameters :
A : Rows # (2 : 128) integer
B : input gain (1.0 : 16.0)
C : Period (0.4 : 100.0)
E9 options
D : Randomize (0.0 : 1.0)

discussion :
Index to Array coming soon



12 Linear motion

ArtMatic script function :Linear_motion

parameters :
A : Direction (-6.283 : 6.283)
B : Speed (-50.0 : 50.0)

discussion :
This component creates motion along a straight line when input is connected to time (w) or z input in 2D systems. The direction is given by the "Direction" angle parameter and will be (cos(angle), sin(angle)). The 'Speed' parameter scales the input time. When negative motion will proceed backward. The motion is at constant speed if the input is linear.
The tile has the option to set the angle in degree or radian.
For a linear motion in 3D use the
Linear motion tile, available starting ArtMatic Engine 8.0.



12 Circular motion

ArtMatic script function :Circular_motion

parameters :
A : Radius (0.0 : 100.0)
E9 options
B : Speed X (-10.0 : 10.0) E9 options
C : Speed Y (-10.0 : 10.0) E9 options

discussion :
When Speed X and Speed Y are the same and when the input is connected to time (w), the result is a circular motion. The motion will be elliptical when the Speed X and Speed Y parameters are different. The 'Radius' sets the radius of the circle.The 'Speed X or Y' parameters scales the input time. When negative motion will proceed backward. The motion position has to be added to the target coordinates usually with 4 in 2 out add tile.
The tile has the options to interpret the radius in various units.
For a 3D circular motion you can use the 13 Circular motion tile, available starting ArtMatic Engine 8.0.



12 Random motion

ArtMatic script function :Random_motion

parameters :
A : Amplitude (0.0 : 100.0)
E9 options
B : Speed % (-50.0 : 50.0) E9 options

discussion :
This component creates continuous random 2D motion when the input is connected to time (w).The 'Amplitude' sets the radius of the motion. The 'Speed' parameter scales the input time. When negative motion will proceed backward. The random positions are generated using a 1D vector valued (2D) perlin noise function. The motion position produced by Random motion has to be added to the target coordinates usually with a 4 in 2 out add tile when the target is a 3D object.
The tile has the options to interpret the radius in various units.
For a 3D random motion you can use the 13 Random motion tile, available starting ArtMatic Engine 8.0.



12 Saw motion

ArtMatic script function :Saw_motion

parameters :
A : Amplitude (-10.0 : 10.0)
E9 options

discussion :
Saw motion uses two dephased triangle saw waves to create a 45° rotated square motion. Amplitude controls both frequency and size which means this component can also be used for DF 3D modeling. This tile is available starting ArtMatic Engine 8.0. The tile has the options to interpret the Amplitude in various units.



12 Perlin noise + derivative

ArtMatic script function :Perlin_noise_DV

parameters :
A : Amplitude (-8.0 : 8.0)
B : Phase (-32.0 : 32.0)
E9 options
C : Frequency (-8.0 : 100.0)

discussion :
The left-output is a 1D Perlin Noise function with its derivative provided from the second output. Derivative can be used to rotate an animated object while the the left-output value animates its position.
Here one can see the derivative in red crossing zero whenever the perlin noise is flat, as expected :



12 Compiled tree (Subtree)

ArtMatic script function :Subtree_

parameters :
A : Scale (0.0 : 1.0)
B : Iterations (0 : 256) integer

discussion :
Compiled Trees are groups of tiles that can be used in place of single tiles as a kind of macro or subroutine. 12 CT can hold any 1 input / 2 outputs tree and can be seen generally as a 2D vector valued 1D function.
12 CT are often used to define 2D coordinates derived from a single input (typically time). When input is time one can see the CT as the motion path equation or a 2D parametric curve of 't'. For example
x=cos(t),y=sin(t) will define a circular motion. To efficiently render parametric curve ArtMatic Engine 8 offer a new component, 2D Motion Path render, that will work in tandem with 12 Compiled trees.

usage :
Select a 12 tile and use "New compiled tree" to create a new CT from the selection (Tree Edit menu or type 'n' key).
To save a CT on disk to use the function elsewhere use "Save compiled tree" from the Tree Edit menu.
You may also copy and paste the entire CT by using Copy Tile and Paste Tile from the Edit menu.
You may iterate the tree by "Iterations" number when the tree contains an Iterations tile to modify and accumulates various values. "Scale" provide an optional scaling of outputs which is set at 1 by default (no scaling).