Open3D (C++ API)
0.11.0
|
#include <IntersectionTest.h>
Static Public Member Functions | |
static bool | AABBAABB (const Eigen::Vector3d &min0, const Eigen::Vector3d &max0, const Eigen::Vector3d &min1, const Eigen::Vector3d &max1) |
static bool | TriangleTriangle3d (const Eigen::Vector3d &p0, const Eigen::Vector3d &p1, const Eigen::Vector3d &p2, const Eigen::Vector3d &q0, const Eigen::Vector3d &q1, const Eigen::Vector3d &q2) |
static bool | TriangleAABB (const Eigen::Vector3d &box_center, const Eigen::Vector3d &box_half_size, const Eigen::Vector3d &vert0, const Eigen::Vector3d &vert1, const Eigen::Vector3d &vert2) |
static bool | PointsCoplanar (const Eigen::Vector3d &p0, const Eigen::Vector3d &p1, const Eigen::Vector3d &p2, const Eigen::Vector3d &p3) |
Tests if the given four points all lie on the same plane. More... | |
static double | LinesMinimumDistance (const Eigen::Vector3d &p0, const Eigen::Vector3d &p1, const Eigen::Vector3d &q0, const Eigen::Vector3d &q1) |
static double | LineSegmentsMinimumDistance (const Eigen::Vector3d &p0, const Eigen::Vector3d &p1, const Eigen::Vector3d &q0, const Eigen::Vector3d &q1) |
static utility::optional< double > | LineExactAABB (const Line3D &line, const AxisAlignedBoundingBox &box) |
Returns the lower intersection parameter for a line with an axis aligned bounding box or empty if no intersection. This method is about 20x slower than the slab method, see details to know when to use. This function wraps the underlying implementation on the Line3D class and is included here for API coherence; if you are testing large numbers of lines, rays, or segments use the Line3D, Ray3D, or Segment3D classes directly. More... | |
static utility::optional< double > | LineSlabAABB (const Line3D &line, const AxisAlignedBoundingBox &box) |
Returns the lower intersection parameter for a line with an axis aligned bounding box or no value if there is no intersection. This function wraps the underlying implementation on the Line3D class and is included here for API coherence; if you are testing large numbers of lines, rays, or segments use the Line3D, Ray3D, or Segment3D classes directly. More... | |
|
static |
|
inlinestatic |
Returns the lower intersection parameter for a line with an axis aligned bounding box or empty if no intersection. This method is about 20x slower than the slab method, see details to know when to use. This function wraps the underlying implementation on the Line3D class and is included here for API coherence; if you are testing large numbers of lines, rays, or segments use the Line3D, Ray3D, or Segment3D classes directly.
Calculates the lower intersection parameter of a parameterized line with an axis aligned bounding box. The intersection point can be recovered with .Line().pointAt(...). If the line does not intersect the box the return value will be empty. Also note that if the AABB is behind the line's origin point, the value returned will still be of the lower intersection, which is the first intersection in the direction of the line, not the intersection closer to the origin.
This implementation is a naive exact method that considers intersections with all six bounding box planes. It is not optimized for speed and should only be used when a problem is conditioned such that the slab method is unacceptable. Use this when a line is likely to lie exactly in one of the AABB planes and false negatives are unacceptable. Typically this will only happen when lines are axis-aligned and both lines and bounding volumes are regularly spaced, and every intersection is important. In such cases if performance is important, a simple custom implementation based on the problem directionality will likely outperform even the slab method.
|
static |
Computes the minimum distance between two line segments. The first line segment is defined by 3D points p0
and p1
, the second line segment is defined by 3D points q0
and q1
. This implementation is based on the description of David Eberly (https://www.geometrictools.com/Documentation/DistanceLine3Line3.pdf).
|
inlinestatic |
Returns the lower intersection parameter for a line with an axis aligned bounding box or no value if there is no intersection. This function wraps the underlying implementation on the Line3D class and is included here for API coherence; if you are testing large numbers of lines, rays, or segments use the Line3D, Ray3D, or Segment3D classes directly.
Calculates the lower intersection parameter of a parameterized line with an axis aligned bounding box. The intersection point can be recovered with .Line().pointAt(...). If the line does not intersect the box the return value will be empty. Also note that if the AABB is behind the line's origin point, the value returned will still be of the lower intersection, which is the first intersection in the direction of the line, not the intersection closer to the origin.
This implementation is based off of Tavian Barnes' optimized branchless slab method. https://tavianator.com/2011/ray_box.html. It runs in roughly 5% of the time as the the naive exact method, but can degenerate in specific conditions where a line lies exactly in one of the AABB's planes.
|
static |
Computes the minimum distance between two lines. The first line is defined by 3D points p0
and p1
, the second line is defined by 3D points q0
and q1
. The returned distance is negative if no minimum distance can be computed. This implementation is based on the description of Paul Bourke (http://paulbourke.net/geometry/pointlineplane/).
|
static |
Tests if the given four points all lie on the same plane.
|
static |
|
static |