Plane Class Reference

Class representing a plane defined by a point and a normal, or a plane equation. More...

Functions

PLANE_TYPE type (self)
 Type of the plane defined by its orientation. More...
 
np.array[float] get_normal (self)
 Gets the plane normal vector. More...
 
np.array[float] get_center (self)
 Gets the plane center point. More...
 
Transform get_pose (self, py_pose=Transform())
 Gets the plane pose relative to the global reference frame. More...
 
np.array[float] get_extents (self)
 Gets the width and height of the bounding rectangle around the plane contours. More...
 
np.array[float] get_plane_equation (self)
 Gets the plane equation. More...
 
np.array[float][float] get_bounds (self)
 Gets the polygon bounds of the plane. More...
 
Mesh extract_mesh (self)
 Compute and return the mesh of the bounds polygon. More...
 
float get_closest_distance (self, point=[0, 0, 0])
 Gets the distance between the input point and the projected point alongside the normal vector onto the plane (the closest point on the plane). More...
 
None clear (self)
 Clears all the data.
 

Detailed Description

Class representing a plane defined by a point and a normal, or a plane equation.

Other elements can be extracted such as the mesh, the 3D bounds, etc.

Note
The plane measurements are expressed in reference defined by sl.RuntimeParameters.measure3D_reference_frame.

Functions

◆ type()

PLANE_TYPE type (   self)

Type of the plane defined by its orientation.

Note
It is deduced from the gravity vector and is therefore not available with on sl.MODEL.ZED.
sl.MODEL.ZED will give sl.PLANE_TYPE.UNKNOWN for every planes.

◆ get_normal()

np.array[float] get_normal (   self)

Gets the plane normal vector.

Returns
sl.Plane normalized normal vector (NumPy array).

◆ get_center()

np.array[float] get_center (   self)

Gets the plane center point.

Returns
sl.Plane center point

◆ get_pose()

Transform get_pose (   self,
  py_pose = Transform() 
)

Gets the plane pose relative to the global reference frame.

Parameters
py_pose: sl.Transform to fill (or it creates one by default).
Returns
Transformation matrix (rotation and translation) of the plane pose.
Note
Can be used to transform the global reference frame center (0, 0, 0) to the plane center.

◆ get_extents()

np.array[float] get_extents (   self)

Gets the width and height of the bounding rectangle around the plane contours.

Returns
Width and height of the bounding plane contours (NumPy array).
Warning
This value is expressed in the plane reference frame.

◆ get_plane_equation()

np.array[float] get_plane_equation (   self)

Gets the plane equation.

Returns
Plane equation coefficients [a, b, c, d] (NumPy array).
Note
The plane equation has the following form: ax + by + cz = d.

◆ get_bounds()

np.array[float][float] get_bounds (   self)

Gets the polygon bounds of the plane.

Returns
Vector of 3D points forming a polygon bounds corresponding to the current visible limits of the plane (NumPy array).

◆ extract_mesh()

Mesh extract_mesh (   self)

Compute and return the mesh of the bounds polygon.

Returns
sl::Mesh representing the plane delimited by the visible bounds.

◆ get_closest_distance()

float get_closest_distance (   self,
  point = [0,0,0] 
)

Gets the distance between the input point and the projected point alongside the normal vector onto the plane (the closest point on the plane).

Parameters
point: Point to project into the plane.
Returns
The Euclidean distance between the input point and the projected point.