#include "intersect_with_half_space.h" #include "mesh_boolean.h" #include "half_space_box.h" template < typename DerivedV, typename DerivedF, typename Derivedp, typename Derivedn, typename DerivedVC, typename DerivedFC, typename DerivedJ> IGL_INLINE bool igl::copyleft::cgal::intersect_with_half_space( const Eigen::MatrixBase & V, const Eigen::MatrixBase & F, const Eigen::MatrixBase & p, const Eigen::MatrixBase & n, Eigen::PlainObjectBase & VC, Eigen::PlainObjectBase & FC, Eigen::PlainObjectBase & J) { typedef CGAL::Plane_3 Plane; typedef CGAL::Point_3 Point; typedef CGAL::Vector_3 Vector; Plane P(Point(p(0),p(1),p(2)),Vector(n(0),n(1),n(2))); return intersect_with_half_space(V,F,P,VC,FC,J); } template < typename DerivedV, typename DerivedF, typename Derivedequ, typename DerivedVC, typename DerivedFC, typename DerivedJ> IGL_INLINE bool igl::copyleft::cgal::intersect_with_half_space( const Eigen::MatrixBase & V, const Eigen::MatrixBase & F, const Eigen::MatrixBase & equ, Eigen::PlainObjectBase & VC, Eigen::PlainObjectBase & FC, Eigen::PlainObjectBase & J) { typedef CGAL::Plane_3 Plane; Plane P(equ(0),equ(1),equ(2),equ(3)); return intersect_with_half_space(V,F,P,VC,FC,J); } template < typename DerivedV, typename DerivedF, typename DerivedVC, typename DerivedFC, typename DerivedJ> IGL_INLINE bool igl::copyleft::cgal::intersect_with_half_space( const Eigen::MatrixBase & V, const Eigen::MatrixBase & F, const CGAL::Plane_3 & P, Eigen::PlainObjectBase & VC, Eigen::PlainObjectBase & FC, Eigen::PlainObjectBase & J) { Eigen::Matrix BV; Eigen::Matrix BF; half_space_box(P,V,BV,BF); // Disturbingly, (BV,BF) must be first argument const bool ret = mesh_boolean(BV,BF,V,F,MESH_BOOLEAN_TYPE_INTERSECT,VC,FC,J); // But now J is wrong... std::for_each( J.data(), J.data()+J.size(), [&BF,&F](typename DerivedJ::Scalar & j) {j = (j, Eigen::Matrix, Eigen::Matrix, Eigen::Matrix, Eigen::Matrix, -1, -1, 1, -1, -1>, Eigen::Matrix, Eigen::Matrix >(Eigen::MatrixBase > const&, Eigen::MatrixBase > const&, Eigen::MatrixBase > const&, Eigen::MatrixBase > const&, Eigen::PlainObjectBase, -1, -1, 1, -1, -1> >&, Eigen::PlainObjectBase >&, Eigen::PlainObjectBase >&); // generated by autoexplicit.sh template bool igl::copyleft::cgal::intersect_with_half_space, Eigen::Matrix, Eigen::Matrix, Eigen::CwiseUnaryOp, Eigen::Matrix const>, Eigen::Matrix, -1, -1, 1, -1, -1>, Eigen::Matrix, Eigen::Matrix >(Eigen::MatrixBase > const&, Eigen::MatrixBase > const&, Eigen::MatrixBase > const&, Eigen::MatrixBase, Eigen::Matrix const> > const&, Eigen::PlainObjectBase, -1, -1, 1, -1, -1> >&, Eigen::PlainObjectBase >&, Eigen::PlainObjectBase >&); // generated by autoexplicit.sh template bool igl::copyleft::cgal::intersect_with_half_space, Eigen::Matrix, Eigen::Matrix, Eigen::Matrix, Eigen::Matrix, -1, -1, 1, -1, -1>, Eigen::Matrix, Eigen::Matrix >(Eigen::MatrixBase > const&, Eigen::MatrixBase > const&, Eigen::MatrixBase > const&, Eigen::MatrixBase > const&, Eigen::PlainObjectBase, -1, -1, 1, -1, -1> >&, Eigen::PlainObjectBase >&, Eigen::PlainObjectBase >&); // generated by autoexplicit.sh template bool igl::copyleft::cgal::intersect_with_half_space, Eigen::Matrix, Eigen::Matrix, Eigen::CwiseUnaryOp, Eigen::Matrix const>, Eigen::Matrix, -1, -1, 1, -1, -1>, Eigen::Matrix, Eigen::Matrix >(Eigen::MatrixBase > const&, Eigen::MatrixBase > const&, Eigen::MatrixBase > const&, Eigen::MatrixBase, Eigen::Matrix const> > const&, Eigen::PlainObjectBase, -1, -1, 1, -1, -1> >&, Eigen::PlainObjectBase >&, Eigen::PlainObjectBase >&); #endif