mrs_lib
Various reusable classes, functions and utilities for use in MRS projects
Loading...
Searching...
No Matches
mrs_lib::geometry::Cuboid Class Reference

geometric representation of a cuboid More...

#include <shapes.h>

Public Member Functions

 Cuboid ()
 constructor for initialization with all points set to [0,0,0]
 ~Cuboid ()
 virtual destructor
 Cuboid (Eigen::Vector3d p0, Eigen::Vector3d p1, Eigen::Vector3d p2, Eigen::Vector3d p3, Eigen::Vector3d p4, Eigen::Vector3d p5, Eigen::Vector3d p6, Eigen::Vector3d p7)
 constructor from six provided points (vector3)
 Cuboid (std::vector< Eigen::Vector3d > points)
 constructor from a std::vector of provided points
 Cuboid (Eigen::Vector3d center, Eigen::Vector3d size, Eigen::Quaterniond orientation)
 constructor from a provided center point, size and orientation
const std::vector< Eigen::Vector3d > vertices () const
 getter for all vertices (vector3) of this cuboid
const Eigen::Vector3d center () const
 getter for the center point
const Rectangle getRectangle (int face_idx) const
 getter for one side corresponding to a provided index
const std::vector< Eigen::Vector3d > intersectionRay (Ray r, double epsilon=1e-4) const
 calculate the intersection between this cuboid and a provided ray within a given tolerance. Can result in 0, 1 or 2 intersection points

Detailed Description

geometric representation of a cuboid

Constructor & Destructor Documentation

◆ Cuboid() [1/3]

mrs_lib::geometry::Cuboid::Cuboid ( Eigen::Vector3d p0,
Eigen::Vector3d p1,
Eigen::Vector3d p2,
Eigen::Vector3d p3,
Eigen::Vector3d p4,
Eigen::Vector3d p5,
Eigen::Vector3d p6,
Eigen::Vector3d p7 )

constructor from six provided points (vector3)

Parameters
p0vector3
p1vector3
p2vector3
p3vector3
p4vector3
p5vector3
p6vector3
p7vector3

◆ Cuboid() [2/3]

mrs_lib::geometry::Cuboid::Cuboid ( std::vector< Eigen::Vector3d > points)

constructor from a std::vector of provided points

Parameters
pointsstd::vector<vector3>

◆ Cuboid() [3/3]

mrs_lib::geometry::Cuboid::Cuboid ( Eigen::Vector3d center,
Eigen::Vector3d size,
Eigen::Quaterniond orientation )

constructor from a provided center point, size and orientation

Parameters
centervector3
sizevector3
orientationquaternion

Member Function Documentation

◆ center()

const Eigen::Vector3d mrs_lib::geometry::Cuboid::center ( ) const

getter for the center point

Returns
vector3

◆ getRectangle()

const Rectangle mrs_lib::geometry::Cuboid::getRectangle ( int face_idx) const

getter for one side corresponding to a provided index

Parameters
face_idxindex of the side to lookup points for
Returns
rectangle representing the cuboid side

◆ intersectionRay()

const std::vector< Eigen::Vector3d > mrs_lib::geometry::Cuboid::intersectionRay ( Ray r,
double epsilon = 1e-4 ) const

calculate the intersection between this cuboid and a provided ray within a given tolerance. Can result in 0, 1 or 2 intersection points

Parameters
rray to check intersection with
epsilontolerance for the calculation
Returns
std::vector<vector3> list of intersection points (depending on the geometry, can yield 0, 1 or 2 points)

◆ vertices()

const std::vector< Eigen::Vector3d > mrs_lib::geometry::Cuboid::vertices ( ) const

getter for all vertices (vector3) of this cuboid

Returns
std::vector<vector3>

The documentation for this class was generated from the following files:
  • /home/runner/work/mrs_lib/mrs_lib/include/mrs_lib/geometry/shapes.h
  • /home/runner/work/mrs_lib/mrs_lib/src/geometry/shapes.cpp