123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263 |
- #ifndef IGL_COPYLEFT_CGAL_HALF_SPACE_BOX_H
- #define IGL_COPYLEFT_CGAL_HALF_SPACE_BOX_H
- #include "../../igl_inline.h"
- #include <Eigen/Core>
- #include <CGAL/Exact_predicates_exact_constructions_kernel.h>
- #include <CGAL/Plane_3.h>
- 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 <typename DerivedV>
- IGL_INLINE void half_space_box(
- const CGAL::Plane_3<CGAL::Epeck> & P,
- const Eigen::PlainObjectBase<DerivedV> & V,
- Eigen::Matrix<CGAL::Epeck::FT,8,3> & BV,
- Eigen::Matrix<int,12,3> & 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 <typename Derivedp, typename Derivedn, typename DerivedV>
- IGL_INLINE void half_space_box(
- const Eigen::PlainObjectBase<Derivedp> & p,
- const Eigen::PlainObjectBase<Derivedn> & n,
- const Eigen::PlainObjectBase<DerivedV> & V,
- Eigen::Matrix<CGAL::Epeck::FT,8,3> & BV,
- Eigen::Matrix<int,12,3> & 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 <typename Derivedequ, typename DerivedV>
- IGL_INLINE void half_space_box(
- const Eigen::PlainObjectBase<Derivedequ> & equ,
- const Eigen::PlainObjectBase<DerivedV> & V,
- Eigen::Matrix<CGAL::Epeck::FT,8,3> & BV,
- Eigen::Matrix<int,12,3> & BF);
- }
- }
- }
- #ifndef IGL_STATIC_LIBRARY
- # include "half_space_box.cpp"
- #endif
- #endif
|