Package springbots :: Module gear :: Class Spring
[hide private]

Class Spring

source code


Spring: An object that connect nodes, and can only exist if connecting two diferent nodes. A spring has a normal lenght state and if pulled or pushed it applies a force on the nodes it connects to restabilish it's state. Springs can also move like muscles by changing it normal lenght by a sine wave frequency.

Instance Methods [hide private]
 
__init__(self, a, b, amplitude=0, offset=3.14159265359, normal=None)
Creates a spring connecting nodes A and B, with an start amplitude, offset and normal lenght.
source code
 
refresh(self, elast=0.5, ang=None, visc=0)
Refreshes a spring by appling forces on surrounding nodes and creating buoyancy forces if there are viscosity on the enviroment.
source code
 
__repr__(self)
repr(x)
source code

Inherited from object: __delattr__, __getattribute__, __hash__, __new__, __reduce__, __reduce_ex__, __setattr__, __str__

Properties [hide private]

Inherited from object: __class__

Method Details [hide private]

__init__(self, a, b, amplitude=0, offset=3.14159265359, normal=None)
(Constructor)

source code 

Creates a spring connecting nodes A and B, with an start amplitude, offset and normal lenght.

Overrides: object.__init__

__repr__(self)
(Representation operator)

source code 

repr(x)

Overrides: object.__repr__
(inherited documentation)