3D Geometry Structure and Algorithm#
3D Geometry Structure#
-
class IGeo3d#
Common abstract base class for all 3D geometry types.
Subclassed by visionflow::geo3d::Line3f, visionflow::geo3d::Plane3f, visionflow::geo3d::Point3f, visionflow::geo3d::Vector3f
Public Types
-
struct Point3f : public visionflow::geo3d::IGeo3d#
Floating point 3D coordinate points.
-
struct Vector3f : public visionflow::geo3d::IGeo3d#
A floating-point 3d vector with size and direction from the origin point (0, 0, 0).
Public Functions
-
Vector3f() = default#
< Default constructor,no initialization.
Constructor with three values.
-
Vector3f(float x, float y, float z)#
Constructor with a Point.
-
virtual IGeo3d::Geo3dType type() const override#
Enumerate value of geometry types.
- Returns:
Geo3dType
-
float length() const#
Norm of a vector.
- Returns:
float Norm length.
-
Vector3f() = default#
-
struct Plane3f : public visionflow::geo3d::IGeo3d#
3D float point plane.
Public Functions
-
Plane3f() = default#
< Default constructor,no initialization.
-
Plane3f(float a, float b, float c, float d)#
Constructor with ax+by+cz+d=0.
-
Plane3f(const Point3f &lhs, const Vector3f &rhs)#
Constructor with a Point on the Plane and the normal Vector (a vector perpendicular to the plane) of the Plane.
-
Plane3f(float x_intercept, float y_intercept, float z_intercept)#
Constructor with x/x_intercept+y/y_intercept+z/z_intercept=1.
-
virtual IGeo3d::Geo3dType type() const override#
Enumerate value of geometry types.
- Returns:
Geo3dType
-
visionflow::geometry::Radian angle_x_normal_project() const#
the angle between x positive axis and vector projected by normal vector on xy plane, the range is (-𝝅, 𝝅].
-
visionflow::geometry::Radian angle_z_normal() const#
angle between normal and z axis, the range is [0, 𝝅].
-
float distance_along_x_axis(const Point3f &point) const#
The distance from the point to the plane along x axis.
- Parameters:
point – the point to calculate distance.
- Returns:
Distance from the point to the plane along x axis, note that the distance is infinity if plane is parallel to the x axis.
-
Plane3f() = default#
-
struct Line3f : public visionflow::geo3d::IGeo3d#
3D float point straight line.
3D Geometry algorithms#
- group distance_geo3d
Calculate the distance between two 3D geometry shapes.
shapes.
- param lhs:
[in] geometry shape
- param rhs:
[in] geometry shape
- param result:
[out] The distance between geo1 and geo2
Functions
-
float distance(const visionflow::geo3d::Point3f &lhs, const visionflow::geo3d::Point3f &rhs)#
-
float distance(const visionflow::geo3d::Line3f &lhs, const visionflow::geo3d::Line3f &rhs)#
-
float distance(const visionflow::geo3d::Plane3f &lhs, const visionflow::geo3d::Plane3f &rhs)#
-
float distance(const visionflow::geo3d::Point3f &lhs, const visionflow::geo3d::Line3f &rhs)#
-
float distance(const visionflow::geo3d::Point3f &lhs, const visionflow::geo3d::Plane3f &rhs)#
-
float distance(const visionflow::geo3d::Line3f &lhs, const visionflow::geo3d::Plane3f &rhs)#
-
float distance(const visionflow::geo3d::Line3f &lhs, const visionflow::geo3d::Point3f &rhs)#
-
float distance(const visionflow::geo3d::Plane3f &lhs, const visionflow::geo3d::Point3f &rhs)#
-
float distance(const visionflow::geo3d::Plane3f &lhs, const visionflow::geo3d::Line3f &rhs)#
- group intersection_geo3d
Calculate the intersection between the input 3D geometry shapes.
the input 3D geometry shapes.
- throws excepts::InvalidArgument:
If the input 3D geometry shapes do not intersect.
- param lhs:
[in] geometry shape
- param rhs:
[in] geometry shape
- param result:
[out] The intersection of geo1 and geo2
Functions
-
visionflow::geo3d::Point3f intersection(const visionflow::geo3d::Line3f &lhs, const visionflow::geo3d::Line3f &rhs)#
-
visionflow::geo3d::Line3f intersection(const visionflow::geo3d::Plane3f &lhs, const visionflow::geo3d::Plane3f &rhs)#
- group intersection_point
Calculate the intersection point between the input 3D geometry shapes.
the input 3D geometry shapes.
- throws excepts::InvalidArgument:
If the input 3D geometry shapes do not have an intersection point.
- param lhs:
[in] geometry shape
- param rhs:
[in] geometry shape
- param result:
[out] The intersection point of geo1 and geo2
Functions
-
visionflow::geo3d::Point3f intersection_point(const visionflow::geo3d::Line3f &lhs, const visionflow::geo3d::Plane3f &rhs)#
-
visionflow::geo3d::Point3f intersection_point(const visionflow::geo3d::Plane3f &lhs, const visionflow::geo3d::Line3f &rhs)#
-
visionflow::geo3d::Point3f intersection_point(const visionflow::geo3d::Plane3f &lhs, const visionflow::geo3d::Plane3f &mhs, const visionflow::geo3d::Plane3f &rhs)#
- group intersects_one_point_geo3d
Verify if two 3D geometry shape have only one intersection point.
shapes have only one intersection point.
- param lhs:
[in] geometry shape
- param rhs:
[in] geometry shape
Functions
-
bool intersects_one_point(const visionflow::geo3d::Line3f &lhs, const visionflow::geo3d::Plane3f &rhs)#
-
bool intersects_one_point(const visionflow::geo3d::Plane3f &lhs, const visionflow::geo3d::Line3f &rhs)#
-
bool intersects_one_point(const visionflow::geo3d::Plane3f &lhs, const visionflow::geo3d::Plane3f &mhs, const visionflow::geo3d::Plane3f &rhs)#
- group intersects_geo3d
Verify if two 3D geometry shape intersect.
shapes intersect (at least one intersection point).
- param lhs:
[in] geometry shape
- param rhs:
[in] geometry shape
Functions
-
bool intersects(const visionflow::geo3d::Line3f &lhs, const visionflow::geo3d::Line3f &rhs)#
-
bool intersects(const visionflow::geo3d::Plane3f &lhs, const visionflow::geo3d::Plane3f &rhs)#
- group min_angle_geo3d
Calculate the minimum angle between two 3D geometry shapes.
geometry shapes.
- param lhs:
geometry shape
- param rhs:
geometry shape
- return:
The acute minimum angle radian of two 3D geometry shapes, the range is [0, 𝝅/2]
Functions
-
visionflow::geometry::Radian min_angle(const visionflow::geo3d::Line3f &lhs, const visionflow::geo3d::Line3f &rhs)#
-
visionflow::geometry::Radian min_angle(const visionflow::geo3d::Line3f &lhs, const visionflow::geo3d::Plane3f &rhs)#
-
visionflow::geometry::Radian min_angle(const visionflow::geo3d::Plane3f &lhs, const visionflow::geo3d::Line3f &rhs)#
-
visionflow::geometry::Radian min_angle(const visionflow::geo3d::Plane3f &lhs, const visionflow::geo3d::Plane3f &rhs)#