Open3D (C++ API)  0.17.0
IntersectionTest.h
Go to the documentation of this file.
1 // ----------------------------------------------------------------------------
2 // - Open3D: www.open3d.org -
3 // ----------------------------------------------------------------------------
4 // Copyright (c) 2018-2023 www.open3d.org
5 // SPDX-License-Identifier: MIT
6 // ----------------------------------------------------------------------------
7 
8 #pragma once
9 
10 #include <Eigen/Dense>
11 
12 #include "BoundingVolume.h"
13 #include "Line3D.h"
14 
15 namespace open3d {
16 namespace geometry {
17 
19 public:
20  static bool AABBAABB(const Eigen::Vector3d& min0,
21  const Eigen::Vector3d& max0,
22  const Eigen::Vector3d& min1,
23  const Eigen::Vector3d& max1);
24 
25  static bool TriangleTriangle3d(const Eigen::Vector3d& p0,
26  const Eigen::Vector3d& p1,
27  const Eigen::Vector3d& p2,
28  const Eigen::Vector3d& q0,
29  const Eigen::Vector3d& q1,
30  const Eigen::Vector3d& q2);
31 
32  static bool TriangleAABB(const Eigen::Vector3d& box_center,
33  const Eigen::Vector3d& box_half_size,
34  const Eigen::Vector3d& vert0,
35  const Eigen::Vector3d& vert1,
36  const Eigen::Vector3d& vert2);
37 
39  static bool PointsCoplanar(const Eigen::Vector3d& p0,
40  const Eigen::Vector3d& p1,
41  const Eigen::Vector3d& p2,
42  const Eigen::Vector3d& p3);
43 
50  static double LinesMinimumDistance(const Eigen::Vector3d& p0,
51  const Eigen::Vector3d& p1,
52  const Eigen::Vector3d& q0,
53  const Eigen::Vector3d& q1);
54 
60  static double LineSegmentsMinimumDistance(const Eigen::Vector3d& p0,
61  const Eigen::Vector3d& p1,
62  const Eigen::Vector3d& q0,
63  const Eigen::Vector3d& q1);
64 
119  const Line3D& line, const AxisAlignedBoundingBox& box) {
120  return line.ExactAABB(box);
121  }
122 
175  const Line3D& line, const AxisAlignedBoundingBox& box) {
176  return line.SlabAABB(box);
177  }
178 };
179 
180 } // namespace geometry
181 } // namespace open3d
A bounding box that is aligned along the coordinate axes.
Definition: BoundingVolume.h:159
Definition: IntersectionTest.h:18
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.
Definition: IntersectionTest.cpp:71
static bool AABBAABB(const Eigen::Vector3d &min0, const Eigen::Vector3d &max0, const Eigen::Vector3d &min1, const Eigen::Vector3d &max1)
Definition: IntersectionTest.cpp:18
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)
Definition: IntersectionTest.cpp:58
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)
Definition: IntersectionTest.cpp:34
static double LinesMinimumDistance(const Eigen::Vector3d &p0, const Eigen::Vector3d &p1, const Eigen::Vector3d &q0, const Eigen::Vector3d &q1)
Definition: IntersectionTest.cpp:78
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 ...
Definition: IntersectionTest.h:174
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 ...
Definition: IntersectionTest.h:118
static double LineSegmentsMinimumDistance(const Eigen::Vector3d &p0, const Eigen::Vector3d &p1, const Eigen::Vector3d &q0, const Eigen::Vector3d &q1)
Definition: IntersectionTest.cpp:119
Line3D is a class which derives from Eigen::ParametrizedLine<double, 3> in order to capture the seman...
Definition: Line3D.h:49
virtual utility::optional< double > SlabAABB(const AxisAlignedBoundingBox &box) const
Returns the lower intersection parameter for a line with an axis aligned bounding box or empty if no ...
Definition: Line3D.cpp:136
virtual utility::optional< double > ExactAABB(const AxisAlignedBoundingBox &box) const
Returns the lower intersection parameter for a line with an axis aligned bounding box or empty if no ...
Definition: Line3D.cpp:72
Definition: Optional.h:259
Definition: PinholeCameraIntrinsic.cpp:16