Sofa.SofaDeformable.LinearSpring

class Sofa.SofaDeformable.LinearSpring(self: Sofa.SofaDeformable.LinearSpring, index1: int, index2: int, springStiffness: float = 100, dampingFactor: float = 5, restLength: float, elongationOnly: bool = False, enabled: bool = True)

Bases: pybind11_object

A linear spring connecting pair of nodes of two different objects

Create a linear spring from indices and spring parameters.

Parameters
  • index1 – Index of the point on object 1.

  • index2 – Index of the point on object 2.

  • springStiffness – Stiffnes k of the spring (f = -k*x -d*v)

  • dampingFactor – Damping factor d of the spring (f = -k*x -d*v)

  • restLength – Initial length of the spring, such that f = 0

  • elongationOnly – If set to true, no compression of the spring is possible (x < 0)

  • enabled – If set to false, no force will be calculated for this spring

Returns

A linear spring of type Sofa.SofaDeformable.LinearSpring