Basic AABB support; in_element; (req C++17) #182
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Fixes #150
As much as I'd like to have as close as possible match in python binding names to igl function names, I'm not sure what to do about
igl::AABB
which is templated onint DIM
for the dimension and dependent functions likeigl::in_element
which take anAABB
instance as an argument. In this PR, I introduce two wrappersin_element_2
andin_element_3
which correspond toin_element
called with a 2D and 3DAABB
class respectively.In turn, I've also introduced the
AABB
class, which (like all bound classes?) only works forEigen::MatrixXd
andEigen::MatrixXi
inputs. Despite this inelegance,squared_distance
member function is, I think, a good example of how to usestd::variant
to achieve pythonic variable return types.(For now, the bindings match
igl::in_element
, in that you can't call it without first precomputing anAABB
tree. The mothership probably ought to have a version that hides constructing the AABB tree and then the python bindings should mirror it with a corresponding wrapper.