geometric representation of a rectangle (can represent any quadrilateral)
More...
#include <shapes.h>
|
|
| Rectangle () |
| | constructor for initialization with points set to [0,0,0], [1,0,0], [1,1,0] and [0,1,0]
|
| |
|
| ~Rectangle () |
| | destructor
|
| |
| | Rectangle (std::vector< Eigen::Vector3d > points) |
| | constructor using a std::vector of points (vector3). Provide points in a counter-clockwise order for correct behavior
|
| |
| | Rectangle (Eigen::Vector3d a, Eigen::Vector3d b, Eigen::Vector3d c, Eigen::Vector3d d) |
| | constructor using four points (vector3). Provide points in a counter-clockwise order for correct behavior
|
| |
| const Eigen::Vector3d | a () const |
| | getter for first point
|
| |
| const Eigen::Vector3d | b () const |
| | getter for the second point
|
| |
| const Eigen::Vector3d | c () const |
| | getter for the third point
|
| |
| const Eigen::Vector3d | d () const |
| | getter for the fourth point
|
| |
| const Eigen::Vector3d | center () const |
| | getter for center point
|
| |
| const Eigen::Vector3d | normal () const |
| | getter for the normal vector. It originates in the center of the Rectangle, length is normalized, orientation follows the right-hand rule, assuiming the points are provided in counter-clockwise order
|
| |
| const std::vector< Eigen::Vector3d > | vertices () const |
| | getter for all the points of this rectangle provided as std::vector
|
| |
| const std::vector< Triangle > | triangles () const |
| | getter for the triangles forming this rectangle
|
| |
| const std::optional< Eigen::Vector3d > | intersectionRay (Ray r, double epsilon=1e-4) const |
| | calculate an intersection of this rectangle with a given ray with given tolerance
|
| |
| bool | isFacing (Eigen::Vector3d point) const |
| | check if the normal is facing a given point, i.e. if the point lies in the same half-space as the rectangle normal
|
| |
| double | solidAngleRelativeTo (Eigen::Vector3d point) const |
| | compute the solid angle of this rectangle relative to a given sphere center
|
| |
geometric representation of a rectangle (can represent any quadrilateral)
◆ Rectangle() [1/2]
| mrs_lib::geometry::Rectangle::Rectangle |
( |
std::vector< Eigen::Vector3d > |
points | ) |
|
constructor using a std::vector of points (vector3). Provide points in a counter-clockwise order for correct behavior
- Parameters
-
| points | std::vector of points in 3d |
◆ Rectangle() [2/2]
| mrs_lib::geometry::Rectangle::Rectangle |
( |
Eigen::Vector3d |
a, |
|
|
Eigen::Vector3d |
b, |
|
|
Eigen::Vector3d |
c, |
|
|
Eigen::Vector3d |
d |
|
) |
| |
constructor using four points (vector3). Provide points in a counter-clockwise order for correct behavior
- Parameters
-
◆ a()
| const Eigen::Vector3d mrs_lib::geometry::Rectangle::a |
( |
| ) |
const |
getter for first point
- Returns
- 1st point (vector3)
◆ b()
| const Eigen::Vector3d mrs_lib::geometry::Rectangle::b |
( |
| ) |
const |
getter for the second point
- Returns
- 2nd point (vector3)
◆ c()
| const Eigen::Vector3d mrs_lib::geometry::Rectangle::c |
( |
| ) |
const |
getter for the third point
- Returns
- 3rd point (vector3)
◆ center()
| const Eigen::Vector3d mrs_lib::geometry::Rectangle::center |
( |
| ) |
const |
getter for center point
- Returns
- center point (vector3)
◆ d()
| const Eigen::Vector3d mrs_lib::geometry::Rectangle::d |
( |
| ) |
const |
getter for the fourth point
- Returns
- 4th point (vector3)
◆ intersectionRay()
| const std::optional< Eigen::Vector3d > mrs_lib::geometry::Rectangle::intersectionRay |
( |
Ray |
r, |
|
|
double |
epsilon = 1e-4 |
|
) |
| const |
calculate an intersection of this rectangle with a given ray with given tolerance
- Parameters
-
| r | ray to calculate intersection with |
| epsilon | calculation tolerance |
- Returns
- vector3 intersection if exists, std::none if no intersection is found
◆ isFacing()
| bool mrs_lib::geometry::Rectangle::isFacing |
( |
Eigen::Vector3d |
point | ) |
const |
check if the normal is facing a given point, i.e. if the point lies in the same half-space as the rectangle normal
- Parameters
-
| point | vector3 to check against |
- Returns
- true if the normal is facing given point. Returns false for angle >= 90 degrees
◆ normal()
| const Eigen::Vector3d mrs_lib::geometry::Rectangle::normal |
( |
| ) |
const |
getter for the normal vector. It originates in the center of the Rectangle, length is normalized, orientation follows the right-hand rule, assuiming the points are provided in counter-clockwise order
- Returns
- normal vector3
◆ solidAngleRelativeTo()
| double mrs_lib::geometry::Rectangle::solidAngleRelativeTo |
( |
Eigen::Vector3d |
point | ) |
const |
compute the solid angle of this rectangle relative to a given sphere center
- Parameters
-
| point | center of a sphere to compute the solid angle for |
- Returns
- solid angle in steradians
◆ triangles()
| const std::vector< Triangle > mrs_lib::geometry::Rectangle::triangles |
( |
| ) |
const |
getter for the triangles forming this rectangle
- Returns
- std::vector of triangles
◆ vertices()
| const std::vector< Eigen::Vector3d > mrs_lib::geometry::Rectangle::vertices |
( |
| ) |
const |
getter for all the points of this rectangle provided as std::vector
- Returns
- std::vector of points (vector3)
The documentation for this class was generated from the following files:
- include/mrs_lib/geometry/shapes.h
- src/geometry/shapes.cpp