DynamoDS / Dynamo

Open Source Graphical Programming for Design
https://dynamobim.org
Other
1.73k stars 633 forks source link

dynamic relaxation node #45

Closed tatlin closed 11 years ago

tatlin commented 12 years ago

dynRelaxation node implements a basic particle system input - list of ref points get mapped to particles (use Revit XYZ class for now for Vector3d) input - list of line-bypoints mapped to springs input - timestep - seperate node to set ms, either implement a timer node or set ms as a double fixity - read parameter / data set on user-created ref points (bool fixed) gravity and forces - hard code gravity and drag for now in the PS. solver can handle wind as well but let's get the basics going first.

internals - solver - verlet or rk4 particle.cs spring.cs particlesystem.cs

dynRelaxation node is responsible for managing inputs, instantiating the PS, creating particles from ref points and springs from lines, and then calling the update as part of Evaluate. after PS update step, PS update step needs to return particle list. dynRelaxation Evaluate() will take particle list with updated positions and then map that back to ref points to update their position. Curve-by-points will update automatically, no need to make spring length back to CBPs. on evaluate all we are doing is updating the position of existing ref points so refresh should be fairly quick, update ref points individually or as a group. question is do we need nested transactions to do this. Need to ask Stephen/Peter about threading.

basic use cases:

tatlin commented 12 years ago

Works now. I've got it more stable with shorter spring rest length, tighter steps and more dampening. In example below there are 10 points laid out along x-axis every 100 feet. Spring rest length is 1 foot. You can see the contraction in the screenshot below. You can see from the forces in the m_Velocity field and the delta between m_oldPosition and m_Position that the point is moving to the left. What i'm not sure, because the dynamics are not working yet is how well the dampening works over time and does acceleration stay under control or not.

Regarding dynamics - I'm still experimenting with timers and having trouble having the stopwatch trigger an update when the interval is hit. I have recreated the old dynTimer and am using a stopwatch but the only way I can hit KeepTime() is in the Evaluate loop for dynTimer. I want to send a pulse downstream every time the stopwatch hits a specified interval in milliseconds. I feel a mental block coming on here - I need some Stephen magic or at least a hint from Stephen or Ian.

Todo on the dynDynamicRelaxation:

tatlin commented 12 years ago

need to expose Gravity vector and Wind vec as inputs to node

Steell commented 12 years ago

"Timer" node has been implemented as "Evaluation Interval" node

ekatzenstein commented 9 years ago

Does the evaluation interval exist any more?

tatlin commented 9 years ago

Hi erik @ekatzenstein, the evaluation interval node did not make the transition to 7.x but @Steell @ikeough and @lukechurch have a new timer design for a number of needs here.

ekatzenstein commented 9 years ago

Thanks Matt, was there meant to be a link at the end of your post? Seems to be missing.

On Wednesday, November 19, 2014, Matt Jezyk notifications@github.com wrote:

Hi erik @ekatzenstein https://github.com/ekatzenstein, the evaluation interval node did not make the transition to 7.x but @Steell https://github.com/Steell @ikeough https://github.com/ikeough and @lukechurch https://github.com/lukechurch have a new timer design for a number of needs here.

— Reply to this email directly or view it on GitHub https://github.com/DynamoDS/Dynamo/issues/45#issuecomment-63755705.

tatlin commented 9 years ago

Nope, just wanted to say we have people working on this now

-matt

On Nov 19, 2014, at 10:26 PM, ekatzenstein notifications@github.com wrote:

Thanks Matt, was there meant to be a link at the end of your post? Seems to be missing.

On Wednesday, November 19, 2014, Matt Jezyk notifications@github.com wrote:

Hi erik @ekatzenstein https://github.com/ekatzenstein, the evaluation interval node did not make the transition to 7.x but @Steell https://github.com/Steell @ikeough https://github.com/ikeough and @lukechurch https://github.com/lukechurch have a new timer design for a number of needs here.

— Reply to this email directly or view it on GitHub https://github.com/DynamoDS/Dynamo/issues/45#issuecomment-63755705.

— Reply to this email directly or view it on GitHub.

ekatzenstein commented 9 years ago

Ok great. Looking forward to the next release.

On Wednesday, November 19, 2014, Matt Jezyk notifications@github.com wrote:

Nope, just wanted to say we have people working on this now

-matt

On Nov 19, 2014, at 10:26 PM, ekatzenstein <notifications@github.com javascript:_e(%7B%7D,'cvml','notifications@github.com');> wrote:

Thanks Matt, was there meant to be a link at the end of your post? Seems to be missing.

On Wednesday, November 19, 2014, Matt Jezyk <notifications@github.com javascript:_e(%7B%7D,'cvml','notifications@github.com');> wrote:

Hi erik @ekatzenstein https://github.com/ekatzenstein, the evaluation interval node did not make the transition to 7.x but @Steell https://github.com/Steell @ikeough https://github.com/ikeough and @lukechurch https://github.com/lukechurch have a new timer design for a number of needs here.

— Reply to this email directly or view it on GitHub https://github.com/DynamoDS/Dynamo/issues/45#issuecomment-63755705.

— Reply to this email directly or view it on GitHub.

— Reply to this email directly or view it on GitHub https://github.com/DynamoDS/Dynamo/issues/45#issuecomment-63757635.