Attributes:
Methods:
Constants:
Extends Pointable.
The Finger class represents a tracked finger.
Fingers are Pointable objects that the Leap Motion software has classified as a finger. Get valid Finger objects from a Frame or a Hand object.
Fingers may be permanently associated to a hand. In this case the angular order of the finger IDs will be invariant. As fingers move in and out of view it is possible for the guessed ID of a finger to be incorrect. Consequently, it may be necessary for finger IDs to be exchanged. All tracked properties, such as velocity, will remain continuous in the API. However, quantities that are derived from the API output (such as a history of positions) will be discontinuous unless they have a corresponding ID exchange.
Note that Finger objects can be invalid, which means that they do not contain valid tracking data and do not correspond to a physical finger. Invalid Finger objects can be the result of asking for a Finger object using an ID from an earlier frame when no Finger objects with that ID exist in the current frame. A Finger object created from the Finger constructor is also invalid. Test for validity with the Pointable.is_valid() attribute.
New in version 1.0.
Constructs a Finger object.
finger = Finger(pointable)
Get valid Finger and Pointable objects from a Frame or a Hand object.
Parameters: | finger (Pointable) – An object representing a finger. If no finger parameter is supplied, or the object does not represent a finger, an invalid Finger object is returned. |
---|---|
Return type: | Finger |
New in version 1.0.
Type: | integer |
---|
The integer code representing the finger name.
- 0 = TYPE_THUMB
- 1 = TYPE_INDEX
- 2 = TYPE_MIDDLE
- 3 = TYPE_RING
- 4 = TYPE_PINKY
finger_type = finger.type
Note: prior to API version 2.2.6, type was a method, not a property.
New in version 2.0.
Type: | py:class:Bone |
---|
The object representing the specified bone on this finger.
bone = finger.bone(Bone.TYPE_PROXIMAL)
Parameters: | boneIndex (integer) – A code identifying the bone type:
|
---|---|
Returns: | Bone – The Bone object representing the specified segment of the finger. |
New in version 2.0.
Deprecated. Use Finger.bone(boneIndex) instead.
The position of the specified joint on this finger in millimeters from the Leap Motion origin.
Arguments
jointIx (int) – A code identifying the finger joint:
- 0 = JOINT_MCP – The metacarpophalangeal joint, or knuckle, of the finger.
- 1 = JOINT_PIP – The proximal interphalangeal joint of the finger. This joint is the middle joint of a finger.
- 2 = JOINT_DIP – The distal interphalangeal joint of the finger. This joint is closest to the tip.
- 3 = JOINT_TIP – The tip of the finger.
Returns
The Vector containing the coordinates of the joint position.
New in version 2.0.
Type: | integer |
---|
The distal interphalangeal joint – the last joint before the finger tip.
New in version 2.0.
Type: | integer |
---|
The metacarpophalangeal joint – the knuckle.
New in version 2.0.
Type: | integer |
---|
The proximal interphalangeal joint – the joint between the proximal and intermediate phalanx bones.
New in version 2.0.
Type: | integer |
---|
The finger tip (not anatomically a joint, but included for convenience).
New in version 2.0.
Type: | integer |
---|
The index finger.
New in version 2.0.
Type: | integer |
---|
The middle finger.
New in version 2.0.
Type: | integer |
---|
The little finger.
New in version 2.0.
Type: | integer |
---|
The ring finger.
New in version 2.0.
Type: | integer |
---|
The thumb.
New in version 2.0.
Type: | integer |
---|
The zone directly in front of the virtual touch plane.
New in version 2.0.
Type: | integer |
---|
The zone before reaching the hover zone.
New in version 2.0.
Type: | integer |
---|
The zone touching or penetrating the virtual touch plane.
New in version 2.0.
Type: | Finger |
---|
An invalid Finger object.
You can use this invalid object in comparisons testing whether a given Finger instance is valid or invalid. (You can also use the Pointable.is_valid attribute.)
New in version 1.0.