Node information connected to your output

I'm in a project where the current node depends on information from the node connected to its output, what better way to do this?

Thanks

Hi. Your question is super vague. Can you provide more detail?

Also explain what you need to do if the node is connected to multiple following nodes.

I want to simulate a mass-spring system.

spring_1->mass_1->spring_2->mass_2

In this system, to calculate mass 1, I need information about mass 2 that is in front of you.

In this case only one type of node will matter to me. It is necessary to go through all the nodes and get information of the specific type.

Are there nodes for each spring and each mass?

It sounds like flow context is ideal for this.

Instead of hard coding the masses in your simulation node[s] calculate based on the flow variables.

Set them in a change node:
set flow.mass1 = 100
set flow.mass2 = 50

Yes, the spring connects the two masses.

In that case consider the inputs and outputs of each node type.

  1. Each Spring has two inputs, the positions of each end. You can use two topic values to to identify them. It has one output, which is the current tension.

  2. Each Mass has two inputs, the tension on each end, and one output, the position.

So the wiring will look like this, probably with change nodes to setup the topics as appropriate.

image

This topic was automatically closed 60 days after the last reply. New replies are no longer allowed.