From bigfug
Jump to: navigation, search

There are nodes in Fugio that take data from an input pin, process it in some way, and send it to an output pin.

An example of paired pins would be the Abs node, which takes a number as its input and outputs the absolute value of that number:

Asd

An example where pins are not paired would be the Add node, which takes multiple inputs, and outputs a single value, being the sum of all the inputs.

Paired-Pins-Add.png

A single pair of pins means one input and one output that are paired together so that the value of the output is wholly dependent on the value from the input.

Multiple Paired Pins

Nodes that support paired pins are able to take multiple inputs, for which they will create the corresponding outputs.

The Float Threshold node is a good example because as well as supporting paired pins, it also takes an additional parameter, which is the Threshold value (a floating point number between 0.0 and 1.0)

The Float Threshold node compares each of the paired input values with the threshold value and sets the paired outputs to be true (or 1) if the input value is equal or above the threshold, or false (or 0) if the input value is less than the threshold value.

Initially the Float Threshold node only has a single Float input pin, so to make another, we can drag the link from the second node onto the body of the Float Threshold node:

Paired-Pins-Float-Threshold-01.png

The link colour has turned gray to show that we can drop it here. When we release the mouse button, the node creates a new input pin and a new paired output pin:

Paired-Pins-Float-Threshold-02.png

We can repeat this any number of times to create more input and output pairs.

Paired-Pins-Float-Threshold-03.png

Here we have created a third input using the same process, and connected the output pins to Led nodes.

The threshold value is 0.6, and the paired inputs and outputs are set as follows:

0.0 -> ( 0.0 >= 0.6 ) -> false
0.5 -> ( 0.5 >= 0.6 ) -> false
1.0 -> ( 1.0 >= 0.6 ) -> true

Using paired pins in a node makes it easier to group together similar functionality and results in having fewer nodes, which is good for clarity and performance.