Attributes:
Methods:
The InteractionBox class represents a boxshaped region completely within the field of view of the Leap Motion controller.
The interaction box is an axisaligned rectangular prism and provides normalized coordinates for hands, fingers, and tools within this box. The InteractionBox region is defined by a center and dimensions along the x, y, and z axes.
Get an InteractionBox object from a Frame object.
interaction_box = frame.interaction_box
The InteractionBox class can make it easier to map positions in the Leap Motion coordinate system to 2D or 3D coordinate systems used for application drawing. The following example illustrates how to convert coordinates from the Leap Motion coordinate system to an applicationdefined coordinate system using the normalize_point() function. This example is 2D (it ignores the zaxis), but the technique can be be used for all three dimensions.
app_width = 600
app_height = 400
i_box = frame.interaction_box
normalized_tip = i_box.normalize_point(finger.tip_position)
app_x = app_width * normalized_tip.x
app_y = app_height * (1  normalized_tip.y)
Note that the ydimension is inverted since most 2D drawing coordinate systems put the zeropoint of the yaxis at the top of the window.
New in version 1.0.
Type:  Vector 

The center of the InteractionBox in device coordinates (millimeters). This point is equidistant from opposing sides of the box.
center = interaction_box.center
New in version 1.0.
Type:  float 

The width of the InteractionBox in millimeters, measured along the xaxis.
x_dimension = interaction_box.width
New in version 1.0.
Type:  float 

The height of the InteractionBox in millimeters, measured along the yaxis.
y_dimension = interaction_box.height
New in version 1.0.
Type:  float 

The depth of the InteractionBox in millimeters, measured along the zaxis.
z_dimension = interaction_box.depth
New in version 1.0.
Type:  boolean 

Reports whether this is a valid InteractionBox object.
if interaction_box.is_valid:
#Use the box
New in version 1.0.
Normalizes the coordinates of a point using the interaction box.
Coordinates from the Leap Motion frame of reference (millimeters) are converted to a range of [0..1] such that the minimum value of the InteractionBox maps to 0 and the maximum value of the InteractionBox maps to 1. The coordinates for normalized points outside the InteractionBox boundaries can be negative or greater than one (unless the clamp parameter is True, which is the default).
leap_point = finger.tip_position
normalized_point = interaction_box.normalize_point(leap_point, True)
Parameters: 


Returns:  Vector – The normalized position. 
New in version 1.0.
Converts a position defined by normalized InteractionBox coordinates into device coordinates in millimeters.
leap_point = interaction_box.denormalize_point(normalized_point)
This function performs the inverse of InteractionBox.normalize_point(). Note that if the position originally normalized was outside the box and the clamp parameter was True, then the denormalized coordinates will not be the original position. Instead, the denormalized coordinates will be those of the nearset point on the boundary of the interaction box.
Parameters:  normalizedPosition (Vector) – The input position in normalixed, InteractionBox coordinates. 

Return type:  Vector – The corresponding denormalized position in device coordinates. 
New in version 1.0.
Type:  InteractionBox 

An invalid InteractionBox object.
New in version 1.0.
Compare InteractionBox object equality. Two InteractionBox objects are equal if and only if both InteractionBox objects represent the exact same InteractionBox and both InteractionBoxes are valid.
New in version 1.0.
Compare InteractionBox object inequality. Two InteractionBox objects are equal if and only if both InteractionBox objects represent the exact same InteractionBox and both InteractionBoxes are valid.
New in version 1.0.