Download vendor/libigl/include/igl/copyleft/cgal/coplanar.cpp from AVSim/simulation-package: direct link, hf CLI and curl.
- Browser
- Download file 1.21 kB
-
https://huggingface.co/datasets/AVSim/simulation-package/resolve/main/vendor/libigl/include/igl/copyleft/cgal/coplanar.cpp
- Command line
-
hf download hf://datasets/AVSim/simulation-package/vendor/libigl/include/igl/copyleft/cgal/coplanar.cpp
-
curl -L -o coplanar.cpp https://huggingface.co/datasets/AVSim/simulation-package/resolve/main/vendor/libigl/include/igl/copyleft/cgal/coplanar.cpp
1.21 kB
| template <typename DerivedV> | |
| IGL_INLINE bool igl::copyleft::cgal::coplanar( | |
| const Eigen::MatrixBase<DerivedV> & V) | |
| { | |
| // 3 points in 3D are always coplanar | |
| if(V.rows() < 4){ return true; } | |
| // spanning points found so far | |
| std::vector<CGAL::Point_3<CGAL::Epick> > p; | |
| for(int i = 0;i<V.rows();i++) | |
| { | |
| const CGAL::Point_3<CGAL::Epick> pi(V(i,0), V(i,1), V(i,2)); | |
| switch(p.size()) | |
| { | |
| case 0: | |
| p.push_back(pi); | |
| break; | |
| case 1: | |
| if(p[0] != pi) | |
| { | |
| p.push_back(pi); | |
| } | |
| break; | |
| case 2: | |
| if(!CGAL::collinear(p[0],p[1],pi)) | |
| { | |
| p.push_back(pi); | |
| } | |
| break; | |
| case 3: | |
| if(!CGAL::coplanar(p[0],p[1],p[2],pi)) | |
| { | |
| return false; | |
| } | |
| break; | |
| } | |
| } | |
| return true; | |
| } | |
| // Explicit template instantiation | |
| // generated by autoexplicit.sh | |
| template bool igl::copyleft::cgal::coplanar<Eigen::Matrix<double, -1, 3, 0, -1, 3> >(Eigen::MatrixBase<Eigen::Matrix<double, -1, 3, 0, -1, 3> > const&); | |