|
@@ -10,15 +10,25 @@
|
|
|
|
|
|
template <typename DerivedV, typename DerivedBV, typename DerivedBF>
|
|
|
IGL_INLINE void igl::bounding_box(
|
|
|
- const Eigen::PlainObjectBase<DerivedV>& V,
|
|
|
+ const Eigen::MatrixBase<DerivedV>& V,
|
|
|
+ Eigen::PlainObjectBase<DerivedBV>& BV,
|
|
|
+ Eigen::PlainObjectBase<DerivedBF>& BF)
|
|
|
+{
|
|
|
+ return bounding_box(V,0.,BV,BF);
|
|
|
+}
|
|
|
+
|
|
|
+template <typename DerivedV, typename DerivedBV, typename DerivedBF>
|
|
|
+IGL_INLINE void igl::bounding_box(
|
|
|
+ const Eigen::MatrixBase<DerivedV>& V,
|
|
|
+ const typename DerivedV::Scalar pad,
|
|
|
Eigen::PlainObjectBase<DerivedBV>& BV,
|
|
|
Eigen::PlainObjectBase<DerivedBF>& BF)
|
|
|
{
|
|
|
using namespace std;
|
|
|
|
|
|
const int dim = V.cols();
|
|
|
- const auto & minV = V.colwise().minCoeff();
|
|
|
- const auto & maxV = V.colwise().maxCoeff();
|
|
|
+ const auto & minV = V.colwise().minCoeff().array()-pad;
|
|
|
+ const auto & maxV = V.colwise().maxCoeff().array()+pad;
|
|
|
// 2^n vertices
|
|
|
BV.resize((1<<dim),dim);
|
|
|
|
|
@@ -82,6 +92,12 @@ IGL_INLINE void igl::bounding_box(
|
|
|
|
|
|
#ifdef IGL_STATIC_LIBRARY
|
|
|
// Explicit template instantiation
|
|
|
-template void igl::bounding_box<Eigen::Matrix<double, -1, 3, 0, -1, 3>, Eigen::Matrix<double, -1, 3, 0, -1, 3>, Eigen::Matrix<int, -1, 3, 0, -1, 3> >(Eigen::PlainObjectBase<Eigen::Matrix<double, -1, 3, 0, -1, 3> > const&, Eigen::PlainObjectBase<Eigen::Matrix<double, -1, 3, 0, -1, 3> >&, Eigen::PlainObjectBase<Eigen::Matrix<int, -1, 3, 0, -1, 3> >&);
|
|
|
-template void igl::bounding_box<Eigen::Matrix<double, -1, -1, 0, -1, -1>, Eigen::Matrix<double, -1, -1, 0, -1, -1>, Eigen::Matrix<int, -1, -1, 0, -1, -1> >(Eigen::PlainObjectBase<Eigen::Matrix<double, -1, -1, 0, -1, -1> > const&, Eigen::PlainObjectBase<Eigen::Matrix<double, -1, -1, 0, -1, -1> >&, Eigen::PlainObjectBase<Eigen::Matrix<int, -1, -1, 0, -1, -1> >&);
|
|
|
+// generated by autoexplicit.sh
|
|
|
+template void igl::bounding_box<Eigen::Matrix<double, -1, -1, 0, -1, -1>, Eigen::Matrix<double, -1, 2, 0, -1, 2>, Eigen::Matrix<int, -1, -1, 0, -1, -1> >(Eigen::MatrixBase<Eigen::Matrix<double, -1, -1, 0, -1, -1> > const&, Eigen::PlainObjectBase<Eigen::Matrix<double, -1, 2, 0, -1, 2> >&, Eigen::PlainObjectBase<Eigen::Matrix<int, -1, -1, 0, -1, -1> >&);
|
|
|
+// generated by autoexplicit.sh
|
|
|
+template void igl::bounding_box<Eigen::Matrix<double, -1, -1, 1, -1, -1>, Eigen::Matrix<double, -1, 2, 0, -1, 2>, Eigen::Matrix<int, -1, -1, 0, -1, -1> >(Eigen::MatrixBase<Eigen::Matrix<double, -1, -1, 1, -1, -1> > const&, Eigen::Matrix<double, -1, -1, 1, -1, -1>::Scalar, Eigen::PlainObjectBase<Eigen::Matrix<double, -1, 2, 0, -1, 2> >&, Eigen::PlainObjectBase<Eigen::Matrix<int, -1, -1, 0, -1, -1> >&);
|
|
|
+// generated by autoexplicit.sh
|
|
|
+template void igl::bounding_box<Eigen::Matrix<double, -1, -1, 1, -1, -1>, Eigen::Matrix<double, -1, 2, 0, -1, 2>, Eigen::Matrix<int, -1, -1, 0, -1, -1> >(Eigen::MatrixBase<Eigen::Matrix<double, -1, -1, 1, -1, -1> > const&, Eigen::PlainObjectBase<Eigen::Matrix<double, -1, 2, 0, -1, 2> >&, Eigen::PlainObjectBase<Eigen::Matrix<int, -1, -1, 0, -1, -1> >&);
|
|
|
+template void igl::bounding_box<Eigen::Matrix<double, -1, 3, 0, -1, 3>, Eigen::Matrix<double, -1, 3, 0, -1, 3>, Eigen::Matrix<int, -1, 3, 0, -1, 3> >(Eigen::MatrixBase<Eigen::Matrix<double, -1, 3, 0, -1, 3> > const&, Eigen::PlainObjectBase<Eigen::Matrix<double, -1, 3, 0, -1, 3> >&, Eigen::PlainObjectBase<Eigen::Matrix<int, -1, 3, 0, -1, 3> >&);
|
|
|
+template void igl::bounding_box<Eigen::Matrix<double, -1, -1, 0, -1, -1>, Eigen::Matrix<double, -1, -1, 0, -1, -1>, Eigen::Matrix<int, -1, -1, 0, -1, -1> >(Eigen::MatrixBase<Eigen::Matrix<double, -1, -1, 0, -1, -1> > const&, Eigen::PlainObjectBase<Eigen::Matrix<double, -1, -1, 0, -1, -1> >&, Eigen::PlainObjectBase<Eigen::Matrix<int, -1, -1, 0, -1, -1> >&);
|
|
|
#endif
|