Skip to content

Class Argos::AABBTree

ClassList > Argos > AABBTree

Axis-Aligned Bounding Box tree for accelerating spatial queries on a triangle mesh. More...

  • #include <AABBTree.h>

Classes

Type Name
struct Triangle
A single triangle with its vertex positions, original vertex indices, and the source face it came from.

Public Types

Type Name
typedef Vector3D< double > Vec3
Convenience alias for 3D positions used by the tree.

Public Functions

Type Name
AABBTree (const Mesh & mesh)
Build an AABB tree from a mesh.
bool empty () const
Whether the tree contains no triangles.
int getNbIntersections (const Vec3 & v1, const Vec3 & v2)
Count how many triangles intersect the segment [v1, v2].
const std::vector< Triangle > & getTriangles () const
Const access to the flattened triangle list.
double nearestDistance (const Vec3 & point) const
Euclidean distance from a point to the nearest triangle.
double nearestDistanceSquared (const Vec3 & point) const
Squared distance from a point to the nearest triangle.
std::vector< Triangle > nearestTriangles (const Vec3 & point) const
Find all triangles within the current best distance.
std::size_t triangleCount () const
Number of triangles stored in the tree.

Detailed Description

Builds a balanced binary tree of AABBs over the triangles of a Mesh. Supports nearest-point queries and ray-intersection counting.

Public Types Documentation

typedef Vec3

Convenience alias for 3D positions used by the tree.

using Argos::AABBTree::Vec3 =  Vector3D<double>;


Public Functions Documentation

function AABBTree

Build an AABB tree from a mesh.

explicit Argos::AABBTree::AABBTree (
    const  Mesh & mesh
) 

Parameters:

  • mesh The input mesh (triangulated internally if needed).

function empty

Whether the tree contains no triangles.

bool Argos::AABBTree::empty () const


function getNbIntersections [1/2]

Count how many triangles intersect the segment [v1, v2].

int Argos::AABBTree::getNbIntersections (
    const  Vec3 & v1,
    const  Vec3 & v2
) 

Parameters:

  • v1 Segment start.
  • v2 Segment end.

Returns:

Number of intersections.


function getTriangles

Const access to the flattened triangle list.

const std::vector< Triangle > & Argos::AABBTree::getTriangles () const


function nearestDistance

Euclidean distance from a point to the nearest triangle.

double Argos::AABBTree::nearestDistance (
    const  Vec3 & point
) const

Parameters:

  • point Query point.

Returns:

Minimum distance.


function nearestDistanceSquared

Squared distance from a point to the nearest triangle.

double Argos::AABBTree::nearestDistanceSquared (
    const  Vec3 & point
) const

Parameters:

  • point Query point.

Returns:

Squared minimum distance.


function nearestTriangles [1/2]

Find all triangles within the current best distance.

std::vector< Triangle > Argos::AABBTree::nearestTriangles (
    const  Vec3 & point
) const

Parameters:

  • point Query point.

Returns:

Vector of nearest triangles (may contain ties).


function triangleCount

Number of triangles stored in the tree.

std::size_t Argos::AABBTree::triangleCount () const



The documentation for this class was generated from the following file include/structure/AABBTree.h