|
Easy3D 2.6.1
|
A 3D Plane of equation a*x + b*y + c*z + d = 0. More...
#include <easy3d/core/plane.h>
Public Types | |
| typedef Vec< 2, FT > | Point2 |
| The type of the 2D point. | |
| typedef Vec< 3, FT > | Point3 |
| The type of the 3D point. | |
| typedef Vec< 3, FT > | Vector3 |
| The type of the 3D vector. | |
| typedef GenericLine< 3, FT > | Line3 |
| The type of the 3D line. | |
| typedef GenericPlane< FT > | thisclass |
| The type of this class. | |
Public Member Functions | |
| GenericPlane (const Point3 &p1, const Point3 &p2, const Point3 &p3) | |
Constructs a plane from three points p1, p2, and p3. | |
| GenericPlane (const Point3 &p, const Vector3 &n) | |
Constructs a plane from a point p and the plane normal n. | |
| GenericPlane (FT a, FT b, FT c, FT d) | |
Constructs a plane from its equation parameters a, b, c, and d. | |
| GenericPlane ()=default | |
| Default constructor. | |
| FT | a () const |
Returns plane equation parameter a. | |
| FT | b () const |
Returns plane equation parameter b. | |
| FT | c () const |
Returns plane equation parameter c. | |
| FT | d () const |
Returns plane equation parameter d. | |
| FT & | operator[] (size_t idx) |
Returns the idx_th parameter of the plane equation. | |
| const FT & | operator[] (size_t idx) const |
Returns the idx_th const parameter of the plane equation (const version). | |
| Vector3 | normal () const |
| Returns the normal of the plane. | |
| Point3 | point () const |
| Returns a point lying on this plane. | |
| Vector3 | base1 () const |
| Returns the first ortho-base defined on this plane. | |
| Vector3 | base2 () const |
| Returns the second ortho-base defined on this plane. | |
| Point2 | to_2d (const Point3 &p) const |
| Converts a 3D point into a 2D point relative to the local coordinate system defined by the three orthogonal vectors base1(), base2(), and normal(). | |
| Point3 | to_3d (const Point2 &p) const |
| Converts a 2D point in the local coordinate system defined by the three orthogonal vectors base1(), base2(), and normal() into the 3D space. | |
| Point3 | projection (const Point3 &p) const |
The projection of a point p on this plane. | |
| FT | value (const Point3 &p) const |
Evaluates the plane (i.e., computes the value of a * x + b * y + c * z + d) for the given point p. | |
| FT | squared_distance (const Point3 &p) const |
Computes the squared distance of a point p to this plane. | |
| bool | intersect (const Line3 &line, Point3 &p) const |
Tests if a line intersects with this plane (both line and the plane are unlimited). | |
| bool | intersect (const Line3 &line) const |
Tests if a line intersects with this plane (both line and the plane are unlimited). | |
| bool | intersect (const Point3 &s, const Point3 &t, Point3 &p) const |
Tests if a line segment (given by its two end points s and t) intersects with this plane. | |
| bool | intersect (const Point3 &s, const Point3 &t) const |
Tests if a line segment (given by its two end points s and t) intersects with this plane. | |
| bool | intersect (const thisclass &another, Line3 &line) const |
Tests if this plane intersects with another plane. | |
| bool | intersect (const thisclass &another) const |
Tests if this plane intersects with another plane. | |
| int | orient (const Point3 &p) const |
| Determines the relative orientation of a point with respect to this plane. | |
| const FT * | data () const |
| Returns the constant memory address of the coefficients. | |
| FT * | data () |
| Returns the memory address of the coefficients. | |
| operator const FT * () const | |
| Conversion operator returning the constant memory address of the coefficients. This is very convenient to pass a plane as a parameter to functions. | |
| operator FT * () | |
| Conversion operator returning the memory address of the coefficients. This is very convenient to pass a plane as a parameter to functions. | |
A 3D Plane of equation a*x + b*y + c*z + d = 0.
| FT | The scalar type for plane coefficients. |
| GenericPlane | ( | const Point3 & | p1, |
| const Point3 & | p2, | ||
| const Point3 & | p3 ) |
Constructs a plane from three points p1, p2, and p3.
| p1 | The first point. |
| p2 | The second point. |
| p3 | The third point. |
| GenericPlane | ( | const Point3 & | p, |
| const Vector3 & | n ) |
Constructs a plane from a point p and the plane normal n.
| p | The point on the plane. |
| n | The normal vector of the plane. |
|
inline |
Constructs a plane from its equation parameters a, b, c, and d.
| a | The coefficient for x. |
| b | The coefficient for y. |
| c | The coefficient for z. |
| d | The constant term. |
|
inline |
Returns plane equation parameter a.
a.
|
inline |
Returns plane equation parameter b.
b. | GenericPlane< FT >::Vector3 base1 | ( | ) | const |
Returns the first ortho-base defined on this plane.
| GenericPlane< FT >::Vector3 base2 | ( | ) | const |
Returns the second ortho-base defined on this plane.
|
inline |
Returns plane equation parameter c.
c.
|
inline |
Returns plane equation parameter d.
d.
|
inline |
Returns the memory address of the coefficients.
|
inline |
Returns the constant memory address of the coefficients.
| bool intersect | ( | const Line3 & | line | ) | const |
Tests if a line intersects with this plane (both line and the plane are unlimited).
| line | The line to test. |
true if they intersect, false otherwise (the line is parallel to this plane). Tests if a line intersects with this plane (both line and the plane are unlimited).
| line | The line to test. |
| p | The intersection point if they intersect. |
true if they intersect, false otherwise (the line is parallel to this plane). Tests if a line segment (given by its two end points s and t) intersects with this plane.
| s | The start point of the line segment. |
| t | The end point of the line segment. |
true if they intersect, false otherwise (the two end points of the line segment lie on the same side of the plane). Tests if a line segment (given by its two end points s and t) intersects with this plane.
| s | The start point of the line segment. |
| t | The end point of the line segment. |
| p | The intersection point if they intersect. |
true if they intersect, false otherwise (the two end points of the line segment lie on the same side of the plane). | bool intersect | ( | const thisclass & | another | ) | const |
Tests if this plane intersects with another plane.
| another | The other plane to test. |
true if they intersect, false otherwise (the two planes are parallel). Tests if this plane intersects with another plane.
| another | The other plane to test. |
| line | The intersecting line if they intersect. |
true if they intersect, false otherwise (the two planes are parallel). | GenericPlane< FT >::Vector3 normal | ( | ) | const |
Returns the normal of the plane.
|
inline |
Conversion operator returning the constant memory address of the coefficients. This is very convenient to pass a plane as a parameter to functions.
|
inline |
Conversion operator returning the memory address of the coefficients. This is very convenient to pass a plane as a parameter to functions.
|
inline |
Returns the idx_th parameter of the plane equation.
| idx | The index of the parameter. |
idx_th parameter.
|
inline |
Returns the idx_th const parameter of the plane equation (const version).
| idx | The index of the parameter. |
idx_th const parameter. | int orient | ( | const Point3 & | p | ) | const |
Determines the relative orientation of a point with respect to this plane.
| p | The point to test. |
| GenericPlane< FT >::Point3 point | ( | ) | const |
Returns a point lying on this plane.
| GenericPlane< FT >::Point3 projection | ( | const Point3 & | p | ) | const |
The projection of a point p on this plane.
| p | The point to project. |
| FT squared_distance | ( | const Point3 & | p | ) | const |
Computes the squared distance of a point p to this plane.
| p | The point to compute the distance to. |
| GenericPlane< FT >::Point2 to_2d | ( | const Point3 & | p | ) | const |
Converts a 3D point into a 2D point relative to the local coordinate system defined by the three orthogonal vectors base1(), base2(), and normal().
| p | The 3D point to convert. |
| GenericPlane< FT >::Point3 to_3d | ( | const Point2 & | p | ) | const |
Converts a 2D point in the local coordinate system defined by the three orthogonal vectors base1(), base2(), and normal() into the 3D space.
| p | The 2D point to convert. |
|
inline |
Evaluates the plane (i.e., computes the value of a * x + b * y + c * z + d) for the given point p.
| p | The point to evaluate. |