ellipsoid_tree 0.1.0
Exact intersection tests for ellipsoids and friends
Loading...
Searching...
No Matches
ellipsoid_tree::SimplexTree Class Reference

Spatial index over a collection of simplices (e.g. a mesh). More...

#include <ellipsoid_tree/object_tree.hpp>

Inheritance diagram for ellipsoid_tree::SimplexTree:

Public Member Functions

 SimplexTree ()=default
 Empty tree (indexes no simplices).
 
 SimplexTree (std::vector< Simplex > simplices, int num_threads=0)
 Index a collection of simplices, precomputing each affine-coordinate transform and building the tree over their bounding boxes.
 
 SimplexTree (const Eigen::Ref< const Eigen::MatrixXd > &vertices, const Eigen::Ref< const Eigen::MatrixXi > &cells, int num_threads=0)
 Mesh convenience: vertices (dim x num_vertices), cells (K x num_cells) of vertex indices; one simplex per cell column.
 
int size () const
 Number of indexed simplices.
 
int dim () const
 Spatial dimension of the indexed simplices.
 
const Simplexobject (int ii) const
 The ii-th indexed simplex.
 
const std::vector< Simplex > & objects () const
 All indexed simplices, in index order.
 
const AABBTreetree () const
 The underlying AABB tree over the elements' bounding boxes.
 
Eigen::VectorXd affine_coordinates (int ii, const Eigen::Ref< const Eigen::VectorXd > &p) const
 Affine (barycentric) coordinates of p with respect to element ii.
 
std::vector< int > collisions (const Eigen::Ref< const Eigen::VectorXd > &p) const
 Indices of the simplices containing the query point.
 
int first_collision (const Eigen::Ref< const Eigen::VectorXd > &p) const
 Index of one element containing p, or -1 (early-exit traversal).
 
std::vector< int > collisions (const Box &q) const
 Indices of the simplices intersecting the query box.
 
std::vector< int > collisions (const Simplex &q) const
 Indices of the simplices intersecting the query simplex.
 
std::vector< int > collisions (const Ball &q) const
 Indices of the simplices intersecting the query ball.
 
std::vector< int > collisions (const Ellipsoid &q, double tau) const
 Indices of the simplices intersecting the query ellipsoid at scale tau.
 
std::vector< int > collisions (const Segment &q) const
 Indices of the simplices intersecting the query segment.
 
std::vector< int > collisions (const Halfspace &q) const
 Indices of the simplices intersecting the query halfspace.
 
std::vector< std::pair< int, int > > self_collision_pairs () const
 Every intersecting pair within the family of simplices (the overlap graph).
 

Public Attributes

bool exact_ellipsoid_pruning = true
 Enable the exact ellipsoid-box test during node pruning (vs. bounding-box only).
 

Detailed Description

Spatial index over a collection of simplices (e.g. a mesh).

Constructor & Destructor Documentation

◆ SimplexTree() [1/3]

ellipsoid_tree::SimplexTree::SimplexTree ( )
default

Empty tree (indexes no simplices).

◆ SimplexTree() [2/3]

ellipsoid_tree::SimplexTree::SimplexTree ( std::vector< Simplex simplices,
int  num_threads = 0 
)
inlineexplicit

Index a collection of simplices, precomputing each affine-coordinate transform and building the tree over their bounding boxes.

◆ SimplexTree() [3/3]

ellipsoid_tree::SimplexTree::SimplexTree ( const Eigen::Ref< const Eigen::MatrixXd > &  vertices,
const Eigen::Ref< const Eigen::MatrixXi > &  cells,
int  num_threads = 0 
)
inline

Mesh convenience: vertices (dim x num_vertices), cells (K x num_cells) of vertex indices; one simplex per cell column.

Member Function Documentation

◆ size()

int ellipsoid_tree::SimplexTree::size ( ) const
inline

Number of indexed simplices.

◆ dim()

int ellipsoid_tree::SimplexTree::dim ( ) const
inline

Spatial dimension of the indexed simplices.

◆ object()

const Simplex & ellipsoid_tree::SimplexTree::object ( int  ii) const
inline

The ii-th indexed simplex.

◆ objects()

const std::vector< Simplex > & ellipsoid_tree::SimplexTree::objects ( ) const
inline

All indexed simplices, in index order.

◆ tree()

const AABBTree & ellipsoid_tree::SimplexTree::tree ( ) const
inline

The underlying AABB tree over the elements' bounding boxes.

◆ affine_coordinates()

Eigen::VectorXd ellipsoid_tree::SimplexTree::affine_coordinates ( int  ii,
const Eigen::Ref< const Eigen::VectorXd > &  p 
) const
inline

Affine (barycentric) coordinates of p with respect to element ii.

◆ collisions() [1/7]

std::vector< int > ellipsoid_tree::SimplexTree::collisions ( const Eigen::Ref< const Eigen::VectorXd > &  p) const
inline

Indices of the simplices containing the query point.

◆ first_collision()

int ellipsoid_tree::SimplexTree::first_collision ( const Eigen::Ref< const Eigen::VectorXd > &  p) const
inline

Index of one element containing p, or -1 (early-exit traversal).

◆ collisions() [2/7]

std::vector< int > ellipsoid_tree::SimplexTree::collisions ( const Box q) const
inline

Indices of the simplices intersecting the query box.

◆ collisions() [3/7]

std::vector< int > ellipsoid_tree::SimplexTree::collisions ( const Simplex q) const
inline

Indices of the simplices intersecting the query simplex.

◆ collisions() [4/7]

std::vector< int > ellipsoid_tree::SimplexTree::collisions ( const Ball q) const
inline

Indices of the simplices intersecting the query ball.

◆ collisions() [5/7]

std::vector< int > ellipsoid_tree::SimplexTree::collisions ( const Ellipsoid q,
double  tau 
) const
inline

Indices of the simplices intersecting the query ellipsoid at scale tau.

◆ collisions() [6/7]

std::vector< int > ellipsoid_tree::SimplexTree::collisions ( const Segment q) const
inline

Indices of the simplices intersecting the query segment.

◆ collisions() [7/7]

std::vector< int > ellipsoid_tree::SimplexTree::collisions ( const Halfspace q) const
inline

Indices of the simplices intersecting the query halfspace.

◆ self_collision_pairs()

std::vector< std::pair< int, int > > ellipsoid_tree::SimplexTree::self_collision_pairs ( ) const
inline

Every intersecting pair within the family of simplices (the overlap graph).

Member Data Documentation

◆ exact_ellipsoid_pruning

bool ellipsoid_tree::SimplexTree::exact_ellipsoid_pruning = true

Enable the exact ellipsoid-box test during node pruning (vs. bounding-box only).


The documentation for this class was generated from the following file: