Plane Class Reference

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

Functions

 Plane ()
 Default constructor. More...
 
 ~Plane ()
 Default destructor. More...
 
void clear ()
 Clears all the data. More...
 
sl::float3 getNormal ()
 Gets the plane normal vector. More...
 
sl::float3 getCenter ()
 Gets the plane center point. More...
 
Transform getPose ()
 Gets the plane pose relative to the global reference frame. More...
 
sl::float2 getExtents ()
 Gets the width and height of the bounding rectangle around the plane contours. More...
 
sl::float4 getPlaneEquation ()
 Gets the plane equation. More...
 
std::vector< sl::float3 > getBounds ()
 Gets the polygon bounds of the plane. More...
 
sl::Mesh extractMesh ()
 Compute and return the mesh of the bounds polygon. More...
 
float getClosestDistance (sl::float3 point=sl::float3(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...
 

Attributes

PLANE_TYPE type = PLANE_TYPE::UNKNOWN
 Type of the plane defined by its orientation. More...
 

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.

Constructor and Destructor

◆ Plane()

Plane ( )

Default constructor.

◆ ~Plane()

~Plane ( )

Default destructor.

Functions

◆ clear()

void clear ( )

Clears all the data.

◆ getNormal()

sl::float3 getNormal ( )

Gets the plane normal vector.

Returns
sl::Plane normalized normal vector.

◆ getCenter()

sl::float3 getCenter ( )

Gets the plane center point.

Returns
sl::Plane center point.

◆ getPose()

Transform getPose ( )

Gets the plane pose relative to the global reference frame.

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.

◆ getExtents()

sl::float2 getExtents ( )

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

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

◆ getPlaneEquation()

sl::float4 getPlaneEquation ( )

Gets the plane equation.

Returns
Plane equation coefficients {a, b, c, d}.
Note
The plane equation has the following form: ax + by + cz = d.

◆ getBounds()

std::vector<sl::float3> getBounds ( )

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.

◆ extractMesh()

sl::Mesh extractMesh ( )

Compute and return the mesh of the bounds polygon.

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

◆ getClosestDistance()

float getClosestDistance ( sl::float3  point = sl::float3(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.

Variables

◆ type

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.