Extends Pointable.
The Tool class represents a tracked tool.
Tools are Pointable objects that the Leap Motion software has classified as a tool. Tools are longer, thinner, and straighter than a typical finger. Get valid Tool objects from a Frame object.
Note that Tool objects can be invalid, which means that they do not contain valid tracking data and do not correspond to a physical tool. Invalid Tool objects can be the result of asking for a Tool object using an ID from an earlier frame when no Tool objects with that ID exist in the current frame. A Tool object created from the Tool constructor is also invalid. Test for validity with the inherited Pointable.is_valid property.
New in version 1.0.
Constructs a Tool object.
Get valid Tool and Pointable objects from a Frame or a Hand object.
tool = frame.tools.frontmost
if tool.is_valid:
# Use tool data
Parameters: | tool (Pointable) – An object representing a tool. If no tool parameter is supplied, or the object does not represent a tool, an invalid Tool object is returned. |
---|
New in version 1.0.
Type: | Tool |
---|
An invalid Tool object.
New in version 1.0.