|
ACF $AcfVersion:0$
|
Geometric utility functions for 3D space. More...
Functions | |
| double | GetAngleBetweenVectors (const CVector3d &v1, const CVector3d &v2) |
| Calculate angle between two vectors in radians. | |
| double | GetSignedAngleBetweenVectors (const CVector3d &v1, const CVector3d &v2, const CVector3d &axis) |
| Calculate signed angle between two vectors around an axis. | |
| double | GetDistance (const CVector3d &p1, const CVector3d &p2) |
| Calculate distance between two points. | |
| double | GetDistanceSq (const CVector3d &p1, const CVector3d &p2) |
| Calculate squared distance between two points (faster). | |
| double | GetDistance (const CVector3d &point, const CPlane3d &plane) |
| Calculate distance from point to plane. | |
| double | GetDistance (const CVector3d &point, const CLine3d &line) |
| Calculate distance from point to line. | |
| bool | AreIntersecting (const CLine3d &line1, const CLine3d &line2, double tolerance=I_BIG_EPSILON) |
| Check if two lines intersect in 3D. | |
| bool | GetIntersection (const CLine3d &line, const CPlane3d &plane, CVector3d &result, double tolerance=I_BIG_EPSILON) |
| Find intersection point between line and plane. | |
| double | GetClosestPoints (const CLine3d &line1, const CLine3d &line2, CVector3d &point1, CVector3d &point2) |
| Find closest points between two lines. | |
| bool | IsOnPositiveSide (const CVector3d &point, const CPlane3d &plane) |
| Check if point is on the same side of plane as the plane's normal. | |
| CVector3d | ProjectVectorOntoVector (const CVector3d &vector, const CVector3d &onto) |
| Project vector onto another vector. | |
| bool | GetBarycentricCoordinates (const CVector3d &point, const CVector3d &p1, const CVector3d &p2, const CVector3d &p3, double &u, double &v, double &w) |
| Calculate barycentric coordinates of point relative to triangle. | |
| bool | IsPointInTriangle (const CVector3d &point, const CVector3d &p1, const CVector3d &p2, const CVector3d &p3) |
| Check if point is inside triangle. | |
| CVector3d | GetTriangleNormal (const CVector3d &p1, const CVector3d &p2, const CVector3d &p3) |
| Calculate normal vector of triangle. | |
| double | GetTriangleArea (const CVector3d &p1, const CVector3d &p2, const CVector3d &p3) |
| Calculate area of triangle. | |
Geometric utility functions for 3D space.
| bool i3d::Geometry::AreIntersecting | ( | const CLine3d & | line1, |
| const CLine3d & | line2, | ||
| double | tolerance = I_BIG_EPSILON |
||
| ) |
Check if two lines intersect in 3D.
| line1 | First line. |
| line2 | Second line. |
| tolerance | Tolerance for intersection test. |
Calculate angle between two vectors in radians.
| v1 | First vector. |
| v2 | Second vector. |
Definition at line 28 of file Geometry.h.
References imath::TVector< Size, Element >::GetDotProduct(), and i3d::CVector3d::GetNormalized().
Referenced by GetSignedAngleBetweenVectors().
| bool i3d::Geometry::GetBarycentricCoordinates | ( | const CVector3d & | point, |
| const CVector3d & | p1, | ||
| const CVector3d & | p2, | ||
| const CVector3d & | p3, | ||
| double & | u, | ||
| double & | v, | ||
| double & | w | ||
| ) |
Calculate barycentric coordinates of point relative to triangle.
| point | Point to calculate barycentric coordinates for. |
| p1 | First triangle vertex. |
| p2 | Second triangle vertex. |
| p3 | Third triangle vertex. |
| u | Output barycentric coordinate u. |
| v | Output barycentric coordinate v. |
| w | Output barycentric coordinate w (w = 1 - u - v). |
| double i3d::Geometry::GetClosestPoints | ( | const CLine3d & | line1, |
| const CLine3d & | line2, | ||
| CVector3d & | point1, | ||
| CVector3d & | point2 | ||
| ) |
Find closest points between two lines.
| line1 | First line. |
| line2 | Second line. |
| point1 | Output closest point on line1. |
| point2 | Output closest point on line2. |
Calculate distance between two points.
Definition at line 64 of file Geometry.h.
References imath::TVector< Size, Element >::GetLength().
Calculate distance from point to line.
Definition at line 91 of file Geometry.h.
References i3d::CLine3d::GetDistance().
Calculate distance from point to plane.
Definition at line 82 of file Geometry.h.
References i3d::CPlane3d::GetDistance().
Calculate squared distance between two points (faster).
Definition at line 73 of file Geometry.h.
| bool i3d::Geometry::GetIntersection | ( | const CLine3d & | line, |
| const CPlane3d & | plane, | ||
| CVector3d & | result, | ||
| double | tolerance = I_BIG_EPSILON |
||
| ) |
Find intersection point between line and plane.
| line | Line to intersect. |
| plane | Plane to intersect. |
| result | Output intersection point. |
| tolerance | Tolerance for parallel check. |
|
inline |
Calculate signed angle between two vectors around an axis.
| v1 | First vector. |
| v2 | Second vector. |
| axis | Axis to measure rotation around. |
Definition at line 44 of file Geometry.h.
References GetAngleBetweenVectors(), i3d::CVector3d::GetCrossProduct(), imath::TVector< Size, Element >::GetDotProduct(), and i3d::CVector3d::GetNormalized().
|
inline |
Calculate area of triangle.
Definition at line 206 of file Geometry.h.
References i3d::CVector3d::GetCrossProduct(), and imath::TVector< Size, Element >::GetLength().
|
inline |
Calculate normal vector of triangle.
Definition at line 195 of file Geometry.h.
References i3d::CVector3d::GetCrossProduct(), and i3d::CVector3d::GetNormalized().
Check if point is on the same side of plane as the plane's normal.
Definition at line 132 of file Geometry.h.
References i3d::CPlane3d::GetSignedDistance().
| bool i3d::Geometry::IsPointInTriangle | ( | const CVector3d & | point, |
| const CVector3d & | p1, | ||
| const CVector3d & | p2, | ||
| const CVector3d & | p3 | ||
| ) |
Check if point is inside triangle.
| point | Point to test. |
| p1 | First triangle vertex. |
| p2 | Second triangle vertex. |
| p3 | Third triangle vertex. |
|
inline |
Project vector onto another vector.
| vector | Vector to project. |
| onto | Vector to project onto. |
Definition at line 144 of file Geometry.h.
References imath::TVector< Size, Element >::GetDotProduct(), imath::TVector< Size, Element >::GetLength2(), and I_BIG_EPSILON.