|
libigl v2.5.0
|
Implementation of semi-general purpose axis-aligned bounding box hierarchy. More...
#include <AABB.h>
Public Types | |
| typedef DerivedV::Scalar | Scalar |
| Scalar type of vertex positions (e.g., double). | |
| typedef Eigen::Matrix< Scalar, 1, DIM > | RowVectorDIMS |
| Fixed-size (DIM) RowVector type using Scalar. | |
| typedef Eigen::Matrix< Scalar, DIM, 1 > | VectorDIMS |
| Fixed-size (DIM) (Column)Vector type using Scalar. | |
| typedef Eigen::Matrix< Scalar, Eigen::Dynamic, DIM > | MatrixXDIMS |
| Fixed-width (DIM) Matrix type using Scalar. | |
Public Member Functions | |
| IGL_INLINE bool | is_leaf () const |
| Return whether at leaf node. | |
| IGL_INLINE bool | is_root () const |
| Return whether at root node. | |
| IGL_INLINE AABB< DerivedV, DIM > * | root () const |
| Return the root node of this node's tree by following its parent. | |
| IGL_INLINE AABB< DerivedV, DIM > * | detach () |
| IGL_INLINE void | refit_lineage () |
| IGL_INLINE std::vector< AABB< DerivedV, DIM > * > | gather_leaves (const int m) |
| Get a vector of leaves indexed by their m_primitive id (these better be non-negative and tightly packed. | |
| IGL_INLINE std::vector< AABB< DerivedV, DIM > * > | gather_leaves () |
| IGL_INLINE AABB< DerivedV, DIM > * | pad (const std::vector< AABB< DerivedV, DIM > * > &leaves, const Scalar pad, const int polish_rotate_passes=0) |
| Pad leaves by pad in each dimension. | |
| IGL_INLINE AABB< DerivedV, DIM > * | update (const Eigen::AlignedBox< Scalar, DIM > &new_box, const Scalar pad=0) |
| IGL_INLINE AABB< DerivedV, DIM > * | insert (AABB *other) |
| Insert a (probably a leaf) AABB other into this AABB tree. | |
| IGL_INLINE AABB< DerivedV, DIM > * | insert_as_sibling (AABB *other) |
| Insert other as a sibling to this by creating a new internal node to be their shared parent. | |
| IGL_INLINE Scalar | rotate (const bool dry_run=false) |
| Try to swap this node with its close relatives if it will decrease total internal surface area. | |
| IGL_INLINE Scalar | rotate_across (const bool dry_run=false) |
| Try to swap this node with its cousins if it will decrease total internal surface area. | |
| IGL_INLINE Scalar | rotate_up (const bool dry_run=false) |
| Try to swap this node with its pibling if it will decrease total internal surface area. | |
| IGL_INLINE Scalar | rotate_down (const bool dry_run=false) |
| Try to swap this node with one of its niblings if it will decrease total internal surface area. | |
| IGL_INLINE void | rotate_lineage () |
| IGL_INLINE int | subtree_size () const |
| Number of nodes contained in subtree (is it?). | |
| IGL_INLINE bool | append_intersecting_leaves (const Eigen::AlignedBox< Scalar, DIM > &box, std::vector< const AABB< DerivedV, DIM > * > &leaves) const |
| IGL_INLINE DerivedV::Scalar | internal_surface_area () const |
| Compute sum of surface area of all internal (non-root, non-leaf) boxes. | |
| IGL_INLINE void | validate () const |
| Validate the subtree under this node by running a bunch of assertions. | |
| IGL_INLINE void | print (const int depth=0) const |
| print the memory addresses of the tree in a somewhat legible way | |
| IGL_INLINE int | size () const |
| IGL_INLINE int | height () const |
| template<typename DerivedEle, typename Derivedbb_mins, typename Derivedbb_maxs, typename Derivedelements> | |
| IGL_INLINE void | init (const Eigen::MatrixBase< DerivedV > &V, const Eigen::MatrixBase< DerivedEle > &Ele, const Eigen::MatrixBase< Derivedbb_mins > &bb_mins, const Eigen::MatrixBase< Derivedbb_maxs > &bb_maxs, const Eigen::MatrixBase< Derivedelements > &elements, const int i=0) |
| Build an Axis-Aligned Bounding Box tree for a given mesh and given serialization of a previous AABB tree. | |
| template<typename DerivedEle> | |
| IGL_INLINE void | init (const Eigen::MatrixBase< DerivedV > &V, const Eigen::MatrixBase< DerivedEle > &Ele) |
| Build an Axis-Aligned Bounding Box tree for a given mesh and given serialization of a previous AABB tree. | |
| template<typename DerivedEle, typename DerivedSI, typename DerivedI> | |
| IGL_INLINE void | init (const Eigen::MatrixBase< DerivedV > &V, const Eigen::MatrixBase< DerivedEle > &Ele, const Eigen::MatrixBase< DerivedSI > &SI, const Eigen::MatrixBase< DerivedI > &I) |
| Build an Axis-Aligned Bounding Box tree for a given mesh. | |
| template<typename DerivedEle> | |
| IGL_INLINE AABB< DerivedV, DIM > * | update_primitive (const Eigen::MatrixBase< DerivedV > &V, const Eigen::MatrixBase< DerivedEle > &Ele, const Scalar pad=0) |
| template<typename DerivedEle, typename Derivedq> | |
| IGL_INLINE std::vector< int > | find (const Eigen::MatrixBase< DerivedV > &V, const Eigen::MatrixBase< DerivedEle > &Ele, const Eigen::MatrixBase< Derivedq > &q, const bool first=false) const |
| Find the indices of elements containing given point: this makes sense when Ele is a co-dimension 0 simplex (tets in 3D, triangles in 2D). | |
| template<typename Derivedbb_mins, typename Derivedbb_maxs, typename Derivedelements> | |
| IGL_INLINE void | serialize (Eigen::PlainObjectBase< Derivedbb_mins > &bb_mins, Eigen::PlainObjectBase< Derivedbb_maxs > &bb_maxs, Eigen::PlainObjectBase< Derivedelements > &elements, const int i=0) const |
| Serialize this class into 3 arrays (so we can pass it pack to matlab). | |
| template<typename DerivedEle> | |
| IGL_INLINE Scalar | squared_distance (const Eigen::MatrixBase< DerivedV > &V, const Eigen::MatrixBase< DerivedEle > &Ele, const RowVectorDIMS &p, int &i, Eigen::PlainObjectBase< RowVectorDIMS > &c) const |
| Compute squared distance to a query point. | |
| template<typename DerivedEle> | |
| IGL_INLINE Scalar | squared_distance (const Eigen::MatrixBase< DerivedV > &V, const Eigen::MatrixBase< DerivedEle > &Ele, const RowVectorDIMS &p, const Scalar low_sqr_d, const Scalar up_sqr_d, int &i, Eigen::PlainObjectBase< RowVectorDIMS > &c) const |
| Compute squared distance to a query point if within low_sqr_d and up_sqr_d. | |
| template<typename DerivedEle> | |
| IGL_INLINE Scalar | squared_distance (const Eigen::MatrixBase< DerivedV > &V, const Eigen::MatrixBase< DerivedEle > &Ele, const RowVectorDIMS &p, const Scalar up_sqr_d, int &i, Eigen::PlainObjectBase< RowVectorDIMS > &c) const |
| Compute squared distance to a query point (default low_sqr_d). | |
| template<typename DerivedEle> | |
| IGL_INLINE bool | intersect_ray (const Eigen::MatrixBase< DerivedV > &V, const Eigen::MatrixBase< DerivedEle > &Ele, const RowVectorDIMS &origin, const RowVectorDIMS &dir, std::vector< igl::Hit< typename DerivedV::Scalar > > &hits) const |
| Intersect a ray with the mesh return all hits. | |
| template<typename DerivedEle> | |
| IGL_INLINE bool | intersect_ray (const Eigen::MatrixBase< DerivedV > &V, const Eigen::MatrixBase< DerivedEle > &Ele, const RowVectorDIMS &origin, const RowVectorDIMS &dir, igl::Hit< typename DerivedV::Scalar > &hit) const |
| Intersect a ray with the mesh return first hit. | |
| template<typename DerivedEle> | |
| IGL_INLINE bool | intersect_ray (const Eigen::MatrixBase< DerivedV > &V, const Eigen::MatrixBase< DerivedEle > &Ele, const RowVectorDIMS &origin, const RowVectorDIMS &dir, const Scalar min_t, igl::Hit< typename DerivedV::Scalar > &hit) const |
| Intersect a ray with the mesh return first hit farther than min_t. | |
| template<typename DerivedEle, typename DerivedOrigin, typename DerivedDir, typename DerivedI, typename DerivedT, typename DerivedUV> | |
| IGL_INLINE void | intersect_ray (const Eigen::MatrixBase< DerivedV > &V, const Eigen::MatrixBase< DerivedEle > &Ele, const Eigen::MatrixBase< DerivedOrigin > &origin, const Eigen::MatrixBase< DerivedDir > &dir, const Scalar min_t, Eigen::PlainObjectBase< DerivedI > &I, Eigen::PlainObjectBase< DerivedT > &T, Eigen::PlainObjectBase< DerivedUV > &UV) |
| Intersect a rays with the mesh return first hit for each. | |
| template<typename DerivedEle, typename DerivedOrigin, typename DerivedDir> | |
| IGL_INLINE void | intersect_ray (const Eigen::MatrixBase< DerivedV > &V, const Eigen::MatrixBase< DerivedEle > &Ele, const Eigen::MatrixBase< DerivedOrigin > &origin, const Eigen::MatrixBase< DerivedDir > &dir, std::vector< std::vector< igl::Hit< typename DerivedV::Scalar > > > &hits) |
| template<typename DerivedEle, typename DerivedP, typename DerivedsqrD, typename DerivedI, typename DerivedC> | |
| IGL_INLINE void | squared_distance (const Eigen::MatrixBase< DerivedV > &V, const Eigen::MatrixBase< DerivedEle > &Ele, const Eigen::MatrixBase< DerivedP > &P, Eigen::PlainObjectBase< DerivedsqrD > &sqrD, Eigen::PlainObjectBase< DerivedI > &I, Eigen::PlainObjectBase< DerivedC > &C) const |
| Compute the squared distance from all query points in P to the closest points on the primitives stored in the AABB hierarchy for the mesh (V,Ele). | |
| template<typename DerivedEle, typename Derivedother_V, typename Derivedother_Ele, typename DerivedsqrD, typename DerivedI, typename DerivedC> | |
| IGL_INLINE void | squared_distance (const Eigen::MatrixBase< DerivedV > &V, const Eigen::MatrixBase< DerivedEle > &Ele, const AABB< Derivedother_V, DIM > &other, const Eigen::MatrixBase< Derivedother_V > &other_V, const Eigen::MatrixBase< Derivedother_Ele > &other_Ele, Eigen::PlainObjectBase< DerivedsqrD > &sqrD, Eigen::PlainObjectBase< DerivedI > &I, Eigen::PlainObjectBase< DerivedC > &C) const |
| Compute the squared distance from all query points in P already stored in its own AABB hierarchy to the closest points on the primitives stored in the AABB hierarchy for the mesh (V,Ele). | |
Static Public Member Functions | |
| static IGL_INLINE Scalar | rotate_up (const bool dry_run, AABB< DerivedV, DIM > *reining, AABB< DerivedV, DIM > *grandparent, AABB< DerivedV, DIM > *parent, AABB< DerivedV, DIM > *challenger, AABB< DerivedV, DIM > *sibling) |
| "Rotate" (swap) reining with challenger. | |
Public Attributes | |
| AABB * | m_left |
| Pointer to "left" child node (nullptr if leaf). | |
| AABB * | m_right |
| Pointer to "right" child node (nullptr if leaf). | |
| AABB * | m_parent |
| Pointer to "parent" node (nullptr if root). | |
| Eigen::AlignedBox< Scalar, DIM > | m_box |
| Axis-Aligned Bounding Box containing this node. | |
| int | m_primitive |
| Index of single primitive in this node if full leaf, otherwise -1 for non-leaf. | |
Friends | |
| void | swap (AABB &first, AABB &second) |
Implementation of semi-general purpose axis-aligned bounding box hierarchy.
Determine if collapse the edge e would create new intersections.
The mesh (V,Ele) is stored and managed by the caller and each routine here simply takes it as references (it better not change between calls).
It's a little annoying that the Dimension is a template parameter and not picked up at run time from V. This leads to duplicated code for 2d/3d (up to dim).
| DerivedV | Matrix type of vertex positions (e.g., Eigen::MatrixXd) |
| DIM | Dimension of mesh vertex positions (2 or 3) |
| [in] | e | index into E of edge to try to collapse. E(e,:) = [s d] or [d s] so that s<d, then d is collapsed to s. |
| [in] | p | dim list of vertex position where to place merged vertex [mesh inputs] |
| [in,out] | V | #V by dim list of vertex positions, lesser index of E(e,:) will be set to midpoint of edge. |
| [in,out] | F | #F by 3 list of face indices into V. |
| [in,out] | E | #E by 2 list of edge indices into V. |
| [in,out] | EMAP | #F*3 list of indices into E, mapping each directed edge to unique unique edge in E |
| [in,out] | EF | #E by 2 list of edge flaps, EF(e,0)=f means e=(i-->j) is the edge of F(f,:) opposite the vth corner, where EI(e,0)=v. Similarly EF(e,1) " e=(j->i) |
| [in,out] | EI | #E by 2 list of edge flap corners (see above). [mesh inputs] |
| [in] | tree | AABB tree whose leaves correspond to the current (non-null) faces in (V,F) |
| typedef DerivedV::Scalar igl::AABB< DerivedV, DIM >::Scalar |
Scalar type of vertex positions (e.g., double).
| typedef Eigen::Matrix<Scalar,1,DIM> igl::AABB< DerivedV, DIM >::RowVectorDIMS |
Fixed-size (DIM) RowVector type using Scalar.
| typedef Eigen::Matrix<Scalar,DIM,1> igl::AABB< DerivedV, DIM >::VectorDIMS |
Fixed-size (DIM) (Column)Vector type using Scalar.
| typedef Eigen::Matrix<Scalar,Eigen::Dynamic,DIM> igl::AABB< DerivedV, DIM >::MatrixXDIMS |
Fixed-width (DIM) Matrix type using Scalar.
| IGL_INLINE bool igl::AABB< DerivedV, DIM >::is_leaf | ( | ) | const |
Return whether at leaf node.
| IGL_INLINE bool igl::AABB< DerivedV, DIM >::is_root | ( | ) | const |
Return whether at root node.
| IGL_INLINE AABB< DerivedV, DIM > * igl::AABB< DerivedV, DIM >::root | ( | ) | const |
Return the root node of this node's tree by following its parent.
| IGL_INLINE AABB< DerivedV, DIM > * igl::AABB< DerivedV, DIM >::detach | ( | ) |
| IGL_INLINE void igl::AABB< DerivedV, DIM >::refit_lineage | ( | ) |
| IGL_INLINE std::vector< AABB< DerivedV, DIM > * > igl::AABB< DerivedV, DIM >::gather_leaves | ( | const int | m | ) |
Get a vector of leaves indexed by their m_primitive id (these better be non-negative and tightly packed.
| [in] | m | number of leaves/elements (Ele.rows()) |
| IGL_INLINE std::vector< AABB< DerivedV, DIM > * > igl::AABB< DerivedV, DIM >::gather_leaves | ( | ) |
| IGL_INLINE AABB< DerivedV, DIM > * igl::AABB< DerivedV, DIM >::pad | ( | const std::vector< AABB< DerivedV, DIM > * > & | leaves, |
| const Scalar | pad, | ||
| const int | polish_rotate_passes = 0 ) |
| IGL_INLINE AABB< DerivedV, DIM > * igl::AABB< DerivedV, DIM >::update | ( | const Eigen::AlignedBox< Scalar, DIM > & | new_box, |
| const Scalar | pad = 0 ) |
Example:
| IGL_INLINE AABB< DerivedV, DIM > * igl::AABB< DerivedV, DIM >::insert | ( | AABB< DerivedV, DIM > * | other | ) |
Insert a (probably a leaf) AABB other into this AABB tree.
If other's box is contained in this AABB's box then insert it as a child recursively.
If other's box is not contained in this AABB's box then insert it as a sibling.
It's a very good idea to call either rotate (faster, less good) or rotate_lineage (slower, better) after insertion. Rotating continues to improve the tree's quality so after doing a bunch of insertions you might even consider calling rotate on all nodes.
insert attempts to minimize total internal surface area. Where as init is top-down and splits boxes based on the median along the longest dimension. When initializing a tree, init seems to result in great trees (small height and small total internal surface area).
| [in] | other | pointer to another AABB node |
| IGL_INLINE AABB< DerivedV, DIM > * igl::AABB< DerivedV, DIM >::insert_as_sibling | ( | AABB< DerivedV, DIM > * | other | ) |
Insert other as a sibling to this by creating a new internal node to be their shared parent.
Before
parent
╱ ╲
this(C) sibling
╱ ╲
left right
After
parent
╱ ╲
newbie sibling
╱ ╲
this other
╱ ╲
left right
| [in] | other | pointer to another AABB node |
| IGL_INLINE Scalar igl::AABB< DerivedV, DIM >::rotate | ( | const bool | dry_run = false | ) |
Try to swap this node with its close relatives if it will decrease total internal surface area.
grandparent
╱ ╲
parent pibling°
╱ ╲ ╱ ╲
sibling this cuz1° cuz2°
╱ ╲
nib1° nib2°
°Swap Candidates
| [in] | dry_run | if true then don't actually swap |
| IGL_INLINE Scalar igl::AABB< DerivedV, DIM >::rotate_across | ( | const bool | dry_run = false | ) |
Try to swap this node with its cousins if it will decrease total internal surface area.
| [in] | dry_run | if true then don't actually swap |
Before
grandparent
╱ ╲
parent pibling
╱ ╲ ╱ ╲
sibling this cuz1 cuz2
Candidates
grandparent
╱ ╲
parent pibling
╱ ╲ ╱ ╲
sibling cuz1 this cuz2
Or
grandparent
╱ ╲
parent pibling
╱ ╲ ╱ ╲
sibling cuz2 cuz1 this
| IGL_INLINE Scalar igl::AABB< DerivedV, DIM >::rotate_up | ( | const bool | dry_run = false | ) |
Try to swap this node with its pibling if it will decrease total internal surface area.
| [in] | dry_run | if true then don't actually swap |
Before
grandparent
╱ ╲
other parent
╱ ╲
this sibling
Candidate
grandparent
╱ ╲
this parent
╱ ╲
other sibling
| IGL_INLINE Scalar igl::AABB< DerivedV, DIM >::rotate_down | ( | const bool | dry_run = false | ) |
Try to swap this node with one of its niblings if it will decrease total internal surface area.
| [in] | dry_run | if true then don't actually swap |
Before
parent
╱ ╲
this sibling
╱ ╲
left right
Candidates
parent
╱ ╲
left sibling
╱ ╲
this right
Or
parent
╱ ╲
right sibling
╱ ╲
left this
|
static |
"Rotate" (swap) reining with challenger.
Before
grandparent
╱ ╲
reining parent
╱ ╲
challenger sibling
Candidate
grandparent
╱ ╲
challenger parent
╱ ╲
reining sibling
| [in] | reining | pointer to AABB node to be rotated |
| [in] | grandparent | pointer to challenger's grandparent |
| [in] | parent | pointer to challenger's parent |
| [in] | challenger | pointer to AABB node to be rotated |
| [in] | sibling | pointer to challenger's sibling |
| IGL_INLINE void igl::AABB< DerivedV, DIM >::rotate_lineage | ( | ) |
| IGL_INLINE int igl::AABB< DerivedV, DIM >::subtree_size | ( | ) | const |
Number of nodes contained in subtree (is it?).
| IGL_INLINE bool igl::AABB< DerivedV, DIM >::append_intersecting_leaves | ( | const Eigen::AlignedBox< Scalar, DIM > & | box, |
| std::vector< const AABB< DerivedV, DIM > * > & | leaves ) const |
| [in] | box | query box |
| [in,out] | leaves | list of leaves to append to |
| IGL_INLINE DerivedV::Scalar igl::AABB< DerivedV, DIM >::internal_surface_area | ( | ) | const |
Compute sum of surface area of all internal (non-root, non-leaf) boxes.
| IGL_INLINE void igl::AABB< DerivedV, DIM >::validate | ( | ) | const |
Validate the subtree under this node by running a bunch of assertions.
Does nothing when not in debug mode
| IGL_INLINE void igl::AABB< DerivedV, DIM >::print | ( | const int | depth = 0 | ) | const |
print the memory addresses of the tree in a somewhat legible way
| IGL_INLINE int igl::AABB< DerivedV, DIM >::size | ( | ) | const |
| IGL_INLINE int igl::AABB< DerivedV, DIM >::height | ( | ) | const |
| IGL_INLINE void igl::AABB< DerivedV, DIM >::init | ( | const Eigen::MatrixBase< DerivedV > & | V, |
| const Eigen::MatrixBase< DerivedEle > & | Ele, | ||
| const Eigen::MatrixBase< Derivedbb_mins > & | bb_mins, | ||
| const Eigen::MatrixBase< Derivedbb_maxs > & | bb_maxs, | ||
| const Eigen::MatrixBase< Derivedelements > & | elements, | ||
| const int | i = 0 ) |
Build an Axis-Aligned Bounding Box tree for a given mesh and given serialization of a previous AABB tree.
| [in] | V | #V by dim list of mesh vertex positions. |
| [in] | Ele | #Ele by dim+1 list of mesh indices into #V. |
| [in] | bb_mins | max_tree by dim list of bounding box min corner positions |
| [in] | bb_maxs | max_tree by dim list of bounding box max corner positions |
| [in] | elements | max_tree list of element or (not leaf id) indices into Ele |
| [in] | i | recursive call index {0} |
| IGL_INLINE void igl::AABB< DerivedV, DIM >::init | ( | const Eigen::MatrixBase< DerivedV > & | V, |
| const Eigen::MatrixBase< DerivedEle > & | Ele ) |
Build an Axis-Aligned Bounding Box tree for a given mesh and given serialization of a previous AABB tree.
| [in] | V | #V by dim list of mesh vertex positions. |
| [in] | Ele | #Ele by dim+1 list of mesh indices into #V. |
| IGL_INLINE void igl::AABB< DerivedV, DIM >::init | ( | const Eigen::MatrixBase< DerivedV > & | V, |
| const Eigen::MatrixBase< DerivedEle > & | Ele, | ||
| const Eigen::MatrixBase< DerivedSI > & | SI, | ||
| const Eigen::MatrixBase< DerivedI > & | I ) |
Build an Axis-Aligned Bounding Box tree for a given mesh.
| [in] | V | #V by dim list of mesh vertex positions. |
| [in] | Ele | #Ele by dim+1 list of mesh indices into #V. |
| [in] | SI | #Ele by dim list revealing for each coordinate where Ele's barycenters would be sorted: SI(e,d) = i --> the dth coordinate of the barycenter of the eth element would be placed at position i in a sorted list. |
| [in] | I | #I list of indices into Ele of elements to include (for recursive calls) |
| IGL_INLINE AABB< DerivedV, DIM > * igl::AABB< DerivedV, DIM >::update_primitive | ( | const Eigen::MatrixBase< DerivedV > & | V, |
| const Eigen::MatrixBase< DerivedEle > & | Ele, | ||
| const Scalar | pad = 0 ) |
| IGL_INLINE std::vector< int > igl::AABB< DerivedV, DIM >::find | ( | const Eigen::MatrixBase< DerivedV > & | V, |
| const Eigen::MatrixBase< DerivedEle > & | Ele, | ||
| const Eigen::MatrixBase< Derivedq > & | q, | ||
| const bool | first = false ) const |
Find the indices of elements containing given point: this makes sense when Ele is a co-dimension 0 simplex (tets in 3D, triangles in 2D).
| [in] | V | #V by dim list of mesh vertex positions. Should be same as used to construct mesh. |
| [in] | Ele | #Ele by dim+1 list of mesh indices into #V. Should be same as used to construct mesh. |
| [in] | q | dim row-vector query position |
| [in] | first | whether to only return first element containing q |
| IGL_INLINE void igl::AABB< DerivedV, DIM >::serialize | ( | Eigen::PlainObjectBase< Derivedbb_mins > & | bb_mins, |
| Eigen::PlainObjectBase< Derivedbb_maxs > & | bb_maxs, | ||
| Eigen::PlainObjectBase< Derivedelements > & | elements, | ||
| const int | i = 0 ) const |
Serialize this class into 3 arrays (so we can pass it pack to matlab).
| [out] | bb_mins | max_tree by dim list of bounding box min corner positions |
| [out] | bb_maxs | max_tree by dim list of bounding box max corner positions |
| [out] | elements | max_tree list of element or (not leaf id) indices into Ele |
| [in] | i | recursive call index into these arrays {0} |
| IGL_INLINE Scalar igl::AABB< DerivedV, DIM >::squared_distance | ( | const Eigen::MatrixBase< DerivedV > & | V, |
| const Eigen::MatrixBase< DerivedEle > & | Ele, | ||
| const RowVectorDIMS & | p, | ||
| int & | i, | ||
| Eigen::PlainObjectBase< RowVectorDIMS > & | c ) const |
Compute squared distance to a query point.
| [in] | V | #V by dim list of vertex positions |
| [in] | Ele | #Ele by dim list of simplex indices |
| [in] | p | dim-long query point |
| [out] | i | facet index corresponding to smallest distances |
| [out] | c | closest point |
| IGL_INLINE Scalar igl::AABB< DerivedV, DIM >::squared_distance | ( | const Eigen::MatrixBase< DerivedV > & | V, |
| const Eigen::MatrixBase< DerivedEle > & | Ele, | ||
| const RowVectorDIMS & | p, | ||
| const Scalar | low_sqr_d, | ||
| const Scalar | up_sqr_d, | ||
| int & | i, | ||
| Eigen::PlainObjectBase< RowVectorDIMS > & | c ) const |
Compute squared distance to a query point if within low_sqr_d and up_sqr_d.
| [in] | V | #V by dim list of vertex positions |
| [in] | Ele | #Ele by dim list of simplex indices |
| [in] | p | dim-long query point |
| [in] | low_sqr_d | lower bound on squared distance, specified maximum squared distance |
| [in] | up_sqr_d | current upper bounded on squared distance, current minimum squared distance (only consider distances less than this), see output. |
| [out] | i | facet index corresponding to smallest distances |
| [out] | c | closest point |
| IGL_INLINE Scalar igl::AABB< DerivedV, DIM >::squared_distance | ( | const Eigen::MatrixBase< DerivedV > & | V, |
| const Eigen::MatrixBase< DerivedEle > & | Ele, | ||
| const RowVectorDIMS & | p, | ||
| const Scalar | up_sqr_d, | ||
| int & | i, | ||
| Eigen::PlainObjectBase< RowVectorDIMS > & | c ) const |
Compute squared distance to a query point (default low_sqr_d).
| [in] | V | #V by dim list of vertex positions |
| [in] | Ele | #Ele by dim list of simplex indices |
| [in] | p | dim-long query point |
| [in] | up_sqr_d | current upper bounded on squared distance, current minimum squared distance (only consider distances less than this), see output. |
| [out] | i | facet index corresponding to smallest distances |
| [out] | c | closest point |
| IGL_INLINE bool igl::AABB< DerivedV, DIM >::intersect_ray | ( | const Eigen::MatrixBase< DerivedV > & | V, |
| const Eigen::MatrixBase< DerivedEle > & | Ele, | ||
| const RowVectorDIMS & | origin, | ||
| const RowVectorDIMS & | dir, | ||
| std::vector< igl::Hit< typename DerivedV::Scalar > > & | hits ) const |
Intersect a ray with the mesh return all hits.
| [in] | V | #V by dim list of vertex positions |
| [in] | Ele | #Ele by dim list of simplex indices |
| [in] | origin | dim-long ray origin |
| [in] | dir | dim-long ray direction |
| [out] | hits | list of hits |
| IGL_INLINE bool igl::AABB< DerivedV, DIM >::intersect_ray | ( | const Eigen::MatrixBase< DerivedV > & | V, |
| const Eigen::MatrixBase< DerivedEle > & | Ele, | ||
| const RowVectorDIMS & | origin, | ||
| const RowVectorDIMS & | dir, | ||
| igl::Hit< typename DerivedV::Scalar > & | hit ) const |
Intersect a ray with the mesh return first hit.
| [in] | V | #V by dim list of vertex positions |
| [in] | Ele | #Ele by dim list of simplex indices |
| [in] | origin | dim-long ray origin |
| [in] | dir | dim-long ray direction |
| [out] | hit | first hit |
| IGL_INLINE bool igl::AABB< DerivedV, DIM >::intersect_ray | ( | const Eigen::MatrixBase< DerivedV > & | V, |
| const Eigen::MatrixBase< DerivedEle > & | Ele, | ||
| const RowVectorDIMS & | origin, | ||
| const RowVectorDIMS & | dir, | ||
| const Scalar | min_t, | ||
| igl::Hit< typename DerivedV::Scalar > & | hit ) const |
Intersect a ray with the mesh return first hit farther than min_t.
| [in] | V | #V by dim list of vertex positions |
| [in] | Ele | #Ele by dim list of simplex indices |
| [in] | origin | dim-long ray origin |
| [in] | dir | dim-long ray direction |
| [in] | min_t | minimum t value to consider |
| [out] | hit | first hit |
| IGL_INLINE void igl::AABB< DerivedV, DIM >::intersect_ray | ( | const Eigen::MatrixBase< DerivedV > & | V, |
| const Eigen::MatrixBase< DerivedEle > & | Ele, | ||
| const Eigen::MatrixBase< DerivedOrigin > & | origin, | ||
| const Eigen::MatrixBase< DerivedDir > & | dir, | ||
| const Scalar | min_t, | ||
| Eigen::PlainObjectBase< DerivedI > & | I, | ||
| Eigen::PlainObjectBase< DerivedT > & | T, | ||
| Eigen::PlainObjectBase< DerivedUV > & | UV ) |
Intersect a rays with the mesh return first hit for each.
| [in] | V | #V by dim list of vertex positions |
| [in] | Ele | #Ele by dim list of simplex indices |
| [in] | origin | #ray by dim+1 list of ray origins |
| [in] | dir | #ray by dim list of ray directions |
| [in] | min_t | minimum t value to consider |
| [out] | I | #ray list of indices into Ele of closest primitives (-1 indicates no hit) |
| [out] | T | #ray list of t values (nan indicates no hit) |
| [out] | UV | #ray by dim list of barycentric coordinates |
| IGL_INLINE void igl::AABB< DerivedV, DIM >::intersect_ray | ( | const Eigen::MatrixBase< DerivedV > & | V, |
| const Eigen::MatrixBase< DerivedEle > & | Ele, | ||
| const Eigen::MatrixBase< DerivedOrigin > & | origin, | ||
| const Eigen::MatrixBase< DerivedDir > & | dir, | ||
| std::vector< std::vector< igl::Hit< typename DerivedV::Scalar > > > & | hits ) |
| IGL_INLINE void igl::AABB< DerivedV, DIM >::squared_distance | ( | const Eigen::MatrixBase< DerivedV > & | V, |
| const Eigen::MatrixBase< DerivedEle > & | Ele, | ||
| const Eigen::MatrixBase< DerivedP > & | P, | ||
| Eigen::PlainObjectBase< DerivedsqrD > & | sqrD, | ||
| Eigen::PlainObjectBase< DerivedI > & | I, | ||
| Eigen::PlainObjectBase< DerivedC > & | C ) const |
Compute the squared distance from all query points in P to the closest points on the primitives stored in the AABB hierarchy for the mesh (V,Ele).
| [in] | V | #V by dim list of vertex positions |
| [in] | Ele | #Ele by dim list of simplex indices |
| [in] | P | #P by dim list of query points |
| [out] | sqrD | #P list of squared distances |
| [out] | I | #P list of indices into Ele of closest primitives |
| [out] | C | #P by dim list of closest points |
| IGL_INLINE void igl::AABB< DerivedV, DIM >::squared_distance | ( | const Eigen::MatrixBase< DerivedV > & | V, |
| const Eigen::MatrixBase< DerivedEle > & | Ele, | ||
| const AABB< Derivedother_V, DIM > & | other, | ||
| const Eigen::MatrixBase< Derivedother_V > & | other_V, | ||
| const Eigen::MatrixBase< Derivedother_Ele > & | other_Ele, | ||
| Eigen::PlainObjectBase< DerivedsqrD > & | sqrD, | ||
| Eigen::PlainObjectBase< DerivedI > & | I, | ||
| Eigen::PlainObjectBase< DerivedC > & | C ) const |
Compute the squared distance from all query points in P already stored in its own AABB hierarchy to the closest points on the primitives stored in the AABB hierarchy for the mesh (V,Ele).
| [in] | V | #V by dim list of vertex positions |
| [in] | Ele | #Ele by dim list of simplex indices |
| [in] | other | AABB hierarchy of another set of primitives (must be points) |
| [in] | other_V | #other_V by dim list of query points |
| [in] | other_Ele | #other_Ele by ss list of simplex indices into other_V (must be simple list of points: ss == 1) |
| [out] | sqrD | #P list of squared distances |
| [out] | I | #P list of indices into Ele of closest primitives |
| [out] | C | #P by dim list of closest points |
|
friend |
| AABB* igl::AABB< DerivedV, DIM >::m_left |
Pointer to "left" child node (nullptr if leaf).
| AABB* igl::AABB< DerivedV, DIM >::m_right |
Pointer to "right" child node (nullptr if leaf).
| AABB* igl::AABB< DerivedV, DIM >::m_parent |
Pointer to "parent" node (nullptr if root).
| Eigen::AlignedBox<Scalar,DIM> igl::AABB< DerivedV, DIM >::m_box |
Axis-Aligned Bounding Box containing this node.
| int igl::AABB< DerivedV, DIM >::m_primitive |
Index of single primitive in this node if full leaf, otherwise -1 for non-leaf.