fork from Formality-Net-Animator
This tool is used to create an animation of the reduction process of interaction nets for Nasic (N-Ary Symmetric Interaction Combinators).
It's recommended have a sketch before defining the type and position of the nodes.
- Go to the root folder and run a local server.
- Open
http://localhost:8080
to visualize the canvas.
- Single click: select an element
- Click and move: updates an element position. Can be done in nodes and pivots.
- Click and use arrow keys: updates an element angle, makes a rotation
- Space bar: saves an state of nodes' info as position, rotating, ports, etc.
- Press crtl/cmd and click a node to check if can do a transformation (reduction or duplication). If it can transform, the transformation will occur, otherwise nothing happens.
- Press 'x' to remove the last state of nodes saved
- Press 'h' to hide pivots position
- Press 'p' to play an animation
Tip: to make a smooth animation, do small changes on the position and rotation of the elements and save them. More states saved, more smooth is the animation.
Corrigir bugs na linha 568
, não sei o que fazer, focarei em estudar mais pra ver se resolvo:
function connectPorts([nodeA, slotA], [nodeB, slotB]) {
nodeA.ports[slotA] = [nodeB, slotB];
nodeB.ports[slotB] = [nodeA, slotA];
}
e 216
:
connectPorts([this_node , port_a], [to_node_a , port_from_a])