Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Dynamics #105

Merged
merged 25 commits into from Feb 15, 2014
Merged

Dynamics #105

merged 25 commits into from Feb 15, 2014

Conversation

genete
Copy link
Member

@genete genete commented Feb 14, 2014

Implementation of ValueNode_Dynamic

This is the implementation of a new Convert type that allows to link two vectors with a dynamic link. The value node (vector type) that is converted to Dynamic will be linked to another vector value using a linear/rotational spring system with damping and friction.

Once you convert the Value to Dynamic it offers the following subparameters:

  • Tip Static (Vector) This is the equilibrium position of the system without external forces relative to the Origin. See Origin. Since it is a vector its length is used for the linear spring equilibrium length and its angle form the x axis is used for the torsion spring equilibrium angle. The initial value of this subparameter is the current value of the Value that is being converted to Dynamic.
  • Origin (Vector) This is the basement of the dynamic system. Defaults to (0.0, 0.0). If the user changes this value the final equilibrium calculated position of the value is modified too. Accelerations of the Origin are used to move the Tip due to the fictitious forces needed to apply under non inertial reference systems.
  • Force (Vector) External force applied on the Tip of the dynamic system. Defaults to (0.0, 0.0).
  • Torque (Real) External momentum applied tot he dynamic system at the Origin. Defaults to 0.0.
  • Damping (Real) Damper coefficient of the linear link. Defaults to 0.4
  • Friction (Real) Friction coefficient of the rotational link. Defaults to 0.4
  • Spring (Real) Spring coefficient of the linear link. Defaults to 30.0
  • Torsion (Real) Torsion coefficient of the rotational link. Defaults to 30.0
  • Mass (Real) Mass of the dynamic system. Defaults to 0.3
  • Inertia (Real) Moment of inertia of the dynamic system. Defaults to 0.3

Comments

  • The movement of the Origin produces two effects. It drags the resulting vector the same amount of the Origin along the time (that is the resulting vector is the sum of the Origin(t) + dynamic tip(t)) and its acceleration produces an inertial force contrary to the acceleration direction and magnitude.
  • The Torque only affects the angle of the resulting vector respect to the Origin. This means that the mass center of gravity is located at the origin (where the torque is applied) and so there is not centrifugal effects.
  • Since the Origin only can be translated, there is not Coriolis forces.
  • The Force is applied on the tip position so it would produce effects on the angle and on the length of the tip. Force (F) is decomposed into two vectors one aligned with the Tip vector (Fr) and other perpendicular (Fa). The one aligned (Fr) is used on the linear damper spring equations. The one perpendicular (Fa) is used as additional torque by this expression Fr*R (where R is the size of the Tip vector)
  • If Mass (Inertia) is animated and reaches near to zero, then the movement for linear (rotational) link is disabled.
  • If Mass (inertia) is constant and equal to zero, then the movement for linear (rotational) link is disabled. It is useful when user wants to create a rigid link on linear (rotational) link.
  • Except mass and inertia = 0.0, user is responsible of the meaning of the values of the parameters (i.e. negative mass, or negative friction or spring constant)

Further development

  • Implement reverse manipulation. The Tip Static subparameter should be the one modified when the user tweaks the Dynamic value node handle. This way the user can alter the equilibrium position of the spring (which is other type of animation of this model)
  • Add one more subparameter to don't allow Origin to drag the result. Origin would only be used as an input of the movement of the basement but not to calculate the final position of the tip. This is useful when the vector that represent the tip is not a free vector but it is already a vector that depends on other. I. e. Bones.
  • Study how to implement this on a chain of bones taking in consideration the reactive internal forces.

It allows to have Boost/Odeint libraries only available since Boost 1.53.0
New member to reset state.
Disable torsion spring again, needs fixes.
Avoid zero division when mass or inertia are zero.
Avoid zero division when mass or inertia are small enough.
morevnaproject added a commit that referenced this pull request Feb 15, 2014
@morevnaproject morevnaproject merged commit 7a4931a into synfig:master Feb 15, 2014
@morevnaproject
Copy link
Member

It would be nice to put such description onto wiki page! ^__^

@d-j-a-y
Copy link
Contributor

d-j-a-y commented Mar 5, 2014

It would be nice to put such description onto wiki page! ^__^
done

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants