#ifndef IGL_COPYLEFT_CGAL_HALF_SPACE_BOX_H #define IGL_COPYLEFT_CGAL_HALF_SPACE_BOX_H #include "../../igl_inline.h" #include #include #include namespace igl { namespace copyleft { namespace cgal { // Construct a mesh of box (BV,BF) so that it contains the intersection of // the half-space under the plane (P) and the bounding box of V, and does not // contain any of the half-space above (P). // // Inputs: // P plane so that normal points away from half-space // V #V by 3 list of vertex positions // Outputs: // BV #BV by 3 list of box vertex positions // BF #BF b3 list of box triangle indices into BV template IGL_INLINE void half_space_box( const CGAL::Plane_3 & P, const Eigen::MatrixBase & V, Eigen::Matrix & BV, Eigen::Matrix & BF); // Inputs: // p 3d point on plane // n 3d vector of normal of plane pointing away from inside // V #V by 3 list of vertex positions // Outputs: // BV #BV by 3 list of box vertex positions // BF #BF b3 list of box triangle indices into BV template IGL_INLINE void half_space_box( const Eigen::MatrixBase & p, const Eigen::MatrixBase & n, const Eigen::MatrixBase & V, Eigen::Matrix & BV, Eigen::Matrix & BF); // Inputs: // equ plane equation: a*x+b*y+c*z + d = 0 // V #V by 3 list of vertex positions // Outputs: // BV #BV by 3 list of box vertex positions // BF #BF b3 list of box triangle indices into BV template IGL_INLINE void half_space_box( const Eigen::MatrixBase & equ, const Eigen::MatrixBase & V, Eigen::Matrix & BV, Eigen::Matrix & BF); } } } #ifndef IGL_STATIC_LIBRARY # include "half_space_box.cpp" #endif #endif