فهرست منبع

delete everything but 101

Alec Jacobson 2 سال پیش
والد
کامیت
e3283e29b7
100فایلهای تغییر یافته به همراه232 افزوده شده و 8976 حذف شده
  1. 0 49
      cmake/igl/igl_add_test.cmake
  2. 0 19
      cmake/libigl.cmake
  3. 0 175
      include/igl/copyleft/cgal/BinaryWindingNumberOperations.h
  4. 0 187
      include/igl/copyleft/cgal/CSGTree.h
  5. 0 48
      include/igl/copyleft/cgal/RemeshSelfIntersectionsParam.h
  6. 0 947
      include/igl/copyleft/cgal/SelfIntersectMesh.h
  7. 0 56
      include/igl/copyleft/cgal/assign.h
  8. 0 109
      include/igl/copyleft/cgal/assign_scalar.h
  9. 0 46
      include/igl/copyleft/cgal/cell_adjacency.h
  10. 0 158
      include/igl/copyleft/cgal/closest_facet.h
  11. 0 45
      include/igl/copyleft/cgal/complex_to_mesh.h
  12. 0 56
      include/igl/copyleft/cgal/component_inside_component.h
  13. 0 47
      include/igl/copyleft/cgal/convex_hull.h
  14. 0 25
      include/igl/copyleft/cgal/coplanar.h
  15. 0 43
      include/igl/copyleft/cgal/delaunay_triangulation.h
  16. 0 72
      include/igl/copyleft/cgal/extract_cells.h
  17. 0 63
      include/igl/copyleft/cgal/extract_cells_single_component.h
  18. 0 72
      include/igl/copyleft/cgal/extract_feature.h
  19. 0 61
      include/igl/copyleft/cgal/fast_winding_number.h
  20. 0 53
      include/igl/copyleft/cgal/half_space_box.h
  21. 0 60
      include/igl/copyleft/cgal/hausdorff.h
  22. 0 42
      include/igl/copyleft/cgal/incircle.h
  23. 0 58
      include/igl/copyleft/cgal/insert_into_cdt.h
  24. 0 45
      include/igl/copyleft/cgal/insphere.h
  25. 0 77
      include/igl/copyleft/cgal/intersect_other.h
  26. 0 81
      include/igl/copyleft/cgal/intersect_with_half_space.h
  27. 0 43
      include/igl/copyleft/cgal/lexicographic_triangulation.h
  28. 0 192
      include/igl/copyleft/cgal/mesh_boolean.h
  29. 0 35
      include/igl/copyleft/cgal/mesh_boolean_type_to_funcs.h
  30. 0 41
      include/igl/copyleft/cgal/mesh_to_cgal_triangle_list.h
  31. 0 42
      include/igl/copyleft/cgal/mesh_to_polyhedron.h
  32. 0 99
      include/igl/copyleft/cgal/minkowski_sum.h
  33. 0 77
      include/igl/copyleft/cgal/order_facets_around_edge.h
  34. 0 104
      include/igl/copyleft/cgal/order_facets_around_edges.h
  35. 0 40
      include/igl/copyleft/cgal/orient2D.h
  36. 0 42
      include/igl/copyleft/cgal/orient3D.h
  37. 0 56
      include/igl/copyleft/cgal/outer_edge.h
  38. 0 72
      include/igl/copyleft/cgal/outer_facet.h
  39. 0 49
      include/igl/copyleft/cgal/outer_hull.h
  40. 0 57
      include/igl/copyleft/cgal/outer_hull_legacy.h
  41. 0 52
      include/igl/copyleft/cgal/outer_vertex.h
  42. 0 45
      include/igl/copyleft/cgal/peel_outer_hull_layers.h
  43. 0 29
      include/igl/copyleft/cgal/peel_winding_number_layers.h
  44. 0 39
      include/igl/copyleft/cgal/piecewise_constant_winding_number.h
  45. 0 68
      include/igl/copyleft/cgal/point_areas.h
  46. 0 110
      include/igl/copyleft/cgal/point_mesh_squared_distance.h
  47. 0 41
      include/igl/copyleft/cgal/point_segment_squared_distance.h
  48. 0 46
      include/igl/copyleft/cgal/point_solid_signed_squared_distance.h
  49. 0 43
      include/igl/copyleft/cgal/point_triangle_squared_distance.h
  50. 0 64
      include/igl/copyleft/cgal/points_inside_component.h
  51. 0 40
      include/igl/copyleft/cgal/polyhedron_to_mesh.h
  52. 0 60
      include/igl/copyleft/cgal/projected_cdt.h
  53. 0 44
      include/igl/copyleft/cgal/projected_delaunay.h
  54. 0 95
      include/igl/copyleft/cgal/propagate_winding_numbers.h
  55. 0 42
      include/igl/copyleft/cgal/read_triangle_mesh.h
  56. 0 58
      include/igl/copyleft/cgal/relabel_small_immersed_cells.h
  57. 0 72
      include/igl/copyleft/cgal/remesh_intersections.h
  58. 0 79
      include/igl/copyleft/cgal/remesh_self_intersections.h
  59. 0 49
      include/igl/copyleft/cgal/resolve_intersections.h
  60. 0 37
      include/igl/copyleft/cgal/row_to_point.h
  61. 0 43
      include/igl/copyleft/cgal/segment_segment_squared_distance.h
  62. 0 53
      include/igl/copyleft/cgal/signed_distance_isosurface.h
  63. 0 49
      include/igl/copyleft/cgal/snap_rounding.h
  64. 0 43
      include/igl/copyleft/cgal/string_to_mesh_boolean_type.h
  65. 0 54
      include/igl/copyleft/cgal/subdivide_segments.h
  66. 0 62
      include/igl/copyleft/cgal/submesh_aabb_tree.h
  67. 0 43
      include/igl/copyleft/cgal/triangle_triangle_squared_distance.h
  68. 0 55
      include/igl/copyleft/cgal/triangulate.h
  69. 0 61
      include/igl/copyleft/cgal/trim_with_solid.h
  70. 0 84
      include/igl/copyleft/cgal/wire_mesh.h
  71. 0 54
      include/igl/copyleft/comiso/frame_field.h
  72. 0 112
      include/igl/copyleft/comiso/miq.h
  73. 0 68
      include/igl/copyleft/comiso/nrosy.h
  74. 0 118
      include/igl/copyleft/marching_cubes.h
  75. 0 917
      include/igl/copyleft/marching_cubes_tables.h
  76. 0 38
      include/igl/copyleft/opengl2/render_to_tga.h
  77. 0 31
      include/igl/copyleft/opengl2/texture_from_tga.h
  78. 0 106
      include/igl/copyleft/opengl2/tga.h
  79. 0 42
      include/igl/copyleft/progressive_hulls.h
  80. 0 53
      include/igl/copyleft/progressive_hulls_cost_and_placement.h
  81. 0 46
      include/igl/copyleft/quadprog.h
  82. 0 72
      include/igl/copyleft/tetgen/cdt.h
  83. 0 66
      include/igl/copyleft/tetgen/mesh_to_tetgenio.h
  84. 0 70
      include/igl/copyleft/tetgen/mesh_with_skeleton.h
  85. 0 60
      include/igl/copyleft/tetgen/read_into_tetgenio.h
  86. 0 81
      include/igl/copyleft/tetgen/tetgenio_to_tetmesh.h
  87. 0 151
      include/igl/copyleft/tetgen/tetrahedralize.h
  88. 0 86
      include/igl/embree/EmbreeDevice.h
  89. 0 181
      include/igl/embree/EmbreeIntersector.h
  90. 0 262
      include/igl/embree/EmbreeRenderer.h
  91. 0 61
      include/igl/embree/ambient_occlusion.h
  92. 0 45
      include/igl/embree/bone_heat.h
  93. 0 62
      include/igl/embree/bone_visible.h
  94. 0 49
      include/igl/embree/line_mesh_intersection.h
  95. 0 71
      include/igl/embree/reorient_facets_raycast.h
  96. 0 61
      include/igl/embree/shape_diameter_function.h
  97. 0 71
      include/igl/embree/unproject_in_mesh.h
  98. 0 58
      include/igl/embree/unproject_onto_mesh.h
  99. 232 0
      include/igl/list_to_matrix.cpp
  100. 0 581
      include/igl/matlab/MatlabWorkspace.h

+ 0 - 49
cmake/igl/igl_add_test.cmake

@@ -1,51 +1,2 @@
 function(igl_add_test module_name)
-    if(NOT LIBIGL_BUILD_TESTS)
-        return()
-    endif()
-
-    if(NOT TARGET ${module_name})
-        message(FATAL_ERROR "'${module_name}' is not a CMake target")
-    endif()
-
-    # Check if category is `copyleft` or `restricted`
-    if(${module_name} MATCHES "^igl_copyleft")
-        set(suffix "_copyleft")
-    elseif(${module_name} MATCHES "^igl_restricted")
-        set(suffix "_restricted")
-    else()
-        set(suffix "")
-    endif()
-
-    # Create test executable
-    add_executable(test_${module_name}
-        ${libigl_SOURCE_DIR}/tests/main.cpp
-        ${libigl_SOURCE_DIR}/tests/test_common.h
-        ${ARGN}
-    )
-
-    # Include headers
-    target_include_directories(test_${module_name} PUBLIC ${libigl_SOURCE_DIR}/tests)
-
-    # Compile definitions
-    target_compile_definitions(test_${module_name} PUBLIC CATCH_CONFIG_ENABLE_BENCHMARKING)
-
-    # Dependencies
-    include(catch2)
-    include(libigl_tests_data)
-    target_link_libraries(test_${module_name} PUBLIC
-        ${module_name}
-        igl::tests_data
-        Catch2::Catch2
-    )
-
-    # IDE Folder
-    set_target_properties(test_${module_name} PROPERTIES FOLDER Libigl_Tests)
-
-    # Output directory
-    set_target_properties(test_${module_name} PROPERTIES RUNTIME_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}/tests")
-
-    # Register tests
-    FetchContent_GetProperties(catch2)
-    include("${catch2_SOURCE_DIR}/contrib/Catch.cmake")
-    catch_discover_tests(test_${module_name})
 endfunction()

+ 0 - 19
cmake/libigl.cmake

@@ -13,22 +13,3 @@ include(igl_windows)
 
 # Libigl permissive modules
 igl_include(core)
-igl_include_optional(embree)
-igl_include_optional(opengl)
-igl_include_optional(glfw)
-igl_include_optional(imgui)
-igl_include_optional(predicates)
-igl_include_optional(stb)
-igl_include_optional(spectra)
-igl_include_optional(xml)
-
-# Libigl copyleft modules
-igl_include_optional(copyleft core)
-igl_include_optional(copyleft cgal)
-igl_include_optional(copyleft comiso)
-igl_include_optional(copyleft tetgen)
-
-# Libigl restricted modules
-igl_include_optional(restricted matlab)
-igl_include_optional(restricted mosek)
-igl_include_optional(restricted triangle)

+ 0 - 175
include/igl/copyleft/cgal/BinaryWindingNumberOperations.h

@@ -1,175 +0,0 @@
-// This file is part of libigl, a simple c++ geometry processing library.
-// 
-// Copyright (C) 2015 Qingnan Zhou <[email protected]>
-// 
-// This Source Code Form is subject to the terms of the Mozilla Public License 
-// v. 2.0. If a copy of the MPL was not distributed with this file, You can 
-// obtain one at http://mozilla.org/MPL/2.0/.
-//
-#ifndef IGL_COPYLEFT_CGAL_BINARY_WINDING_NUMBER_OPERATIONS_H
-#define IGL_COPYLEFT_CGAL_BINARY_WINDING_NUMBER_OPERATIONS_H
-
-#include <stdexcept>
-#include "../../igl_inline.h"
-#include "../../MeshBooleanType.h"
-#include <Eigen/Core>
-
-// TODO: This is not written according to libigl style. These should be
-// function handles.
-//
-// Why is this templated on DerivedW
-//
-// These are all generalized to n-ary operations
-namespace igl
-{
-  namespace copyleft
-  {
-    namespace cgal
-    {
-      /// Binary winding number operations
-      template <igl::MeshBooleanType Op>
-      class BinaryWindingNumberOperations {
-        public:
-          template<typename DerivedW>
-            typename DerivedW::Scalar operator()(
-                const Eigen::PlainObjectBase<DerivedW>& /*win_nums*/) const {
-              throw (std::runtime_error("not implemented!"));
-            }
-      };
-
-      /// A ∪ B ∪ ... ∪ Z
-      template <>
-      class BinaryWindingNumberOperations<MESH_BOOLEAN_TYPE_UNION> {
-        public:
-          template<typename DerivedW>
-          typename DerivedW::Scalar operator()(
-              const Eigen::PlainObjectBase<DerivedW>& win_nums) const 
-          {
-            for(int i = 0;i<win_nums.size();i++)
-            {
-              if(win_nums(i) > 0) return true;
-            }
-            return false;
-          }
-      };
-
-      /// A ∩ B ∩ ... ∩ Z
-      template <>
-      class BinaryWindingNumberOperations<MESH_BOOLEAN_TYPE_INTERSECT> {
-        public:
-          template<typename DerivedW>
-          typename DerivedW::Scalar operator()(
-              const Eigen::PlainObjectBase<DerivedW>& win_nums) const 
-          {
-            for(int i = 0;i<win_nums.size();i++)
-            {
-              if(win_nums(i)<=0) return false;
-            }
-            return true;
-          }
-      };
-
-      /// A \ B \ ... \ Z = A \ (B ∪ ... ∪ Z)
-      template <>
-      class BinaryWindingNumberOperations<MESH_BOOLEAN_TYPE_MINUS> {
-        public:
-          template<typename DerivedW>
-          typename DerivedW::Scalar operator()(
-              const Eigen::PlainObjectBase<DerivedW>& win_nums) const 
-          {
-            assert(win_nums.size()>1);
-            // Union of objects 1 through n-1
-            bool union_rest = false;
-            for(int i = 1;i<win_nums.size();i++)
-            {
-              union_rest = union_rest || win_nums(i) > 0;
-              if(union_rest) break;
-            }
-            // Must be in object 0 and not in union of objects 1 through n-1
-            return win_nums(0) > 0 && !union_rest;
-          }
-      };
-
-      /// A ∆ B ∆ ... ∆ Z  (equivalent to set inside odd number of objects)
-      template <>
-      class BinaryWindingNumberOperations<MESH_BOOLEAN_TYPE_XOR> {
-        public:
-          template<typename DerivedW>
-          typename DerivedW::Scalar operator()(
-              const Eigen::PlainObjectBase<DerivedW>& win_nums) const 
-          {
-            // If inside an odd number of objects
-            int count = 0;
-            for(int i = 0;i<win_nums.size();i++)
-            {
-              if(win_nums(i) > 0) count++;
-            }
-            return count % 2 == 1;
-          }
-      };
-
-      /// Resolve all intersections without removing non-coplanar faces
-      template <>
-      class BinaryWindingNumberOperations<MESH_BOOLEAN_TYPE_RESOLVE> {
-        public:
-          template<typename DerivedW>
-            typename DerivedW::Scalar operator()(
-                const Eigen::PlainObjectBase<DerivedW>& /*win_nums*/) const {
-              return true;
-            }
-      };
-
-      typedef BinaryWindingNumberOperations<MESH_BOOLEAN_TYPE_UNION> BinaryUnion;
-      typedef BinaryWindingNumberOperations<MESH_BOOLEAN_TYPE_INTERSECT> BinaryIntersect;
-      typedef BinaryWindingNumberOperations<MESH_BOOLEAN_TYPE_MINUS> BinaryMinus;
-      typedef BinaryWindingNumberOperations<MESH_BOOLEAN_TYPE_XOR> BinaryXor;
-      typedef BinaryWindingNumberOperations<MESH_BOOLEAN_TYPE_RESOLVE> BinaryResolve;
-
-      /// Types of Keep policies
-      enum KeeperType {
-        /// Keep only inside
-        KEEP_INSIDE,
-        /// Keep everything
-        KEEP_ALL
-      };
-
-      /// Filter winding numbers according to keep policy
-      template<KeeperType T>
-      class WindingNumberFilter {
-        public:
-          template<typename DerivedW>
-            short operator()(
-                const Eigen::PlainObjectBase<DerivedW>& /*win_nums*/) const {
-              throw std::runtime_error("Not implemented");
-            }
-      };
-
-      /// Keep inside policy
-      template<>
-      class WindingNumberFilter<KEEP_INSIDE> {
-        public:
-          template<typename T>
-          short operator()(T out_w, T in_w) const {
-            if (in_w > 0 && out_w <= 0) return 1;
-            else if (in_w <= 0 && out_w > 0) return -1;
-            else return 0;
-          }
-      };
-
-      /// Keep all policy
-      template<>
-      class WindingNumberFilter<KEEP_ALL> {
-        public:
-          template<typename T>
-            short operator()(T /*out_w*/, T /*in_w*/) const {
-              return 1;
-            }
-      };
-
-      using KeepInside = WindingNumberFilter<KEEP_INSIDE>;
-      using KeepAll = WindingNumberFilter<KEEP_ALL>;
-    }
-  }
-}
-
-#endif

+ 0 - 187
include/igl/copyleft/cgal/CSGTree.h

@@ -1,187 +0,0 @@
-// This file is part of libigl, a simple c++ geometry processing library.
-// 
-// Copyright (C) 2015 Alec Jacobson <[email protected]>
-// 
-// This Source Code Form is subject to the terms of the Mozilla Public License 
-// v. 2.0. If a copy of the MPL was not distributed with this file, You can 
-// obtain one at http://mozilla.org/MPL/2.0/.
-#ifndef IGL_COPYLEFT_CGAL_CSG_TREE_H
-#define IGL_COPYLEFT_CGAL_CSG_TREE_H
-
-#include "../../MeshBooleanType.h"
-#include "string_to_mesh_boolean_type.h"
-#include "mesh_boolean.h"
-#include <CGAL/Exact_predicates_exact_constructions_kernel.h>
-#include <CGAL/number_utils.h>
-
-namespace igl
-{
-  namespace copyleft
-  {
-    namespace cgal
-    {
-      /// Class for defining and computing a constructive solid geometry result
-      /// out of a tree of boolean operations on "solid" triangle meshes.
-      ///
-      class CSGTree
-      {
-        public:
-          typedef CGAL::Epeck::FT ExactScalar;
-          //typedef Eigen::PlainObjectBase<DerivedF> POBF;
-          typedef Eigen::MatrixXi POBF;
-          typedef Eigen::Matrix<ExactScalar,Eigen::Dynamic,3> MatrixX3E;
-          typedef Eigen::VectorXi VectorJ;
-        private:
-          /// Resulting mesh vertex positions
-          MatrixX3E m_V;
-          /// Resulting mesh face indices into V
-          POBF m_F;
-          /// Birth index of each face in resulting mesh. Birth index is the index
-          VectorJ m_J;
-          /// Number of birth faces in A + those in B. I.e. sum of original "leaf"
-          /// faces involved in result.
-          size_t m_number_of_birth_faces;
-        public:
-          CSGTree()
-          {
-          }
-          //typedef Eigen::MatrixXd MatrixX3E;
-          //typedef Eigen::MatrixXi POBF;
-          // http://stackoverflow.com/a/3279550/148668
-          CSGTree(const CSGTree & other)
-            :
-            // copy things
-            m_V(other.m_V),
-            // This is an issue if m_F is templated
-            // https://forum.kde.org/viewtopic.php?f=74&t=128414
-            m_F(other.m_F),
-            m_J(other.m_J),
-            m_number_of_birth_faces(other.m_number_of_birth_faces)
-          {
-          }
-          // copy-swap idiom
-          friend void swap(CSGTree& first, CSGTree& second)
-          {
-            using std::swap;
-            // swap things
-            swap(first.m_V,second.m_V);
-            // This is an issue if m_F is templated, similar to
-            // https://forum.kde.org/viewtopic.php?f=74&t=128414
-            swap(first.m_F,second.m_F);
-            swap(first.m_J,second.m_J);
-            swap(first.m_number_of_birth_faces,second.m_number_of_birth_faces);
-          }
-          // Pass-by-value (aka copy)
-          CSGTree& operator=(CSGTree other)
-          {
-            swap(*this,other);
-            return *this;
-          }
-          CSGTree(CSGTree&& other):
-            // initialize via default constructor
-            CSGTree() 
-          {
-            swap(*this,other);
-          }
-          /// Construct and compute a boolean operation on existing CSGTree nodes.
-          ///
-          /// @param[in] A  Solid result of previous CSG operation (or identity, see below)
-          /// @param[in] B  Solid result of previous CSG operation (or identity, see below)
-          /// @param[in] type  type of mesh boolean to compute 
-          CSGTree(
-            const CSGTree & A,
-            const CSGTree & B,
-            const MeshBooleanType & type)
-          {
-            // conduct boolean operation
-            mesh_boolean(A.V(),A.F(),B.V(),B.F(),type,m_V,m_F,m_J);
-            // reindex m_J
-            std::for_each(m_J.data(),m_J.data()+m_J.size(),
-              [&](typename VectorJ::Scalar & j) -> void
-              {
-                if(j < A.F().rows())
-                {
-                  j = A.J()(j);
-                }else
-                {
-                  assert(j<(A.F().rows()+B.F().rows()));
-                  j = A.number_of_birth_faces()+(B.J()(j-A.F().rows()));
-                }
-              });
-            m_number_of_birth_faces = 
-              A.number_of_birth_faces() + B.number_of_birth_faces();
-          }
-          /// \overload
-          CSGTree(
-            const CSGTree & A,
-            const CSGTree & B,
-            const std::string & s):
-            CSGTree(A,B,string_to_mesh_boolean_type(s))
-          {
-            // do nothing (all done in constructor).
-          }
-          /// "Leaf" node with identity operation on assumed "solid" mesh (V,F)
-          ///
-          /// @param[in] V  #V by 3 list of mesh vertices (in any precision, will be
-          ///     converted to exact)
-          /// @param[in] F  #F by 3 list of mesh face indices into V
-          template <typename DerivedV>
-          CSGTree(const Eigen::PlainObjectBase<DerivedV> & V, const POBF & F)//:
-          // Possible Eigen bug:
-          // https://forum.kde.org/viewtopic.php?f=74&t=128414
-            //m_V(V.template cast<ExactScalar>()),m_F(F)
-          {
-            m_V = V.template cast<ExactScalar>();
-            m_F = F;
-            // number of faces
-            m_number_of_birth_faces = m_F.rows();
-            // identity birth index
-            m_J = VectorJ::LinSpaced(
-              m_number_of_birth_faces,0,m_number_of_birth_faces-1);
-          }
-          // Returns reference to resulting mesh vertices m_V in exact scalar
-          // representation
-          const MatrixX3E & V() const
-          {
-            return m_V;
-          }
-          // Returns mesh vertices in the desired output type, casting when
-          // appropriate to floating precision.
-          template <typename DerivedV>
-          DerivedV cast_V() const
-          {
-            DerivedV dV;
-            dV.resize(m_V.rows(),m_V.cols());
-            for(int i = 0;i<m_V.rows();i++)
-            {
-              for(int j = 0;j<m_V.cols();j++)
-              {
-                dV(i,j) = CGAL::to_double(m_V(i,j));
-              }
-            }
-            return dV;
-          }
-          // Returns reference to resulting mesh faces m_F
-          const POBF & F() const
-          {
-            return m_F;
-          }
-          // Returns reference to "birth parents" indices into [F1;F2;...;Fn]
-          // where F1, ... , Fn are the face lists of the leaf ("original") input
-          // meshes.
-          const VectorJ & J() const
-          {
-            return m_J;
-          }
-          // The number of leaf faces = #F1 + #F2 + ... + #Fn
-          const size_t & number_of_birth_faces() const
-          {
-            return m_number_of_birth_faces;
-          }
-      };
-    }
-  }
-}
-
-
-#endif

+ 0 - 48
include/igl/copyleft/cgal/RemeshSelfIntersectionsParam.h

@@ -1,48 +0,0 @@
-// This file is part of libigl, a simple c++ geometry processing library.
-// 
-// Copyright (C) 2015 Alec Jacobson <[email protected]>
-// 
-// This Source Code Form is subject to the terms of the Mozilla Public License 
-// v. 2.0. If a copy of the MPL was not distributed with this file, You can 
-// obtain one at http://mozilla.org/MPL/2.0/.
-#ifndef IGL_COPYLEFT_CGAL_REMESH_SELF_INTERSECTIONS_PARAM_H
-#define IGL_COPYLEFT_CGAL_REMESH_SELF_INTERSECTIONS_PARAM_H
-
-namespace igl
-{
-  namespace copyleft
-  {
-    namespace cgal
-    {
-      /// Parameters for SelfIntersectMesh, remesh_self_intersections and
-      /// remesh_intersections, and intersect_other
-      ///
-      struct RemeshSelfIntersectionsParam
-      {
-        /// avoid constructing intersections results when possible
-        bool detect_only;
-        /// return after detecting the first intersection (if first_only==true,
-        /// then detect_only should also be true)
-        bool first_only;
-        /// whether to stitch all resulting constructed elements into a
-        /// (non-manifold) mesh 
-        bool stitch_all;
-        /// whether to use slow and more precise rounding (see assign_scalar)
-        bool slow_and_more_precise_rounding;
-        inline RemeshSelfIntersectionsParam(
-          bool _detect_only=false, 
-          bool _first_only=false,
-          bool _stitch_all=false,
-          bool _slow_and_more_precise_rounding=false
-          ):
-          detect_only(_detect_only),
-          first_only(_first_only),
-          stitch_all(_stitch_all),
-          slow_and_more_precise_rounding(_slow_and_more_precise_rounding)
-        {};
-      };
-    }
-  }
-}
-
-#endif

+ 0 - 947
include/igl/copyleft/cgal/SelfIntersectMesh.h

@@ -1,947 +0,0 @@
-// This file is part of libigl, a simple c++ geometry processing library.
-// 
-// Copyright (C) 2014 Alec Jacobson <[email protected]> 
-// 
-// This Source Code Form is subject to the terms of the Mozilla Public License 
-// v. 2.0. If a copy of the MPL was not distributed with this file, You can 
-// obtain one at http://mozilla.org/MPL/2.0/.
-#ifndef IGL_COPYLEFT_CGAL_SELFINTERSECTMESH_H
-#define IGL_COPYLEFT_CGAL_SELFINTERSECTMESH_H
-
-#include "CGAL_includes.hpp"
-#include "RemeshSelfIntersectionsParam.h"
-#include "../../unique.h"
-#include "../../default_num_threads.h"
-
-#include <Eigen/Dense>
-#include <list>
-#include <map>
-#include <vector>
-#include <thread>
-#include <mutex>
-#include <cstdio>
-
-//#define IGL_SELFINTERSECTMESH_TIMING
-#ifndef IGL_FIRST_HIT_EXCEPTION
-#define IGL_FIRST_HIT_EXCEPTION 10
-#endif
-
-// The easiest way to keep track of everything is to use a class
-
-namespace igl
-{
-  namespace copyleft
-  {
-    namespace cgal
-    {
-      /// Class for computing the self-intersections of a mesh
-      ///
-      /// @tparam Kernel is a CGAL kernel like:
-      ///     CGAL::Exact_predicates_inexact_constructions_kernel
-      /// or
-      ///     CGAL::Exact_predicates_exact_constructions_kernel
-      template <
-        typename Kernel,
-        typename DerivedV,
-        typename DerivedF,
-        typename DerivedVV,
-        typename DerivedFF,
-        typename DerivedIF,
-        typename DerivedJ,
-        typename DerivedIM>
-      class SelfIntersectMesh
-      {
-        typedef
-          SelfIntersectMesh<
-          Kernel,
-          DerivedV,
-          DerivedF,
-          DerivedVV,
-          DerivedFF,
-          DerivedIF,
-          DerivedJ,
-          DerivedIM> Self;
-        public:
-          // 3D Primitives
-          typedef CGAL::Point_3<Kernel>    Point_3;
-          typedef CGAL::Segment_3<Kernel>  Segment_3;
-          typedef CGAL::Triangle_3<Kernel> Triangle_3;
-          typedef CGAL::Plane_3<Kernel>    Plane_3;
-          typedef CGAL::Tetrahedron_3<Kernel> Tetrahedron_3;
-          // 2D Primitives
-          typedef CGAL::Point_2<Kernel>    Point_2;
-          typedef CGAL::Segment_2<Kernel>  Segment_2;
-          typedef CGAL::Triangle_2<Kernel> Triangle_2;
-          // 2D Constrained Delaunay Triangulation types
-          typedef CGAL::Exact_intersections_tag Itag;
-          // Axis-align boxes for all-pairs self-intersection detection
-          typedef std::vector<Triangle_3> Triangles;
-          typedef typename Triangles::iterator TrianglesIterator;
-          typedef typename Triangles::const_iterator TrianglesConstIterator;
-          typedef
-            CGAL::Box_intersection_d::Box_with_handle_d<double,3,TrianglesIterator>
-            Box;
-
-          // Input mesh
-          const Eigen::MatrixBase<DerivedV> & V;
-          const Eigen::MatrixBase<DerivedF> & F;
-          // Number of self-intersecting triangle pairs
-          typedef typename DerivedF::Index Index;
-          Index count;
-          typedef std::vector<std::pair<Index, CGAL::Object>> ObjectList;
-          // Using a vector here makes this **not** output sensitive
-          Triangles T;
-          typedef std::vector<Index> IndexList;
-          IndexList lIF;
-          // #F-long list of faces with intersections mapping to the order in
-          // which they were first found
-          std::map<Index,ObjectList> offending;
-          // Make a short name for the edge map's key
-          typedef std::pair<Index,Index> EMK;
-          // Make a short name for the type stored at each edge, the edge map's
-          // value
-          typedef std::vector<Index> EMV;
-          // Make a short name for the edge map
-          typedef std::map<EMK,EMV> EdgeMap;
-          // Maps edges of offending faces to all incident offending faces
-          std::vector<std::pair<TrianglesIterator, TrianglesIterator> >
-              candidate_triangle_pairs;
-
-        public:
-          RemeshSelfIntersectionsParam params;
-        public:
-          /// Constructs (VV,FF) a new mesh with self-intersections of (V,F)
-          /// subdivided
-          ///
-          /// @param[in] V  #V by 3 list of vertex positions
-          /// @param[in] F  #F by 3 list of triangle indices into V
-          /// @param[in] params  parameters
-          /// @param[out] VV  #VV by 3 list of vertex positions
-          /// @param[out] FF  #FF by 3 list of triangle indices into VV
-          /// @param[out] IF  #IF by 2 list of edge indices into VV
-          /// @param[out] J  #F list of indices into FF of birth parents
-          /// @param[out] IM  #VV list of indices into V of birth parents
-          ///
-          ///
-          /// \see remesh_self_intersections.h
-          inline SelfIntersectMesh(
-              const Eigen::MatrixBase<DerivedV> & V,
-              const Eigen::MatrixBase<DerivedF> & F,
-              const RemeshSelfIntersectionsParam & params,
-              Eigen::PlainObjectBase<DerivedVV> & VV,
-              Eigen::PlainObjectBase<DerivedFF> & FF,
-              Eigen::PlainObjectBase<DerivedIF> & IF,
-              Eigen::PlainObjectBase<DerivedJ> & J,
-              Eigen::PlainObjectBase<DerivedIM> & IM);
-        private:
-          /// Helper function to mark a face as offensive
-          ///
-          /// @param[in] f  index of face in F
-          inline void mark_offensive(const Index f);
-          /// Helper function to count intersections between faces
-          ///
-          /// @param[in] fa  index of face A in F
-          /// @param[in] fb  index of face B in F
-          inline void count_intersection( const Index fa, const Index fb);
-          /// Helper function for box_intersect. Intersect two triangles A and B,
-          /// append the intersection object (point,segment,triangle) to a running
-          /// list for A and B
-          ///
-          /// @param[in] A  triangle in 3D
-          /// @param[in] B  triangle in 3D
-          /// @param[in] fa  index of A in F (and key into offending)
-          /// @param[in] fb  index of B in F (and key into offending)
-          /// @return true only if A intersects B
-          ///
-          inline bool intersect(
-              const Triangle_3 & A,
-              const Triangle_3 & B,
-              const Index fa,
-              const Index fb);
-          /// Helper function for box_intersect. In the case where A and B have
-          /// already been identified to share a vertex, then we only want to
-          /// add possible segment intersections. Assumes truly duplicate
-          /// triangles are not given as input
-          ///
-          /// @param[in] A  triangle in 3D
-          /// @param[in] B  triangle in 3D
-          /// @param[in] fa  index of A in F (and key into offending)
-          /// @param[in] fb  index of B in F (and key into offending)
-          /// @param[in] va  index of shared vertex in A (and key into offending)
-          /// @param[in] vb  index of shared vertex in B (and key into offending)
-          /// @return true if intersection (besides shared point)
-          ///
-          inline bool single_shared_vertex(
-              const Triangle_3 & A,
-              const Triangle_3 & B,
-              const Index fa,
-              const Index fb,
-              const Index va,
-              const Index vb);
-          //// Helper handling one direction
-          ///
-          /// @param[in] A  triangle in 3D
-          /// @param[in] B  triangle in 3D
-          /// @param[in] fa  index of A in F (and key into offending)
-          /// @param[in] fb  index of B in F (and key into offending)
-          /// @param[in] va  index of shared vertex in A (and key into offending)
-          /// @return true if intersection (besides shared point)
-          inline bool single_shared_vertex(
-              const Triangle_3 & A,
-              const Triangle_3 & B,
-              const Index fa,
-              const Index fb,
-              const Index va);
-          /// Helper function for box_intersect. In the case where A and B have
-          /// already been identified to share two vertices, then we only want
-          /// to add a possible coplanar (Triangle) intersection. Assumes truly
-          /// degenerate facets are not givin as input.
-          ///
-          /// @param[in] A  triangle in 3D
-          /// @param[in] B  triangle in 3D
-          /// @param[in] fa  index of A in F (and key into offending)
-          /// @param[in] fb  index of B in F (and key into offending)
-          /// @param[in] shared  list of pairs of indices of shared vertices
-          /// @return true if intersection (besides shared point)
-          inline bool double_shared_vertex(
-              const Triangle_3 & A,
-              const Triangle_3 & B,
-              const Index fa,
-              const Index fb,
-              const std::vector<std::pair<Index,Index> > shared);
-
-        public:
-          /// Callback function called during box self intersections test. Means
-          /// boxes a and b intersect. This method then checks if the triangles
-          /// in each box intersect and if so, then processes the intersections
-          ///
-          /// @param[in] a  box containing a triangle
-          /// @param[in] b  box containing a triangle
-          inline void box_intersect(const Box& a, const Box& b);
-          /// Process all of the intersecting boxes
-          inline void process_intersecting_boxes();
-        public:
-          // Getters:
-          //const IndexList& get_lIF() const{ return lIF;}
-          /// Static function that captures a SelfIntersectMesh instance to pass
-          /// to cgal.
-          /// @param[in] SIM  pointer to SelfIntersectMesh instance
-          /// @param[in] a  box containing a triangle
-          /// @param[in] b  box containing a triangle
-          static inline void box_intersect_static(
-            SelfIntersectMesh * SIM,
-            const Box &a,
-            const Box &b);
-        private:
-          std::mutex m_offending_lock;
-      };
-    }
-  }
-}
-
-// Implementation
-
-#include "mesh_to_cgal_triangle_list.h"
-#include "remesh_intersections.h"
-
-#include "../../REDRUM.h"
-#include "../../get_seconds.h"
-#include "../../C_STR.h"
-
-
-#include <functional>
-#include <algorithm>
-#include <exception>
-#include <cassert>
-#include <iostream>
-
-// References:
-// http://minregret.googlecode.com/svn/trunk/skyline/src/extern/CGAL-3.3.1/examples/Polyhedron/polyhedron_self_intersection.cpp
-// http://www.cgal.org/Manual/3.9/examples/Boolean_set_operations_2/do_intersect.cpp
-
-// Q: Should we be using CGAL::Polyhedron_3?
-// A: No! Input is just a list of unoriented triangles. Polyhedron_3 requires
-// a 2-manifold.
-// A: But! It seems we could use CGAL::Triangulation_3. Though it won't be easy
-// to take advantage of functions like insert_in_facet because we want to
-// constrain segments. Hmmm. Actually Triangulation_3 doesn't look right...
-
-// CGAL's box_self_intersection_d uses C-style function callbacks without
-// userdata. This is a leapfrog method for calling a member function. It should
-// be bound as if the prototype was:
-//   static void box_intersect(const Box &a, const Box &b)
-// using boost:
-//  boost::function<void(const Box &a,const Box &b)> cb
-//    = boost::bind(&::box_intersect, this, _1,_2);
-//
-template <
-  typename Kernel,
-  typename DerivedV,
-  typename DerivedF,
-  typename DerivedVV,
-  typename DerivedFF,
-  typename DerivedIF,
-  typename DerivedJ,
-  typename DerivedIM>
-inline void igl::copyleft::cgal::SelfIntersectMesh<
-  Kernel,
-  DerivedV,
-  DerivedF,
-  DerivedVV,
-  DerivedFF,
-  DerivedIF,
-  DerivedJ,
-  DerivedIM>::box_intersect_static(
-  Self * SIM,
-  const typename Self::Box &a,
-  const typename Self::Box &b)
-{
-  SIM->box_intersect(a,b);
-}
-
-template <
-  typename Kernel,
-  typename DerivedV,
-  typename DerivedF,
-  typename DerivedVV,
-  typename DerivedFF,
-  typename DerivedIF,
-  typename DerivedJ,
-  typename DerivedIM>
-inline igl::copyleft::cgal::SelfIntersectMesh<
-  Kernel,
-  DerivedV,
-  DerivedF,
-  DerivedVV,
-  DerivedFF,
-  DerivedIF,
-  DerivedJ,
-  DerivedIM>::SelfIntersectMesh(
-  const Eigen::MatrixBase<DerivedV> & V,
-  const Eigen::MatrixBase<DerivedF> & F,
-  const RemeshSelfIntersectionsParam & params,
-  Eigen::PlainObjectBase<DerivedVV> & VV,
-  Eigen::PlainObjectBase<DerivedFF> & FF,
-  Eigen::PlainObjectBase<DerivedIF> & IF,
-  Eigen::PlainObjectBase<DerivedJ> & J,
-  Eigen::PlainObjectBase<DerivedIM> & IM):
-  V(V),
-  F(F),
-  count(0),
-  T(),
-  lIF(),
-  offending(),
-  params(params)
-{
-  using namespace std;
-  using namespace Eigen;
-
-#ifdef IGL_SELFINTERSECTMESH_TIMING
-  const auto & tictoc = []() -> double
-  {
-    static double t_start = igl::get_seconds();
-    double diff = igl::get_seconds()-t_start;
-    t_start += diff;
-    return diff;
-  };
-  const auto log_time = [&](const std::string& label) -> void{
-    printf("%50s: %0.5lf\n",
-      C_STR("SelfIntersectMesh." << label),tictoc());
-  };
-  tictoc();
-#endif
-
-  // Compute and process self intersections
-  mesh_to_cgal_triangle_list(V,F,T);
-#ifdef IGL_SELFINTERSECTMESH_TIMING
-  log_time("convert_to_triangle_list");
-#endif
-  // http://www.cgal.org/Manual/latest/doc_html/cgal_manual/Box_intersection_d/Chapter_main.html#Section_63.5
-  // Create the corresponding vector of bounding boxes
-  std::vector<Box> boxes;
-  boxes.reserve(T.size());
-  for (
-    TrianglesIterator tit = T.begin();
-    tit != T.end();
-    ++tit)
-  {
-    if (!tit->is_degenerate())
-    {
-      boxes.push_back(Box(tit->bbox(), tit));
-    }
-  }
-  // Leapfrog callback
-  std::function<void(const Box &a,const Box &b)> cb =
-    std::bind(&box_intersect_static, this,
-      // Explicitly use std namespace to avoid confusion with boost (who puts
-      // _1 etc. in global namespace)
-      std::placeholders::_1,
-      std::placeholders::_2);
-#ifdef IGL_SELFINTERSECTMESH_TIMING
-  log_time("box_and_bind");
-#endif
-  // Run the self intersection algorithm with all defaults
-  CGAL::box_self_intersection_d(boxes.begin(), boxes.end(),cb);
-#ifdef IGL_SELFINTERSECTMESH_TIMING
-  log_time("box_intersection_d");
-#endif
-  try{
-    process_intersecting_boxes();
-  }catch(int e)
-  {
-    // Rethrow if not IGL_FIRST_HIT_EXCEPTION
-    if(e != IGL_FIRST_HIT_EXCEPTION)
-    {
-      throw e;
-    }
-    // Otherwise just fall through
-  }
-#ifdef IGL_SELFINTERSECTMESH_TIMING
-  log_time("resolve_intersection");
-#endif
-
-  // Convert lIF to Eigen matrix
-  assert(lIF.size()%2 == 0);
-  IF.resize(lIF.size()/2,2);
-  {
-    Index i=0;
-    for(
-      typename IndexList::const_iterator ifit = lIF.begin();
-      ifit!=lIF.end();
-      )
-    {
-      IF(i,0) = (*ifit);
-      ifit++;
-      IF(i,1) = (*ifit);
-      ifit++;
-      i++;
-    }
-  }
-#ifdef IGL_SELFINTERSECTMESH_TIMING
-  log_time("store_intersecting_face_pairs");
-#endif
-
-  if(params.detect_only)
-  {
-    return;
-  }
-
-  remesh_intersections(
-    V,F,T,offending,
-    params.stitch_all,params.slow_and_more_precise_rounding,VV,FF,J,IM);
-
-#ifdef IGL_SELFINTERSECTMESH_TIMING
-  log_time("remesh_intersection");
-#endif
-}
-
-
-template <
-  typename Kernel,
-  typename DerivedV,
-  typename DerivedF,
-  typename DerivedVV,
-  typename DerivedFF,
-  typename DerivedIF,
-  typename DerivedJ,
-  typename DerivedIM>
-inline void igl::copyleft::cgal::SelfIntersectMesh<
-  Kernel,
-  DerivedV,
-  DerivedF,
-  DerivedVV,
-  DerivedFF,
-  DerivedIF,
-  DerivedJ,
-  DerivedIM>::mark_offensive(const Index f)
-{
-  using namespace std;
-  lIF.push_back(f);
-  if(offending.count(f) == 0)
-  {
-    // first time marking, initialize with new id and empty list
-    offending[f] = {};
-  }
-}
-
-template <
-  typename Kernel,
-  typename DerivedV,
-  typename DerivedF,
-  typename DerivedVV,
-  typename DerivedFF,
-  typename DerivedIF,
-  typename DerivedJ,
-  typename DerivedIM>
-inline void igl::copyleft::cgal::SelfIntersectMesh<
-  Kernel,
-  DerivedV,
-  DerivedF,
-  DerivedVV,
-  DerivedFF,
-  DerivedIF,
-  DerivedJ,
-  DerivedIM>::count_intersection(
-  const Index fa,
-  const Index fb)
-{
-  std::lock_guard<std::mutex> guard(m_offending_lock);
-  mark_offensive(fa);
-  mark_offensive(fb);
-  this->count++;
-  // We found the first intersection
-  if(params.first_only && this->count >= 1)
-  {
-    throw IGL_FIRST_HIT_EXCEPTION;
-  }
-
-}
-
-template <
-  typename Kernel,
-  typename DerivedV,
-  typename DerivedF,
-  typename DerivedVV,
-  typename DerivedFF,
-  typename DerivedIF,
-  typename DerivedJ,
-  typename DerivedIM>
-inline bool igl::copyleft::cgal::SelfIntersectMesh<
-  Kernel,
-  DerivedV,
-  DerivedF,
-  DerivedVV,
-  DerivedFF,
-  DerivedIF,
-  DerivedJ,
-  DerivedIM>::intersect(
-  const Triangle_3 & A,
-  const Triangle_3 & B,
-  const Index fa,
-  const Index fb)
-{
-  // Determine whether there is an intersection
-  if(!CGAL::do_intersect(A,B))
-  {
-    return false;
-  }
-  count_intersection(fa,fb);
-  if(!params.detect_only)
-  {
-    // Construct intersection
-    CGAL::Object result = CGAL::intersection(A,B);
-    // Could avoid this mutex if `offending` was per-thread and passed as input
-    // reference.
-    std::lock_guard<std::mutex> guard(m_offending_lock);
-    offending[fa].push_back({fb, result});
-    offending[fb].push_back({fa, result});
-  }
-  return true;
-}
-
-template <
-  typename Kernel,
-  typename DerivedV,
-  typename DerivedF,
-  typename DerivedVV,
-  typename DerivedFF,
-  typename DerivedIF,
-  typename DerivedJ,
-  typename DerivedIM>
-inline bool igl::copyleft::cgal::SelfIntersectMesh<
-  Kernel,
-  DerivedV,
-  DerivedF,
-  DerivedVV,
-  DerivedFF,
-  DerivedIF,
-  DerivedJ,
-  DerivedIM>::single_shared_vertex(
-  const Triangle_3 & A,
-  const Triangle_3 & B,
-  const Index fa,
-  const Index fb,
-  const Index va,
-  const Index vb)
-{
-  if(single_shared_vertex(A,B,fa,fb,va))
-  {
-    return true;
-  }
-  return single_shared_vertex(B,A,fb,fa,vb);
-}
-
-template <
-  typename Kernel,
-  typename DerivedV,
-  typename DerivedF,
-  typename DerivedVV,
-  typename DerivedFF,
-  typename DerivedIF,
-  typename DerivedJ,
-  typename DerivedIM>
-inline bool igl::copyleft::cgal::SelfIntersectMesh<
-  Kernel,
-  DerivedV,
-  DerivedF,
-  DerivedVV,
-  DerivedFF,
-  DerivedIF,
-  DerivedJ,
-  DerivedIM>::single_shared_vertex(
-  const Triangle_3 & A,
-  const Triangle_3 & B,
-  const Index fa,
-  const Index fb,
-  const Index va)
-{
-  // This was not a good idea. It will not handle coplanar triangles well.
-  using namespace std;
-  Segment_3 sa(
-    A.vertex((va+1)%3),
-    A.vertex((va+2)%3));
-
-  if(CGAL::do_intersect(sa,B))
-  {
-    // can't put count_intersection(fa,fb) here since we use intersect below
-    // and then it will be counted twice.
-    if(params.detect_only)
-    {
-      count_intersection(fa,fb);
-      return true;
-    }
-    CGAL::Object result = CGAL::intersection(sa,B);
-    if(const Point_3 * p = CGAL::object_cast<Point_3 >(&result))
-    {
-      // Single intersection --> segment from shared point to intersection
-      CGAL::Object seg = CGAL::make_object(Segment_3(
-        A.vertex(va),
-        *p));
-      count_intersection(fa,fb);
-      std::lock_guard<std::mutex> guard(m_offending_lock);
-      offending[fa].push_back({fb, seg});
-      offending[fb].push_back({fa, seg});
-      return true;
-    }else if(CGAL::object_cast<Segment_3 >(&result))
-    {
-      // Need to do full test. Intersection could be a general poly.
-      bool test = intersect(A,B,fa,fb);
-      ((void)test);
-      assert(test && "intersect should agree with do_intersect");
-      return true;
-    }else
-    {
-      cerr<<REDRUM("Segment ∩ triangle neither point nor segment?")<<endl;
-      assert(false);
-    }
-  }
-
-  return false;
-}
-
-
-template <
-  typename Kernel,
-  typename DerivedV,
-  typename DerivedF,
-  typename DerivedVV,
-  typename DerivedFF,
-  typename DerivedIF,
-  typename DerivedJ,
-  typename DerivedIM>
-inline bool igl::copyleft::cgal::SelfIntersectMesh<
-  Kernel,
-  DerivedV,
-  DerivedF,
-  DerivedVV,
-  DerivedFF,
-  DerivedIF,
-  DerivedJ,
-  DerivedIM>::double_shared_vertex(
-  const Triangle_3 & A,
-  const Triangle_3 & B,
-  const Index fa,
-  const Index fb,
-  const std::vector<std::pair<Index,Index> > shared)
-{
-  using namespace std;
-
-  auto opposite_vertex = [](const Index a0, const Index a1) {
-    // get opposite index of A
-    int a2=-1;
-	for(int c=0;c<3;++c)
-      if(c!=a0 && c!=a1) {
-        a2 = c;
-        break;
-      }
-      assert(a2 != -1);
-      return a2;
-  };
-
-  // must be co-planar
-  Index a2 = opposite_vertex(shared[0].first, shared[1].first);
-  if (! B.supporting_plane().has_on(A.vertex(a2)))
-    return false;
-  
-  Index b2 = opposite_vertex(shared[0].second, shared[1].second);
-
-  if (int(CGAL::coplanar_orientation(A.vertex(shared[0].first), A.vertex(shared[1].first), A.vertex(a2))) * 
-	  int(CGAL::coplanar_orientation(B.vertex(shared[0].second), B.vertex(shared[1].second), B.vertex(b2))) < 0)
-    // There is certainly no self intersection as the non-shared triangle vertices lie on opposite sides of the shared edge.
-    return false;
-
-  // Since A and B are non-degenerate the intersection must be a polygon
-  // (triangle). Either
-  //   - the vertex of A (B) opposite the shared edge of lies on B (A), or
-  //   - an edge of A intersects and edge of B without sharing a vertex
-  //
-  // Determine if the vertex opposite edge (a0,a1) in triangle A lies in
-  // (intersects) triangle B
-  const auto & opposite_point_inside = [](
-    const Triangle_3 & A, const Index a2, const Triangle_3 & B) 
-    -> bool
-  {
-    return CGAL::do_intersect(A.vertex(a2),B);
-  };
-
-  // Determine if edge opposite vertex va in triangle A intersects edge
-  // opposite vertex vb in triangle B.
-  const auto & opposite_edges_intersect = [](
-    const Triangle_3 & A, const Index va,
-    const Triangle_3 & B, const Index vb) -> bool
-  {
-    Segment_3 sa( A.vertex((va+1)%3), A.vertex((va+2)%3));
-    Segment_3 sb( B.vertex((vb+1)%3), B.vertex((vb+2)%3));
-    bool ret = CGAL::do_intersect(sa,sb);
-    return ret;
-  };
-
-  if( 
-    !opposite_point_inside(A,a2,B) &&
-    !opposite_point_inside(B,b2,A) &&
-    !opposite_edges_intersect(A,shared[0].first,B,shared[1].second) && 
-    !opposite_edges_intersect(A,shared[1].first,B,shared[0].second))
-  {
-    return false;
-  }
-
-  // there is an intersection indeed
-  count_intersection(fa,fb);
-  if(params.detect_only)
-  {
-    return true;
-  }
-  // Construct intersection
-  try
-  {
-    // This can fail for Epick but not Epeck
-    CGAL::Object result = CGAL::intersection(A,B);
-    if(!result.empty())
-    {
-      if(CGAL::object_cast<Segment_3 >(&result))
-      {
-        // not coplanar
-        assert(false &&
-          "Co-planar non-degenerate triangles should intersect over triangle");
-        return false;
-      } else if(CGAL::object_cast<Point_3 >(&result))
-      {
-        // this "shouldn't" happen but does for inexact
-        assert(false &&
-          "Co-planar non-degenerate triangles should intersect over triangle");
-        return false;
-      } else
-      {
-        // Triangle object
-        std::lock_guard<std::mutex> guard(m_offending_lock);
-        offending[fa].push_back({fb, result});
-        offending[fb].push_back({fa, result});
-        return true;
-      }
-    }else
-    {
-      // CGAL::intersection is disagreeing with do_intersect
-      assert(false && "CGAL::intersection should agree with predicate tests");
-      return false;
-    }
-  }catch(...)
-  {
-    // This catches some cgal assertion:
-    //     CGAL error: assertion violation!
-    //     Expression : is_finite(d)
-    //     File       : /opt/local/include/CGAL/GMP/Gmpq_type.h
-    //     Line       : 132
-    //     Explanation:
-    // But only if NDEBUG is not defined, otherwise there's an uncaught
-    // "Floating point exception: 8" SIGFPE
-    return false;
-  }
-  // No intersection.
-  return false;
-}
-
-template <
-  typename Kernel,
-  typename DerivedV,
-  typename DerivedF,
-  typename DerivedVV,
-  typename DerivedFF,
-  typename DerivedIF,
-  typename DerivedJ,
-  typename DerivedIM>
-inline void igl::copyleft::cgal::SelfIntersectMesh<
-  Kernel,
-  DerivedV,
-  DerivedF,
-  DerivedVV,
-  DerivedFF,
-  DerivedIF,
-  DerivedJ,
-  DerivedIM>::box_intersect(
-  const Box& a,
-  const Box& b)
-{
-  candidate_triangle_pairs.push_back({a.handle(), b.handle()});
-}
-
-template <
-  typename Kernel,
-  typename DerivedV,
-  typename DerivedF,
-  typename DerivedVV,
-  typename DerivedFF,
-  typename DerivedIF,
-  typename DerivedJ,
-  typename DerivedIM>
-inline void igl::copyleft::cgal::SelfIntersectMesh<
-  Kernel,
-  DerivedV,
-  DerivedF,
-  DerivedVV,
-  DerivedFF,
-  DerivedIF,
-  DerivedJ,
-  DerivedIM>::process_intersecting_boxes()
-{
-  std::mutex exception_mutex;
-  bool exception_fired = false;
-  int exception = -1;
-  // Eventually switching to igl::parallel_for would be good, but currently
-  // igl::parallel_for does not provide a way to catch exceptions fired on a
-  // spawned thread _outside_ of its loop-chunk which is the mechanism used here
-  // to bail out early when `first_only=true` to avoid
-  // O(#candidate_triangle_pairs) behavior.
-  auto process_chunk = [&]( const size_t first, const size_t last) -> void
-  {
-    try
-    {
-      assert(last >= first);
-
-      for (size_t i=first; i<last; i++)
-      {
-        if(exception_fired) return;
-        Index fa=T.size(), fb=T.size();
-        {
-          const auto& tri_pair = candidate_triangle_pairs[i];
-          fa = tri_pair.first - T.begin();
-          fb = tri_pair.second - T.begin();
-        }
-        assert(fa < T.size());
-        assert(fb < T.size());
-
-        if(exception_fired) return;
-
-        const Triangle_3& A = T[fa];
-        const Triangle_3& B = T[fb];
-
-        // Number of combinatorially shared vertices
-        Index comb_shared_vertices = 0;
-        // Number of geometrically shared vertices (*not* including
-        // combinatorially shared)
-        Index geo_shared_vertices = 0;
-        // Keep track of shared vertex indices
-        std::vector<std::pair<Index,Index> > shared;
-        Index ea,eb;
-        for(ea=0;ea<3;ea++)
-        {
-          for(eb=0;eb<3;eb++)
-          {
-            if(F(fa,ea) == F(fb,eb))
-            {
-              comb_shared_vertices++;
-              shared.emplace_back(ea,eb);
-            }else if(A.vertex(ea) == B.vertex(eb))
-            {
-              geo_shared_vertices++;
-              shared.emplace_back(ea,eb);
-            }
-          }
-        }
-        const Index total_shared_vertices =
-          comb_shared_vertices + geo_shared_vertices;
-        if(exception_fired) return;
-
-        if(comb_shared_vertices== 3)
-        {
-          assert(shared.size() == 3);
-          // Combinatorially duplicate face, these should be removed by
-          // preprocessing
-          continue;
-        }
-        if(total_shared_vertices== 3)
-        {
-          assert(shared.size() == 3);
-          // Geometrically duplicate face, these should be removed by
-          // preprocessing
-          continue;
-        }
-        if(total_shared_vertices == 2)
-        {
-          assert(shared.size() == 2);
-          // Q: What about coplanar?
-          //
-          // o    o
-          // |\  /|
-          // | \/ |
-          // | /\ |
-          // |/  \|
-          // o----o
-          double_shared_vertex(A,B,fa,fb,shared);
-          continue;
-        }
-        assert(total_shared_vertices<=1);
-        if(total_shared_vertices==1)
-        {
-          single_shared_vertex(A,B,fa,fb,shared[0].first,shared[0].second);
-        }else
-        {
-          intersect(A,B,fa,fb);
-        }
-      }
-    }catch(int e)
-    {
-      std::lock_guard<std::mutex> exception_lock(exception_mutex);
-      exception_fired = true;
-      exception = e;
-    }
-  };
-  const size_t num_threads = default_num_threads();
-  assert(num_threads > 0);
-  const size_t num_pairs = candidate_triangle_pairs.size();
-  const size_t chunk_size = num_pairs / num_threads;
-  std::vector<std::thread> threads;
-  for (size_t i=0; i<num_threads-1; i++)
-  {
-    threads.emplace_back(process_chunk, i*chunk_size, (i+1)*chunk_size);
-  }
-  // Do some work in the master thread.
-  process_chunk((num_threads-1)*chunk_size, num_pairs);
-  for (auto& t : threads)
-  {
-    if (t.joinable()) t.join();
-  }
-  if(exception_fired) throw exception;
-  //process_chunk(0, candidate_triangle_pairs.size());
-}
-
-#endif

+ 0 - 56
include/igl/copyleft/cgal/assign.h

@@ -1,56 +0,0 @@
-// This file is part of libigl, a simple c++ geometry processing library.
-// 
-// Copyright (C) 2016 Alec Jacobson <[email protected]>
-// 
-// This Source Code Form is subject to the terms of the Mozilla Public License 
-// v. 2.0. If a copy of the MPL was not distributed with this file, You can 
-// obtain one at http://mozilla.org/MPL/2.0/.
-#ifndef IGL_COPYLEFT_CGAL_ASSIGN_H
-#define IGL_COPYLEFT_CGAL_ASSIGN_H
-#include "../../igl_inline.h"
-#include <Eigen/Core>
-#include <CGAL/Exact_predicates_exact_constructions_kernel.h>
-
-namespace igl
-{
-  namespace copyleft
-  {
-    namespace cgal
-    {
-      /// Vector version of assign_scalar
-      ///
-      /// @param[in] C  matrix of scalars
-      /// @param[in] slow_and_more_precise  see assign_scalar
-      /// @param[out] D  matrix same size as C
-      ///
-      /// \see assign_scalar
-      template <typename DerivedC, typename DerivedD>
-      IGL_INLINE void assign(
-        const Eigen::MatrixBase<DerivedC> & C,
-        const bool slow_and_more_precise,
-        Eigen::PlainObjectBase<DerivedD> & D);
-      /// \overload
-      template <typename DerivedC, typename DerivedD>
-      IGL_INLINE void assign(
-        const Eigen::MatrixBase<DerivedC> & C,
-        Eigen::PlainObjectBase<DerivedD> & D);
-      /// \overload
-      template <typename ReturnScalar, typename DerivedC>
-      IGL_INLINE 
-      Eigen::Matrix<
-        ReturnScalar,
-        DerivedC::RowsAtCompileTime, 
-        DerivedC::ColsAtCompileTime, 
-        1,
-        DerivedC::MaxRowsAtCompileTime, 
-        DerivedC::MaxColsAtCompileTime> 
-      assign(
-        const Eigen::MatrixBase<DerivedC> & C);
-    }
-  }
-}
-
-#ifndef IGL_STATIC_LIBRARY
-#  include "assign.cpp"
-#endif
-#endif

+ 0 - 109
include/igl/copyleft/cgal/assign_scalar.h

@@ -1,109 +0,0 @@
-// This file is part of libigl, a simple c++ geometry processing library.
-//
-// Copyright (C) 2015 Alec Jacobson <[email protected]>
-// Copyright (C) 2021 Alec Jacobson <[email protected]>
-//
-// This Source Code Form is subject to the terms of the Mozilla Public License
-// v. 2.0. If a copy of the MPL was not distributed with this file, You can
-// obtain one at http://mozilla.org/MPL/2.0/.
-#ifndef IGL_COPYLEFT_CGAL_ASSIGN_SCALAR_H
-#define IGL_COPYLEFT_CGAL_ASSIGN_SCALAR_H
-#include "../../igl_inline.h"
-#include <CGAL/Exact_predicates_exact_constructions_kernel.h>
-#include <CGAL/Exact_predicates_exact_constructions_kernel_with_sqrt.h>
-#ifndef WIN32
-#include <CGAL/gmpxx.h>
-#endif
-
-namespace igl
-{
-  namespace copyleft
-  {
-    namespace cgal
-    {
-      /// Conduct the casting copy:
-      ///   lhs = rhs
-      /// using `slow_and_more_precise` rounding if more desired.
-      ///
-      /// @tparam RHS right-hand side scalar type
-      /// @tparam LHS left-hand side scalar type
-      /// @param[in] rhs  right-hand side scalar
-      /// @param[in] slow_and_more_precise  when appropriate use more elaborate rounding
-      ///     guaranteed to find a closest lhs value in an absolute value sense.
-      ///     Think of `slow_and_more_precise=true` as "round to closest number"
-      ///     and `slow_and_more_precise=false` as "round down/up". CGAL's number
-      ///     types are bit mysterious about how exactly rounding is conducted.
-      ///     For example, the rationals created during remesh_intersections on
-      ///     floating point input appear to be tightly rounded up or down so the
-      ///     difference with the `slow_and_more_precise=true` will be exactly
-      ///     zero 50% of the time and "one floating point unit" (at whatever
-      ///     scale) the other 50% of the time.
-      /// @param[out] lhs  left-hand side scalar
-      template <typename RHS, typename LHS>
-      IGL_INLINE void assign_scalar(
-        const RHS & rhs,
-        const bool & slow_and_more_precise,
-        LHS & lhs);
-      /// \overload
-      /// \brief For legacy reasons, all of these overload uses
-      /// `slow_and_more_precise=true`. This is subject to change if we determine
-      /// it is sufficiently overkill. In that case, we'd create a new
-      /// non-overloaded function.
-      IGL_INLINE void assign_scalar(
-        const CGAL::Epeck::FT & cgal,
-        CGAL::Epeck::FT & d);
-      /// \overload
-      IGL_INLINE void assign_scalar(
-        const CGAL::Epeck::FT & cgal,
-        double & d);
-      /// \overload
-      IGL_INLINE void assign_scalar(
-      /// \overload
-        const CGAL::Epeck::FT & cgal,
-        float& d);
-      IGL_INLINE void assign_scalar(
-      /// \overload
-        const double & c,
-        double & d);
-      /// \overload
-      IGL_INLINE void assign_scalar(
-        const float& c,
-        float & d);
-      /// \overload
-      IGL_INLINE void assign_scalar(
-        const float& c,
-        double& d);
-      /// \overload
-      IGL_INLINE void assign_scalar(
-        const CGAL::Exact_predicates_exact_constructions_kernel_with_sqrt::FT & cgal,
-        CGAL::Exact_predicates_exact_constructions_kernel_with_sqrt::FT & d);
-      /// \overload
-      IGL_INLINE void assign_scalar(
-        const CGAL::Exact_predicates_exact_constructions_kernel_with_sqrt::FT & cgal,
-        double & d);
-      /// \overload
-      IGL_INLINE void assign_scalar(
-        const CGAL::Exact_predicates_exact_constructions_kernel_with_sqrt::FT & cgal,
-        float& d);
-#ifndef WIN32
-      /// \overload
-      IGL_INLINE void assign_scalar(
-        const CGAL::Simple_cartesian<mpq_class>::FT & cgal,
-        CGAL::Simple_cartesian<mpq_class>::FT & d);
-      /// \overload
-      IGL_INLINE void assign_scalar(
-        const CGAL::Simple_cartesian<mpq_class>::FT & cgal,
-        double & d);
-      /// \overload
-      IGL_INLINE void assign_scalar(
-        const CGAL::Simple_cartesian<mpq_class>::FT & cgal,
-        float& d);
-#endif
-    }
-  }
-}
-
-#ifndef IGL_STATIC_LIBRARY
-#  include "assign_scalar.cpp"
-#endif
-#endif

+ 0 - 46
include/igl/copyleft/cgal/cell_adjacency.h

@@ -1,46 +0,0 @@
-// This file is part of libigl, a simple c++ geometry processing library.
-// 
-// Copyright (C) 2016 Qingnan Zhou <[email protected]>
-// 
-// This Source Code Form is subject to the terms of the Mozilla Public License 
-// v. 2.0. If a copy of the MPL was not distributed with this file, You can 
-// obtain one at http://mozilla.org/MPL/2.0/.
-//
-#ifndef IGL_COPYLEFT_CGAL_CELL_ADJACENCY_H
-#define IGL_COPYLEFT_CGAL_CELL_ADJACENCY_H
-#include "../../igl_inline.h"
-#include <Eigen/Core>
-#include <set>
-#include <tuple>
-#include <vector>
-
-namespace igl
-{
-  namespace copyleft
-  {
-    namespace cgal
-    {
-      /// Determine adjacency of cells
-      ///
-      /// @param[in] per_patch_cells  #P by 2 list of cell labels on each side
-      ///   of each patch.  Cell labels are assumed to be continuous from 0 to #C.
-      /// @param[in] num_cells        number of cells.
-      /// @param[out] adjacency_list  #C array of list of adjcent cell
-      ///   information.  If cell i and cell j are adjacent via patch x, where i
-      ///   is on the positive side of x, and j is on the negative side.  Then,
-      ///   adjacency_list[i] will contain the entry {j, false, x} and
-      ///   adjacency_list[j] will contain the entry {i, true, x}
-      template < typename DerivedC >
-      IGL_INLINE void cell_adjacency(
-          const Eigen::PlainObjectBase<DerivedC>& per_patch_cells,
-          const size_t num_cells,
-          std::vector<std::set<std::tuple<typename DerivedC::Scalar, bool, size_t> > >&
-          adjacency_list);
-    }
-  }
-}
-
-#ifndef IGL_STATIC_LIBRARY
-#  include "cell_adjacency.cpp"
-#endif
-#endif

+ 0 - 158
include/igl/copyleft/cgal/closest_facet.h

@@ -1,158 +0,0 @@
-// This file is part of libigl, a simple c++ geometry processing library.
-// 
-// Copyright (C) 2015 Qingnan Zhou <[email protected]>
-// 
-// This Source Code Form is subject to the terms of the Mozilla Public License 
-// v. 2.0. If a copy of the MPL was not distributed with this file, You can 
-// obtain one at http://mozilla.org/MPL/2.0/.
-//
-#ifndef IGL_COPYLET_CGAL_CLOSEST_FACET_H
-#define IGL_COPYLET_CGAL_CLOSEST_FACET_H
-
-#include "../../igl_inline.h"
-#include <Eigen/Core>
-#include <vector>
-
-#include <CGAL/AABB_tree.h>
-#include <CGAL/AABB_traits.h>
-#include <CGAL/AABB_triangle_primitive.h>
-#include <CGAL/intersections.h>
-#include <CGAL/Exact_predicates_exact_constructions_kernel.h>
-
-namespace igl
-{
-  namespace copyleft
-  {
-    namespace cgal
-    {
-      /// Determine the closest facet for each of the input points.
-      ///
-      /// @param[in] V  #V by 3 array of vertices.
-      /// @param[in] F  #F by 3 array of faces.
-      /// @param[in] I  #I list of triangle indices to consider.
-      /// @param[in] P  #P by 3 array of query points.
-      /// @param[in] EMAP  #F*3 list of indices into uE.
-      /// @param[in] uEC  #uE+1 list of cumsums of directed edges sharing each unique edge
-      /// @param[in] uEE  #E list of indices into E (see `igl::unique_edge_map`)
-      /// @param[in] VF  #V list of lists of incident faces (adjacency list)
-      /// @param[in] VFi  #V list of lists of index of incidence within incident faces listed in VF
-      /// @param[in] tree  AABB containing triangles of (V,F(I,:))
-      /// @param[in] triangles  #I list of cgal triangles
-      /// @param[in] in_I  #F list of whether in submesh
-      /// @param[out] R  #P list of closest facet indices.
-      /// @param[out] S  #P list of bools indicating on which side of the closest facet
-      ///      each query point lies.
-      ///
-      /// \note The use of `size_t` here is a bad idea. These should just be int
-      /// to avoid nonsense with windows.
-      template<
-        typename DerivedV,
-        typename DerivedF,
-        typename DerivedI,
-        typename DerivedP,
-        typename DerivedEMAP,
-        typename DeriveduEC,
-        typename DeriveduEE,
-        typename Kernel,
-        typename DerivedR,
-        typename DerivedS >
-      IGL_INLINE void closest_facet(
-          const Eigen::PlainObjectBase<DerivedV>& V,
-          const Eigen::PlainObjectBase<DerivedF>& F,
-          const Eigen::PlainObjectBase<DerivedI>& I,
-          const Eigen::PlainObjectBase<DerivedP>& P,
-          const Eigen::PlainObjectBase<DerivedEMAP>& EMAP,
-          const Eigen::PlainObjectBase<DeriveduEC>& uEC,
-          const Eigen::PlainObjectBase<DeriveduEE>& uEE,
-          const std::vector<std::vector<size_t> > & VF,
-          const std::vector<std::vector<size_t> > & VFi,
-          const CGAL::AABB_tree<
-            CGAL::AABB_traits<
-              Kernel, 
-              CGAL::AABB_triangle_primitive<
-                Kernel, typename std::vector<
-                  typename Kernel::Triangle_3 >::iterator > > > & tree,
-          const std::vector<typename Kernel::Triangle_3 > & triangles,
-          const std::vector<bool> & in_I,
-          Eigen::PlainObjectBase<DerivedR>& R,
-          Eigen::PlainObjectBase<DerivedS>& S);
-      /// \overload
-      template<
-        typename DerivedV,
-        typename DerivedF,
-        typename DerivedI,
-        typename DerivedP,
-        typename DerivedEMAP,
-        typename DeriveduEC,
-        typename DeriveduEE,
-        typename DerivedR,
-        typename DerivedS >
-      IGL_INLINE void closest_facet(
-        const Eigen::PlainObjectBase<DerivedV>& V,
-        const Eigen::PlainObjectBase<DerivedF>& F,
-        const Eigen::PlainObjectBase<DerivedI>& I,
-        const Eigen::PlainObjectBase<DerivedP>& P,
-        const Eigen::PlainObjectBase<DerivedEMAP>& EMAP,
-        const Eigen::PlainObjectBase<DeriveduEC>& uEC,
-        const Eigen::PlainObjectBase<DeriveduEE>& uEE,
-              Eigen::PlainObjectBase<DerivedR>& R,
-              Eigen::PlainObjectBase<DerivedS>& S);
-      /// \overload
-      template<
-        typename DerivedV,
-        typename DerivedF,
-        typename DerivedP,
-        typename DerivedEMAP,
-        typename DeriveduEC,
-        typename DeriveduEE,
-        typename DerivedR,
-        typename DerivedS >
-      IGL_INLINE void closest_facet(
-        const Eigen::PlainObjectBase<DerivedV>& V,
-        const Eigen::PlainObjectBase<DerivedF>& F,
-        const Eigen::PlainObjectBase<DerivedP>& P,
-        const Eigen::PlainObjectBase<DerivedEMAP>& EMAP,
-        const Eigen::PlainObjectBase<DeriveduEC>& uEC,
-        const Eigen::PlainObjectBase<DeriveduEE>& uEE,
-        Eigen::PlainObjectBase<DerivedR>& R,
-        Eigen::PlainObjectBase<DerivedS>& S);
-      /// \overload
-      template<
-        typename DerivedV,
-        typename DerivedF,
-        typename DerivedI,
-        typename DerivedP,
-        typename DerivedEMAP,
-        typename DeriveduEC,
-        typename DeriveduEE,
-        typename Kernel,
-        typename DerivedR,
-        typename DerivedS >
-      IGL_INLINE void closest_facet(
-          const Eigen::PlainObjectBase<DerivedV>& V,
-          const Eigen::PlainObjectBase<DerivedF>& F,
-          const Eigen::PlainObjectBase<DerivedI>& I,
-          const Eigen::PlainObjectBase<DerivedP>& P,
-          const Eigen::PlainObjectBase<DerivedEMAP>& EMAP,
-          const Eigen::PlainObjectBase<DeriveduEC>& uEC,
-          const Eigen::PlainObjectBase<DeriveduEE>& uEE,
-          const std::vector<std::vector<size_t> > & VF,
-          const std::vector<std::vector<size_t> > & VFi,
-          const CGAL::AABB_tree<
-            CGAL::AABB_traits<
-              Kernel, 
-              CGAL::AABB_triangle_primitive<
-                Kernel, typename std::vector<
-                  typename Kernel::Triangle_3 >::iterator > > > & tree,
-          const std::vector<typename Kernel::Triangle_3 > & triangles,
-          const std::vector<bool> & in_I,
-          Eigen::PlainObjectBase<DerivedR>& R,
-          Eigen::PlainObjectBase<DerivedS>& S);
-    }
-  }
-}
-
-#ifndef IGL_STATIC_LIBRARY
-#include "closest_facet.cpp"
-#endif
-#endif

+ 0 - 45
include/igl/copyleft/cgal/complex_to_mesh.h

@@ -1,45 +0,0 @@
-// This file is part of libigl, a simple c++ geometry processing library.
-// 
-// Copyright (C) 2014 Alec Jacobson <[email protected]>
-// 
-// This Source Code Form is subject to the terms of the Mozilla Public License 
-// v. 2.0. If a copy of the MPL was not distributed with this file, You can 
-// obtain one at http://mozilla.org/MPL/2.0/.
-#ifndef IGL_COPYLEFT_CGAL_COMPLEX_TO_MESH_H
-#define IGL_COPYLEFT_CGAL_COMPLEX_TO_MESH_H
-#include "../../igl_inline.h"
-
-#include <Eigen/Dense>
-#include <CGAL/Complex_2_in_triangulation_3.h>
-
-namespace igl 
-{
-  namespace copyleft
-  {
-    namespace cgal
-    {
-      /// Convert a CGAL::Complex_2_in_triangulation_3 to a mesh (V,F)
-      ///
-      /// @tparam Tr  CGAL triangulation type, e.g. CGAL::Surface_mesh_default_triangulation_3
-      /// @param[in] c2t3  2-complex (surface) living in a 3d triangulation
-      ///   (e.g. result of CGAL::make_surface_mesh)
-      /// @param[out] V  #V by 3 list of vertex positions
-      /// @param[out] F  #F by 3 list of triangle indices
-      /// @return true iff conversion was successful, failure can ok if CGAL code
-      /// can't figure out ordering.
-      ///
-      template <typename Tr, typename DerivedV, typename DerivedF>
-      IGL_INLINE bool complex_to_mesh(
-        const CGAL::Complex_2_in_triangulation_3<Tr> & c2t3,
-        Eigen::PlainObjectBase<DerivedV> & V, 
-        Eigen::PlainObjectBase<DerivedF> & F);
-    }
-  }
-}
-
-#ifndef IGL_STATIC_LIBRARY
-#  include "complex_to_mesh.cpp"
-#endif
-
-#endif
-

+ 0 - 56
include/igl/copyleft/cgal/component_inside_component.h

@@ -1,56 +0,0 @@
-// This file is part of libigl, a simple c++ geometry processing library.
-// 
-// Copyright (C) 2015 Qingnan Zhou <[email protected]>
-// 
-// This Source Code Form is subject to the terms of the Mozilla Public License 
-// v. 2.0. If a copy of the MPL was not distributed with this file, You can 
-// obtain one at http://mozilla.org/MPL/2.0/.
-#ifndef IGL_COPYLEFT_CGAL_COMONENT_INSIDE_COMPONENT
-#define IGL_COPYLEFT_CGAL_COMONENT_INSIDE_COMPONENT
-
-#include "../../igl_inline.h"
-#include <Eigen/Core>
-#include <vector>
-
-namespace igl {
-  namespace copyleft
-  {
-    namespace cgal 
-    {
-      /// Determine if connected facet component (V1, F1, I1) is inside of
-      /// connected facet component (V2, F2, I2).
-      ///
-      /// \pre Both components must represent closed, self-intersection free,
-      /// non-degenerated surfaces that are the boundary of 3D volumes. In
-      /// addition, (V1, F1, I1) must not intersect with (V2, F2, I2).
-      ///
-      /// @param[in] V1  #V1 by 3 list of vertex position of mesh 1
-      /// @param[in] F1  #F1 by 3 list of triangles indices into V1
-      /// @param[in] I1  #I1 list of indices into F1, indicate the facets of component
-      /// @param[in] V2  #V2 by 3 list of vertex position of mesh 2
-      /// @param[in] F2  #F2 by 3 list of triangles indices into V2
-      /// @param[in] I2  #I2 list of indices into F2, indicate the facets of component
-      /// @return true iff (V1, F1, I1) is entirely inside of (V2, F2, I2).
-      template<typename DerivedV, typename DerivedF, typename DerivedI>
-          IGL_INLINE bool component_inside_component(
-                  const Eigen::PlainObjectBase<DerivedV>& V1,
-                  const Eigen::PlainObjectBase<DerivedF>& F1,
-                  const Eigen::PlainObjectBase<DerivedI>& I1,
-                  const Eigen::PlainObjectBase<DerivedV>& V2,
-                  const Eigen::PlainObjectBase<DerivedF>& F2,
-                  const Eigen::PlainObjectBase<DerivedI>& I2);
-      /// \overload
-      template<typename DerivedV, typename DerivedF>
-          IGL_INLINE bool component_inside_component(
-                  const Eigen::PlainObjectBase<DerivedV>& V1,
-                  const Eigen::PlainObjectBase<DerivedF>& F1,
-                  const Eigen::PlainObjectBase<DerivedV>& V2,
-                  const Eigen::PlainObjectBase<DerivedF>& F2);
-    }
-  }
-}
-
-#ifndef IGL_STATIC_LIBRARY
-#include "component_inside_component.cpp"
-#endif
-#endif

+ 0 - 47
include/igl/copyleft/cgal/convex_hull.h

@@ -1,47 +0,0 @@
-// This file is part of libigl, a simple c++ geometry processing library.
-// 
-// Copyright (C) 2017 Alec Jacobson <[email protected]>
-// 
-// This Source Code Form is subject to the terms of the Mozilla Public License 
-// v. 2.0. If a copy of the MPL was not distributed with this file, You can 
-// obtain one at http://mozilla.org/MPL/2.0/.
-#ifndef IGL_COPYLEFT_CGAL_CONVEX_HULL_H
-#define IGL_COPYLEFT_CGAL_CONVEX_HULL_H
-#include "../../igl_inline.h"
-#include <Eigen/Core>
-
-namespace igl
-{
-  namespace copyleft
-  {
-    namespace cgal
-    {
-      /// Given a set of points (V), compute the convex hull as a triangle mesh (W,G)
-      /// 
-      /// @param[in] V  #V by 3 list of input points
-      /// @param[out] W  #W by 3 list of convex hull points
-      /// @param[out] G  #G by 3 list of triangle indices into W
-      template <
-        typename DerivedV,
-        typename DerivedW,
-        typename DerivedG>
-      IGL_INLINE void convex_hull(
-        const Eigen::MatrixBase<DerivedV> & V,
-        Eigen::PlainObjectBase<DerivedW> & W,
-        Eigen::PlainObjectBase<DerivedG> & G);
-      /// \overload
-      template <
-        typename DerivedV,
-        typename DerivedF>
-      IGL_INLINE void convex_hull(
-        const Eigen::MatrixBase<DerivedV> & V,
-        Eigen::PlainObjectBase<DerivedF> & F);
-    }
-  }
-}
-  
-#ifndef IGL_STATIC_LIBRARY
-#  include "convex_hull.cpp"
-#endif
-
-#endif 

+ 0 - 25
include/igl/copyleft/cgal/coplanar.h

@@ -1,25 +0,0 @@
-#ifndef IGL_COPYLEFT_CGAL_COPLANAR_H
-#define IGL_COPYLEFT_CGAL_COPLANAR_H
-#include "../../igl_inline.h"
-#include <Eigen/Core>
-namespace igl
-{
-  namespace copyleft
-  {
-    namespace cgal
-    {
-      /// Test whether all points are on same plane.
-      ///
-      /// @param[in] V  #V by 3 list of 3D vertex positions
-      /// @return true if all points lie on the same plane
-      template <typename DerivedV>
-      IGL_INLINE bool coplanar(
-        const Eigen::MatrixBase<DerivedV> & V);
-    }
-  }
-}
-#ifndef IGL_STATIC_LIBRARY
-#  include "coplanar.cpp"
-#endif
-
-#endif

+ 0 - 43
include/igl/copyleft/cgal/delaunay_triangulation.h

@@ -1,43 +0,0 @@
-// This file is part of libigl, a simple c++ geometry processing library.
-// 
-// Copyright (C) 2016 Qingan Zhou <[email protected]>
-// 
-// This Source Code Form is subject to the terms of the Mozilla Public License 
-// v. 2.0. If a copy of the MPL was not distributed with this file, You can 
-// obtain one at http://mozilla.org/MPL/2.0/.
-
-#ifndef IGL_COPYLEFT_CGAL_DELAUNAY_TRIANGULATION_H
-#define IGL_COPYLEFT_CGAL_DELAUNAY_TRIANGULATION_H
-
-#include "../../igl_inline.h"
-#include <Eigen/Core>
-
-namespace igl
-{
-  namespace copyleft
-  {
-    namespace cgal
-    {
-      /// Given a set of points in 2D, return a Delaunay triangulation of these
-      /// points.
-      ///
-      /// @param[in] V  #V by 2 list of vertex positions
-      /// @param[out] F  #F by 3 of faces in Delaunay triangulation.
-      template<
-        typename DerivedV,
-        typename DerivedF
-        >
-      IGL_INLINE void delaunay_triangulation(
-          const Eigen::MatrixBase<DerivedV>& V,
-          Eigen::PlainObjectBase<DerivedF>& F);
-    }
-  }
-}
-
-
-
-
-#ifndef IGL_STATIC_LIBRARY
-#  include "delaunay_triangulation.cpp"
-#endif
-#endif

+ 0 - 72
include/igl/copyleft/cgal/extract_cells.h

@@ -1,72 +0,0 @@
-// This file is part of libigl, a simple c++ geometry processing library.
-// 
-// Copyright (C) 2015 Qingnan Zhou <[email protected]>
-// 
-// This Source Code Form is subject to the terms of the Mozilla Public License 
-// v. 2.0. If a copy of the MPL was not distributed with this file, You can 
-// obtain one at http://mozilla.org/MPL/2.0/.
-//
-#ifndef IGL_COPYLEFT_CGAL_EXTRACT_CELLS_H
-#define IGL_COPYLEFT_CGAL_EXTRACT_CELLS_H
-
-#include "../../igl_inline.h"
-#include <Eigen/Core>
-#include <vector>
-
-namespace igl {
-  namespace copyleft
-  {
-    namespace cgal
-    {
-      /// Extract connected 3D space partitioned by mesh (V, F).
-      ///
-      /// @param[in] V  #V by 3 array of vertices.
-      /// @param[in] F  #F by 3 array of faces.
-      /// @param[in] P  #F list of patch indices.
-      /// @param[in] E  #E by 2 array of vertex indices, one edge per row.
-      /// @param[in] uE    #uE by 2 list of vertex_indices, represents undirected edges.
-      /// @param[in] EMAP  #F*3 list of indices into uE.
-      /// @param[in] uEC  #uE+1 list of cumsums of directed edges sharing each unique edge
-      /// @param[in] uEE  #E list of indices into E (see `igl::unique_edge_map`)
-      /// @param[out] cells  #F by 2 array of cell indices.  cells(i,0) represents the
-      ///          cell index on the positive side of face i, and cells(i,1)
-      ///          represents cell index of the negqtive side.
-      ///          By convension cell with index 0 is the infinite cell.
-      /// @return the number of cells
-      template<
-        typename DerivedV,
-        typename DerivedF,
-        typename DerivedP,
-        typename DerivedE,
-        typename DeriveduE,
-        typename DerivedEMAP,
-        typename DeriveduEC,
-        typename DeriveduEE,
-        typename DerivedC >
-      IGL_INLINE size_t extract_cells(
-        const Eigen::PlainObjectBase<DerivedV>& V,
-        const Eigen::PlainObjectBase<DerivedF>& F,
-        const Eigen::PlainObjectBase<DerivedP>& P,
-        const Eigen::PlainObjectBase<DerivedE>& E,
-        const Eigen::PlainObjectBase<DeriveduE>& uE,
-        const Eigen::PlainObjectBase<DerivedEMAP>& EMAP,
-        const Eigen::PlainObjectBase<DeriveduEC>& uEC,
-        const Eigen::PlainObjectBase<DeriveduEE>& uEE,
-        Eigen::PlainObjectBase<DerivedC>& cells);
-      /// \overload
-      template<
-        typename DerivedV,
-        typename DerivedF,
-        typename DerivedC >
-      IGL_INLINE size_t extract_cells(
-        const Eigen::PlainObjectBase<DerivedV>& V,
-        const Eigen::PlainObjectBase<DerivedF>& F,
-        Eigen::PlainObjectBase<DerivedC>& cells);
-    }
-  }
-}
-
-#ifndef IGL_STATIC_LIBRARY
-#  include "extract_cells.cpp"
-#endif
-#endif

+ 0 - 63
include/igl/copyleft/cgal/extract_cells_single_component.h

@@ -1,63 +0,0 @@
-// This file is part of libigl, a simple c++ geometry processing library.
-// 
-// Copyright (C) 2015 Qingnan Zhou <[email protected]>
-// 
-// This Source Code Form is subject to the terms of the Mozilla Public License 
-// v. 2.0. If a copy of the MPL was not distributed with this file, You can 
-// obtain one at http://mozilla.org/MPL/2.0/.
-//
-#ifndef IGL_COPYLEFT_CGAL_EXTRACT_CELLS_SINGLE_COMPONENT_H
-#define IGL_COPYLEFT_CGAL_EXTRACT_CELLS_SINGLE_COMPONENT_H
-
-#include "../../igl_inline.h"
-#include <Eigen/Core>
-#include <vector>
-
-namespace igl {
-  namespace copyleft
-  {
-    namespace cgal
-    {
-      /// Extract connected 3D space partitioned by mesh (V,F) composed of
-      /// **possibly multiple components** (the name of this function is
-      /// dubious).
-      ///
-      /// @param[in] V  #V by 3 array of vertices.
-      /// @param[in] F  #F by 3 array of faces.
-      /// @param[in] P  #F list of patch indices.
-      /// @param[in] E  #E by 2 array of vertex indices, one edge per row.
-      /// @param[in] uE    #uE by 2 list of vertex_indices, represents undirected edges.
-      /// @param[in] EMAP  #F*3 list of indices into uE.
-      /// @param[in] uEC  #uE+1 list of cumsums of directed edges sharing each unique edge
-      /// @param[in] uEE  #E list of indices into E (see `igl::unique_edge_map`)
-      /// @param[out] cells  #P by 2 array of cell indices.  cells(i,0) represents the
-      ///    cell index on the positive side of patch i, and cells(i,1)
-      ///    represents cell index of the negative side.
-      /// @return number of components
-      template<
-        typename DerivedV,
-        typename DerivedF,
-        typename DerivedP,
-        typename DeriveduE,
-        typename DerivedEMAP,
-        typename DeriveduEC,
-        typename DeriveduEE,
-        typename DerivedC >
-      IGL_INLINE size_t extract_cells_single_component(
-        const Eigen::PlainObjectBase<DerivedV>& V,
-        const Eigen::PlainObjectBase<DerivedF>& F,
-        const Eigen::PlainObjectBase<DerivedP>& P,
-        const Eigen::PlainObjectBase<DeriveduE>& uE,
-        const Eigen::PlainObjectBase<DerivedEMAP>& EMAP,
-        const Eigen::PlainObjectBase<DeriveduEC>& uEC,
-        const Eigen::PlainObjectBase<DeriveduEE>& uEE,
-        Eigen::PlainObjectBase<DerivedC>& cells);
-    }
-  }
-}
-
-#ifndef IGL_STATIC_LIBRARY
-#  include "extract_cells_single_component.cpp"
-#endif
-#endif
-

+ 0 - 72
include/igl/copyleft/cgal/extract_feature.h

@@ -1,72 +0,0 @@
-// This file is part of libigl, a simple c++ geometry processing library.
-// 
-// Copyright (C) 2016 Qingnan Zhou <[email protected]>
-// 
-// This Source Code Form is subject to the terms of the Mozilla Public License 
-// v. 2.0. If a copy of the MPL was not distributed with this file, You can 
-// obtain one at http://mozilla.org/MPL/2.0/.
-
-#ifndef IGL_COPYLEFT_CGAL_EXTRACT_FEATURE_H
-#define IGL_COPYLEFT_CGAL_EXTRACT_FEATURE_H
-#include "../../igl_inline.h"
-#include <Eigen/Core>
-#include <vector>
-
-namespace igl
-{
-  namespace copyleft
-  {
-    namespace cgal
-    {
-      /// Extract feature edges based on dihedral angle.
-      /// Here, dihedral angle is defined as the angle between surface
-      /// __normals__ as described in
-      /// http://mathworld.wolfram.com/DihedralAngle.html
-      ///
-      /// Non-manifold and boundary edges are automatically considered as
-      /// features.
-      ///
-      /// @param[in] V   #V by 3 array of vertices.
-      /// @param[in] F   #F by 3 array of faces.
-      /// @param[in] tol Edges with dihedral angle larger than this are considered
-      ///       as features.  Angle is measured in radian.
-      /// @param[out] feature_edges: #E by 2 array of edges.  Each edge satisfies at
-      ///      least one of the following criteria:
-      ///      * Edge has dihedral angle larger than tol.
-      ///      * Edge is boundary.
-      ///      * Edge is non-manifold (i.e. it has more than 2 adjacent
-      ///        faces).
-      template <
-        typename DerivedV,
-        typename DerivedF,
-        typename DerivedE>
-      IGL_INLINE void extract_feature(
-            const Eigen::PlainObjectBase<DerivedV>& V,
-            const Eigen::PlainObjectBase<DerivedF>& F,
-            const double tol,
-            Eigen::PlainObjectBase<DerivedE>& feature_edges);
-      // \overload
-      // @param[in] E    #E by 2 array of directed edges.
-      // @param[in] uE   #uE by 2 array of undirected edges.
-      // @param[in] uE2E #uE list of lists mapping undirected edges to all
-      //   corresponding directed edges.
-      template <
-        typename DerivedV,
-        typename DerivedF,
-        typename DerivedE>
-      IGL_INLINE void extract_feature(
-            const Eigen::PlainObjectBase<DerivedV>& V,
-            const Eigen::PlainObjectBase<DerivedF>& F,
-            const double tol,
-            const Eigen::PlainObjectBase<DerivedE>& E,
-            const Eigen::PlainObjectBase<DerivedE>& uE,
-            const std::vector<std::vector<typename DerivedE::Scalar> >& uE2E,
-            Eigen::PlainObjectBase<DerivedE>& feature_edges);
-    }
-  }
-}
-
-#ifndef IGL_STATIC_LIBRARY
-#  include "extract_feature.cpp"
-#endif
-#endif

+ 0 - 61
include/igl/copyleft/cgal/fast_winding_number.h

@@ -1,61 +0,0 @@
-#ifndef IGL_COPYLEFT_CGAL_FAST_WINDING_NUMBER
-#define IGL_COPYLEFT_CGAL_FAST_WINDING_NUMBER
-#include "../../igl_inline.h"
-#include <Eigen/Core>
-#include <vector>
-namespace igl
-{
-  namespace copyleft
-  {
-    namespace cgal
-    {
-      /// Evaluate the fast winding number for point data, without known areas. The
-      /// areas are calculated using igl::knn and igl::copyleft::cgal::point_areas.
-      ///
-      /// This function performes the precomputation and evaluation all in one.
-      /// If you need to acess the precomuptation for repeated evaluations, use the
-      /// two functions designed for exposed precomputation, which are the first two
-      /// functions see in igl/fast_winding_number.h
-      ///
-      /// @param[in] P  #P by 3 list of point locations
-      /// @param[in] N  #P by 3 list of point normals
-      /// @param[in] Q  #Q by 3 list of query points for the winding number
-      /// @param[in] beta  This is a Barnes-Hut style accuracy term that separates near feild
-      ///         from far field. The higher the beta, the more accurate and slower
-      ///         the evaluation. We reccommend using a beta value of 2.
-      /// @param[in] expansion_order    the order of the taylor expansion. We support 0,1,2.
-      /// @param[out] WN  #Q by 1 list of windinng number values at each query point
-      ///
-      template <
-        typename DerivedP, 
-        typename DerivedN, 
-        typename DerivedQ,
-        typename BetaType, 
-        typename DerivedWN>
-      IGL_INLINE void fast_winding_number(
-        const Eigen::MatrixBase<DerivedP>& P,
-        const Eigen::MatrixBase<DerivedN>& N,
-        const Eigen::MatrixBase<DerivedQ>& Q,
-        const int expansion_order,
-        const BetaType beta,
-        Eigen::PlainObjectBase<DerivedWN>& WN);
-      /// \overload
-      template <
-        typename DerivedP, 
-        typename DerivedN, 
-        typename DerivedQ, 
-        typename DerivedWN>
-      IGL_INLINE void fast_winding_number(
-        const Eigen::MatrixBase<DerivedP>& P,
-        const Eigen::MatrixBase<DerivedN>& N,
-        const Eigen::MatrixBase<DerivedQ>& Q,
-        Eigen::PlainObjectBase<DerivedWN>& WN);
-    }
-  }
-}
-#ifndef IGL_STATIC_LIBRARY
-#  include "fast_winding_number.cpp"
-#endif
-
-#endif
-

+ 0 - 53
include/igl/copyleft/cgal/half_space_box.h

@@ -1,53 +0,0 @@
-#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).
-      ///
-      /// @param[in] P  plane so that normal points away from half-space
-      /// @param[in] V  #V by 3 list of vertex positions
-      /// @param[out] BV  #BV by 3 list of box vertex positions
-      /// @param[out] 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::MatrixBase<DerivedV> & V,
-        Eigen::Matrix<CGAL::Epeck::FT,8,3> & BV,
-        Eigen::Matrix<int,12,3> & BF);
-      /// \overload
-      /// @param[in] p  3d point on plane
-      /// @param[in] n  3d vector of normal of plane pointing away from inside
-      template <typename Derivedp, typename Derivedn, typename DerivedV>
-      IGL_INLINE void half_space_box(
-        const Eigen::MatrixBase<Derivedp> & p,
-        const Eigen::MatrixBase<Derivedn> & n,
-        const Eigen::MatrixBase<DerivedV> & V,
-        Eigen::Matrix<CGAL::Epeck::FT,8,3> & BV,
-        Eigen::Matrix<int,12,3> & BF);
-      /// \overload
-      /// @param[in] equ  plane equation: a*x+b*y+c*z + d = 0
-      template <typename Derivedequ, typename DerivedV>
-      IGL_INLINE void half_space_box(
-        const Eigen::MatrixBase<Derivedequ> & equ,
-        const Eigen::MatrixBase<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

+ 0 - 60
include/igl/copyleft/cgal/hausdorff.h

@@ -1,60 +0,0 @@
-// This file is part of libigl, a simple c++ geometry processing library.
-// 
-// Copyright (C) 2015 Alec Jacobson <[email protected]>
-// 
-// This Source Code Form is subject to the terms of the Mozilla Public License 
-// v. 2.0. If a copy of the MPL was not distributed with this file, You can 
-// obtain one at http://mozilla.org/MPL/2.0/.
-#ifndef IGL_COPYLEFT_CGAL_HAUSDORFF_H
-#define IGL_COPYLEFT_CGAL_HAUSDORFF_H
-#include "../../igl_inline.h"
-
-#include <Eigen/Dense>
-#include "CGAL_includes.hpp"
-#include <vector>
-
-namespace igl 
-{
-  namespace copyleft
-  {
-    namespace cgal
-    {
-      /// Compute lower and upper bounds (l,u) on the Hausdorff distance between a triangle
-      /// (V) and a pointset (e.g., mesh, triangle soup) given by a distance function
-      /// handle (dist_to_B).
-      ///
-      /// @param[in] V   3 by 3 list of corner positions so that V.row(i) is the position of the
-      ///     ith corner
-      /// @param[in] treeB  CGAL's AABB tree containing triangle soup (VB,FB)
-      /// @param[in] TB  list of CGAL triangles in order of FB (for determining which was found
-      ///     in computation)
-      /// @param[out] l  lower bound on Hausdorff distance 
-      /// @param[out] u  upper bound on Hausdorff distance
-      ///
-      template <
-        typename DerivedV,
-        typename Kernel,
-        typename Scalar>
-      IGL_INLINE void hausdorff(
-        const Eigen::MatrixBase<DerivedV>& V,
-        const CGAL::AABB_tree<
-          CGAL::AABB_traits<Kernel, 
-            CGAL::AABB_triangle_primitive<Kernel, 
-              typename std::vector<CGAL::Triangle_3<Kernel> >::iterator
-            >
-          >
-        > & treeB,
-        const std::vector<CGAL::Triangle_3<Kernel> > & TB,
-        Scalar & l,
-        Scalar & u);
-    }
-  }
-}
-
-#ifndef IGL_STATIC_LIBRARY
-#  include "hausdorff.cpp"
-#endif
-
-#endif
-
-

+ 0 - 42
include/igl/copyleft/cgal/incircle.h

@@ -1,42 +0,0 @@
-// This file is part of libigl, a simple c++ geometry processing library.
-//
-// Copyright (C) 2016 Qingan Zhou <[email protected]>
-//
-// This Source Code Form is subject to the terms of the Mozilla Public License
-// v. 2.0. If a copy of the MPL was not distributed with this file, You can
-// obtain one at http://mozilla.org/MPL/2.0/.
-
-#ifndef IGL_COPYLEFT_CGAL_INCIRCLE_H
-#define IGL_COPYLEFT_CGAL_INCIRCLE_H
-
-#include "../../igl_inline.h"
-
-namespace igl
-{
-  namespace copyleft
-  {
-    namespace cgal
-    {
-      /// Test whether point is in a given circle
-      ///
-      /// @param[in] pa 2D point on sphere
-      /// @param[in] pb 2D point on sphere
-      /// @param[in] pc 2D point on sphere
-      /// @param[in] pd 2D point to test
-      /// @return 1 if pd is inside of the oriented circle formed by pa,pb,pc.
-      ///   0 if pd is co-circular with pa,pb,pc.
-      ///  -1 if pd is outside of the oriented circle formed by pa,pb,pc.
-      template <typename Scalar>
-      IGL_INLINE short incircle(
-          const Scalar *pa,
-          const Scalar *pb,
-          const Scalar *pc,
-          const Scalar *pd);
-    }
-  }
-}
-
-#ifndef IGL_STATIC_LIBRARY
-#  include "incircle.cpp"
-#endif
-#endif

+ 0 - 58
include/igl/copyleft/cgal/insert_into_cdt.h

@@ -1,58 +0,0 @@
-// This file is part of libigl, a simple c++ geometry processing library.
-//
-// Copyright (C) 2016 Alec Jacobson
-//
-// This Source Code Form is subject to the terms of the Mozilla Public License
-// v. 2.0. If a copy of the MPL was not distributed with this file, You can
-// obtain one at http://mozilla.org/MPL/2.0/.
-#ifndef IGL_COPYLEFT_CGAL_INSERT_INTO_CDT_H
-#define IGL_COPYLEFT_CGAL_INSERT_INTO_CDT_H
-#include "../../igl_inline.h"
-
-#include <CGAL/double.h> // Workaround https://github.com/CGAL/cgal/issues/2182 with CGAL 4.10-1
-#include <CGAL/Plane_3.h>
-#include <CGAL/Constrained_Delaunay_triangulation_2.h>
-#include <CGAL/Constrained_triangulation_plus_2.h>
-
-namespace igl
-{
-  namespace copyleft
-  {
-    namespace cgal
-    {
-      /// Given a current 2D constrained Delaunay triangulation (cdt), insert a
-      /// 3D "object" (e.g., resulting from intersecting two triangles) into the
-      /// cdt, by projecting it via the given plane (P) and adding appropriate
-      /// constraints.
-      ///
-      /// @param[in] obj  CGAL::Object representing a vertex, segment, or (convex)
-      ///     polygon. All vertices should lie on the plane P. If not, then this
-      ///     adds the _projection_ of this object to the cdt and that might not
-      ///     be what you wanted to do.
-      /// @param[in] P  plane obj lies on and upon which the cdt is being performed
-      /// @param[in] cdt  current CDT, see output
-      /// @param[out] cdt  CDT updated to contain constraints for the given object
-      ///
-      template <typename Kernel>
-      IGL_INLINE void insert_into_cdt(
-        const CGAL::Object & obj,
-        const CGAL::Plane_3<Kernel> & P,
-        CGAL::Constrained_triangulation_plus_2<
-          CGAL::Constrained_Delaunay_triangulation_2<
-            Kernel,
-            CGAL::Triangulation_data_structure_2<
-              CGAL::Triangulation_vertex_base_2<Kernel>,
-              CGAL::Constrained_triangulation_face_base_2< Kernel>
-            >,
-            CGAL::Exact_intersections_tag
-          >
-        >
-        & cdt);
-    }
-  }
-}
-
-#ifndef IGL_STATIC_LIBRARY
-#  include "insert_into_cdt.cpp"
-#endif
-#endif

+ 0 - 45
include/igl/copyleft/cgal/insphere.h

@@ -1,45 +0,0 @@
-// This file is part of libigl, a simple c++ geometry processing library.
-// 
-// Copyright (C) 2016 Qingan Zhou <[email protected]>
-// 
-// This Source Code Form is subject to the terms of the Mozilla Public License 
-// v. 2.0. If a copy of the MPL was not distributed with this file, You can 
-// obtain one at http://mozilla.org/MPL/2.0/.
-
-#ifndef IGL_COPYLEFT_CGAL_INSPHERE_H
-#define IGL_COPYLEFT_CGAL_INSPHERE_H
-
-#include "../../igl_inline.h"
-
-namespace igl
-{
-  namespace copyleft
-  {
-    namespace cgal
-    {
-      /// Test whether point is in a given sphere.
-      ///
-      /// @param[in] pa 3D point on sphere
-      /// @param[in] pb 3D point on sphere
-      /// @param[in] pc 3D point on sphere
-      /// @param[in] pd 3D point on sphere
-      /// @param[in] pe 3D point to test
-      /// @return 1 if pe is inside of the oriented sphere formed by pa,pb,pc,pd,
-      ///  0 if pe is co-spherical with pa,pb,pc,pd, 
-      ///  -1 if pe is outside of the oriented sphere formed by pa,pb,pc,pd.
-      ///
-      template <typename Scalar>
-      IGL_INLINE short insphere(
-          const Scalar pa[3],
-          const Scalar pb[3],
-          const Scalar pc[3],
-          const Scalar pd[3],
-          const Scalar pe[3]);
-    }
-  }
-}
-
-#ifndef IGL_STATIC_LIBRARY
-#  include "insphere.cpp"
-#endif
-#endif

+ 0 - 77
include/igl/copyleft/cgal/intersect_other.h

@@ -1,77 +0,0 @@
-// This file is part of libigl, a simple c++ geometry processing library.
-// 
-// Copyright (C) 2015 Alec Jacobson <[email protected]>
-// 
-// This Source Code Form is subject to the terms of the Mozilla Public License 
-// v. 2.0. If a copy of the MPL was not distributed with this file, You can 
-// obtain one at http://mozilla.org/MPL/2.0/.
-#ifndef IGL_COPYLEFT_CGAL_INTERSECT_OTHER_H
-#define IGL_COPYLEFT_CGAL_INTERSECT_OTHER_H
-#include "../../igl_inline.h"
-#include "RemeshSelfIntersectionsParam.h"
-
-#include <Eigen/Dense>
-
-namespace igl
-{
-  namespace copyleft
-  {
-    namespace cgal
-    {
-      /// Given a triangle mesh (VA,FA) and another mesh (VB,FB) find all pairs
-      /// of intersecting faces. Note that self-intersections are ignored.
-      /// 
-      /// @param[in] VA  #V by 3 list of vertex positions
-      /// @param[in] FA  #F by 3 list of triangle indices into VA
-      /// @param[in] VB  #V by 3 list of vertex positions
-      /// @param[in] FB  #F by 3 list of triangle indices into VB
-      /// @param[in] params   whether to detect only and then whether to only
-      ///   find first intersection
-      /// @param[out] IF  #intersecting face pairs by 2 list of intersecting
-      ///   face pairs, indexing FA and FB
-      /// @param[out] VVAB  #VVAB by 3 list of vertex positions
-      /// @param[out] FFAB  #FFAB by 3 list of triangle indices into VVA
-      /// @param[out] JAB  #FFAB list of indices into [FA;FB] denoting birth triangle
-      /// @param[out] IMAB  #VVAB list of indices stitching duplicates
-      ///   (resulting from mesh intersections) together
-      /// @return true on success
-      template <
-        typename DerivedVA,
-        typename DerivedFA,
-        typename DerivedVB,
-        typename DerivedFB,
-        typename DerivedIF,
-        typename DerivedVVAB,
-        typename DerivedFFAB,
-        typename DerivedJAB,
-        typename DerivedIMAB>
-      IGL_INLINE bool intersect_other(
-        const Eigen::PlainObjectBase<DerivedVA> & VA,
-        const Eigen::PlainObjectBase<DerivedFA> & FA,
-        const Eigen::PlainObjectBase<DerivedVB> & VB,
-        const Eigen::PlainObjectBase<DerivedFB> & FB,
-        const RemeshSelfIntersectionsParam & params,
-        Eigen::PlainObjectBase<DerivedIF> & IF,
-        Eigen::PlainObjectBase<DerivedVVAB> & VVAB,
-        Eigen::PlainObjectBase<DerivedFFAB> & FFAB,
-        Eigen::PlainObjectBase<DerivedJAB>  & JAB,
-        Eigen::PlainObjectBase<DerivedIMAB> & IMAB);
-      /// \overload
-      /// @param[in] first_only  whether to only find first intersection
-      IGL_INLINE bool intersect_other(
-        const Eigen::MatrixXd & VA,
-        const Eigen::MatrixXi & FA,
-        const Eigen::MatrixXd & VB,
-        const Eigen::MatrixXi & FB,
-        const bool first_only,
-        Eigen::MatrixXi & IF);
-    }
-  }
-}
-
-#ifndef IGL_STATIC_LIBRARY
-#  include "intersect_other.cpp"
-#endif
-  
-#endif
-

+ 0 - 81
include/igl/copyleft/cgal/intersect_with_half_space.h

@@ -1,81 +0,0 @@
-#ifndef IGL_COPYLEFT_CGAL_INTERSECT_WITH_HALF_SPACE_H
-#define IGL_COPYLEFT_CGAL_INTERSECT_WITH_HALF_SPACE_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
-    {
-      /// Intersect a PWN mesh with a half-space. Point on plane, normal pointing
-      /// outward.
-      ///
-      /// @param[in] V  #V by 3 list of mesh vertex positions
-      /// @param[in] p  3d point on plane
-      /// @param[in] n  3d vector of normal of plane pointing away from inside
-      /// @param[out] VC  #VC by 3 list of vertex positions of boolean result mesh
-      /// @param[out] FC  #FC by 3 list of triangle indices into VC
-      /// @param[out] J  #FC list of indices into [F;F.rows()+[1;2]] revealing
-      ///   "birth" facet
-      /// @return true if mesh_boolean was succsesful
-      template <
-        typename DerivedV,
-        typename DerivedF,
-        typename Derivedp,
-        typename Derivedn,
-        typename DerivedVC,
-        typename DerivedFC,
-        typename DerivedJ>
-      IGL_INLINE bool intersect_with_half_space(
-        const Eigen::MatrixBase<DerivedV > & V,
-        const Eigen::MatrixBase<DerivedF > & F,
-        const Eigen::MatrixBase<Derivedp > & p,
-        const Eigen::MatrixBase<Derivedn > & n,
-        Eigen::PlainObjectBase<DerivedVC > & VC,
-        Eigen::PlainObjectBase<DerivedFC > & FC,
-        Eigen::PlainObjectBase<DerivedJ > & J);
-      /// \overload
-      /// @param[in] equ  plane equation: P(x,y,z) = a*x+b*y+c*z + d = 0,
-      ///   P(x,y,z) < 0 is _inside_.
-      template <
-        typename DerivedV,
-        typename DerivedF,
-        typename Derivedequ,
-        typename DerivedVC,
-        typename DerivedFC,
-        typename DerivedJ>
-      IGL_INLINE bool intersect_with_half_space(
-        const Eigen::MatrixBase<DerivedV > & V,
-        const Eigen::MatrixBase<DerivedF > & F,
-        const Eigen::MatrixBase<Derivedequ > & equ,
-        Eigen::PlainObjectBase<DerivedVC > & VC,
-        Eigen::PlainObjectBase<DerivedFC > & FC,
-        Eigen::PlainObjectBase<DerivedJ > & J);
-      /// \overload
-      /// @param[in] P  plane 
-      template <
-        typename DerivedV,
-        typename DerivedF,
-        typename DerivedVC,
-        typename DerivedFC,
-        typename DerivedJ>
-      IGL_INLINE bool intersect_with_half_space(
-        const Eigen::MatrixBase<DerivedV > & V,
-        const Eigen::MatrixBase<DerivedF > & F,
-        const CGAL::Plane_3<CGAL::Epeck> & P,
-        Eigen::PlainObjectBase<DerivedVC > & VC,
-        Eigen::PlainObjectBase<DerivedFC > & FC,
-        Eigen::PlainObjectBase<DerivedJ > & J);
-    }
-  }
-}
-
-#ifndef IGL_STATIC_LIBRARY
-#  include "intersect_with_half_space.cpp"
-#endif
-
-#endif

+ 0 - 43
include/igl/copyleft/cgal/lexicographic_triangulation.h

@@ -1,43 +0,0 @@
-// This file is part of libigl, a simple c++ geometry processing library.
-// 
-// Copyright (C) 2016 Alec Jacobson <[email protected]>
-//                    Qingan Zhou <[email protected]>
-// 
-// This Source Code Form is subject to the terms of the Mozilla Public License 
-// v. 2.0. If a copy of the MPL was not distributed with this file, You can 
-// obtain one at http://mozilla.org/MPL/2.0/.
-
-#ifndef IGL_COPYLEFT_CGAL_LEXICOGRAPHIC_TRIANGULATION_H
-#define IGL_COPYLEFT_CGAL_LEXICOGRAPHIC_TRIANGULATION_H
-#include "../../igl_inline.h"
-#include <Eigen/Core>
-
-namespace igl
-{
-  namespace copyleft
-  {
-    namespace cgal
-    {
-      /// Given a set of points in 2D, return a lexicographic triangulation of these
-      /// points.
-      ///
-      /// @param[in] P  #P by 2 list of vertex positions
-      /// @param[out] F  #F by 3 of faces in lexicographic triangulation.
-      template<
-        typename DerivedP,
-        typename DerivedF
-        >
-      IGL_INLINE void lexicographic_triangulation(
-          const Eigen::PlainObjectBase<DerivedP>& P,
-          Eigen::PlainObjectBase<DerivedF>& F);
-    }
-  }
-}
-
-
-
-
-#ifndef IGL_STATIC_LIBRARY
-#  include "lexicographic_triangulation.cpp"
-#endif
-#endif

+ 0 - 192
include/igl/copyleft/cgal/mesh_boolean.h

@@ -1,192 +0,0 @@
-// This file is part of libigl, a simple c++ geometry processing library.
-// 
-// Copyright (C) 2015 Alec Jacobson <[email protected]>
-//                    Qingnan Zhou <[email protected]>
-// 
-// This Source Code Form is subject to the terms of the Mozilla Public License 
-// v. 2.0. If a copy of the MPL was not distributed with this file, You can 
-// obtain one at http://mozilla.org/MPL/2.0/.
-//
-#ifndef IGL_COPYLEFT_CGAL_MESH_BOOLEAN_H
-#define IGL_COPYLEFT_CGAL_MESH_BOOLEAN_H
-
-#include "../../igl_inline.h"
-#include "../../MeshBooleanType.h"
-#include <Eigen/Core>
-#include <functional>
-#include <vector>
-
-namespace igl
-{
-  namespace copyleft
-  {
-    namespace cgal
-    {
-      ///  Compute Boolean csg operations on "solid", consistently oriented
-      ///  meshes.
-      ///
-      ///  @param[in] VA  #VA by 3 list of vertex positions of first mesh
-      ///  @param[in] FA  #FA by 3 list of triangle indices into VA
-      ///  @param[in] VB  #VB by 3 list of vertex positions of second mesh
-      ///  @param[in] FB  #FB by 3 list of triangle indices into VB
-      ///  @param[in] type  type of boolean operation
-      ///  @param[out] VC  #VC by 3 list of vertex positions of boolean result mesh
-      ///  @param[out] FC  #FC by 3 list of triangle indices into VC
-      ///  @param[out] J  #FC list of indices into [FA;FA.rows()+FB] revealing "birth" facet
-      ///  @return true if inputs induce a piecewise constant winding number
-      ///  field and type is valid
-      ///
-      ///  \see mesh_boolean_cork, intersect_other, remesh_self_intersections
-      template <
-        typename DerivedVA,
-        typename DerivedFA,
-        typename DerivedVB,
-        typename DerivedFB,
-        typename DerivedVC,
-        typename DerivedFC,
-        typename DerivedJ>
-      IGL_INLINE bool mesh_boolean(
-        const Eigen::MatrixBase<DerivedVA > & VA,
-        const Eigen::MatrixBase<DerivedFA > & FA,
-        const Eigen::MatrixBase<DerivedVB > & VB,
-        const Eigen::MatrixBase<DerivedFB > & FB,
-        const MeshBooleanType & type,
-        Eigen::PlainObjectBase<DerivedVC > & VC,
-        Eigen::PlainObjectBase<DerivedFC > & FC,
-        Eigen::PlainObjectBase<DerivedJ > & J);
-      /// \overload
-      /// @param[in] type_str  string describing type of boolean operation see mesh_boolean_type_to_funcs
-      template <
-        typename DerivedVA,
-        typename DerivedFA,
-        typename DerivedVB,
-        typename DerivedFB,
-        typename DerivedVC,
-        typename DerivedFC,
-        typename DerivedJ>
-      IGL_INLINE bool mesh_boolean(
-        const Eigen::MatrixBase<DerivedVA > & VA,
-        const Eigen::MatrixBase<DerivedFA > & FA,
-        const Eigen::MatrixBase<DerivedVB > & VB,
-        const Eigen::MatrixBase<DerivedFB > & FB,
-        const std::string & type_str,
-        Eigen::PlainObjectBase<DerivedVC > & VC,
-        Eigen::PlainObjectBase<DerivedFC > & FC,
-        Eigen::PlainObjectBase<DerivedJ > & J);
-      ///  \overload
-      ///
-      ///  @param[in] wind_num_op  function handle for filtering winding numbers from
-      ///               tuples of integer values to [0,1] outside/inside values
-      ///  @param[in] keep  function handle for determining if a patch should be "kept"
-      ///      in the output based on the winding number on either side
-      template <
-        typename DerivedVA,
-        typename DerivedFA,
-        typename DerivedVB,
-        typename DerivedFB,
-        typename DerivedVC,
-        typename DerivedFC,
-        typename DerivedJ>
-      IGL_INLINE bool mesh_boolean(
-          const Eigen::MatrixBase<DerivedVA> & VA,
-          const Eigen::MatrixBase<DerivedFA> & FA,
-          const Eigen::MatrixBase<DerivedVB> & VB,
-          const Eigen::MatrixBase<DerivedFB> & FB,
-          const std::function<int(const Eigen::Matrix<int,1,Eigen::Dynamic>) >& wind_num_op,
-          const std::function<int(const int, const int)> & keep,
-          Eigen::PlainObjectBase<DerivedVC > & VC,
-          Eigen::PlainObjectBase<DerivedFC > & FC,
-          Eigen::PlainObjectBase<DerivedJ > & J);
-      /// Variadic mesh Boolean operations
-      ///
-      /// @param[in] Vlist  k-long list of lists of mesh vertex positions
-      /// @param[in] Flist  k-long list of lists of mesh face indices, so that Flist[i] indexes
-      ///      vertices in Vlist[i]
-      /// @param[in] wind_num_op  function handle for filtering winding numbers from
-      ///      n-tuples of integer values to [0,1] outside/inside values
-      /// @param[in] keep  function handle for determining if a patch should be "kept"
-      ///      in the output based on the winding number on either side
-      /// @param[out] VC  #VC by 3 list of vertex positions of boolean result mesh
-      /// @param[out] FC  #FC by 3 list of triangle indices into VC
-      /// @param[out] J  #FC list of indices into [Flist[0];Flist[1];...;Flist[k]]
-      ///      revealing "birth" facet
-      /// @return true iff inputs induce a piecewise constant winding number
-      ///   field
-      template <
-        typename DerivedV,
-        typename DerivedF,
-        typename DerivedVC,
-        typename DerivedFC,
-        typename DerivedJ>
-      IGL_INLINE bool mesh_boolean(
-          const std::vector<DerivedV > & Vlist,
-          const std::vector<DerivedF > & Flist,
-          const std::function<int(const Eigen::Matrix<int,1,Eigen::Dynamic>) >& wind_num_op,
-          const std::function<int(const int, const int)> & keep,
-          Eigen::PlainObjectBase<DerivedVC > & VC,
-          Eigen::PlainObjectBase<DerivedFC > & FC,
-          Eigen::PlainObjectBase<DerivedJ > & J);
-      /// \overload
-      template <
-        typename DerivedV,
-        typename DerivedF,
-        typename DerivedVC,
-        typename DerivedFC,
-        typename DerivedJ>
-      IGL_INLINE bool mesh_boolean(
-          const std::vector<DerivedV > & Vlist,
-          const std::vector<DerivedF > & Flist,
-          const MeshBooleanType & type,
-          Eigen::PlainObjectBase<DerivedVC > & VC,
-          Eigen::PlainObjectBase<DerivedFC > & FC,
-          Eigen::PlainObjectBase<DerivedJ > & J);
-      /// \overload
-      /// \brief Given a merged mesh (V,F) and list of sizes of inputs
-      ///
-      /// @param[in] V  #V by 3 list of merged mesh vertex positions
-      /// @param[in] F  #F by 3 list of merged mesh face indices so that first sizes(0)
-      ///     faces come from the first input, and the next sizes(1) faces come
-      ///     from the second input, and so on.
-      /// @param[in] sizes  #inputs list of sizes so that sizes(i) is the #faces in the
-      ///     ith input
-      template <
-        typename DerivedVV,
-        typename DerivedFF,
-        typename Derivedsizes,
-        typename DerivedVC,
-        typename DerivedFC,
-        typename DerivedJ>
-      IGL_INLINE bool mesh_boolean(
-          const Eigen::MatrixBase<DerivedVV > & VV,
-          const Eigen::MatrixBase<DerivedFF > & FF,
-          const Eigen::MatrixBase<Derivedsizes> & sizes,
-          const std::function<int(const Eigen::Matrix<int,1,Eigen::Dynamic>) >& wind_num_op,
-          const std::function<int(const int, const int)> & keep,
-          Eigen::PlainObjectBase<DerivedVC > & VC,
-          Eigen::PlainObjectBase<DerivedFC > & FC,
-          Eigen::PlainObjectBase<DerivedJ > & J);
-      /// \overload
-      template <
-        typename DerivedVA,
-        typename DerivedFA,
-        typename DerivedVB,
-        typename DerivedFB,
-        typename DerivedVC,
-        typename DerivedFC>
-      IGL_INLINE bool mesh_boolean(
-          const Eigen::MatrixBase<DerivedVA > & VA,
-          const Eigen::MatrixBase<DerivedFA > & FA,
-          const Eigen::MatrixBase<DerivedVB > & VB,
-          const Eigen::MatrixBase<DerivedFB > & FB,
-          const MeshBooleanType & type,
-          Eigen::PlainObjectBase<DerivedVC > & VC,
-          Eigen::PlainObjectBase<DerivedFC > & FC);
-    }
-  }
-}
-
-#ifndef IGL_STATIC_LIBRARY
-#  include "mesh_boolean.cpp"
-#endif
-
-#endif

+ 0 - 35
include/igl/copyleft/cgal/mesh_boolean_type_to_funcs.h

@@ -1,35 +0,0 @@
-#ifndef IGL_COPYLEFT_CGAL_MESH_BOOLEAN_TYPE_TO_FUNCS_H
-#define IGL_COPYLEFT_CGAL_MESH_BOOLEAN_TYPE_TO_FUNCS_H
-
-#include "../../igl_inline.h"
-#include "../../MeshBooleanType.h"
-#include <Eigen/Core>
-#include <functional>
-namespace igl
-{
-  namespace copyleft
-  {
-    namespace cgal
-    {
-      /// Convert a MeshBooleanType enum to a pair of winding number conversion
-      /// function and "keep" function used by mesh_boolean
-      ///
-      /// @param[in] type  MeshBooleanType enum value
-      /// @param[out] wind_num_op  function handle for filtering winding numbers from
-      ///      tuples of integer values to [0,1] outside/inside values
-      /// @param[out] keep  function handle for determining if a patch should be "kept"
-      ///      in the output based on the winding number on either side
-      ///
-      /// \see string_to_mesh_boolean_type
-      IGL_INLINE void mesh_boolean_type_to_funcs(
-        const MeshBooleanType & type,
-        std::function<int(const Eigen::Matrix<int,1,Eigen::Dynamic>) >& 
-          wind_num_op,
-        std::function<int(const int, const int)> & keep);
-    }
-  }
-}
-#ifndef IGL_STATIC_LIBRARY
-#  include "mesh_boolean_type_to_funcs.cpp"
-#endif
-#endif

+ 0 - 41
include/igl/copyleft/cgal/mesh_to_cgal_triangle_list.h

@@ -1,41 +0,0 @@
-// This file is part of libigl, a simple c++ geometry processing library.
-// 
-// Copyright (C) 2014 Alec Jacobson <[email protected]>
-// 
-// This Source Code Form is subject to the terms of the Mozilla Public License 
-// v. 2.0. If a copy of the MPL was not distributed with this file, You can 
-// obtain one at http://mozilla.org/MPL/2.0/.
-#ifndef IGL_COPYLEFT_CGAL_MESH_TO_CGAL_TRIANGLE_LIST_H
-#define IGL_COPYLEFT_CGAL_MESH_TO_CGAL_TRIANGLE_LIST_H
-#include "../../igl_inline.h"
-#include <Eigen/Core>
-#include "CGAL_includes.hpp"
-namespace igl
-{
-  namespace copyleft
-  {
-    namespace cgal
-    {
-      /// Convert a mesh (V,F) to a list of CGAL triangles
-      ///
-      /// @2tparam Kernal  CGAL computation and construction kernel (e.g.
-      ///     CGAL::Exact_predicates_exact_constructions_kernel)
-      /// @param[in] V  #V by 3 list of vertex positions
-      /// @param[in] F  #F by 3 list of triangle indices
-      /// @param[out] T  #F list of CGAL triangles
-      template <
-        typename DerivedV,
-        typename DerivedF,
-        typename Kernel>
-      IGL_INLINE void mesh_to_cgal_triangle_list(
-        const Eigen::MatrixBase<DerivedV> & V,
-        const Eigen::MatrixBase<DerivedF> & F,
-        std::vector<CGAL::Triangle_3<Kernel> > & T);
-    }
-  }
-}
-#ifndef IGL_STATIC_LIBRARY
-#  include "mesh_to_cgal_triangle_list.cpp"
-#endif
-
-#endif

+ 0 - 42
include/igl/copyleft/cgal/mesh_to_polyhedron.h

@@ -1,42 +0,0 @@
-// This file is part of libigl, a simple c++ geometry processing library.
-// 
-// Copyright (C) 2015 Alec Jacobson <[email protected]>
-// 
-// This Source Code Form is subject to the terms of the Mozilla Public License 
-// v. 2.0. If a copy of the MPL was not distributed with this file, You can 
-// obtain one at http://mozilla.org/MPL/2.0/.
-#ifndef IGL_COPYLEFT_CGAL_MESH_TO_POLYHEDRON_H
-#define IGL_COPYLEFT_CGAL_MESH_TO_POLYHEDRON_H
-#include "../../igl_inline.h"
-#include <Eigen/Core>
-
-namespace igl
-{
-  namespace copyleft
-  {
-    namespace cgal
-    {
-      /// Convert a mesh (V,F) to a CGAL Polyhedron
-      ///
-      /// @tparam Polyhedron  CGAL Polyhedron type (e.g. Polyhedron_3)
-      /// @param[in] V  #V by 3 list of vertex positions
-      /// @param[in] F  #F by 3 list of triangle indices
-      /// @param[out] poly  cgal polyhedron
-      /// @return true only if (V,F) can be converted to a valid polyhedron
-      /// (i.e. if (V,F) is vertex and edge manifold).
-      template <
-        typename DerivedV,
-        typename DerivedF,
-        typename Polyhedron>
-      IGL_INLINE bool mesh_to_polyhedron(
-        const Eigen::MatrixBase<DerivedV> & V,
-        const Eigen::MatrixBase<DerivedF> & F,
-        Polyhedron & poly);
-    }
-  }
-}
-#ifndef IGL_STATIC_LIBRARY
-#  include "mesh_to_polyhedron.cpp"
-#endif
-
-#endif

+ 0 - 99
include/igl/copyleft/cgal/minkowski_sum.h

@@ -1,99 +0,0 @@
-// This file is part of libigl, a simple c++ geometry processing library.
-// 
-// Copyright (C) 2016 Alec Jacobson <[email protected]>
-// 
-// This Source Code Form is subject to the terms of the Mozilla Public License 
-// v. 2.0. If a copy of the MPL was not distributed with this file, You can 
-// obtain one at http://mozilla.org/MPL/2.0/.
-#ifndef IGL_COPYLEFT_CGAL_MINKOWSKI_SUM_H
-#define IGL_COPYLEFT_CGAL_MINKOWSKI_SUM_H
-
-#include "../../igl_inline.h"
-#include <Eigen/Core>
-
-namespace igl
-{
-  namespace copyleft
-  {
-    namespace cgal
-    {
-      /// Compute the Minkowski sum of a closed triangle mesh (V,F) and a
-      /// set of simplices in 3D.
-      ///
-      /// @param[in] VA  #VA by 3 list of mesh vertices in 3D
-      /// @param[in] FA  #FA by 3 list of triangle indices into VA
-      /// @param[in] VB  #VB by 3 list of mesh vertices in 3D
-      /// @param[in] FB  #FB by ss list of simplex indices into VB, ss<=3
-      /// @param[in] resolve_overlaps  whether or not to resolve self-union. If false
-      ///     then result may contain self-intersections if input mesh is
-      ///     non-convex.
-      /// @param[out] W  #W by 3 list of mesh vertices in 3D
-      /// @param[out] G  #G by 3 list of triangle indices into W
-      /// @param[out] J  #G by 2 list of indices into 
-      ///   
-      template <
-        typename DerivedVA,
-        typename DerivedFA,
-        typename DerivedVB,
-        typename DerivedFB,
-        typename DerivedW,
-        typename DerivedG,
-        typename DerivedJ>
-      IGL_INLINE void minkowski_sum(
-        const Eigen::MatrixBase<DerivedVA> & VA,
-        const Eigen::MatrixBase<DerivedFA> & FA,
-        const Eigen::MatrixBase<DerivedVB> & VB,
-        const Eigen::MatrixBase<DerivedFB> & FB,
-        const bool resolve_overlaps,
-        Eigen::PlainObjectBase<DerivedW> & W,
-        Eigen::PlainObjectBase<DerivedG> & G,
-        Eigen::PlainObjectBase<DerivedJ> & J);
-      /// \overload
-      /// \brief Compute the Minkowski sum of a closed triangle mesh (V,F) and a
-      /// segment [s,d] in 3D.
-      ///
-      /// @param[in] s  segment source endpoint in 3D
-      /// @param[in] d  segment source endpoint in 3D
-      template <
-        typename DerivedVA,
-        typename DerivedFA,
-        typename sType, int sCols, int sOptions,
-        typename dType, int dCols, int dOptions,
-        typename DerivedW,
-        typename DerivedG,
-        typename DerivedJ>
-      IGL_INLINE void minkowski_sum(
-        const Eigen::MatrixBase<DerivedVA> & VA,
-        const Eigen::MatrixBase<DerivedFA> & FA,
-        const Eigen::Matrix<sType,1,sCols,sOptions> & s,
-        const Eigen::Matrix<dType,1,dCols,dOptions> & d,
-        const bool resolve_overlaps,
-        Eigen::PlainObjectBase<DerivedW> & W,
-        Eigen::PlainObjectBase<DerivedG> & G,
-        Eigen::PlainObjectBase<DerivedJ> & J);
-      /// \overload
-      template <
-        typename DerivedVA,
-        typename DerivedFA,
-        typename sType, int sCols, int sOptions,
-        typename dType, int dCols, int dOptions,
-        typename DerivedW,
-        typename DerivedG,
-        typename DerivedJ>
-      IGL_INLINE void minkowski_sum(
-        const Eigen::MatrixBase<DerivedVA> & VA,
-        const Eigen::MatrixBase<DerivedFA> & FA,
-        const Eigen::Matrix<sType,1,sCols,sOptions> & s,
-        const Eigen::Matrix<dType,1,dCols,dOptions> & d,
-        Eigen::PlainObjectBase<DerivedW> & W,
-        Eigen::PlainObjectBase<DerivedG> & G,
-        Eigen::PlainObjectBase<DerivedJ> & J);
-    }
-  }
-}
-
-#ifndef IGL_STATIC_LIBRARY
-#  include "minkowski_sum.cpp"
-#endif
-
-#endif

+ 0 - 77
include/igl/copyleft/cgal/order_facets_around_edge.h

@@ -1,77 +0,0 @@
-// This file is part of libigl, a simple c++ geometry processing library.
-// 
-// Copyright (C) 2015 Qingnan Zhou <[email protected]>
-// 
-// This Source Code Form is subject to the terms of the Mozilla Public License 
-// v. 2.0. If a copy of the MPL was not distributed with this file, You can 
-// obtain one at http://mozilla.org/MPL/2.0/.
-//
-#ifndef IGL_COPYLEFT_CGAL_ORDER_FACETS_AROUND_EDGE_H
-#define IGL_COPYLEFT_CGAL_ORDER_FACETS_AROUND_EDGE_H
-#include "../../igl_inline.h"
-#include <Eigen/Core>
-#include <vector>
-
-namespace igl 
-{
-  namespace copyleft
-  {
-    namespace cgal 
-    {
-      /// Given a directed edge, sort its adjacent faces.  Assuming the
-      /// directed edge is (s, d).  Sort the adjacent faces clockwise around the
-      /// axis (d - s), i.e. left-hand rule.  An adjacent face is consistently
-      /// oriented if it contains (d, s) as a directed edge.
-      ///
-      /// For overlapping faces, break the tie using signed face index, smaller
-      /// signed index comes before the larger signed index.  Signed index is
-      /// computed as (consistent? 1:-1) * (face_index + 1).
-      ///
-      /// @param[in] V  #V by 3 list of vertices.
-      /// @param[in] F  #F by 3 list of faces
-      /// @param[in] s  Index of source vertex.
-      /// @param[in] d  Index of destination vertex.
-      /// @param[in] adj_faces  List of adjacent face signed indices.
-      /// @param[out] order  List of face indices that orders adjacent faces around edge
-      ///     (s, d) clockwise.
-      template<
-        typename DerivedV,
-        typename DerivedF,
-        typename DerivedI >
-      IGL_INLINE
-      void order_facets_around_edge(
-          const Eigen::PlainObjectBase<DerivedV>& V,
-          const Eigen::PlainObjectBase<DerivedF>& F,
-          size_t s, 
-          size_t d, 
-          const std::vector<int>& adj_faces,
-          Eigen::PlainObjectBase<DerivedI>& order,
-          bool debug=false);
-      /// \overload
-      /// \brief This function is a wrapper around the one above.  Since the ordering
-      /// is circular, the pivot point is used to define a starting point.  So
-      /// order[0] is the index into adj_face that is immediately after the
-      /// pivot face (s, d, pivot point) in clockwise order.
-      ///
-      /// @param[in] pivot_point  A point that forms pivot with edge (s,d)
-      template<
-        typename DerivedV,
-        typename DerivedF,
-        typename DerivedI>
-      IGL_INLINE
-      void order_facets_around_edge(
-        const Eigen::PlainObjectBase<DerivedV>& V,
-        const Eigen::PlainObjectBase<DerivedF>& F,
-        size_t s, 
-        size_t d, 
-        const std::vector<int>& adj_faces,
-        const Eigen::PlainObjectBase<DerivedV>& pivot_point,
-        Eigen::PlainObjectBase<DerivedI>& order);
-    }
-  }
-}
-
-#ifndef IGL_STATIC_LIBRARY
-#include "order_facets_around_edge.cpp"
-#endif
-#endif

+ 0 - 104
include/igl/copyleft/cgal/order_facets_around_edges.h

@@ -1,104 +0,0 @@
-// This file is part of libigl, a simple c++ geometry processing library.
-// 
-// Copyright (C) 2015 Alec Jacobson <[email protected]>
-// 
-// This Source Code Form is subject to the terms of the Mozilla Public License 
-// v. 2.0. If a copy of the MPL was not distributed with this file, You can 
-// obtain one at http://mozilla.org/MPL/2.0/.
-#ifndef IGL_COPYLEFT_CGAL_ORDER_FACETS_AROUND_EDGES_H
-#define IGL_COPYLEFT_CGAL_ORDER_FACETS_AROUND_EDGES_H
-#include "../../igl_inline.h"
-#include <Eigen/Core>
-#include <CGAL/Exact_predicates_exact_constructions_kernel.h>
-#include <vector>
-
-namespace igl
-{
-  namespace copyleft
-  {
-    namespace cgal
-    {
-      /// For each undirected edge, sort its adjacent faces.  Assuming the
-      /// undirected edge is (s, d).  Sort the adjacent faces clockwise around the
-      /// axis (d - s), i.e. left-hand rule.  An adjacent face is consistently
-      /// oriented if it contains (d, s) as a directed edge.
-      ///
-      /// For overlapping faces, break the tie using signed face index, smaller
-      /// signed index comes before the larger signed index.  Signed index is
-      /// computed as (consistent? 1:-1) * index.
-      ///
-      /// @param[in] V    #V by 3 list of vertices.
-      /// @param[in] F    #F by 3 list of faces
-      /// @param[in] N    #F by 3 list of face normals.
-      /// @param[in] uE    #uE by 2 list of vertex_indices, represents undirected edges.
-      /// @param[in] uE2E  #uE list of lists that maps uE to E. (a one-to-many map)
-      /// @param[out] uE2oE #uE list of lists that maps uE to an ordered list of E. (a
-      ///        one-to-many map)
-      /// @param[out] uE2C  #uE list of lists of bools indicates whether each face in
-      ///         uE2oE[i] is consistently orientated as the ordering.
-      ///
-      template<
-          typename DerivedV,
-          typename DerivedF,
-          typename DerivedN,
-          typename DeriveduE,
-          typename uE2EType,
-          typename uE2oEType,
-          typename uE2CType >
-      IGL_INLINE
-      typename std::enable_if<!std::is_same<typename DerivedV::Scalar,
-      typename CGAL::Exact_predicates_exact_constructions_kernel::FT>::value, void>::type
-      order_facets_around_edges(
-        const Eigen::PlainObjectBase<DerivedV>& V,
-        const Eigen::PlainObjectBase<DerivedF>& F,
-        const Eigen::PlainObjectBase<DerivedN>& N,
-        const Eigen::PlainObjectBase<DeriveduE>& uE,
-        const std::vector<std::vector<uE2EType> >& uE2E,
-        std::vector<std::vector<uE2oEType> >& uE2oE,
-        std::vector<std::vector<uE2CType > >& uE2C );
-      /// \overload
-      template<
-          typename DerivedV,
-          typename DerivedF,
-          typename DerivedN,
-          typename DeriveduE,
-          typename uE2EType,
-          typename uE2oEType,
-          typename uE2CType >
-      IGL_INLINE 
-      typename std::enable_if<std::is_same<typename DerivedV::Scalar,
-      typename CGAL::Exact_predicates_exact_constructions_kernel::FT>::value, void>::type
-      order_facets_around_edges(
-        const Eigen::PlainObjectBase<DerivedV>& V,
-        const Eigen::PlainObjectBase<DerivedF>& F,
-        const Eigen::PlainObjectBase<DerivedN>& N,
-        const Eigen::PlainObjectBase<DeriveduE>& uE,
-        const std::vector<std::vector<uE2EType> >& uE2E,
-        std::vector<std::vector<uE2oEType> >& uE2oE,
-        std::vector<std::vector<uE2CType > >& uE2C );
-      /// \overload
-      /// \brief Order faces around each edge. Only exact predicate is used in
-      /// the algorithm.  Normal is not needed.
-      template<
-          typename DerivedV,
-          typename DerivedF,
-          typename DeriveduE,
-          typename uE2EType,
-          typename uE2oEType,
-          typename uE2CType >
-      IGL_INLINE void order_facets_around_edges(
-        const Eigen::PlainObjectBase<DerivedV>& V,
-        const Eigen::PlainObjectBase<DerivedF>& F,
-        const Eigen::PlainObjectBase<DeriveduE>& uE,
-        const std::vector<std::vector<uE2EType> >& uE2E,
-        std::vector<std::vector<uE2oEType> >& uE2oE,
-        std::vector<std::vector<uE2CType > >& uE2C );
-    }
-  }
-}
-
-#ifndef IGL_STATIC_LIBRARY
-#include "order_facets_around_edges.cpp"
-#endif
-
-#endif

+ 0 - 40
include/igl/copyleft/cgal/orient2D.h

@@ -1,40 +0,0 @@
-// This file is part of libigl, a simple c++ geometry processing library.
-//
-// Copyright (C) 2016 Qingan Zhou <[email protected]>
-//
-// This Source Code Form is subject to the terms of the Mozilla Public License
-// v. 2.0. If a copy of the MPL was not distributed with this file, You can
-// obtain one at http://mozilla.org/MPL/2.0/.
-
-#ifndef IGL_COPYLEFT_CGAL_ORIENT_2D_H
-#define IGL_COPYLEFT_CGAL_ORIENT_2D_H
-
-#include "../../igl_inline.h"
-
-namespace igl
-{
-  namespace copyleft
-  {
-    namespace cgal
-    {
-      /// Tests whether a point is above, on, or below a line.
-      ///
-      /// @param[in] pa 2D point on plane
-      /// @param[in] pb 2D point on plane
-      /// @param[in] pc 2D point to test
-      ///  @return 1 if pa,pb,pc,pd forms a triangle of positive area.
-      ///   0 if pa,pb,pc,pd are coplanar.
-      ///  -1 if pa,pb,pc,pd forms a tet of negative area.
-      template <typename Scalar>
-      IGL_INLINE short orient2D(
-          const Scalar *pa,
-          const Scalar *pb,
-          const Scalar *pc);
-    }
-  }
-}
-
-#ifndef IGL_STATIC_LIBRARY
-#  include "orient2D.cpp"
-#endif
-#endif

+ 0 - 42
include/igl/copyleft/cgal/orient3D.h

@@ -1,42 +0,0 @@
-// This file is part of libigl, a simple c++ geometry processing library.
-// 
-// Copyright (C) 2016 Qingan Zhou <[email protected]>
-// 
-// This Source Code Form is subject to the terms of the Mozilla Public License 
-// v. 2.0. If a copy of the MPL was not distributed with this file, You can 
-// obtain one at http://mozilla.org/MPL/2.0/.
-
-#ifndef IGL_COPYLEFT_CGAL_ORIENT_3D_H
-#define IGL_COPYLEFT_CGAL_ORIENT_3D_H
-
-#include "../../igl_inline.h"
-
-namespace igl
-{
-  namespace copyleft
-  {
-    namespace cgal
-    {
-      /// Tests whether a point is above, on, or below a plane.
-      ///
-      /// @param[in] pa 3D point on plane
-      /// @param[in] pb 3D point on plane
-      /// @param[in] pc 3D point on plane
-      /// @param[in] pd 3D point to test
-      ///  @return 1 if pa,pb,pc,pd forms a tet of positive volume.
-      ///   0 if pa,pb,pc,pd are coplanar.
-      ///  -1 if pa,pb,pc,pd forms a tet of negative volume.
-      template <typename Scalar>
-      IGL_INLINE short orient3D(
-          const Scalar pa[3],
-          const Scalar pb[3],
-          const Scalar pc[3],
-          const Scalar pd[3]);
-    }
-  }
-}
-
-#ifndef IGL_STATIC_LIBRARY
-#  include "orient3D.cpp"
-#endif
-#endif

+ 0 - 56
include/igl/copyleft/cgal/outer_edge.h

@@ -1,56 +0,0 @@
-// This file is part of libigl, a simple c++ geometry processing library.
-// 
-// Copyright (C) 2015 Qingan Zhou <[email protected]>
-// Copyright (C) 2021 Alec Jacobson <[email protected]>
-// 
-// This Source Code Form is subject to the terms of the Mozilla Public License 
-// v. 2.0. If a copy of the MPL was not distributed with this file, You can 
-// obtain one at http://mozilla.org/MPL/2.0/.
-#ifndef IGL_COPYLEFT_CGAL_OUTER_EDGE_H
-#define IGL_COPYLEFT_CGAL_OUTER_EDGE_H
-#include "../../igl_inline.h"
-#include <Eigen/Core>
-namespace igl
-{
-  namespace copyleft
-  {
-    namespace cgal
-    {
-      /// Find an edge that is reachable from infinity without crossing any faces.
-      /// Such edge is called "outer edge."
-      ///
-      /// \pre The input mesh must have all self-intersection resolved
-      /// and no duplicated vertices.  The correctness of the output depends on
-      /// the fact that there is no edge overlap.  See
-      /// cgal::remesh_self_intersections.h for how to obtain such input.
-      ///
-      /// @param[in] V  #V by 3 list of vertex positions
-      /// @param[in] F  #F by 3 list of triangle indices into V
-      /// @param[in] I  #I list of facets to consider
-      /// @param[out] v1 index of the first end point of outer edge
-      /// @param[out] v2 index of the second end point of outer edge
-      /// @param[out] A  #A list of facets incident to the outer edge
-      template<
-          typename DerivedV,
-          typename DerivedF,
-          typename DerivedI,
-          typename IndexType,
-          typename DerivedA
-          >
-      IGL_INLINE void outer_edge(
-              const Eigen::PlainObjectBase<DerivedV> & V,
-              const Eigen::PlainObjectBase<DerivedF> & F,
-              const Eigen::PlainObjectBase<DerivedI> & I,
-              IndexType & v1,
-              IndexType & v2,
-              Eigen::PlainObjectBase<DerivedA> & A);
-
-    }
-  }
-}
-
-#ifndef IGL_STATIC_LIBRARY
-#  include "outer_edge.cpp"
-#endif
-#endif
-

+ 0 - 72
include/igl/copyleft/cgal/outer_facet.h

@@ -1,72 +0,0 @@
-// This file is part of libigl, a simple c++ geometry processing library.
-// 
-// Copyright (C) 2015 Qingnan Zhou <[email protected]>
-// 
-// This Source Code Form is subject to the terms of the Mozilla Public License 
-// v. 2.0. If a copy of the MPL was not distributed with this file, You can 
-// obtain one at http://mozilla.org/MPL/2.0/.
-
-#ifndef IGL_COPYLEFT_CGAL_OUTER_FACET_H
-#define IGL_COPYLEFT_CGAL_OUTER_FACET_H
-#include "../../igl_inline.h"
-#include <Eigen/Core>
-
-namespace igl
-{
-  namespace copyleft
-  {
-    namespace cgal
-    {
-      /// Find a facet that is reachable from infinity without crossing any faces.
-      /// Such facet is called "outer facet."
-      ///
-      /// \pre The input mesh must have all self-intersection resolved.  I.e
-      /// there is no duplicated vertices, no overlapping edge and no intersecting
-      /// faces (the only exception is there could be topologically duplicated faces).
-      /// See cgal::remesh_self_intersections.h for how to obtain such input.
-      ///
-      /// This function differ from igl::outer_facet() in the fact this
-      /// function is more robust because it does not rely on facet normals.
-      ///
-      /// @param[in] V  #V by 3 list of vertex positions
-      /// @param[in] F  #F by 3 list of triangle indices into V
-      /// @param[in] I  #I list of facets to consider
-      /// @param[in] N  #N by 3 list of face normals
-      /// @param[out] f  Index of the outer facet.
-      /// @param[out] flipped  true iff the normal of f points inwards.
-      template<
-          typename DerivedV,
-          typename DerivedF,
-          typename DerivedN,
-          typename DerivedI,
-          typename IndexType
-          >
-      IGL_INLINE void outer_facet(
-              const Eigen::PlainObjectBase<DerivedV> & V,
-              const Eigen::PlainObjectBase<DerivedF> & F,
-              const Eigen::PlainObjectBase<DerivedN> & N,
-              const Eigen::PlainObjectBase<DerivedI> & I,
-              IndexType & f,
-              bool & flipped);
-      /// \overload
-      template<
-          typename DerivedV,
-          typename DerivedF,
-          typename DerivedI,
-          typename IndexType
-          >
-      IGL_INLINE void outer_facet(
-        const Eigen::PlainObjectBase<DerivedV> & V,
-        const Eigen::PlainObjectBase<DerivedF> & F,
-        const Eigen::PlainObjectBase<DerivedI> & I,
-        IndexType & f,
-        bool & flipped);
-    }
-
-  }
-}
-
-#ifndef IGL_STATIC_LIBRARY
-#  include "outer_facet.cpp"
-#endif
-#endif

+ 0 - 49
include/igl/copyleft/cgal/outer_hull.h

@@ -1,49 +0,0 @@
-// This file is part of libigl, a simple c++ geometry processing library.
-// 
-// Copyright (C) 2015 Alec Jacobson <[email protected]>
-// 
-// This Source Code Form is subject to the terms of the Mozilla Public License 
-// v. 2.0. If a copy of the MPL was not distributed with this file, You can 
-// obtain one at http://mozilla.org/MPL/2.0/.
-#ifndef IGL_COPYLEFT_CGAL_OUTER_HULL_H
-#define IGL_COPYLEFT_CGAL_OUTER_HULL_H
-#include "../../igl_inline.h"
-#include <Eigen/Core>
-namespace igl
-{
-  namespace copyleft
-  {
-    namespace cgal
-    {
-      /// Compute the "outer hull" of a piecewise constant winding number induce
-      /// triangle mesh (V,F).
-      ///
-      /// @param[in] V  #V by 3 list of vertex positions
-      /// @param[in] F  #F by 3 list of triangle indices into V
-      /// @param[out] HV  #HV by 3 list of output vertex positions
-      /// @param[out] HF  #HF by 3 list of output triangle indices into HV
-      /// @param[out] J  #HF list of indices into F
-      /// @param[out] flip  #HF list of whether facet was flipped when added to HF
-      ///
-      template <
-        typename DerivedV,
-        typename DerivedF,
-        typename DerivedHV,
-        typename DerivedHF,
-        typename DerivedJ,
-        typename Derivedflip>
-      IGL_INLINE void outer_hull(
-        const Eigen::PlainObjectBase<DerivedV> & V,
-        const Eigen::PlainObjectBase<DerivedF> & F,
-        Eigen::PlainObjectBase<DerivedHV> & HV,
-        Eigen::PlainObjectBase<DerivedHF> & HF,
-        Eigen::PlainObjectBase<DerivedJ> & J,
-        Eigen::PlainObjectBase<Derivedflip> & flip);
-    }
-  }
-}
-
-#ifndef IGL_STATIC_LIBRARY
-#  include "outer_hull.cpp"
-#endif
-#endif

+ 0 - 57
include/igl/copyleft/cgal/outer_hull_legacy.h

@@ -1,57 +0,0 @@
-// This file is part of libigl, a simple c++ geometry processing library.
-// 
-// Copyright (C) 2015 Alec Jacobson <[email protected]>
-// 
-// This Source Code Form is subject to the terms of the Mozilla Public License 
-// v. 2.0. If a copy of the MPL was not distributed with this file, You can 
-// obtain one at http://mozilla.org/MPL/2.0/.
-#ifndef IGL_COPYLEFT_CGAL_OUTER_HULL_LEGACY_H
-#define IGL_COPYLEFT_CGAL_OUTER_HULL_LEGACY_H
-#include "../../igl_inline.h"
-#include <Eigen/Core>
-namespace igl
-{
-  namespace copyleft
-  {
-    namespace cgal
-    {
-      /// Compute the "outer hull" of a potentially non-manifold mesh (V,F) whose
-      /// intersections have been "resolved" (e.g. using `cork` or
-      /// `igl::copyleft::cgal::selfintersect`). The outer hull is defined to be all facets
-      /// (regardless of orientation) for which there exists some path from infinity
-      /// to the face without intersecting any other facets. For solids, this is the
-      /// surface of the solid. In general this includes any thin "wings" or
-      /// "flaps".  This implementation largely follows Section 3.6 of "Direct
-      /// repair of self-intersecting meshes" [Attene 2014].
-      ///
-      /// \note This doesn't require the input mesh to be piecewise constant
-      /// winding number, but won't handle multiple non-nested connected
-      /// components.
-      ///
-      /// @param[in] V  #V by 3 list of vertex positions
-      /// @param[in] F  #F by 3 list of triangle indices into V
-      /// @param[out] G  #G by 3 list of output triangle indices into V
-      /// @param[out] J  #G list of indices into F
-      /// @param[out] flip  #F list of whether facet was added to G **and** flipped orientation
-      ///     (false for faces not added to G)
-      template <
-        typename DerivedV,
-        typename DerivedF,
-        typename DerivedG,
-        typename DerivedJ,
-        typename Derivedflip>
-      IGL_INLINE void outer_hull_legacy(
-        const Eigen::PlainObjectBase<DerivedV> & V,
-        const Eigen::PlainObjectBase<DerivedF> & F,
-        Eigen::PlainObjectBase<DerivedG> & G,
-        Eigen::PlainObjectBase<DerivedJ> & J,
-        Eigen::PlainObjectBase<Derivedflip> & flip);
-    }
-  }
-}
-
-#ifndef IGL_STATIC_LIBRARY
-#  include "outer_hull_legacy.cpp"
-#endif
-#endif
-

+ 0 - 52
include/igl/copyleft/cgal/outer_vertex.h

@@ -1,52 +0,0 @@
-// This file is part of libigl, a simple c++ geometry processing library.
-// 
-// Copyright (C) 2015 Qingan Zhou <[email protected]>
-// Copyright (C) 2021 Alec Jacobson <[email protected]>
-// 
-// This Source Code Form is subject to the terms of the Mozilla Public License 
-// v. 2.0. If a copy of the MPL was not distributed with this file, You can 
-// obtain one at http://mozilla.org/MPL/2.0/.
-#ifndef IGL_COPYLEFT_CGAL_OUTER_VERTEX_H
-#define IGL_COPYLEFT_CGAL_OUTER_VERTEX_H
-#include "../../igl_inline.h"
-#include <Eigen/Core>
-namespace igl
-{
-  namespace copyleft
-  {
-    namespace cgal
-    {
-      /// Find a vertex that is reachable from infinite without crossing any faces.
-      /// Such vertex is called "outer vertex."
-      ///
-      /// \pre The input mesh must have all self-intersection resolved and
-      /// no duplicated vertices.  See cgal::remesh_self_intersections.h for how to
-      /// obtain such input.
-      ///
-      /// @param[in] V  #V by 3 list of vertex positions
-      /// @param[in] F  #F by 3 list of triangle indices into V
-      /// @param[in] I  #I list of facets to consider
-      /// @param[out] v_index  index of outer vertex
-      /// @param[out] A  #A list of facets incident to the outer vertex
-      template <
-          typename DerivedV,
-          typename DerivedF,
-          typename DerivedI,
-          typename IndexType,
-          typename DerivedA
-          >
-      IGL_INLINE void outer_vertex(
-              const Eigen::PlainObjectBase<DerivedV> & V,
-              const Eigen::PlainObjectBase<DerivedF> & F,
-              const Eigen::PlainObjectBase<DerivedI> & I,
-              IndexType & v_index,
-              Eigen::PlainObjectBase<DerivedA> & A);
-    }
-  }
-}
-
-#ifndef IGL_STATIC_LIBRARY
-#  include "outer_vertex.cpp"
-#endif
-#endif
-

+ 0 - 45
include/igl/copyleft/cgal/peel_outer_hull_layers.h

@@ -1,45 +0,0 @@
-// This file is part of libigl, a simple c++ geometry processing library.
-// 
-// Copyright (C) 2015 Alec Jacobson <[email protected]>
-// 
-// This Source Code Form is subject to the terms of the Mozilla Public License 
-// v. 2.0. If a copy of the MPL was not distributed with this file, You can 
-// obtain one at http://mozilla.org/MPL/2.0/.
-#ifndef IGL_COPYLEFT_CGAL_PEEL_OUTER_HULL_LAYERS_H
-#define IGL_COPYLEFT_CGAL_PEEL_OUTER_HULL_LAYERS_H
-#include "../../igl_inline.h"
-#include <Eigen/Core>
-namespace igl
-{
-  namespace copyleft
-  {
-    namespace cgal
-    {
-      /// Computes necessary generic information for boolean operations by
-      /// successively "peeling" off the "outer hull" of a mesh (V,F) resulting from
-      /// "resolving" all (self-)intersections.
-      ///
-      /// @param[in] V  #V by 3 list of vertex positions
-      /// @param[in] F  #F by 3 list of triangle indices into V
-      /// @param[out] I  #F list of which peel Iation a facet belongs 
-      /// @param[out] flip  #F list of whether a facet's orientation was flipped when facet
-      ///     "peeled" into its associated outer hull layer.
-      /// @return number of peels
-      template <
-        typename DerivedV,
-        typename DerivedF,
-        typename DerivedI,
-        typename Derivedflip>
-      IGL_INLINE size_t peel_outer_hull_layers(
-        const Eigen::PlainObjectBase<DerivedV > & V,
-        const Eigen::PlainObjectBase<DerivedF > & F,
-        Eigen::PlainObjectBase<DerivedI > & I,
-        Eigen::PlainObjectBase<Derivedflip > & flip);
-    }
-  }
-}
-
-#ifndef IGL_STATIC_LIBRARY
-#  include "peel_outer_hull_layers.cpp"
-#endif
-#endif

+ 0 - 29
include/igl/copyleft/cgal/peel_winding_number_layers.h

@@ -1,29 +0,0 @@
-#ifndef IGL_COPYLEFT_CGAL_PEEL_WINDING_NUMBER_LAYERS_H
-#define IGL_COPYLEFT_CGAL_PEEL_WINDING_NUMBER_LAYERS_H
-#include "../../igl_inline.h"
-#include <Eigen/Core>
-
-namespace igl {
-  namespace copyleft {
-    namespace cgal {
-      /// Peel Winding number layers from a mesh
-      ///
-      /// @param[in] V  #V by 3 list of vertex positions
-      /// @param[in] F  #F by 3 list of triangle indices into V
-      /// @param[out] W  #V by 1 list of winding numbers
-      template<
-          typename DerivedV,
-          typename DerivedF,
-          typename DerivedW >
-      IGL_INLINE size_t peel_winding_number_layers(
-              const Eigen::PlainObjectBase<DerivedV > & V,
-              const Eigen::PlainObjectBase<DerivedF > & F,
-              Eigen::PlainObjectBase<DerivedW>& W);
-    }
-  }
-}
-
-#ifndef IGL_STATIC_LIBRARY
-#  include "peel_winding_number_layers.cpp"
-#endif
-#endif

+ 0 - 39
include/igl/copyleft/cgal/piecewise_constant_winding_number.h

@@ -1,39 +0,0 @@
-// This file is part of libigl, a simple c++ geometry processing library.
-// 
-// Copyright (C) 2015 Alec Jacobson
-// 
-// This Source Code Form is subject to the terms of the Mozilla Public License 
-// v. 2.0. If a copy of the MPL was not distributed with this file, You can 
-// obtain one at http://mozilla.org/MPL/2.0/.
-#ifndef IGL_COPYLEFT_CGAL_PIECEWISE_CONSTANT_WINDING_NUMBER_H
-#define IGL_COPYLEFT_CGAL_PIECEWISE_CONSTANT_WINDING_NUMBER_H
-#include "../../igl_inline.h"
-#include <Eigen/Core>
-#include <vector>
-namespace igl
-{
-  namespace copyleft
-  {
-    namespace cgal
-    {
-      /// Determine if a given mesh induces a piecewise constant winding number
-      /// field: Is this mesh valid input to solid set operations.
-      /// 
-      /// @param[in] V  #V by 3 list of mesh vertex positions
-      /// @param[in] F  #F by 3 list of triangle indices into V
-      /// @return true if the mesh _combinatorially_ induces a piecewise
-      /// constant winding number field.
-      template <
-        typename DerivedV,
-        typename DerivedF>
-      IGL_INLINE bool piecewise_constant_winding_number(
-        const Eigen::PlainObjectBase<DerivedV> & V,
-        const Eigen::PlainObjectBase<DerivedF>& F);
-    }
-  }
-}
-#ifndef IGL_STATIC_LIBRARY
-#  include "piecewise_constant_winding_number.cpp"
-#endif
-#endif
-

+ 0 - 68
include/igl/copyleft/cgal/point_areas.h

@@ -1,68 +0,0 @@
-// This file is part of libigl, a simple c++ geometry processing library.
-//
-// Copyright (C) 2018 Gavin Barill <[email protected]>
-//
-// This Source Code Form is subject to the terms of the Mozilla Public License
-// v. 2.0. If a copy of the MPL was not distributed with this file, You can
-// obtain one at http://mozilla.org/MPL/2.0/
-
-#ifndef IGL_POINT_AREAS_H
-#define IGL_POINT_AREAS_H
-#include "../../igl_inline.h"
-#include <Eigen/Core>
-namespace igl
-{
-  namespace copyleft
-  {
-    namespace cgal
-    {
-      /// Given a 3D set of points P, each with a list of k-nearest-neighbours,
-      /// estimate the geodesic voronoi area associated with each point.
-      ///
-      /// The k nearest neighbours may be known from running igl::knn_octree on
-      /// the output data from igl::octree. We reccomend using a k value
-      /// between 15 and 20 inclusive for accurate area estimation.
-      ///
-      /// N is used filter the neighbours, to ensure area estimation only occurs
-      /// using neighbors that are on the same side of the surface (ie for thin
-      /// sheets), as well as to solve the orientation ambiguity of the tangent
-      /// plane normal.
-      ///
-      /// \note This function *should* be implemented by pre-filtering I, rather
-      /// than filtering in this function using N. In this case, the function
-      /// would only take P and I as input.
-      ///
-      /// @param[in] P  #P by 3 list of point locations
-      /// @param[in] I  #P by k list of k-nearest-neighbor indices into P
-      /// @param[in] N  #P by 3 list of point normals
-      /// @param[out] A  #P list of estimated areas
-      //  @param[out] T  #P by 3 list of tangent plane normals for each point
-      ///
-      /// \see igl::knn
-      template <typename DerivedP, typename DerivedI, typename DerivedN,
-      typename DerivedA, typename DerivedT>
-      IGL_INLINE void point_areas(
-        const Eigen::MatrixBase<DerivedP>& P,
-        const Eigen::MatrixBase<DerivedI>& I,
-        const Eigen::MatrixBase<DerivedN>& N,
-        Eigen::PlainObjectBase<DerivedA> & A,
-        Eigen::PlainObjectBase<DerivedT> & T);
-      /// \overload
-      template <typename DerivedP, typename DerivedI, typename DerivedN,
-               typename DerivedA>
-      IGL_INLINE void point_areas(
-        const Eigen::MatrixBase<DerivedP>& P,
-        const Eigen::MatrixBase<DerivedI>& I,
-        const Eigen::MatrixBase<DerivedN>& N,
-        Eigen::PlainObjectBase<DerivedA> & A);
-        
-    }
-  }
-}
-
-#ifndef IGL_STATIC_LIBRARY
-#  include "point_areas.cpp"
-#endif
-
-#endif
-

+ 0 - 110
include/igl/copyleft/cgal/point_mesh_squared_distance.h

@@ -1,110 +0,0 @@
-// This file is part of libigl, a simple c++ geometry processing library.
-// 
-// Copyright (C) 2014 Alec Jacobson <[email protected]>
-// 
-// This Source Code Form is subject to the terms of the Mozilla Public License 
-// v. 2.0. If a copy of the MPL was not distributed with this file, You can 
-// obtain one at http://mozilla.org/MPL/2.0/.
-#ifndef IGL_COPYLEFT_CGAL_POINT_MESH_SQUARED_DISTANCE_H
-#define IGL_COPYLEFT_CGAL_POINT_MESH_SQUARED_DISTANCE_H
-#include "../../igl_inline.h"
-#include <Eigen/Core>
-#include <vector>
-#include "CGAL_includes.hpp"
-namespace igl
-{
-  namespace copyleft
-  {
-    namespace cgal
-    {
-      /// Compute distances from a set of points P to a triangle mesh (V,F)
-      ///
-      /// @tparam Kernal  CGAL computation and construction kernel (e.g.
-      ///     CGAL::Simple_cartesian<double>)
-      /// @param[in] P  #P by 3 list of query point positions
-      /// @param[in] V  #V by 3 list of vertex positions
-      /// @param[in] F  #F by 3 list of triangle indices
-      /// @param[out] sqrD  #P list of smallest squared distances
-      /// @param[out] I  #P list of facet indices corresponding to smallest distances
-      /// @param[out] C  #P by 3 list of closest points
-      ///
-      /// \bug This only computes distances to triangles. So unreferenced
-      /// vertices and degenerate triangles (segments) are ignored.
-      template <
-        typename Kernel,
-        typename DerivedP,
-        typename DerivedV,
-        typename DerivedF,
-        typename DerivedsqrD,
-        typename DerivedI,
-        typename DerivedC>
-      IGL_INLINE void point_mesh_squared_distance(
-        const Eigen::PlainObjectBase<DerivedP> & P,
-        const Eigen::PlainObjectBase<DerivedV> & V,
-        const Eigen::PlainObjectBase<DerivedF> & F,
-              Eigen::PlainObjectBase<DerivedsqrD> & sqrD,
-              Eigen::PlainObjectBase<DerivedI> & I,
-              Eigen::PlainObjectBase<DerivedC> & C);
-      /// precomputation for point_mesh_squared_distance
-      ///
-      /// @param[in] V  #V by 3 list of vertex positions
-      /// @param[in] F  #F by 3 list of triangle indices
-      /// @param[out] tree  CGAL's AABB tree
-      /// @param[out] T  list of CGAL triangles in order of F (for determining which was found
-      ///     in computation)
-      ///
-      /// \fileinfo
-      template <
-        typename Kernel,
-        typename DerivedV,
-        typename DerivedF
-        >
-      IGL_INLINE void point_mesh_squared_distance_precompute(
-        const Eigen::PlainObjectBase<DerivedV> & V,
-        const Eigen::PlainObjectBase<DerivedF> & F,
-        CGAL::AABB_tree<
-          CGAL::AABB_traits<Kernel, 
-            CGAL::AABB_triangle_primitive<Kernel, 
-              typename std::vector<CGAL::Triangle_3<Kernel> >::iterator
-            >
-          >
-        > & tree,
-        std::vector<CGAL::Triangle_3<Kernel> > & T);
-      /// Compute distances from a set of points P to a triangle mesh (V,F)
-      /// using precomputed trees.
-      ///
-      /// @param[in] P  #P by 3 list of query point positions
-      /// @param[in] tree  CGAL's AABB tree
-      /// @param[in] T  list of CGAL triangles in order of F (for determining which was found
-      ///     in computation)
-      /// @param[out] sqrD  #P list of smallest squared distances
-      /// @param[out] I  #P list of facet indices corresponding to smallest distances
-      /// @param[out] C  #P by 3 list of closest points
-      template <
-        typename Kernel,
-        typename DerivedP,
-        typename DerivedsqrD,
-        typename DerivedI,
-        typename DerivedC>
-      IGL_INLINE void point_mesh_squared_distance(
-        const Eigen::PlainObjectBase<DerivedP> & P,
-        const CGAL::AABB_tree<
-          CGAL::AABB_traits<Kernel, 
-            CGAL::AABB_triangle_primitive<Kernel, 
-              typename std::vector<CGAL::Triangle_3<Kernel> >::iterator
-            >
-          >
-        > & tree,
-        const std::vector<CGAL::Triangle_3<Kernel> > & T,
-        Eigen::PlainObjectBase<DerivedsqrD> & sqrD,
-        Eigen::PlainObjectBase<DerivedI> & I,
-        Eigen::PlainObjectBase<DerivedC> & C);
-    }
-  }
-}
-
-#ifndef IGL_STATIC_LIBRARY
-#  include "point_mesh_squared_distance.cpp"
-#endif
-
-#endif

+ 0 - 41
include/igl/copyleft/cgal/point_segment_squared_distance.h

@@ -1,41 +0,0 @@
-// This file is part of libigl, a simple c++ geometry processing library.
-// 
-// Copyright (C) 2016 Alec Jacobson <[email protected]>
-// 
-// This Source Code Form is subject to the terms of the Mozilla Public License 
-// v. 2.0. If a copy of the MPL was not distributed with this file, You can 
-// obtain one at http://mozilla.org/MPL/2.0/.
-#ifndef IGL_COPYLEFT_CGAL_POINT_SEGMENT_SQUARED_DISTANCE_H
-#define IGL_COPYLEFT_CGAL_POINT_SEGMENT_SQUARED_DISTANCE_H
-#include "../../igl_inline.h"
-#include <CGAL/Segment_3.h>
-#include <CGAL/Point_3.h>
-namespace igl
-{
-  namespace copyleft
-  {
-    namespace cgal
-    {
-      /// Given a point P1 and segment S2 find the points on each of closest
-      /// approach and the squared distance thereof.
-      /// 
-      /// @param[in] P1  point
-      /// @param[in] S2  segment
-      /// @param[out] P2  point on S2 closest to P1
-      /// @param[out] d  distance betwee P1 and S2
-      template < typename Kernel>
-      IGL_INLINE void point_segment_squared_distance(
-          const CGAL::Point_3<Kernel> & P1,
-          const CGAL::Segment_3<Kernel> & S2,
-          CGAL::Point_3<Kernel> & P2,
-          typename Kernel::FT & d);
-
-    }
-  }
-}
-#ifndef IGL_STATIC_LIBRARY
-#  include "point_segment_squared_distance.cpp"
-#endif
-
-#endif
-

+ 0 - 46
include/igl/copyleft/cgal/point_solid_signed_squared_distance.h

@@ -1,46 +0,0 @@
-// This file is part of libigl, a simple c++ geometry processing library.
-// 
-// Copyright (C) 2016 Alec Jacobson <[email protected]>
-// 
-// This Source Code Form is subject to the terms of the Mozilla Public License 
-// v. 2.0. If a copy of the MPL was not distributed with this file, You can 
-// obtain one at http://mozilla.org/MPL/2.0/.
-#ifndef IGL_COPYLEFT_CGAL_POINT_SOLID_SIGNED_SQUARED_DISTANCE_H
-#define IGL_COPYLEFT_CGAL_POINT_SOLID_SIGNED_SQUARED_DISTANCE_H
-#include "../../igl_inline.h"
-#include <Eigen/Core>
-
-namespace igl
-{
-  namespace copyleft
-  {
-    namespace cgal
-    {
-      /// Given a set of points (Q) and the boundary mesh (VB,FB) of a solid (as
-      /// defined in [Zhou et al. 2016], determine the signed squared distance
-      /// for each point q in Q so that d(q,B) is negative if inside and positive
-      /// if outside.
-      ///
-      /// @param[in] Q  #Q by 3 list of query point positions
-      /// @param[in] VB  #VB by 3 list of mesh vertex positions of B
-      /// @param[in] FB  #FB by 3 list of mesh triangle indices into VB
-      /// @param[out] D  #Q list of signed squared distances
-      template <
-        typename DerivedQ,
-        typename DerivedVB,
-        typename DerivedFB,
-        typename DerivedD>
-      IGL_INLINE void point_solid_signed_squared_distance(
-        const Eigen::PlainObjectBase<DerivedQ> & Q,
-        const Eigen::PlainObjectBase<DerivedVB> & VB,
-        const Eigen::PlainObjectBase<DerivedFB> & FB,
-        Eigen::PlainObjectBase<DerivedD> & D);
-    }
-  }
-}
-
-#ifndef IGL_STATIC_LIBRARY
-#  include "point_solid_signed_squared_distance.cpp"
-#endif
-
-#endif

+ 0 - 43
include/igl/copyleft/cgal/point_triangle_squared_distance.h

@@ -1,43 +0,0 @@
-// This file is part of libigl, a simple c++ geometry processing library.
-// 
-// Copyright (C) 2016 Alec Jacobson <[email protected]>
-// 
-// This Source Code Form is subject to the terms of the Mozilla Public License 
-// v. 2.0. If a copy of the MPL was not distributed with this file, You can 
-// obtain one at http://mozilla.org/MPL/2.0/.
-#ifndef IGL_COPYLEFT_CGAL_POINT_TRIANGLE_SQUARED_DISTANCE_H
-#define IGL_COPYLEFT_CGAL_POINT_TRIANGLE_SQUARED_DISTANCE_H
-#include "../../igl_inline.h"
-#include <CGAL/Triangle_3.h>
-#include <CGAL/Point_3.h>
-namespace igl
-{
-  namespace copyleft
-  {
-    namespace cgal
-    {
-      /// Given a point P1 and triangle T2 find the points on each of closest
-      /// approach and the squared distance thereof.
-      /// 
-      /// @param[in] P1  point
-      /// @param[in] T2  triangle
-      /// @param[out] P2  point on T2 closest to P1
-      /// @param[out] d  distance betwee P1 and T2
-      template < typename Kernel>
-      IGL_INLINE void point_triangle_squared_distance(
-        const CGAL::Point_3<Kernel> & P1,
-        const CGAL::Triangle_3<Kernel> & T2,
-        CGAL::Point_3<Kernel> & P2,
-        typename Kernel::FT & d
-        );
-
-    }
-  }
-}
-#ifndef IGL_STATIC_LIBRARY
-#  include "point_triangle_squared_distance.cpp"
-#endif
-
-#endif
-
-

+ 0 - 64
include/igl/copyleft/cgal/points_inside_component.h

@@ -1,64 +0,0 @@
-// This file is part of libigl, a simple c++ geometry processing library.
-// 
-// Copyright (C) 2015 Qingnan Zhou <[email protected]>
-// 
-// This Source Code Form is subject to the terms of the Mozilla Public License 
-// v. 2.0. If a copy of the MPL was not distributed with this file, You can 
-// obtain one at http://mozilla.org/MPL/2.0/.
-#ifndef IGL_COPYLEFT_CGAL_POINTS_INSIDE_COMPONENTS
-#define IGL_COPYLEFT_CGAL_POINTS_INSIDE_COMPONENTS
-
-#include "../../igl_inline.h"
-#include <Eigen/Core>
-#include <vector>
-
-namespace igl 
-{
-  namespace copyleft
-  {
-    namespace cgal {
-      /// Determine if queries points P are inside of connected facet component
-      /// (V, F, I), where I indicates a subset of facets that forms the
-      /// component.
-      ///
-      /// \pre The input mesh must be a closed, self-intersection free,
-      /// non-degenerated surface.  Queries points must be either inside or
-      /// outside of the mesh (i.e. not on the surface of the mesh).
-      ///
-      /// @param[in] V  #V by 3 array of vertex positions.
-      /// @param[in] F  #F by 3 array of triangles.
-      /// @param[in] I  #I list of triangle indices to consider.
-      /// @param[in] P  #P by 3 array of query points.
-      /// @param[out] inside  #P list of booleans that is true iff the
-      ///   corresponding query point is inside of the mesh.
-      template<
-        typename DerivedV,
-        typename DerivedF,
-        typename DerivedI,
-        typename DerivedP,
-        typename DerivedB>
-      IGL_INLINE void points_inside_component(
-        const Eigen::PlainObjectBase<DerivedV>& V,
-        const Eigen::PlainObjectBase<DerivedF>& F,
-        const Eigen::PlainObjectBase<DerivedI>& I,
-        const Eigen::PlainObjectBase<DerivedP>& P,
-        Eigen::PlainObjectBase<DerivedB>& inside);
-      /// \overload
-      template<
-        typename DerivedV,
-        typename DerivedF,
-        typename DerivedP,
-        typename DerivedB>
-      IGL_INLINE void points_inside_component(
-          const Eigen::PlainObjectBase<DerivedV>& V,
-          const Eigen::PlainObjectBase<DerivedF>& F,
-          const Eigen::PlainObjectBase<DerivedP>& P,
-          Eigen::PlainObjectBase<DerivedB>& inside);
-    }
-  }
-}
-
-#ifndef IGL_STATIC_LIBRARY
-#include "points_inside_component.cpp"
-#endif
-#endif

+ 0 - 40
include/igl/copyleft/cgal/polyhedron_to_mesh.h

@@ -1,40 +0,0 @@
-// This file is part of libigl, a simple c++ geometry processing library.
-// 
-// Copyright (C) 2015 Alec Jacobson <[email protected]>
-// 
-// This Source Code Form is subject to the terms of the Mozilla Public License 
-// v. 2.0. If a copy of the MPL was not distributed with this file, You can 
-// obtain one at http://mozilla.org/MPL/2.0/.
-#ifndef IGL_COPYLEFT_CGAL_POLYHEDRON_TO_MESH_H
-#define IGL_COPYLEFT_CGAL_POLYHEDRON_TO_MESH_H
-#include "../../igl_inline.h"
-#include <Eigen/Core>
-
-namespace igl
-{
-  namespace copyleft
-  {
-    namespace cgal
-    {
-      /// Convert a CGAL Polyhedron to a mesh (V,F)
-      ///
-      /// @tparam Polyhedron  CGAL Polyhedron type (e.g. Polyhedron_3)
-      /// @param[in] poly  cgal polyhedron
-      /// @param[out] V  #V by 3 list of vertex positions
-      /// @param[out] F  #F by 3 list of triangle indices
-      template <
-        typename Polyhedron,
-        typename DerivedV,
-        typename DerivedF>
-      IGL_INLINE void polyhedron_to_mesh(
-        const Polyhedron & poly,
-        Eigen::PlainObjectBase<DerivedV> & V,
-        Eigen::PlainObjectBase<DerivedF> & F);
-    }
-  }
-}
-#ifndef IGL_STATIC_LIBRARY
-#  include "polyhedron_to_mesh.cpp"
-#endif
-
-#endif

+ 0 - 60
include/igl/copyleft/cgal/projected_cdt.h

@@ -1,60 +0,0 @@
-// This file is part of libigl, a simple c++ geometry processing library.
-//
-// Copyright (C) 2016 Alec Jacobson
-//
-// This Source Code Form is subject to the terms of the Mozilla Public License
-// v. 2.0. If a copy of the MPL was not distributed with this file, You can
-// obtain one at http://mozilla.org/MPL/2.0/.
-#ifndef IGL_COPYLEFT_CGAL_PROJECTED_CDT_H
-#define IGL_COPYLEFT_CGAL_PROJECTED_CDT_H
-#include "../../igl_inline.h"
-#include <Eigen/Core>
-#include <CGAL/Plane_3.h>
-#include <CGAL/Point_3.h>
-#include <CGAL/Object.h>
-#include <vector>
-namespace igl
-{
-  namespace copyleft
-  {
-    namespace cgal
-    {
-      /// Given a list of objects (e.g., resulting from intersecting a triangle
-      /// with many other triangles), construct a constrained Delaunay
-      /// triangulation on a given plane (P), by inersting constraints for each
-      /// object projected onto that plane.
-      ///
-      /// @param[in] objects  list of objects. This should lie on the given plane (P),
-      ///     otherwise they are added to the cdt _after_ their non-trivial
-      ///     projection
-      /// @param[in] P  plane upon which all objects lie and upon which the CDT is
-      ///     conducted
-      /// @param[out] vertices  list of vertices of the CDT mesh _back on the 3D plane_
-      /// @param[out] faces  list of list of triangle indices into vertices
-      ///
-      template <typename Kernel, typename Index>
-      IGL_INLINE void projected_cdt(
-        const std::vector<CGAL::Object> & objects,
-        const CGAL::Plane_3<Kernel> & P,
-        std::vector<CGAL::Point_3<Kernel> >& vertices,
-        std::vector<std::vector<Index> >& faces);
-      /// \overload
-      ///
-      /// @param[out] V  #V by 3 list of vertices of the CDT mesh _back on the 3D plane_,
-      ///     **cast** from the number type of Kernel to the number type of
-      ///     DerivedV
-      /// @param[out] F  #F by 3 list of triangle indices into V
-      template < typename Kernel, typename DerivedV, typename DerivedF>
-      IGL_INLINE void projected_cdt(
-        const std::vector<CGAL::Object> & objects,
-        const CGAL::Plane_3<Kernel> & P,
-        Eigen::PlainObjectBase<DerivedV> & V,
-        Eigen::PlainObjectBase<DerivedF> & F);
-    }
-  }
-}
-
-#ifndef IGL_STATIC_LIBRARY
-#  include "projected_cdt.cpp"
-#endif
-#endif

+ 0 - 44
include/igl/copyleft/cgal/projected_delaunay.h

@@ -1,44 +0,0 @@
-// This file is part of libigl, a simple c++ geometry processing library.
-// 
-// Copyright (C) 2015 Alec Jacobson <[email protected]>
-// 
-// This Source Code Form is subject to the terms of the Mozilla Public License 
-// v. 2.0. If a copy of the MPL was not distributed with this file, You can 
-// obtain one at http://mozilla.org/MPL/2.0/.
-#ifndef IGL_COPYLEFT_CGAL_PROJECTED_DELAUNAY_H
-#define IGL_COPYLEFT_CGAL_PROJECTED_DELAUNAY_H
-#include "../../igl_inline.h"
-#include "CGAL_includes.hpp"
-namespace igl
-{
-  namespace copyleft
-  {
-    namespace cgal
-    {
-      /// Compute 2D delaunay triangulation of a given 3d triangle and a list of
-      /// intersection objects (points,segments,triangles). CGAL uses an affine
-      /// projection rather than an isometric projection, so we're not guaranteed
-      /// that the 2D delaunay triangulation here will be a delaunay triangulation
-      /// in 3D.
-      ///
-      /// @param[in] A  triangle in 3D
-      /// @param[in] A_objects_3  updated list of intersection objects for A
-      /// @param[out] cdt  Contrained delaunay triangulation in projected 2D plane
-      template <typename Kernel>
-      IGL_INLINE void projected_delaunay(
-        const CGAL::Triangle_3<Kernel> & A,
-        const std::vector<CGAL::Object> & A_objects_3,
-        CGAL::Constrained_triangulation_plus_2<
-          CGAL::Constrained_Delaunay_triangulation_2<
-            Kernel,
-            CGAL::Triangulation_data_structure_2<
-              CGAL::Triangulation_vertex_base_2<Kernel>,
-              CGAL::Constrained_triangulation_face_base_2<Kernel> >,
-            CGAL::Exact_intersections_tag> > & cdt);
-    }
-  }
-}
-#ifndef IGL_STATIC_LIBRARY
-#  include "projected_delaunay.cpp"
-#endif
-#endif

+ 0 - 95
include/igl/copyleft/cgal/propagate_winding_numbers.h

@@ -1,95 +0,0 @@
-// This file is part of libigl, a simple c++ geometry processing library.
-// 
-// Copyright (C) 2015 Qingnan Zhou <[email protected]>
-// 
-// This Source Code Form is subject to the terms of the Mozilla Public License 
-// v. 2.0. If a copy of the MPL was not distributed with this file, You can 
-// obtain one at http://mozilla.org/MPL/2.0/.
-//
-#ifndef IGL_COPYLEFT_CGAL_PROPAGATE_WINDING_NUMBERS_H
-#define IGL_COPYLEFT_CGAL_PROPAGATE_WINDING_NUMBERS_H
-#include "../../igl_inline.h"
-#include <Eigen/Core>
-#include <vector>
-
-// The following methods compute the winding number on each side of each facet
-// or patch of a 3D mesh.  The input mesh is valid if it splits the ambient
-// space, R^3, into subspaces with constant integer winding numbers.  That is
-// the input mesh should be closed and for each directed edge the number of
-// clockwise facing facets should equal the number of counterclockwise facing
-// facets.
-
-namespace igl
-{
-  namespace copyleft
-  {
-    namespace cgal
-    {
-      /// Compute winding number on each side of the face.  The input mesh
-      /// could contain multiple connected components.  The input mesh must
-      /// represent the boundary of a valid 3D volume, which means it is
-      /// closed, consistently oriented and induces integer winding numbers.
-      ///
-      /// @param[in] V  #V by 3 list of vertex positions.
-      /// @param[in] F  #F by 3 list of triangle indices into V.
-      /// @param[in] labels  #F list of facet labels ranging from 0 to k-1.
-      /// @param[out] W  #F by k*2 list of winding numbers.  ``W(i,j*2)`` is the winding
-      ///      number on the positive side of facet ``i`` with respect to the
-      ///      facets labeled ``j``.  Similarly, ``W(i,j*2+1)`` is the winding
-      ///      number on the negative side of facet ``i`` with respect to the
-      ///      facets labeled ``j``.
-      /// @return true iff the input induces a piecewise-constant winding number
-      ///   field.
-      ///
-      /// \note This shouldn't need to be in igl::copyleft::cgal, it should
-      /// instead take as input an index of the ambient cell and the winding
-      /// number vector there.
-      template<
-        typename DerivedV,
-        typename DerivedF,
-        typename DerivedL,
-        typename DerivedW>
-      IGL_INLINE bool propagate_winding_numbers(
-        const Eigen::PlainObjectBase<DerivedV>& V,
-        const Eigen::PlainObjectBase<DerivedF>& F,
-        const Eigen::PlainObjectBase<DerivedL>& labels,
-        Eigen::PlainObjectBase<DerivedW>& W);
-      // \overload
-      //
-      // @param[in] uE    #uE by 2 list of vertex_indices, represents undirected edges.
-      // @param[in] uEC  #uE+1 list of cumsums of directed edges sharing each unique edge
-      // @param[in] uEE  #E list of indices into E (see `igl::unique_edge_map`)
-      // @param[in] num_patches  number of patches
-      // @param[in] P  #F list of patch ids.
-      // @param[in] num_cells    number of cells
-      // @param[in] C  #P by 2 list of cell ids on each side of each patch.
-      template<
-        typename DerivedV,
-        typename DerivedF,
-        typename DeriveduE,
-        typename DeriveduEC,
-        typename DeriveduEE,
-        typename DerivedP,
-        typename DerivedC,
-        typename DerivedL,
-        typename DerivedW>
-      IGL_INLINE bool propagate_winding_numbers(
-        const Eigen::PlainObjectBase<DerivedV>& V,
-        const Eigen::PlainObjectBase<DerivedF>& F,
-        const Eigen::PlainObjectBase<DeriveduE>& uE,
-        const Eigen::PlainObjectBase<DeriveduEC>& uEC,
-        const Eigen::PlainObjectBase<DeriveduEE>& uEE,
-        const size_t num_patches,
-        const Eigen::PlainObjectBase<DerivedP>& P,
-        const size_t num_cells,
-        const Eigen::PlainObjectBase<DerivedC>& C,
-        const Eigen::PlainObjectBase<DerivedL>& labels,
-        Eigen::PlainObjectBase<DerivedW>& W);
-    }
-  }
-}
-
-#ifndef IGL_STATIC_LIBRARY
-#  include "propagate_winding_numbers.cpp"
-#endif
-#endif

+ 0 - 42
include/igl/copyleft/cgal/read_triangle_mesh.h

@@ -1,42 +0,0 @@
-// This file is part of libigl, a simple c++ geometry processing library.
-//
-// Copyright (C) 2016 Alec Jacobson <[email protected]>
-//
-// This Source Code Form is subject to the terms of the Mozilla Public License
-// v. 2.0. If a copy of the MPL was not distributed with this file, You can
-// obtain one at http://mozilla.org/MPL/2.0/.
-#ifndef IGL_COPYLEFT_CGAL_READ_TRIANGLE_MESH_H
-#define IGL_COPYLEFT_CGAL_READ_TRIANGLE_MESH_H
-#include "../../igl_inline.h"
-
-#include <Eigen/Core>
-namespace igl
-{
-  namespace copyleft
-  {
-    namespace cgal
-    {
-      /// Simple wrapper, reads floating point precision but assigns to
-      /// DerivedV::Scalar which may be a CGAL type
-      ///
-      /// @param[in] str  path to file
-      /// @param[out] V  eigen double matrix #V by 3
-      /// @param[out] F  eigen int matrix #F by 3
-      /// @return true iff success
-      ///
-      /// \see igl::read_triangle_mesh
-      template <typename DerivedV, typename DerivedF>
-      IGL_INLINE bool read_triangle_mesh(
-        const std::string str,
-        Eigen::PlainObjectBase<DerivedV>& V,
-        Eigen::PlainObjectBase<DerivedF>& F);
-    }
-  }
-}
-
-#ifndef IGL_STATIC_LIBRARY
-#  include "read_triangle_mesh.cpp"
-#endif
-
-#endif
-

+ 0 - 58
include/igl/copyleft/cgal/relabel_small_immersed_cells.h

@@ -1,58 +0,0 @@
-// This file is part of libigl, a simple c++ geometry processing library.
-// 
-// Copyright (C) 2016 Qingnan Zhou <[email protected]>
-// 
-// This Source Code Form is subject to the terms of the Mozilla Public License 
-// v. 2.0. If a copy of the MPL was not distributed with this file, You can 
-// obtain one at http://mozilla.org/MPL/2.0/.
-//
-#ifndef IGL_RELABEL_SMALL_IMMERSED_CELLS
-#define IGL_RELABEL_SMALL_IMMERSED_CELLS
-
-#include "../../igl_inline.h"
-#include <Eigen/Core>
-#include <vector>
-
-namespace igl
-{
-  namespace copyleft
-  {
-    namespace cgal
-    {
-      /// Relabel winding numbers of small immersed cells.
-      ///
-      /// @param[in] V  #V by 3 list of vertex positions.
-      /// @param[in] F  #F by 3 list of triangle indices into V.
-      /// @param[in] num_patches  number of patches
-      /// @param[in] P  #F list of patch ids.
-      /// @param[in] num_cells    number of cells
-      /// @param[in] C  #P by 2 list of cell ids on each side of each patch.
-      /// @param[in] vol_threshold  Volume threshold, cells smaller than this
-      ///                  and is completely immersed will be relabeled.
-      /// @param[out] W  #F by 2 cell labels.  W(i,0) is the label on the positive side of
-      ///      face i, W(i,1) is the label on the negative side of face i.  W
-      ///      will be modified in place by this method.
-      template<
-        typename DerivedV,
-        typename DerivedF,
-        typename DerivedP,
-        typename DerivedC,
-        typename FT,
-        typename DerivedW>
-      IGL_INLINE void relabel_small_immersed_cells(
-        const Eigen::PlainObjectBase<DerivedV>& V,
-        const Eigen::PlainObjectBase<DerivedF>& F,
-        const size_t num_patches,
-        const Eigen::PlainObjectBase<DerivedP>& P,
-        const size_t num_cells,
-        const Eigen::PlainObjectBase<DerivedC>& C,
-        const FT vol_threashold,
-        Eigen::PlainObjectBase<DerivedW>& W);
-    }
-  }
-}
-
-#ifndef IGL_STATIC_LIBRARY
-#  include "relabel_small_immersed_cells.cpp"
-#endif
-#endif

+ 0 - 72
include/igl/copyleft/cgal/remesh_intersections.h

@@ -1,72 +0,0 @@
-// This file is part of libigl, a simple c++ geometry processing library.
-// 
-// Copyright (C) 2015 Qingnan Zhou <[email protected]>
-// 
-// This Source Code Form is subject to the terms of the Mozilla Public License 
-// v. 2.0. If a copy of the MPL was not distributed with this file, You can 
-// obtain one at http://mozilla.org/MPL/2.0/.
-//
-#ifndef IGL_COPYLEFT_CGAL_REMESH_INTERSECTIONS_H
-#define IGL_COPYLEFT_CGAL_REMESH_INTERSECTIONS_H
-
-#include "../../igl_inline.h"
-#include <Eigen/Dense>
-#include "CGAL_includes.hpp"
-
-namespace igl
-{
-  namespace copyleft
-  {
-    namespace cgal
-    {
-      /// Remesh faces according to results of intersection detection and
-      /// construction (e.g. from `igl::copyleft::cgal::intersect_other` or
-      /// `igl::copyleft::cgal::SelfIntersectMesh`)
-      ///
-      /// @param[in] V  #V by 3 list of vertex positions
-      /// @param[in] F  #F by 3 list of triangle indices into V
-      /// @param[in] T  #F list of cgal triangles
-      /// @param[in] offending #offending map taking face indices into F to pairs of order
-      ///     of first finding and list of intersection objects from all
-      ///     intersections
-      /// @param[in] stitch_all  if true, merge all vertices with the same coordinate.
-      /// @param[out] VV  #VV by 3 list of vertex positions, if stitch_all = false then
-      ///     first #V vertices will always be V
-      /// @param[out] FF  #FF by 3 list of triangle indices into V
-      /// @param[out] IF  #intersecting face pairs by 2  list of intersecting face pairs,
-      ///     indexing F
-      /// @param[out] J  #FF list of indices into F denoting birth triangle
-      /// @param[out] IM  if stitch_all = true   #VV list from 0 to #VV-1
-      ///       elseif stitch_all = false  #VV list of indices into VV of unique vertices.
-      ///
-      template <
-        typename DerivedV,
-        typename DerivedF,
-        typename Kernel,
-        typename DerivedVV,
-        typename DerivedFF,
-        typename DerivedJ,
-        typename DerivedIM>
-      IGL_INLINE void remesh_intersections(
-        const Eigen::MatrixBase<DerivedV> & V,
-        const Eigen::MatrixBase<DerivedF> & F,
-        const std::vector<CGAL::Triangle_3<Kernel> > & T,
-        const std::map<
-          typename DerivedF::Index,
-            std::vector<
-            std::pair<typename DerivedF::Index, CGAL::Object> > > & offending,
-        bool stitch_all,
-        bool slow_and_more_precise_rounding,
-        Eigen::PlainObjectBase<DerivedVV> & VV,
-        Eigen::PlainObjectBase<DerivedFF> & FF,
-        Eigen::PlainObjectBase<DerivedJ> & J,
-        Eigen::PlainObjectBase<DerivedIM> & IM);
-    }
-  }
-}
-
-#ifndef IGL_STATIC_LIBRARY
-#  include "remesh_intersections.cpp"
-#endif
-
-#endif

+ 0 - 79
include/igl/copyleft/cgal/remesh_self_intersections.h

@@ -1,79 +0,0 @@
-// This file is part of libigl, a simple c++ geometry processing library.
-// 
-// Copyright (C) 2014 Alec Jacobson <[email protected]>
-// 
-// This Source Code Form is subject to the terms of the Mozilla Public License 
-// v. 2.0. If a copy of the MPL was not distributed with this file, You can 
-// obtain one at http://mozilla.org/MPL/2.0/.
-#ifndef IGL_COPYLEFT_CGAL_REMESH_SELF_INTERSECTIONS_H
-#define IGL_COPYLEFT_CGAL_REMESH_SELF_INTERSECTIONS_H
-#include "../../igl_inline.h"
-#include "RemeshSelfIntersectionsParam.h"
-
-#include <Eigen/Dense>
-  
-namespace igl
-{
-  namespace copyleft
-  {
-    namespace cgal
-    {
-      /// Given a triangle mesh (V,F) compute a new mesh (VV,FF) which is the same
-      /// as (V,F) except that any self-intersecting triangles in (V,F) have been
-      /// subdivided (new vertices and face created) so that the self-intersection
-      /// contour lies exactly on edges in (VV,FF). New vertices will appear in
-      /// original faces or on original edges. New vertices on edges are "merged"
-      /// only across original faces sharing that edge. This means that if the input
-      /// triangle mesh is a closed manifold the output will be too.
-      ///
-      /// @param[in] V  #V by 3 list of vertex positions
-      /// @param[in] F  #F by 3 list of triangle indices into V
-      /// @param[in] params  struct of optional parameters
-      /// @param[out] VV  #VV by 3 list of vertex positions
-      /// @param[out] FF  #FF by 3 list of triangle indices into VV
-      /// @param[out] IF  #intersecting face pairs by 2  list of intersecting
-      ///   face pairs, indexing F
-      /// @param[out] J  #FF list of indices into F denoting birth triangle
-      /// @param[out] IM  #VV list of indices into VV of unique vertices.
-      ///
-      /// \bug If an existing edge in (V,F) lies exactly on another face then
-      /// any resulting additional vertices along that edge may not get properly
-      /// connected so that the output mesh has the same global topology. This
-      /// is because …
-      ///
-      /// #### Example.
-      ///     // resolve intersections
-      ///     igl::copyleft::cgal::remesh_self_intersections(V,F,params,VV,FF,IF,J,IM);
-      ///     // _apply_ duplicate vertex mapping IM to FF
-      ///     for_each(FF.data(),FF.data()+FF.size(),[&IM](int & a){a=IM(a);});
-      ///     // remove any vertices now unreferenced after duplicate mapping.
-      ///     igl::remove_unreferenced(VV,FF,SV,SF,UIM);
-      ///     // Now (SV,SF) is ready to extract outer hull
-      ///     igl::copyleft::cgal::outer_hull(SV,SF,G,J,flip);
-      ///
-      template <
-        typename DerivedV,
-        typename DerivedF,
-        typename DerivedVV,
-        typename DerivedFF,
-        typename DerivedIF,
-        typename DerivedJ,
-        typename DerivedIM>
-      IGL_INLINE void remesh_self_intersections(
-        const Eigen::MatrixBase<DerivedV> & V,
-        const Eigen::MatrixBase<DerivedF> & F,
-        const RemeshSelfIntersectionsParam & params,
-        Eigen::PlainObjectBase<DerivedVV> & VV,
-        Eigen::PlainObjectBase<DerivedFF> & FF,
-        Eigen::PlainObjectBase<DerivedIF> & IF,
-        Eigen::PlainObjectBase<DerivedJ> & J,
-        Eigen::PlainObjectBase<DerivedIM> & IM);
-    }
-  }
-}
-
-#ifndef IGL_STATIC_LIBRARY
-#  include "remesh_self_intersections.cpp"
-#endif
-  
-#endif

+ 0 - 49
include/igl/copyleft/cgal/resolve_intersections.h

@@ -1,49 +0,0 @@
-// This file is part of libigl, a simple c++ geometry processing library.
-// 
-// Copyright (C) 2016 Alec Jacobson <[email protected]>
-// 
-// This Source Code Form is subject to the terms of the Mozilla Public License 
-// v. 2.0. If a copy of the MPL was not distributed with this file, You can 
-// obtain one at http://mozilla.org/MPL/2.0/.
-#ifndef IGL_COPYLEFT_CGAL_RESOLVE_INTERSECTIONS_H
-#define IGL_COPYLEFT_CGAL_RESOLVE_INTERSECTIONS_H
-#include "../../igl_inline.h"
-#include <Eigen/Core>
-
-namespace igl
-{
-  namespace copyleft
-  {
-    namespace cgal
-    {
-    /// Given a list of possible intersecting segments with endpoints, split
-    /// segments to overlap only at endpoints
-    ///
-    /// @param[in] V  #V by 2 list of vertex positions
-    /// @param[in] E  #E by 2 list of segment indices into V
-    /// @param[out] VI  #VI by 2 list of output vertex positions, copies of V are always
-    ///               the first #V vertices
-    /// @param[out] EI  #EI by 2 list of segment indices into V, #EI ≥ #E
-    /// @param[out] J  #EI list of indices into E revealing "parent segments"
-    /// @param[out] IM  #VI list of indices into VV of unique vertices.
-      template <
-        typename DerivedV, 
-        typename DerivedE, 
-        typename DerivedVI, 
-        typename DerivedEI,
-        typename DerivedJ,
-        typename DerivedIM>
-      IGL_INLINE void resolve_intersections(
-        const Eigen::PlainObjectBase<DerivedV> & V,
-        const Eigen::PlainObjectBase<DerivedE> & E,
-        Eigen::PlainObjectBase<DerivedVI> & VI,
-        Eigen::PlainObjectBase<DerivedEI> & EI,
-        Eigen::PlainObjectBase<DerivedJ> & J,
-        Eigen::PlainObjectBase<DerivedIM> & IM);
-    }
-  }
-}
-#ifndef IGL_STATIC_LIBRARY
-#  include "resolve_intersections.cpp"
-#endif
-#endif

+ 0 - 37
include/igl/copyleft/cgal/row_to_point.h

@@ -1,37 +0,0 @@
-// This file is part of libigl, a simple c++ geometry processing library.
-// 
-// Copyright (C) 2016 Alec Jacobson <[email protected]>
-// 
-// This Source Code Form is subject to the terms of the Mozilla Public License 
-// v. 2.0. If a copy of the MPL was not distributed with this file, You can 
-// obtain one at http://mozilla.org/MPL/2.0/.
-#ifndef IGL_COPYLEFT_CGAL_ROW_TO_POINT_H
-#define IGL_COPYLEFT_CGAL_ROW_TO_POINT_H
-#include "../../igl_inline.h"
-#include <Eigen/Core>
-#include <CGAL/Point_2.h>
-namespace igl
-{
-  namespace copyleft
-  {
-    namespace cgal
-    {
-      /// Extract a row from V and treat as a 2D cgal point (only first two
-      /// columns of V are used).
-      /// 
-      /// @param[in] V  #V by 2 list of vertex positions
-      /// @param[in] i  row index
-      /// @return 2D cgal point
-      template <
-        typename Kernel,
-        typename DerivedV>
-      IGL_INLINE CGAL::Point_2<Kernel> row_to_point(
-        const Eigen::PlainObjectBase<DerivedV> & V,
-        const typename DerivedV::Index & i);
-    }
-  }
-}
-#ifndef IGL_STATIC_LIBRARY
-#  include "row_to_point.cpp"
-#endif
-#endif

+ 0 - 43
include/igl/copyleft/cgal/segment_segment_squared_distance.h

@@ -1,43 +0,0 @@
-// This file is part of libigl, a simple c++ geometry processing library.
-// 
-// Copyright (C) 2016 Alec Jacobson <[email protected]>
-// 
-// This Source Code Form is subject to the terms of the Mozilla Public License 
-// v. 2.0. If a copy of the MPL was not distributed with this file, You can 
-// obtain one at http://mozilla.org/MPL/2.0/.
-#ifndef IGL_COPYLEFT_CGAL_SEGMENT_SEGMENT_SQUARED_DISTANCE_H
-#define IGL_COPYLEFT_CGAL_SEGMENT_SEGMENT_SQUARED_DISTANCE_H
-#include "../../igl_inline.h"
-#include <CGAL/Segment_3.h>
-#include <CGAL/Point_3.h>
-namespace igl
-{
-  namespace copyleft
-  {
-    namespace cgal
-    {
-      /// Given two segments S1 and S2 find the points on each of closest
-      /// approach and the squared distance thereof.
-      /// 
-      /// @param[in] S1  first segment
-      /// @param[in] S2  second segment
-      /// @param[oout] P1  point on S1 closest to S2
-      /// @param[oout] P2  point on S2 closest to S1
-      /// @param[oout] d  distance betwee P1 and S2
-      /// @return true if the closest approach is unique.
-      template < typename Kernel>
-      IGL_INLINE bool segment_segment_squared_distance(
-        const CGAL::Segment_3<Kernel> & S1,
-        const CGAL::Segment_3<Kernel> & S2,
-        CGAL::Point_3<Kernel> & P1,
-        CGAL::Point_3<Kernel> & P2,
-        typename Kernel::FT & d);
-
-    }
-  }
-}
-#ifndef IGL_STATIC_LIBRARY
-#  include "segment_segment_squared_distance.cpp"
-#endif
-
-#endif

+ 0 - 53
include/igl/copyleft/cgal/signed_distance_isosurface.h

@@ -1,53 +0,0 @@
-// This file is part of libigl, a simple c++ geometry processing library.
-// 
-// Copyright (C) 2014 Alec Jacobson <[email protected]>
-// 
-// This Source Code Form is subject to the terms of the Mozilla Public License 
-// v. 2.0. If a copy of the MPL was not distributed with this file, You can 
-// obtain one at http://mozilla.org/MPL/2.0/.
-#ifndef IGL_COPYLEFT_CGAL_SIGNED_DISTANCE_ISOSURFACE_H
-#define IGL_COPYLEFT_CGAL_SIGNED_DISTANCE_ISOSURFACE_H
-#include "../../igl_inline.h"
-#include "../../signed_distance.h"
-#include <Eigen/Core>
-namespace igl
-{
-  namespace copyleft
-  {
-    namespace cgal
-    {
-      /// Compute the contour of an iso-level of the signed distance field to a
-      /// given mesh.
-      ///
-      /// @param[in] IV  #IV by 3 list of input mesh vertex positions
-      /// @param[in] IF  #IF by 3 list of input triangle indices
-      /// @param[in] level  iso-level to contour in world coords, negative is inside.
-      /// @param[in] angle_bound  lower bound on triangle angles (mesh quality) (e.g. 28)
-      /// @param[in] radius_bound  upper bound on triangle size (mesh density?) (e.g. 0.02)
-      /// @param[in] distance_bound  cgal mysterious parameter (mesh density?) (e.g. 0.01)
-      /// @param[in] sign_type  method for computing distance _sign_ (see
-      ///     ../signed_distance.h)
-      /// @param[out] V  #V by 3 list of input mesh vertex positions
-      /// @param[out] F  #F by 3 list of input triangle indices
-      /// @return true if complex_to_mesh is successful
-      ///  
-      IGL_INLINE bool signed_distance_isosurface(
-        const Eigen::MatrixXd & IV,
-        const Eigen::MatrixXi & IF,
-        const double level,
-        const double angle_bound,
-        const double radius_bound,
-        const double distance_bound,
-        const SignedDistanceType sign_type,
-        Eigen::MatrixXd & V,
-        Eigen::MatrixXi & F);
-    }
-  }
-}
-
-#ifndef IGL_STATIC_LIBRARY
-#  include "signed_distance_isosurface.cpp"
-#endif
-
-#endif
-

+ 0 - 49
include/igl/copyleft/cgal/snap_rounding.h

@@ -1,49 +0,0 @@
-// This file is part of libigl, a simple c++ geometry processing library.
-// 
-// Copyright (C) 2016 Alec Jacobson <[email protected]>
-// 
-// This Source Code Form is subject to the terms of the Mozilla Public License 
-// v. 2.0. If a copy of the MPL was not distributed with this file, You can 
-// obtain one at http://mozilla.org/MPL/2.0/.
-#ifndef IGL_COPYLEFT_CGAL_SNAP_ROUNDING_H
-#define IGL_COPYLEFT_CGAL_SNAP_ROUNDING_H
-
-#include "../../igl_inline.h"
-#include <Eigen/Core>
-
-namespace igl
-{
-  namespace copyleft
-  {
-    namespace cgal
-    {
-      /// Snap a list of possible intersecting segments with
-      /// endpoints in any precision to _the_ integer grid.
-      ///
-      /// @param[in] V  #V by 2 list of vertex positions
-      /// @param[in] E  #E by 2 list of segment indices into V
-      /// @param[out] VI  #VI by 2 list of output integer vertex positions, rounded copies
-      ///     of V are always the first #V vertices
-      /// @param[out] EI  #EI by 2 list of segment indices into V, #EI ≥ #E
-      /// @param[out] J  #EI list of indices into E revealing "parent segments"
-      template <
-        typename DerivedV, 
-        typename DerivedE, 
-        typename DerivedVI, 
-        typename DerivedEI,
-        typename DerivedJ>
-      IGL_INLINE void snap_rounding(
-        const Eigen::PlainObjectBase<DerivedV> & V,
-        const Eigen::PlainObjectBase<DerivedE> & E,
-        Eigen::PlainObjectBase<DerivedVI> & VI,
-        Eigen::PlainObjectBase<DerivedEI> & EI,
-        Eigen::PlainObjectBase<DerivedJ> & J);
-    }
-  }
-}
-
-#ifndef IGL_STATIC_LIBRARY
-#  include "snap_rounding.cpp"
-#endif
-
-#endif

+ 0 - 43
include/igl/copyleft/cgal/string_to_mesh_boolean_type.h

@@ -1,43 +0,0 @@
-// This file is part of libigl, a simple c++ geometry processing library.
-// 
-// Copyright (C) 2015 Alec Jacobson <[email protected]>
-// 
-// This Source Code Form is subject to the terms of the Mozilla Public License 
-// v. 2.0. If a copy of the MPL was not distributed with this file, You can 
-// obtain one at http://mozilla.org/MPL/2.0/.
-#ifndef IGL_COPYLEFT_CGAL_STRING_TO_MESH_BOOLEAN_H
-#define IGL_COPYLEFT_CGAL_STRING_TO_MESH_BOOLEAN_H
-
-#include "../../igl_inline.h"
-#include "../../MeshBooleanType.h"
-#include <string>
-
-namespace igl
-{
-  namespace copyleft
-  {
-    namespace cgal
-    {
-      /// Convert string to boolean type
-      ///
-      /// @param[in] s  string identifying type, one of the following:
-      ///      "union","intersect","minus","xor","resolve"
-      /// @param[out] type  type of boolean operation
-      /// @return true only on success
-      ///     
-      IGL_INLINE bool string_to_mesh_boolean_type(
-        const std::string & s,
-        MeshBooleanType & type);
-      /// \overload
-      /// \brief Returns type without error handling
-      IGL_INLINE MeshBooleanType string_to_mesh_boolean_type(
-        const std::string & s);
-    }
-  }
-}
-
-#ifndef IGL_STATIC_LIBRARY
-#  include "string_to_mesh_boolean_type.cpp"
-#endif
-
-#endif

+ 0 - 54
include/igl/copyleft/cgal/subdivide_segments.h

@@ -1,54 +0,0 @@
-// This file is part of libigl, a simple c++ geometry processing library.
-// 
-// Copyright (C) 2016 Alec Jacobson <[email protected]>
-// 
-// This Source Code Form is subject to the terms of the Mozilla Public License 
-// v. 2.0. If a copy of the MPL was not distributed with this file, You can 
-// obtain one at http://mozilla.org/MPL/2.0/.
-#ifndef IGL_COPYLEFT_CGAL_SUBDIVIDE_SEGMENTS_H
-#define IGL_COPYLEFT_CGAL_SUBDIVIDE_SEGMENTS_H
-#include "../../igl_inline.h"
-#include <Eigen/Core>
-#include <CGAL/Segment_2.h>
-#include <CGAL/Point_2.h>
-#include <vector>
-namespace igl
-{
-  namespace copyleft
-  {
-    namespace cgal
-    {
-      /// Insert steiner points to subdivide a given set of line segments
-      /// 
-      /// @param[in] V  #V by 2 list of vertex positions
-      /// @param[in] E  #E by 2 list of segment indices into V
-      /// @param[in] steiner  #E list of lists of unsorted steiner points (including
-      ///     endpoints) along the #E original segments
-      /// @param[out] VI  #VI by 2 list of output vertex positions, copies of V are always
-      ///               the first #V vertices
-      /// @param[out] EI  #EI by 2 list of segment indices into V, #EI ≥ #E
-      /// @param[out] J  #EI list of indices into E revealing "parent segments"
-      /// @param[out] IM  #VI list of indices into VV of unique vertices.
-      template <
-        typename DerivedV, 
-        typename DerivedE,
-        typename Kernel, 
-        typename DerivedVI, 
-        typename DerivedEI,
-        typename DerivedJ,
-        typename DerivedIM>
-      IGL_INLINE void subdivide_segments(
-        const Eigen::PlainObjectBase<DerivedV> & V,
-        const Eigen::PlainObjectBase<DerivedE> & E,
-        const std::vector<std::vector<CGAL::Point_2<Kernel> > > & steiner,
-        Eigen::PlainObjectBase<DerivedVI> & VI,
-        Eigen::PlainObjectBase<DerivedEI> & EI,
-        Eigen::PlainObjectBase<DerivedJ> & J,
-        Eigen::PlainObjectBase<DerivedIM> & IM);
-    }
-  }
-}
-#ifndef IGL_STATIC_LIBRARY
-#  include "subdivide_segments.cpp"
-#endif
-#endif

+ 0 - 62
include/igl/copyleft/cgal/submesh_aabb_tree.h

@@ -1,62 +0,0 @@
-// This file is part of libigl, a simple c++ geometry processing library.
-// 
-// Copyright (C) 2016 Alec Jacobson
-// 
-// This Source Code Form is subject to the terms of the Mozilla Public License 
-// v. 2.0. If a copy of the MPL was not distributed with this file, You can 
-// obtain one at http://mozilla.org/MPL/2.0/.
-//
-#ifndef IGL_COPYLET_CGAL_SUBMESH_AABB_TREE_H
-#define IGL_COPYLET_CGAL_SUBMESH_AABB_TREE_H
-
-#include "../../igl_inline.h"
-#include <Eigen/Core>
-#include <vector>
-
-#include <CGAL/AABB_tree.h>
-#include <CGAL/AABB_traits.h>
-#include <CGAL/AABB_triangle_primitive.h>
-#include <CGAL/intersections.h>
-#include <CGAL/Exact_predicates_exact_constructions_kernel.h>
-
-namespace igl
-{
-  namespace copyleft
-  {
-    namespace cgal
-    {
-      /// Build an AABB tree for a submesh indicated by a face selection list I
-      /// of a full mesh (V,F)
-      ///
-      /// @param[in] V  #V by 3 array of vertices.
-      /// @param[in] F  #F by 3 array of faces.
-      /// @param[in] I  #I list of triangle indices to consider.
-      /// @param[out] tree  aabb containing triangles of (V,F(I,:))
-      /// @param[out] triangles  #I list of cgal triangles
-      /// @param[out] in_I  #F list of whether in submesh
-      template<
-        typename DerivedV,
-        typename DerivedF,
-        typename DerivedI,
-        typename Kernel>
-      IGL_INLINE void submesh_aabb_tree(
-        const Eigen::PlainObjectBase<DerivedV>& V,
-        const Eigen::PlainObjectBase<DerivedF>& F,
-        const Eigen::PlainObjectBase<DerivedI>& I,
-        CGAL::AABB_tree<
-          CGAL::AABB_traits<
-            Kernel, 
-            CGAL::AABB_triangle_primitive<
-              Kernel, typename std::vector<
-                typename Kernel::Triangle_3 >::iterator > > > & tree,
-        std::vector<typename Kernel::Triangle_3 > & triangles,
-        std::vector<bool> & in_I);
-    }
-  }
-}
-
-#ifndef IGL_STATIC_LIBRARY
-#  include "submesh_aabb_tree.cpp"
-#endif
-
-#endif

+ 0 - 43
include/igl/copyleft/cgal/triangle_triangle_squared_distance.h

@@ -1,43 +0,0 @@
-// This file is part of libigl, a simple c++ geometry processing library.
-// 
-// Copyright (C) 2016 Alec Jacobson <[email protected]>
-// 
-// This Source Code Form is subject to the terms of the Mozilla Public License 
-// v. 2.0. If a copy of the MPL was not distributed with this file, You can 
-// obtain one at http://mozilla.org/MPL/2.0/.
-#ifndef IGL_COPYLEFT_CGAL_TRIANGLE_TRIANGLE_SQUARED_DISTANCE_H
-#define IGL_COPYLEFT_CGAL_TRIANGLE_TRIANGLE_SQUARED_DISTANCE_H
-#include "../../igl_inline.h"
-#include <CGAL/Triangle_3.h>
-#include <CGAL/Point_3.h>
-namespace igl
-{
-  namespace copyleft
-  {
-    namespace cgal
-    {
-      /// Given two triangles T1 and T2 find the points on each of closest
-      /// approach and the squared distance thereof.
-      /// 
-      /// @param[in] T1  first triangle
-      /// @param[in] T2  second triangle
-      /// @param[out] P1  point on T1 closest to T2
-      /// @param[out] P2  point on T2 closest to T1
-      /// @param[out] d  distance betwee P1 and T2
-      /// @return true if the closest approach is unique.
-      template < typename Kernel>
-      IGL_INLINE bool triangle_triangle_squared_distance(
-        const CGAL::Triangle_3<Kernel> & T1,
-        const CGAL::Triangle_3<Kernel> & T2,
-        CGAL::Point_3<Kernel> & P1,
-        CGAL::Point_3<Kernel> & P2,
-        typename Kernel::FT & d);
-    }
-  }
-}
-#ifndef IGL_STATIC_LIBRARY
-#  include "triangle_triangle_squared_distance.cpp"
-#endif
-
-#endif
-

+ 0 - 55
include/igl/copyleft/cgal/triangulate.h

@@ -1,55 +0,0 @@
-// This file is part of libigl, a simple c++ geometry processing library.
-//
-// Copyright (C) 2021 Alec Jacobson
-//
-// This Source Code Form is subject to the terms of the Mozilla Public License
-// v. 2.0. If a copy of the MPL was not distributed with this file, You can
-// obtain one at http://mozilla.org/MPL/2.0/.
-#ifndef IGL_COPYLEFT_CGAL_TRIANGULATE_H
-#define IGL_COPYLEFT_CGAL_TRIANGULATE_H
-
-#include "../../igl_inline.h"
-#include <string>
-#include <Eigen/Core>
-
-namespace igl
-{
-  namespace copyleft
-  {
-    namespace cgal
-    {
-      /// Triangulate the interior of a polygon using CGAL 
-      ///
-      /// @param[in] V #V by 2 list of 2D vertex positions
-      /// @param[in] E #E by 2 list of vertex ids forming unoriented edges of the boundary of the polygon
-      /// @param[in] H #H by 2 coordinates of points contained inside holes of the polygon
-      /// @param[in] retain_convex_hull  whether to retain convex hull {true} or trim away
-      ///     all faces reachable from infinite by traversing across
-      ///     non-constrained edges {false}.  {true → "c" flag in `triangle`}
-      /// @param[out] V2  #V2 by 2  coordinates of the vertives of the generated triangulation
-      /// @param[out] F2  #F2 by 3  list of indices forming the faces of the generated triangulation
-      ///
-      /// \see igl::triangle::triangulate
-      template <
-        typename Kernel,
-        typename DerivedV,
-        typename DerivedE,
-        typename DerivedH,
-        typename DerivedV2,
-        typename DerivedF2>
-      IGL_INLINE void triangulate(
-        const Eigen::MatrixBase<DerivedV> & V,
-        const Eigen::MatrixBase<DerivedE> & E,
-        const Eigen::MatrixBase<DerivedH> & H,
-        const bool retain_convex_hull,
-        Eigen::PlainObjectBase<DerivedV2> & V2,
-        Eigen::PlainObjectBase<DerivedF2> & F2);
-    }
-  }
-}
-
-#ifndef IGL_STATIC_LIBRARY
-#  include "triangulate.cpp"
-#endif
-
-#endif

+ 0 - 61
include/igl/copyleft/cgal/trim_with_solid.h

@@ -1,61 +0,0 @@
-// This file is part of libigl, a simple c++ geometry processing library.
-// 
-// Copyright (C) 2016 Alec Jacobson <[email protected]>
-// 
-// This Source Code Form is subject to the terms of the Mozilla Public License 
-// v. 2.0. If a copy of the MPL was not distributed with this file, You can 
-// obtain one at http://mozilla.org/MPL/2.0/.
-#ifndef IGL_COPYLEFT_CGAL_TRIM_WITH_SOLID_H
-#define IGL_COPYLEFT_CGAL_TRIM_WITH_SOLID_H
-
-#include "../../igl_inline.h"
-#include <Eigen/Core>
-
-namespace igl
-{
-  namespace copyleft
-  {
-    namespace cgal
-    {
-      /// Given an arbitrary mesh (VA,FA) and the boundary mesh
-      /// (VB,FB) of a solid (as defined in [Zhou et al. 2016]), Resolve intersections
-      /// between A and B subdividing faces of A so that intersections with B exists
-      /// only along edges and vertices (and coplanar faces). Then determine whether
-      /// each of these faces is inside or outside of B. This can be used to extract
-      /// the part of A inside or outside of B.
-      ///
-      /// @param[in] VA  #VA by 3 list of mesh vertex positions of A
-      /// @param[in] FA  #FA by 3 list of mesh triangle indices into VA
-      /// @param[in] VB  #VB by 3 list of mesh vertex positions of B
-      /// @param[in] FB  #FB by 3 list of mesh triangle indices into VB
-      /// @param[out] V  #V by 3 list of mesh vertex positions of output
-      /// @param[out] F  #F by 3 list of mesh triangle indices into V
-      /// @param[out] D  #F list of bools whether face is inside B
-      /// @param[out] J  #F list of indices into FA revealing birth parent
-      ///
-      template <
-        typename DerivedVA,
-        typename DerivedFA,
-        typename DerivedVB,
-        typename DerivedFB,
-        typename DerivedV,
-        typename DerivedF,
-        typename DerivedD,
-        typename DerivedJ>
-      IGL_INLINE void trim_with_solid(
-        const Eigen::PlainObjectBase<DerivedVA> & VA,
-        const Eigen::PlainObjectBase<DerivedFA> & FA,
-        const Eigen::PlainObjectBase<DerivedVB> & VB,
-        const Eigen::PlainObjectBase<DerivedFB> & FB,
-        Eigen::PlainObjectBase<DerivedV> & Vd,
-        Eigen::PlainObjectBase<DerivedF> & F,
-        Eigen::PlainObjectBase<DerivedD> & D,
-        Eigen::PlainObjectBase<DerivedJ> & J);
-    }
-  }
-}
-
-#ifndef IGL_STATIC_LIBRARY
-#  include "trim_with_solid.cpp"
-#endif
-#endif

+ 0 - 84
include/igl/copyleft/cgal/wire_mesh.h

@@ -1,84 +0,0 @@
-#ifndef IGL_COPYLEFT_CGAL_WIRE_MESH_H
-#define IGL_COPYLEFT_CGAL_WIRE_MESH_H
-#include "../../igl_inline.h"
-#include <Eigen/Core>
-namespace igl
-{
-  namespace copyleft
-  {
-    namespace cgal
-    {
-      /// Construct a "wire" or "wireframe" or "strut" surface mesh, given a
-      /// one-dimensional network of straight edges.
-      ///
-      /// @param[in] WV  #WV by 3 list of vertex positions
-      /// @param[in] WE  #WE by 2 list of edge indices into WV
-      /// @param[in] th  #WE diameter thicknesses of wire edges
-      /// @param[in] poly_size  number of sides on each wire (e.g., 4 would produce wires by
-      ///     connecting rectangular prisms).
-      /// @param[in] solid  whether to resolve self-intersections to
-      ///     create a "solid" output mesh (cf., [Zhou et al. 2016]
-      /// @param[out] V  #V by 3 list of output vertices
-      /// @param[out] F  #F by 3 list of output triangle indices into V
-      /// @param[out] J  #F list of indices into [0,#WV+#WE) revealing "birth simplex" of
-      ///     output faces J(j) < #WV means the face corresponds to the J(j)th
-      ///     vertex in WV. J(j) >= #WV means the face corresponds to the
-      ///     (J(j)-#WV)th edge in WE.
-      template <
-        typename DerivedWV,
-        typename DerivedWE,
-        typename Derivedth,
-        typename DerivedV,
-        typename DerivedF,
-        typename DerivedJ>
-      IGL_INLINE void wire_mesh(
-        const Eigen::MatrixBase<DerivedWV> & WV,
-        const Eigen::MatrixBase<DerivedWE> & WE,
-        const Eigen::MatrixBase<Derivedth> & th,
-        const int poly_size,
-        const bool solid,
-        Eigen::PlainObjectBase<DerivedV> & V,
-        Eigen::PlainObjectBase<DerivedF> & F,
-        Eigen::PlainObjectBase<DerivedJ> & J);
-      /// \overload
-      /// \brief uniform th
-      template <
-        typename DerivedWV,
-        typename DerivedWE,
-        typename DerivedV,
-        typename DerivedF,
-        typename DerivedJ>
-      IGL_INLINE void wire_mesh(
-        const Eigen::MatrixBase<DerivedWV> & WV,
-        const Eigen::MatrixBase<DerivedWE> & WE,
-        const double th,
-        const int poly_size,
-        const bool solid,
-        Eigen::PlainObjectBase<DerivedV> & V,
-        Eigen::PlainObjectBase<DerivedF> & F,
-        Eigen::PlainObjectBase<DerivedJ> & J);
-      /// \overload
-      /// \brief Solid == true
-      template <
-        typename DerivedWV,
-        typename DerivedWE,
-        typename DerivedV,
-        typename DerivedF,
-        typename DerivedJ>
-      IGL_INLINE void wire_mesh(
-        const Eigen::MatrixBase<DerivedWV> & WV,
-        const Eigen::MatrixBase<DerivedWE> & WE,
-        const double th,
-        const int poly_size,
-        Eigen::PlainObjectBase<DerivedV> & V,
-        Eigen::PlainObjectBase<DerivedF> & F,
-        Eigen::PlainObjectBase<DerivedJ> & J);
-
-    }
-  }
-}
-
-#ifndef IGL_STATIC_LIBRARY
-#  include "wire_mesh.cpp"
-#endif
-#endif

+ 0 - 54
include/igl/copyleft/comiso/frame_field.h

@@ -1,54 +0,0 @@
-// This file is part of libigl, a simple c++ geometry processing library.
-//
-// Copyright (C) 2014 Daniele Panozzo <[email protected]>
-//
-// This Source Code Form is subject to the terms of the Mozilla Public License
-// v. 2.0. If a copy of the MPL was not distributed with this file, You can
-// obtain one at http://mozilla.org/MPL/2.0/.
-#ifndef IGL_COMISO_FRAMEFIELD_H
-#define IGL_COMISO_FRAMEFIELD_H
-
-#include "../../igl_inline.h"
-#include "../../PI.h"
-#include <Eigen/Dense>
-#include <vector>
-
-namespace igl
-{
-namespace copyleft
-{
-namespace comiso
-{
-/// Generate a piecewise-constant frame-field field from a sparse set of constraints on faces
-/// using the algorithm proposed in:
-/// Frame Fields: Anisotropic and Non-Orthogonal Cross Fields
-/// Daniele Panozzo, Enrico Puppo, Marco Tarini, Olga Sorkine-Hornung,
-/// ACM Transactions on Graphics (SIGGRAPH, 2014)
-///
-/// @param[in] V       #V by 3 list of mesh vertex coordinates
-/// @param[in] F       #F by 3 list of mesh faces (must be triangles)
-/// @param[in] b       #B by 1 list of constrained face indices
-/// @param[in] bc1     #B by 3 list of the constrained first representative vector of the frame field (up to permutation and sign)
-/// @param[in] bc2     #B by 3 list of the constrained second representative vector of the frame field (up to permutation and sign)
-/// @param[out] FF1      #F by 3 the first representative vector of the frame field (up to permutation and sign)
-/// @param[out] FF2      #F by 3 the second representative vector of the frame field (up to permutation and sign)
-///
-/// \note it now supports only soft constraints, should be extended to support both hard and soft constraints
-IGL_INLINE void frame_field(
-  const Eigen::MatrixXd& V,
-  const Eigen::MatrixXi& F,
-  const Eigen::VectorXi& b,
-  const Eigen::MatrixXd& bc1,
-  const Eigen::MatrixXd& bc2,
-  Eigen::MatrixXd& FF1,
-  Eigen::MatrixXd& FF2
-  );
-}
-}
-}
-
-#ifndef IGL_STATIC_LIBRARY
-#  include "frame_field.cpp"
-#endif
-
-#endif

+ 0 - 112
include/igl/copyleft/comiso/miq.h

@@ -1,112 +0,0 @@
-// This file is part of libigl, a simple c++ geometry processing library.
-//
-// Copyright (C) 2014 Daniele Panozzo <[email protected]>, Olga Diamanti <[email protected]>, Kevin Walliman <[email protected]>
-//
-// This Source Code Form is subject to the terms of the Mozilla Public License
-// v. 2.0. If a copy of the MPL was not distributed with this file, You can
-// obtain one at http://mozilla.org/MPL/2.0/.
-#ifndef IGL_COMISO_MIQ_H
-#define IGL_COMISO_MIQ_H
-#include "../../igl_inline.h"
-#include <Eigen/Core>
-#include <vector>
-
-namespace igl
-{
-  namespace copyleft
-  {
-  namespace comiso
-  {
-    /// Global seamless parametrization aligned with a given per-face Jacobian (PD1, PD2).
-    /// The algorithm is based on
-    /// "Mixed-Integer Quadrangulation" by D. Bommes, H. Zimmer, L. Kobbelt
-    /// ACM SIGGRAPH 2009, Article No. 77 (http://dl.acm.org/citation.cfm?id=1531383)
-    /// We thank Nico Pietroni for providing a reference implementation of MIQ
-    /// on which our code is based.
-    ///
-    ///  \bug Due to the way of handling of hardFeatures the algorithm  may fail in difficult cases.
-    ///  \bug Meshes with boundaries are not hendled properly i.e., jagged edges along the boundary are possible
-    /// @param[in] V                 #V by 3 list of mesh vertex 3D positions
-    /// @param[in] F                 #F by 3 list of faces indices in V
-    /// @param[in] PD1               #V by 3 first line of the Jacobian per triangle
-    /// @param[in] PD2               #V by 3 second line of the Jacobian per triangle (optional, if empty it will be a vector in the tangent plane orthogonal to PD1)
-    /// @param[in] gradientSize      global scaling for the gradient (controls the quads resolution)
-    /// @param[in] stiffness         weight for the stiffness iterations (Reserved but not used!)
-    /// @param[in] directRound       greedily round all integer variables at once (greatly improves optimization speed but lowers quality)
-    /// @param[in] iter              stiffness iterations (0 = no stiffness)
-    /// @param[in] localIter         number of local iterations for the integer rounding
-    /// @param[in] doRound           enables the integer rounding (disabling it could be useful for debugging)
-    /// @param[in] singularityRound  set true/false to decide if the singularities' coordinates should be rounded to the nearest integers
-    /// @param[in] roundVertices     id of additional vertices that should be snapped to integer coordinates
-    /// @param[in] hardFeatures      #H by 2 list of pairs of vertices that belongs to edges that should be snapped to integer coordinates
-    /// @param[out] UV                 #UV by 2 list of vertices in 2D
-    /// @param[out] FUV                #FUV by 3 list of face indices in UV
-    ///
-    template <typename DerivedV, typename DerivedF, typename DerivedU>
-    IGL_INLINE void miq(
-      const Eigen::PlainObjectBase<DerivedV> &V,
-      const Eigen::PlainObjectBase<DerivedF> &F,
-      const Eigen::PlainObjectBase<DerivedV> &PD1,
-      const Eigen::PlainObjectBase<DerivedV> &PD2,
-      Eigen::PlainObjectBase<DerivedU> &UV,
-      Eigen::PlainObjectBase<DerivedF> &FUV,
-      double gradientSize = 30.0,
-      double stiffness = 5.0,
-      bool directRound = false,
-      unsigned int iter = 5,
-      unsigned int localIter = 5,
-      bool doRound = true,
-      bool singularityRound = true,
-      const std::vector<int> &roundVertices = std::vector<int>(),
-      const std::vector<std::vector<int>> &hardFeatures = std::vector<std::vector<int> >());
-
-    /// miq Helper function that allows to directly provided pre-combed bisectors for an already cut mesh
-    ///
-    /// @param[in] V                  #V by 3 list of mesh vertex 3D positions
-    /// @param[in] F                  #F by 3 list of faces indices in V
-    /// @param[in] Additional Input:
-    /// @param[in] PD1_combed         #F by 3 first combed Jacobian
-    /// @param[in] PD2_combed         #F by 3 second combed Jacobian
-    /// @param[in] mismatch             #F by 3 list of per-corner integer PI/2 rotations
-    /// @param[in] singular           #V list of flag that denotes if a vertex is singular or not
-    /// @param[in] seams              #F by 3 list of per-corner flag that denotes seams
-    /// @param[out] UV                 #UV by 2 list of vertices in 2D
-    /// @param[out] FUV                #FUV by 3 list of face indices in UV
-    /// @param[in] gradientSize       global scaling for the gradient (controls the quads resolution)
-    /// @param[in] stiffness          weight for the stiffness iterations (Reserved but not used!)
-    /// @param[in] directRound        greedily round all integer variables at once (greatly improves optimization speed but lowers quality)
-    /// @param[in] iter               stiffness iterations (0 = no stiffness)
-    /// @param[in] localIter          number of local iterations for the integer rounding
-    /// @param[in] doRound            enables the integer rounding (disabling it could be useful for debugging)
-    /// @param[in] singularityRound   set true/false to decide if the singularities' coordinates should be rounded to the nearest integers
-    /// @param[in] roundVertices      id of additional vertices that should be snapped to integer coordinates
-    /// @param[in] hardFeatures       #H by 2 list of pairs of vertices that belongs to edges that should be snapped to integer coordinates
-    ///
-    template <typename DerivedV, typename DerivedF, typename DerivedU>
-    IGL_INLINE void miq(
-      const Eigen::PlainObjectBase<DerivedV> &V,
-      const Eigen::PlainObjectBase<DerivedF> &F,
-      const Eigen::PlainObjectBase<DerivedV> &PD1_combed,
-      const Eigen::PlainObjectBase<DerivedV> &PD2_combed,
-      const Eigen::Matrix<int, Eigen::Dynamic, 3> &mismatch,
-      const Eigen::Matrix<int, Eigen::Dynamic, 1> &singular,
-      const Eigen::Matrix<int, Eigen::Dynamic, 3> &seams,
-      Eigen::PlainObjectBase<DerivedU> &UV,
-      Eigen::PlainObjectBase<DerivedF> &FUV,
-      double gradientSize = 30.0,
-      double stiffness = 5.0,
-      bool directRound = false,
-      unsigned int iter = 5,
-      unsigned int localIter = 5,
-      bool doRound = true,
-      bool singularityRound = true,
-      const std::vector<int> &roundVertices = std::vector<int>(),
-      const std::vector<std::vector<int>> &hardFeatures = std::vector<std::vector<int> >());
-  };
-};
-};
-#ifndef IGL_STATIC_LIBRARY
-#include "miq.cpp"
-#endif
-
-#endif

+ 0 - 68
include/igl/copyleft/comiso/nrosy.h

@@ -1,68 +0,0 @@
-// This file is part of libigl, a simple c++ geometry processing library.
-//
-// Copyright (C) 2014 Daniele Panozzo <[email protected]>
-//
-// This Source Code Form is subject to the terms of the Mozilla Public License
-// v. 2.0. If a copy of the MPL was not distributed with this file, You can
-// obtain one at http://mozilla.org/MPL/2.0/.
-#ifndef IGL_COMISO_NROSY_H
-#define IGL_COMISO_NROSY_H
-
-#include <Eigen/Core>
-#include <Eigen/Sparse>
-#include "../../igl_inline.h"
-
-namespace igl
-{
-  namespace copyleft
-  {
-  namespace comiso
-  {
-    /// Generate a N-RoSy field from a sparse set of constraints
-    ///
-    /// @param[in] V       #V by 3 list of mesh vertex coordinates
-    /// @param[in] F       #F by 3 list of mesh faces (must be triangles)
-    /// @param[in] b       #B by 1 list of constrained face indices
-    /// @param[in] bc      #B by 3 list of representative vectors for the
-    ///   constrained faces
-    /// @param[in] b_soft  #S by 1 b for soft constraints
-    /// @param[in] w_soft  #S by 1 weight for the soft constraints (0-1)
-    /// @param[in] bc_soft #S by 3 bc for soft constraints
-    /// @param[in] N       the degree of the N-RoSy vector field
-    /// @param[in] soft    the strength of the soft constraints w.r.t. smoothness
-    ///           (0 -> smoothness only, 1->constraints only)
-    /// @param[out] R       #F by 3 the representative vectors of the interpolated field
-    /// @param[out] S       #V by 1 the singularity index for each vertex (0 = regular)
-    IGL_INLINE void nrosy(
-      const Eigen::MatrixXd& V,
-      const Eigen::MatrixXi& F,
-      const Eigen::VectorXi& b,
-      const Eigen::MatrixXd& bc,
-      const Eigen::VectorXi& b_soft,
-      const Eigen::VectorXd& w_soft,
-      const Eigen::MatrixXd& bc_soft,
-      int N,
-      double soft,
-      Eigen::MatrixXd& R,
-      Eigen::VectorXd& S
-      );
-    /// \overload
-    IGL_INLINE void nrosy(
-     const Eigen::MatrixXd& V,
-     const Eigen::MatrixXi& F,
-     const Eigen::VectorXi& b,
-     const Eigen::MatrixXd& bc,
-     int N,
-     Eigen::MatrixXd& R,
-     Eigen::VectorXd& S
-      );
-
-  }
-}
-}
-
-#ifndef IGL_STATIC_LIBRARY
-#  include "nrosy.cpp"
-#endif
-
-#endif

+ 0 - 118
include/igl/copyleft/marching_cubes.h

@@ -1,118 +0,0 @@
-// This file is part of libigl, a simple c++ geometry processing library.
-//
-// Copyright (C) 2014 Alec Jacobson <[email protected]>
-//
-// This Source Code Form is subject to the terms of the Mozilla Public License
-// v. 2.0. If a copy of the MPL was not distributed with this file, You can
-// obtain one at http://mozilla.org/MPL/2.0/.
-#ifndef IGL_COPYLEFT_MARCHINGCUBES_H
-#define IGL_COPYLEFT_MARCHINGCUBES_H
-#include "../igl_inline.h"
-
-#include <Eigen/Core>
-namespace igl
-{
-  namespace copyleft
-  {
-    /// Performs marching cubes reconstruction on a grid defined by values, and
-    /// points, and generates a mesh defined by vertices and faces
-    ///
-    /// @param[in] values  #number_of_grid_points x 1 array -- the scalar values of an
-    ///    implicit function defined on the grid points (<0 in the inside of the
-    ///    surface, 0 on the border, >0 outside)
-    /// @param[in] points  #number_of_grid_points x 3 array -- 3-D positions of the grid
-    ///    points, ordered in x,y,z order:
-    ///      points[index] = the point at (x,y,z) where :
-    ///      x = (index % (xres -1),
-    ///      y = (index / (xres-1)) %(yres-1),
-    ///      z = index / (xres -1) / (yres -1) ).
-    ///      where x,y,z index x, y, z dimensions
-    ///      i.e. index = x + y*xres + z*xres*yres
-    /// @param[in] xres  resolutions of the grid in x dimension
-    /// @param[in] yres  resolutions of the grid in y dimension
-    /// @param[in] zres  resolutions of the grid in z dimension
-    /// @param[in] isovalue  the isovalue of the surface to reconstruct
-    /// @param[out] vertices  #V by 3 list of mesh vertex positions
-    /// @param[out] faces  #F by 3 list of mesh triangle indices
-    ///
-    /// \see igl::marching_cubes
-    template <typename DerivedValues, typename DerivedPoints, typename DerivedVertices, typename DerivedFaces>
-    IGL_INLINE void marching_cubes(
-        const Eigen::MatrixBase<DerivedValues> &values,
-        const Eigen::MatrixBase<DerivedPoints> &points,
-        const unsigned x_res,
-        const unsigned y_res,
-        const unsigned z_res,
-        const double isovalue,
-        Eigen::PlainObjectBase<DerivedVertices> &vertices,
-        Eigen::PlainObjectBase<DerivedFaces> &faces);
-    /// \overload
-    /// Overload of the above function where the isovalue defaults to 0.0
-    template <typename DerivedValues, typename DerivedPoints, typename DerivedVertices, typename DerivedFaces>
-    IGL_INLINE void marching_cubes(
-      const Eigen::MatrixBase<DerivedValues> &values,
-      const Eigen::MatrixBase<DerivedPoints> &points,
-      const unsigned x_res,
-      const unsigned y_res,
-      const unsigned z_res,
-      Eigen::PlainObjectBase<DerivedVertices> &vertices,
-      Eigen::PlainObjectBase<DerivedFaces> &faces);
-    /// \overload
-    /// @param[in] value_fun a function that takes a 3D point and returns a scalar value
-    template <
-      typename DerivedValue, 
-      typename DerivedPoint,
-      typename DerivedPoints, 
-      typename DerivedVertices, 
-      typename DerivedFaces>
-    IGL_INLINE void marching_cubes(
-        const std::function< DerivedValue(const DerivedPoint & ) > & value_fun,
-        const Eigen::MatrixBase<DerivedPoints> &points,
-        const unsigned x_res,
-        const unsigned y_res,
-        const unsigned z_res,
-        const double isovalue, 
-        Eigen::PlainObjectBase<DerivedVertices> &vertices,
-        Eigen::PlainObjectBase<DerivedFaces> &faces);
-    /// Perform marching cubes reconstruction on the sparse grid cells defined by (indices, points).
-    /// The indices parameter is an nx8 dense array of index values into the points and values arrays.
-    /// Each row of indices represents a cube for which to generate vertices and faces over.
-    ///
-    /// @param[in] values  #number_of_grid_points x 1 array -- the scalar values of an
-    ///    implicit function defined on the grid points (<0 in the inside of the
-    ///    surface, 0 on the border, >0 outside)
-    /// @param[in] points  #number_of_grid_points x 3 array -- 3-D positions of the grid
-    ///    points, ordered in x,y,z order:
-    /// @param[in] indices  #cubes x 8 array -- one row for each cube where each value is
-    ///    the index of a vertex in points and a scalar in values.
-    ///    i.e. points[indices[i, j]] = the position of the j'th vertex of the i'th cube
-    /// @param[out] vertices  #V by 3 list of mesh vertex positions
-    /// @param[out] faces  #F by 3 list of mesh triangle indices
-    ///
-    /// \note The winding direction of the cube indices will affect the output winding of the faces
-    ///
-    template <typename DerivedValues, typename DerivedPoints, typename DerivedVertices, typename DerivedIndices, typename DerivedFaces>
-    IGL_INLINE void marching_cubes(
-      const Eigen::MatrixBase<DerivedValues> &values,
-      const Eigen::MatrixBase<DerivedPoints> &points,
-      const Eigen::MatrixBase<DerivedIndices> &indices,
-      const double isovalue,
-      Eigen::PlainObjectBase<DerivedVertices> &vertices,
-      Eigen::PlainObjectBase<DerivedFaces> &faces);
-    /// \overload
-    /// \brief  isovalue defaults to 0.0
-    template <typename DerivedValues, typename DerivedPoints, typename DerivedVertices, typename DerivedIndices, typename DerivedFaces>
-    IGL_INLINE void marching_cubes(
-      const Eigen::MatrixBase<DerivedValues> &values,
-      const Eigen::MatrixBase<DerivedPoints> &points,
-      const Eigen::MatrixBase<DerivedIndices> &indices,
-      Eigen::PlainObjectBase<DerivedVertices> &vertices,
-      Eigen::PlainObjectBase<DerivedFaces> &faces);
-  }
-}
-
-#ifndef IGL_STATIC_LIBRARY
-#  include "marching_cubes.cpp"
-#endif
-
-#endif

+ 0 - 917
include/igl/copyleft/marching_cubes_tables.h

@@ -1,917 +0,0 @@
-/*===========================================================================*\
- *                                                                           *
- *                                IsoEx                                      *
- *        Copyright (C) 2002 by Computer Graphics Group, RWTH Aachen         *
- *                         www.rwth-graphics.de                              *
- *                                                                           *
- *---------------------------------------------------------------------------* 
- *                                                                           *
- *                                License                                    *
- *                                                                           *
- *  This library is free software; you can redistribute it and/or modify it  *
- *  under the terms of the GNU Library General Public License as published   *
- *  by the Free Software Foundation, version 2.                              *
- *                                                                           *
- *  This library is distributed in the hope that it will be useful, but      *
- *  WITHOUT ANY WARRANTY; without even the implied warranty of               *
- *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU        *
- *  Library General Public License for more details.                         *
- *                                                                           *
- *  You should have received a copy of the GNU Library General Public        *
- *  License along with this library; if not, write to the Free Software      *
- *  Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.                *
- *                                                                           *
- \*===========================================================================*/
-
-//=============================================================================
-#ifndef IGL_ISOEX_MC_TABLES_HH
-#define IGL_ISOEX_MC_TABLES_HH
-//=============================================================================
-
-
-//int edgeTable[256];
-//int triTable[256][2][17];
-//int polyTable[8][16];
-
-const int edgeTable[256]=
-{
-  0x0  , 0x109, 0x203, 0x30a, 0x406, 0x50f, 0x605, 0x70c,
-  0x80c, 0x905, 0xa0f, 0xb06, 0xc0a, 0xd03, 0xe09, 0xf00,
-  0x190, 0x99 , 0x393, 0x29a, 0x596, 0x49f, 0x795, 0x69c,
-  0x99c, 0x895, 0xb9f, 0xa96, 0xd9a, 0xc93, 0xf99, 0xe90,
-  0x230, 0x339, 0x33 , 0x13a, 0x636, 0x73f, 0x435, 0x53c,
-  0xa3c, 0xb35, 0x83f, 0x936, 0xe3a, 0xf33, 0xc39, 0xd30,
-  0x3a0, 0x2a9, 0x1a3, 0xaa , 0x7a6, 0x6af, 0x5a5, 0x4ac,
-  0xbac, 0xaa5, 0x9af, 0x8a6, 0xfaa, 0xea3, 0xda9, 0xca0,
-  0x460, 0x569, 0x663, 0x76a, 0x66 , 0x16f, 0x265, 0x36c,
-  0xc6c, 0xd65, 0xe6f, 0xf66, 0x86a, 0x963, 0xa69, 0xb60,
-  0x5f0, 0x4f9, 0x7f3, 0x6fa, 0x1f6, 0xff , 0x3f5, 0x2fc,
-  0xdfc, 0xcf5, 0xfff, 0xef6, 0x9fa, 0x8f3, 0xbf9, 0xaf0,
-  0x650, 0x759, 0x453, 0x55a, 0x256, 0x35f, 0x55 , 0x15c,
-  0xe5c, 0xf55, 0xc5f, 0xd56, 0xa5a, 0xb53, 0x859, 0x950,
-  0x7c0, 0x6c9, 0x5c3, 0x4ca, 0x3c6, 0x2cf, 0x1c5, 0xcc ,
-  0xfcc, 0xec5, 0xdcf, 0xcc6, 0xbca, 0xac3, 0x9c9, 0x8c0,
-  0x8c0, 0x9c9, 0xac3, 0xbca, 0xcc6, 0xdcf, 0xec5, 0xfcc,
-  0xcc , 0x1c5, 0x2cf, 0x3c6, 0x4ca, 0x5c3, 0x6c9, 0x7c0,
-  0x950, 0x859, 0xb53, 0xa5a, 0xd56, 0xc5f, 0xf55, 0xe5c,
-  0x15c, 0x55 , 0x35f, 0x256, 0x55a, 0x453, 0x759, 0x650,
-  0xaf0, 0xbf9, 0x8f3, 0x9fa, 0xef6, 0xfff, 0xcf5, 0xdfc,
-  0x2fc, 0x3f5, 0xff , 0x1f6, 0x6fa, 0x7f3, 0x4f9, 0x5f0,
-  0xb60, 0xa69, 0x963, 0x86a, 0xf66, 0xe6f, 0xd65, 0xc6c,
-  0x36c, 0x265, 0x16f, 0x66 , 0x76a, 0x663, 0x569, 0x460,
-  0xca0, 0xda9, 0xea3, 0xfaa, 0x8a6, 0x9af, 0xaa5, 0xbac,
-  0x4ac, 0x5a5, 0x6af, 0x7a6, 0xaa , 0x1a3, 0x2a9, 0x3a0,
-  0xd30, 0xc39, 0xf33, 0xe3a, 0x936, 0x83f, 0xb35, 0xa3c,
-  0x53c, 0x435, 0x73f, 0x636, 0x13a, 0x33 , 0x339, 0x230,
-  0xe90, 0xf99, 0xc93, 0xd9a, 0xa96, 0xb9f, 0x895, 0x99c,
-  0x69c, 0x795, 0x49f, 0x596, 0x29a, 0x393, 0x99 , 0x190,
-  0xf00, 0xe09, 0xd03, 0xc0a, 0xb06, 0xa0f, 0x905, 0x80c,
-  0x70c, 0x605, 0x50f, 0x406, 0x30a, 0x203, 0x109, 0x0   
-};
-
-
-//-----------------------------------------------------------------------------
-
-
-const int triTable[256][2][17] =
-{{{-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1},
-  { 0, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1}},
-  
-  {{0, 8, 3, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1},
-    {1, 3, 0, 8, 3, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1}},
-  
-  {{0, 1, 9, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1},
-    {1, 3, 0,  1, 9, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1}},
-  
-  {{1, 8, 3, 9, 8, 1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1},
-    {1, 4, 1, 9, 8, 3, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1}},
-  
-  {{1, 2, 10, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1},
-    {1, 3, 1, 2, 10, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1}},
-  
-  {{0, 8, 3, 1, 2, 10, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1},
-    {2, 3, 3, 0, 8,  3,  1,  2, 10, -1, -1, -1, -1, -1, -1, -1, -1}},
-  
-  {{9, 2, 10, 0, 2, 9, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1},
-    {1, 4, 2, 10, 9, 0, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1}},
-  
-  {{2, 8, 3, 2, 10, 8, 10, 9, 8, -1, -1, -1, -1, -1, -1, -1, -1},
-    {1, 5, 10,  9, 8,  3, 2 , -1,-1, -1, -1, -1, -1, -1, -1, -1, -1}},
-  
-  {{3, 11, 2, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1},
-    {1,  3, 3, 11,  2, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1}},
-  
-  {{0, 11, 2, 8, 11, 0, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1},
-    {1,  4, 0, 8, 11, 2, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1}},
-  
-  /* 10 */
-  {{1, 9, 0, 2, 3, 11, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1},
-    {2, 3, 3, 1, 9, 0, 2, 3,11, -1, -1, -1, -1, -1, -1, -1, -1}},
-  
-  {{1, 11, 2, 1, 9, 11, 9, 8, 11, -1, -1, -1, -1, -1, -1, -1, -1},
-    {1,  5, 9, 8, 11, 2, 1,-1, -1, -1, -1, -1, -1, -1, -1, -1, -1}},
-  
-  {{3, 10, 1, 11, 10, 3, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1},
-    {1,  4, 3, 11,10, 1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1}},
-  
-  {{0, 10, 1, 0, 8, 10, 8, 11, 10, -1, -1, -1, -1, -1, -1, -1, -1},
-    {1,  5, 8, 11, 10, 1, 0, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1}},
-  
-  {{3, 9, 0, 3, 11, 9, 11, 10, 9, -1, -1, -1, -1, -1, -1, -1, -1},
-    {1, 5, 11,10,  9, 0, 3, -1,-1, -1, -1, -1, -1, -1, -1, -1, -1}},
-  
-  /* 15 */
-  {{9, 8, 10, 10, 8, 11, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1},
-    {1, 4,  8, 11, 10, 9, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1}},
-  
-  {{4, 7, 8, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1},
-    {1, 3, 4,  7,  8, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1}},
-  
-  {{4, 3, 0, 7, 3, 4, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1},
-    {1, 4, 4, 7, 3, 0, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1}},
-  
-  {{0, 1, 9, 8, 4, 7, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1},
-    {2, 3, 3, 0, 1, 9,  8,  4,  7, -1, -1, -1, -1, -1, -1, -1, -1}},
-  
-  {{4, 1, 9, 4, 7, 1, 7, 3, 1, -1, -1, -1, -1, -1, -1, -1, -1},
-    {1, 5, 7, 3, 1, 9, 4,  -1,-1, -1, -1, -1, -1, -1, -1, -1, -1}},
-  
-  /* 20 */
-  {{1, 2, 10, 8, 4, 7, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1},
-    {2, 3,  3, 1, 2,10,  8,  4,  7, -1, -1, -1, -1, -1, -1, -1, -1}},
-  
-  {{3, 4, 7, 3, 0, 4, 1, 2, 10, -1, -1, -1, -1, -1, -1, -1, -1},
-    {2, 4, 3, 3, 0, 4, 7, 1,  2, 10, -1, -1, -1, -1, -1, -1, -1}},
-  
-  {{9, 2, 10, 9, 0, 2, 8, 4, 7, -1, -1, -1, -1, -1, -1, -1, -1},
-    {2, 4,  3, 2,10, 9, 0, 8, 4,  7, -1, -1, -1, -1, -1, -1, -1}},
-  
-  {{2, 10, 9, 2, 9, 7, 2, 7, 3, 7, 9, 4, -1, -1, -1, -1, -1},
-    {1,  6, 7, 3, 2,10, 9, 4, -1, -1, -1, -1, -1, -1, -1, -1, -1}},
-  
-  {{8, 4, 7, 3, 11, 2, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1},
-    {2, 3, 3, 8,  4, 7,  3, 11,  2, -1, -1, -1, -1, -1, -1, -1, -1}},
-  
-  /* 25 */
-  {{11, 4, 7, 11, 2, 4, 2, 0, 4, -1, -1, -1, -1, -1, -1, -1, -1},
-    { 1, 5, 2, 0,  4, 7,11,-1,-1, -1, -1, -1, -1, -1, -1, -1, -1}},
-  
-  {{9, 0, 1, 8, 4, 7, 2, 3, 11, -1, -1, -1, -1, -1, -1, -1, -1},
-    {3, 3, 3, 3, 9, 0, 1, 8,  4,  7,  2,  3, 11, -1, -1, -1, -1}},
-  
-  {{4, 7, 11, 9, 4, 11, 9, 11, 2, 9, 2, 1, -1, -1, -1, -1, -1},
-    {2, 4, 4, 2, 1, 9, 11, 11,9,4,7, -1, -1, -1, -1, -1 ,-1}},
-  
-  {{3, 10, 1, 3, 11, 10, 7, 8, 4, -1, -1, -1, -1, -1, -1, -1, -1},
-    {2,  4, 3, 3, 11,10, 1,  7, 8,  4, -1, -1, -1, -1, -1, -1, -1}},
-  
-  {{1, 11, 10, 1, 4, 11, 1, 0, 4, 7, 11, 4, -1, -1, -1, -1, -1},
-    {1,  6,  1, 0, 4,  7,11,10, -1, -1, -1, -1, -1, -1, -1, -1, -1}},
-  
-  /* 30 */
-  {{4, 7, 8, 9, 0, 11, 9, 11, 10, 11, 0, 3, -1, -1, -1, -1, -1},
-    {2, 3, 5, 4, 7,  8, 0,  3, 11, 10, 9, -1, -1, -1, -1, -1, -1}},
-  
-  {{4, 7, 11, 4, 11, 9, 9, 11, 10, -1, -1, -1, -1, -1, -1, -1, -1},
-    {1, 5,  4,  7,11,10, 9, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1}},
-  
-  {{9, 5, 4, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1},
-    {1, 3, 9,  5, 4, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1}},
-  
-  {{9, 5, 4, 0, 8, 3, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1},
-    {2, 3, 3, 9, 5, 4,  0,  8,  3, -1, -1, -1, -1, -1, -1, -1, -1}},
-  
-  {{0, 5, 4, 1, 5, 0, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1},
-    {1, 4, 0, 1, 5, 4, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1}},
-  
-  /* 35 */
-  {{8, 5, 4, 8, 3, 5, 3, 1, 5, -1, -1, -1, -1, -1, -1, -1, -1},
-    {1, 5, 3, 1, 5, 4, 8,-1,-1, -1, -1, -1, -1, -1, -1, -1, -1}},
-  
-  {{1, 2, 10, 9, 5, 4, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1},
-    {2, 3,  3, 1, 2,10,  9,  5,  4, -1, -1, -1, -1, -1, -1, -1, -1}},
-  
-  {{3, 0, 8, 1, 2, 10, 4, 9, 5, -1, -1, -1, -1, -1, -1, -1, -1},
-    {3, 3, 3, 3, 3,  0, 8, 1, 2, 10,  4,  9,  5, -1, -1, -1, -1}},
-  
-  {{5, 2, 10, 5, 4, 2, 4, 0, 2, -1, -1, -1, -1, -1, -1, -1, -1},
-    {1, 5,  4, 0, 2,10, 5,-1,-1, -1, -1, -1, -1, -1, -1, -1, -1}},
-  
-  {{2, 10, 5, 3, 2, 5, 3, 5, 4, 3, 4, 8, -1, -1, -1, -1, -1},
-    {2,  4, 4, 2, 10, 5, 3, 4, 8, 3, 5, -1, -1, -1, -1, -1, -1}},
-  
-  /* 40 */
-  {{9, 5, 4, 2, 3, 11, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1},
-    {2, 3, 3, 9, 5,  4,  2,  3, 11, -1, -1, -1, -1, -1, -1, -1, -1}},
-  
-  {{0, 11, 2, 0, 8, 11, 4, 9, 5, -1, -1, -1, -1, -1, -1, -1, -1},
-    {2,  4, 3, 0, 8, 11, 2, 4, 9,  5, -1, -1, -1, -1, -1, -1, -1}},
-  
-  {{0, 5, 4, 0, 1, 5, 2, 3, 11, -1, -1, -1, -1, -1, -1, -1, -1},
-    {2, 4, 3, 0, 1, 5, 4, 2,  3, 11, -1, -1, -1, -1, -1, -1, -1}},
-  
-  {{2, 1, 5, 2, 5, 8, 2, 8, 11, 4, 8, 5, -1, -1, -1, -1, -1},
-    {1, 6, 2, 1, 5, 4, 8,11, -1, -1, -1, -1, -1, -1, -1, -1, -1}},
-  
-  {{10, 3, 11, 10, 1, 3, 9, 5, 4, -1, -1, -1, -1, -1, -1, -1, -1},
-    { 2, 4,  3,  3,11,10, 1, 9, 5,  4, -1, -1, -1, -1, -1, -1, -1}},
-  
-  /* 45 */
-  {{4, 9, 5, 0, 8, 1, 8, 10, 1, 8, 11, 10, -1, -1, -1, -1, -1},
-    {2, 3, 5, 4, 9, 5, 1,  0, 8,11, 10, -1, -1, -1, -1, -1, -1}},
-  
-  {{5, 4, 0, 5, 0, 11, 5, 11, 10, 11, 0, 3, -1, -1, -1, -1, -1},
-    {1, 6, 5, 4, 0,  3,11, 10, -1, -1, -1, -1, -1, -1, -1, -1, -1}},
-  
-  {{5, 4, 8, 5, 8, 10, 10, 8, 11, -1, -1, -1, -1, -1, -1, -1, -1},
-    {1, 5, 5, 4, 8, 11, 10,-1, -1, -1, -1, -1, -1, -1, -1, -1, -1}},
-  
-  {{9, 7, 8, 5, 7, 9, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1},
-    {1, 4, 7, 8, 9, 5, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1}},
-  
-  {{9, 3, 0, 9, 5, 3, 5, 7, 3, -1, -1, -1, -1, -1, -1, -1, -1},
-    {1, 5, 5, 7, 3, 0, 9,-1,-1, -1, -1, -1, -1, -1, -1, -1, -1}},
-  
-  /* 50 */
-  {{0, 7, 8, 0, 1, 7, 1, 5, 7, -1, -1, -1, -1, -1, -1, -1, -1},
-    {1, 5, 1, 5, 7, 8, 0,-1,-1, -1, -1, -1, -1, -1, -1, -1, -1}},
-  
-  {{1, 5, 3, 3, 5, 7, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1},
-    {1, 4, 3, 1, 5, 7, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1}},
-  
-  {{9, 7, 8, 9, 5, 7, 10, 1, 2, -1, -1, -1, -1, -1, -1, -1, -1},
-    {2, 4, 3, 7, 8, 9,  5,10, 1,  2, -1, -1, -1, -1, -1, -1, -1}},
-  
-  {{10, 1, 2, 9, 5, 0, 5, 3, 0, 5, 7, 3, -1, -1, -1, -1, -1},
-    { 2, 3, 5,10, 1, 2, 0, 9, 5, 7, 3,-1, -1, -1, -1, -1, -1}},
-  
-  {{8, 0, 2, 8, 2, 5, 8, 5, 7, 10, 5, 2, -1, -1, -1, -1, -1},
-    {1, 6, 2,10, 5, 7, 8, 0,-1, -1, -1, -1, -1, -1, -1, -1, -1}},
-  
-  /* 55 */
-  {{2, 10, 5, 2, 5, 3, 3, 5, 7, -1, -1, -1, -1, -1, -1, -1, -1},
-    {1,  5, 2,10, 5, 7, 3,-1,-1, -1, -1, -1, -1, -1, -1, -1, -1}},
-  
-  {{7, 9, 5, 7, 8, 9, 3, 11, 2, -1, -1, -1, -1, -1, -1, -1, -1},
-    {2, 4, 3, 7, 8, 9, 5,  3,11,  2, -1, -1, -1, -1, -1, -1, -1}},
-  
-  {{9, 5, 7, 9, 7, 2, 9, 2, 0, 2, 7, 11, -1, -1, -1, -1, -1},
-    {1, 6, 2, 0, 9, 5, 7,11, -1, -1, -1, -1, -1, -1, -1, -1, -1}},
-  
-  {{2, 3, 11, 0, 1, 8, 1, 7, 8, 1, 5, 7, -1, -1, -1, -1, -1},
-    {2, 3,  5, 2, 3,11, 8, 0, 1, 5, 7, -1, -1, -1, -1, -1, -1}},
-  
-  {{11, 2, 1, 11, 1, 7, 7, 1, 5, -1, -1, -1, -1, -1, -1, -1, -1},
-    {1,  5,11, 2, 1, 5, 7, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1}},
-  
-  /* 60 */
-  {{9, 5, 8, 8, 5, 7, 10, 1, 3, 10, 3, 11, -1, -1, -1, -1, -1},
-    {2, 4, 4, 3,11, 10, 1, 5, 7,  8, 9, -1, -1, -1, -1, -1, -1}},
-  
-  {{5, 7, 0, 5, 0, 9, 7, 11, 0, 1, 0, 10, 11, 10, 0, -1, -1},
-    {1, 7, 5, 7, 11,10, 1, 0, 9, -1, -1, -1, -1, -1, -1, -1, -1}},
-  
-  {{11, 10, 0, 11, 0, 3, 10, 5, 0, 8, 0, 7, 5, 7, 0, -1, -1},
-    {1, 7, 11,10,5, 7, 8, 0,3, -1, -1, -1, -1, -1, -1, -1, -1}},
-  
-  {{11, 10, 5, 7, 11, 5, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1},
-    { 1,  4, 5, 7, 11,10, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1}},
-  
-  {{10, 6, 5, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1},
-    { 1, 3,10,  6,  5, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1}},
-  
-  /* 65 */
-  {{0, 8, 3, 5, 10, 6, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1},
-    {2, 3, 3, 0,  8, 3,  5, 10, 6, -1, -1, -1, -1, -1, -1, -1, -1}},
-  
-  {{9, 0, 1, 5, 10, 6, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1},
-    {2, 3, 3, 9,  0, 1,  5, 10,  6, -1, -1, -1, -1, -1, -1, -1, -1}},
-  
-  {{1, 8, 3, 1, 9, 8, 5, 10, 6, -1, -1, -1, -1, -1, -1, -1, -1},
-    {2, 4, 3, 1, 9, 8, 3,  5,10,  6, -1, -1, -1, -1, -1, -1, -1}},
-  
-  {{1, 6, 5, 2, 6, 1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1},
-    {1, 4, 1, 2, 6, 5, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1}},
-  
-  {{1, 6, 5, 1, 2, 6, 3, 0, 8, -1, -1, -1, -1, -1, -1, -1, -1},
-    {2, 4, 3, 1, 2, 6, 5, 3, 0,  8, -1, -1, -1, -1, -1, -1, -1}},
-  
-  /* 70 */
-  {{9, 6, 5, 9, 0, 6, 0, 2, 6, -1, -1, -1, -1, -1, -1, -1, -1},
-    {1, 5, 0, 2, 6, 5, 9, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1}},
-  
-  {{5, 9, 8, 5, 8, 2, 5, 2, 6, 3, 2, 8, -1, -1, -1, -1, -1},
-    {1, 6, 2, 6, 5, 9, 8, 3, -1, -1, -1, -1, -1, -1, -1, -1, -1}},
-  
-  {{2, 3, 11, 10, 6, 5, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1},
-    {2, 3,  3,  2, 3,11, 10,  6,  5, -1, -1, -1, -1, -1, -1, -1, -1}},
-  
-  {{11, 0, 8, 11, 2, 0, 10, 6, 5, -1, -1, -1, -1, -1, -1, -1, -1},
-    { 2, 4, 3,  0, 8, 11, 2, 10, 6,  5, -1, -1, -1, -1, -1, -1, -1}},
-  
-  {{0, 1, 9, 2, 3, 11, 5, 10, 6, -1, -1, -1, -1, -1, -1, -1, -1},
-    {3, 3, 3, 3, 0,  1, 9,  2, 3, 11,  5, 10,  6, -1, -1, -1, -1}},
-  
-  /* 75 */
-  {{5, 10, 6, 1, 9, 2, 9, 11, 2, 9, 8, 11, -1, -1, -1, -1, -1},
-    {2, 3,  5, 5,10, 6, 2,  1, 9, 8,11, -1, -1, -1, -1, -1, -1}},
-  
-  {{6, 3, 11, 6, 5, 3, 5, 1, 3, -1, -1, -1, -1, -1, -1, -1, -1},
-    {1, 5,  5, 1, 3, 11,6, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1}},
-  
-  {{0, 8, 11, 0, 11, 5, 0, 5, 1, 5, 11, 6, -1, -1, -1, -1, -1},
-    {1, 6,  5, 1,  0, 8,11, 6, -1, -1, -1, -1, -1, -1, -1, -1, -1}},
-  
-  {{3, 11, 6, 0, 3, 6, 0, 6, 5, 0, 5, 9, -1, -1, -1, -1, -1},
-    {2,  4, 4, 3, 11, 6, 0, 5, 9, 0, 6, -1, -1, -1, -1}},
-  
-  {{6, 5, 9, 6, 9, 11, 11, 9, 8, -1, -1, -1, -1, -1, -1, -1, -1},
-    {1, 5, 6, 5, 9,  8, 11, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1}},
-  
-  /* 80 */
-  {{5, 10, 6, 4, 7, 8, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1},
-    {2,  3, 3, 5,10, 6,  4,  7,  8, -1, -1, -1, -1, -1, -1, -1, -1}},
-  
-  {{4, 3, 0, 4, 7, 3, 6, 5, 10, -1, -1, -1, -1, -1, -1, -1, -1},
-    {2, 4, 3, 4, 7, 3, 0, 6,  5, 10, -1, -1, -1, -1, -1, -1, -1}},
-  
-  {{1, 9, 0, 5, 10, 6, 8, 4, 7, -1, -1, -1, -1, -1, -1, -1, -1},
-    {3, 3, 3, 3,  1, 9, 0, 5,10,  6,  8,  4,  7, -1, -1, -1, -1}},
-  
-  {{10, 6, 5, 1, 9, 7, 1, 7, 3, 7, 9, 4, -1, -1, -1, -1, -1},
-    { 2, 3, 5,10, 6, 5, 9, 4, 7, 3, 1,-1, -1, -1, -1, -1, -1}},
-  
-  {{6, 1, 2, 6, 5, 1, 4, 7, 8, -1, -1, -1, -1, -1, -1, -1, -1},
-    {2, 4, 3, 1, 2, 6, 5, 4, 7,  8, -1, -1, -1, -1, -1, -1, -1}},
-  
-  /* 85 */
-  {{1, 2, 5, 5, 2, 6, 3, 0, 4, 3, 4, 7, -1, -1, -1, -1, -1},
-    {2, 4, 4, 2, 6, 5, 1, 3, 0, 4, 7, -1, -1, -1, -1, -1, -1}},
-  
-  {{8, 4, 7, 9, 0, 5, 0, 6, 5, 0, 2, 6, -1, -1, -1, -1, -1},
-    {2, 3, 5, 8, 4, 7, 5, 9, 0, 2, 6, -1, -1, -1, -1, -1, -1}},
-  
-  {{7, 3, 9, 7, 9, 4, 3, 2, 9, 5, 9, 6, 2, 6, 9, -1, -1},
-    {1, 7, 7, 3, 2, 6, 5, 9, 4,-1, -1, -1, -1, -1, -1, -1, -1}},
-  
-  {{3, 11, 2, 7, 8, 4, 10, 6, 5, -1, -1, -1, -1, -1, -1, -1, -1},
-    {3,  3, 3, 3, 3,11,  2, 7, 8,  4, 10,  6,  5, -1, -1, -1, -1}},
-  
-  {{5, 10, 6, 4, 7, 2, 4, 2, 0, 2, 7, 11, -1, -1, -1, -1, -1},
-    {2,  3, 5, 5,10, 6, 7,11, 2, 0, 4, -1, -1, -1, -1, -1, -1}},
-  
-  /* 90 */
-  {{0, 1, 9, 4, 7, 8, 2, 3, 11, 5, 10, 6, -1, -1, -1, -1, -1},
-    {4, 3, 3, 3, 3, 0, 1, 9,  4, 7,  8, 2,  3, 11, 5, 10, 6}},
-  
-  {{9, 2, 1, 9, 11, 2, 9, 4, 11, 7, 11, 4, 5, 10, 6, -1, -1},
-    {3, 4, 4, 3, 2, 1,  9,11, 4, 7, 11, 9, 5, 10, 6,  -1, -1}},
-  
-  {{8, 4, 7, 3, 11, 5, 3, 5, 1, 5, 11, 6, -1, -1, -1, -1, -1},
-    {2, 3, 5, 8,  4, 7, 11, 6, 5, 1, 3, -1, -1, -1, -1, -1, -1}},
-  
-  {{5, 1, 11, 5, 11, 6, 1, 0, 11, 7, 11, 4, 0, 4, 11, -1, -1},
-    {1, 7,  5, 1, 0,  4, 7,11, 6,  -1, -1, -1, -1, -1, -1, -1, -1}},
-  
-  {{0, 5, 9, 0, 6, 5, 0, 3, 6, 11, 6, 3, 8, 4, 7, -1, -1},
-    {3, 4, 4, 3, 0, 6, 5, 9, 3, 11, 6, 0, 8, 4, 7, -1, -1}},
-  
-  /* 95 */
-  {{6, 5, 9, 6, 9, 11, 4, 7, 9, 7, 11, 9, -1, -1, -1, -1, -1},
-    {2, 4, 4, 9, 4, 7, 11, 6, 5, 9, 11,-1, -1, -1, -1, -1, -1}},
-  
-  {{10, 4, 9, 6, 4, 10, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1},
-    { 1, 4, 4, 9, 10, 6, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1}},
-  
-  {{4, 10, 6, 4, 9, 10, 0, 8, 3, -1, -1, -1, -1, -1, -1, -1, -1},
-    {2,  4, 3, 4,  9,10, 6, 0, 8,  3, -1, -1, -1, -1, -1, -1, -1}},
-  
-  {{10, 0,  1, 10, 6, 0, 6, 4, 0, -1, -1, -1, -1, -1, -1, -1, -1},
-    { 1, 5,  6, 4, 0, 1, 10, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1}},
-  
-  {{8, 3, 1, 8, 1, 6, 8, 6, 4, 6, 1, 10, -1, -1, -1, -1, -1},
-    {1, 6, 1,10, 6, 4, 8, 3, -1, -1, -1, -1, -1, -1, -1, -1, -1}},
-  
-  /* 100 */
-  {{1, 4, 9, 1, 2, 4, 2, 6, 4, -1, -1, -1, -1, -1, -1, -1, -1},
-    {1, 5, 2, 6, 4, 9, 1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1}},
-  
-  {{3, 0, 8, 1, 2, 9, 2, 4, 9, 2, 6, 4, -1, -1, -1, -1, -1},
-    {2, 3, 5, 3, 0, 8, 9, 1, 2, 6, 4, -1, -1, -1, -1, -1, -1}},
-  
-  {{0, 2, 4, 4, 2, 6, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1},
-    {1, 4, 2, 6, 4, 0, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1}},
-  
-  {{8, 3, 2, 8, 2, 4, 4, 2, 6, -1, -1, -1, -1, -1, -1, -1, -1},
-    {1, 5, 8, 3, 2, 6, 4, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1}},
-  
-  {{10, 4, 9, 10, 6, 4, 11, 2, 3, -1, -1, -1, -1, -1, -1, -1, -1},
-    { 2, 4, 3, 10, 6, 4,  9,11, 2,  3, -1, -1, -1, -1, -1, -1, -1}},
-  
-  /* 105 */
-  {{0, 8, 2, 2, 8, 11, 4, 9, 10, 4, 10, 6, -1, -1, -1, -1, -1},
-    {2, 4, 4, 2, 11, 8, 0, 10,  6, 4,  9, -1, -1, -1, -1, -1, -1}},
-  
-  {{3, 11, 2, 0, 1, 6, 0, 6, 4, 6, 1, 10, -1, -1, -1, -1, -1},
-    {2,  3, 5, 3,11, 2, 1, 10,6, 4, 0, -1, -1, -1, -1, -1, -1}},
-  
-  {{6, 4, 1, 6, 1, 10, 4, 8, 1, 2, 1, 11, 8, 11, 1, -1, -1},
-    {1, 7, 6, 4, 8,11, 2,  1,10, -1, -1, -1, -1, -1, -1, -1, -1}},
-  
-  {{9, 6, 4, 9, 3, 6, 9, 1, 3, 11, 6, 3, -1, -1, -1, -1, -1},
-    {1, 6, 3,11, 6, 4, 9, 1, -1, -1, -1, -1, -1, -1, -1, -1, -1}},
-  
-  {{8, 11, 1, 8, 1, 0, 11, 6, 1, 9, 1, 4, 6, 4, 1, -1, -1},
-    {1,  7, 8,11, 6, 4,  9, 1, 0, -1, -1, -1, -1, -1, -1, -1, -1}},
-  
-  /* 110 */
-  {{3, 11, 6, 3, 6, 0, 0, 6, 4, -1, -1, -1, -1, -1, -1, -1, -1},
-    {1,  5, 3,11, 6, 4, 0, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1}},
-  
-  {{6, 4, 8, 11, 6, 8, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1},
-    {1, 4, 8, 11, 6, 4, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1}},
-  
-  {{7, 10, 6, 7, 8, 10, 8, 9, 10, -1, -1, -1, -1, -1, -1, -1, -1},
-    {1,  5, 8,  9,10, 6, 7,-1, -1, -1, -1, -1, -1, -1, -1, -1, -1}},
-  
-  {{0, 7, 3, 0, 10,  7, 0, 9, 10, 6, 7, 10, -1, -1, -1, -1, -1},
-    {1, 6, 0, 9, 10,  6, 7, 3, -1,-1,-1, -1, -1, -1, -1, -1, -1}},
-  
-  {{10, 6, 7, 1, 10, 7, 1, 7,  8, 1, 8, 0, -1, -1, -1, -1, -1},
-    { 2, 4, 4, 8, 0, 1,  7, 10, 6, 7, 1,-1, -1, -1, -1, -1, -1}},
-  
-  /* 115 */
-  {{10, 6, 7, 10, 7, 1, 1, 7, 3, -1, -1, -1, -1, -1, -1, -1, -1},
-    { 1, 5, 10, 6, 7, 3, 1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1}},
-  
-  {{1, 2, 6, 1, 6, 8, 1, 8, 9, 8, 6, 7, -1, -1, -1, -1, -1},
-    {1, 6, 1, 2, 6, 7, 8, 9, -1, -1, -1, -1, -1, -1, -1, -1, -1}},
-  
-  {{2, 6, 9, 2, 9, 1, 6, 7, 9, 0, 9, 3, 7, 3, 9, -1, -1},
-    {1, 7, 2, 6, 7, 3, 0, 9, 1, -1, -1, -1, -1, -1, -1, -1, -1}},
-  
-  {{7, 8, 0, 7, 0, 6, 6, 0, 2, -1, -1, -1, -1, -1, -1, -1, -1},
-    {1, 5, 7, 8, 0, 2, 6, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1}},
-  
-  {{7, 3, 2, 6, 7, 2, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1},
-    {1, 4, 7, 3, 2, 6,  -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1}},
-  
-  /* 120 */
-  {{2, 3, 11, 10, 6, 8, 10, 8, 9, 8, 6, 7, -1, -1, -1, -1, -1},
-    {2, 3,  5,  2, 3,11,  6, 7, 8, 9,10, -1, -1, -1, -1, -1, -1}},
-  
-  {{2, 0, 7, 2, 7, 11, 0, 9, 7, 6, 7, 10, 9, 10, 7, -1, -1},
-    {1, 7, 2, 0, 9,10,6, 7, 11, -1, -1, -1, -1, -1, -1, -1, -1}},
-  
-  {{1, 8, 0, 1, 7, 8, 1, 10, 7, 6, 7, 10, 2, 3, 11, -1, -1},
-    {3, 4, 4, 3, 8, 0, 1, 7, 10, 6, 7, 1, 11, 2, 3, -1, -1}},
-  
-  {{11, 2, 1, 11, 1, 7, 10, 6, 1, 6, 7, 1, -1, -1, -1, -1, -1},
-    { 2, 4, 4, 11, 2,  1,7, 1, 10, 6, 7,-1, -1, -1, -1, -1, -1}},
-  
-  {{8, 9, 6, 8, 6, 7, 9, 1, 6, 11, 6, 3, 1, 3, 6, -1, -1},
-    {1, 7, 8, 9, 1, 3, 11, 6, 7,-1, -1, -1, -1, -1, -1, -1, -1}},
-  
-  /* 125 */
-  {{0, 9, 1, 11, 6, 7, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1},
-    {2, 3, 3,  0, 9, 1, 11,  6,  7, -1, -1, -1, -1, -1, -1, -1, -1}},
-  
-  {{7, 8, 0, 7, 0, 6, 3, 11, 0, 11, 6, 0, -1, -1, -1, -1, -1},
-    {2, 4, 4, 0, 3,11, 6, 7,  8, 0, 6, -1, -1, -1, -1, -1, -1}},
-  
-  {{7, 11, 6, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1},
-    {1, 3,  7, 11,  6, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1}},
-  
-  {{7, 6, 11, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1},
-    {1, 3,  7,  6, 11, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1}},
-  
-  {{3, 0, 8, 11, 7, 6, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1},
-    {2, 3, 3,  3, 0, 8, 11,  7,  6, -1, -1, -1, -1, -1, -1, -1, -1}},
-  
-  /* 130 */
-  {{0, 1, 9, 11, 7, 6, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1},
-    {2, 3, 3,  0, 1, 9, 11,  7,  6, -1, -1, -1, -1, -1, -1, -1, -1}},
-  
-  {{8, 1, 9, 8, 3, 1, 11, 7, 6, -1, -1, -1, -1, -1, -1, -1, -1},
-    {2, 4, 3, 1, 9,  8, 3,11, 7,  6, -1, -1, -1, -1, -1, -1, -1}},
-  
-  {{10, 1, 2, 6, 11, 7, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1},
-    { 2, 3, 3,10,  1, 2,  6, 11,  7, -1, -1, -1, -1, -1, -1, -1, -1}},
-  
-  {{1, 2, 10, 3, 0, 8, 6, 11, 7, -1, -1, -1, -1, -1, -1, -1, -1},
-    {3, 3,  3, 3, 1, 2,10,  3, 0,  8,  6, 11,  7, -1, -1, -1, -1}},
-  
-  {{2, 9, 0, 2, 10, 9, 6, 11, 7, -1, -1, -1, -1, -1, -1, -1, -1},
-    {2, 4, 3, 2, 10, 9, 0, 6, 11,  7, -1, -1, -1, -1, -1, -1, -1}},
-  
-  /* 135 */
-  {{6, 11, 7, 2, 10, 3, 10, 8, 3, 10, 9, 8, -1, -1, -1, -1, -1},
-    {2,  3, 5, 6, 11, 7,  3, 2,10,  9, 8, -1, -1, -1, -1, -1, -1}},
-  
-  {{7, 2, 3, 6, 2, 7, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1},
-    {1, 4, 2, 3, 7, 6, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1}},
-  
-  {{7, 0, 8, 7, 6, 0, 6, 2, 0, -1, -1, -1, -1, -1, -1, -1, -1},
-    {1, 5, 6, 2, 0, 8, 7, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1}},
-  
-  {{2, 7, 6, 2, 3, 7, 0, 1, 9, -1, -1, -1, -1, -1, -1, -1, -1},
-    {2, 4, 3, 2, 3, 7, 6, 0, 1,  9, -1, -1, -1, -1, -1, -1, -1}},
-  
-  {{1, 6, 2, 1, 8, 6, 1, 9, 8, 8, 7, 6, -1, -1, -1, -1, -1},
-    {1, 6, 6, 2, 1, 9, 8, 7, -1, -1, -1, -1, -1, -1, -1, -1, -1}},
-  
-  /* 140 */
-  {{10, 7, 6, 10, 1, 7, 1, 3, 7, -1, -1, -1, -1, -1, -1, -1, -1},
-    { 1, 5, 1,  3, 7, 6,10, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1}},
-  
-  {{10, 7, 6, 1, 7, 10, 1, 8, 7, 1, 0, 8, -1, -1, -1, -1, -1},
-    { 2, 4, 4, 10, 1, 7, 6,  8, 7, 1, 0,-1, -1, -1, -1, -1, -1}},
-  
-  {{0, 3, 7, 0, 7, 10, 0, 10, 9, 6, 10, 7, -1, -1, -1, -1, -1},
-    {1, 6,10, 9, 0, 3,  7, 6,-1, -1, -1, -1, -1, -1, -1, -1, -1}},
-  
-  {{7, 6, 10, 7, 10, 8, 8, 10, 9, -1, -1, -1, -1, -1, -1, -1, -1},
-    {1, 5,  7, 6, 10, 9, 8, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1}},
-  
-  {{6, 8, 4, 11, 8, 6, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1},
-    {1, 4, 6, 11, 8, 4, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1}},
-  
-  /* 145 */
-  {{3, 6, 11, 3, 0, 6, 0, 4, 6, -1, -1, -1, -1, -1, -1, -1, -1},
-    {1, 5,  0, 4, 6,11, 3, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1}},
-  
-  {{8, 6, 11, 8, 4, 6, 9, 0, 1, -1, -1, -1, -1, -1, -1, -1, -1},
-    {2, 4,  3, 6,11, 8, 4, 9, 0,  1, -1, -1, -1, -1, -1, -1, -1}},
-  
-  {{9, 4, 6, 9, 6, 3, 9, 3, 1, 11, 3, 6, -1, -1, -1, -1, -1},
-    {1, 6, 6,11, 3, 1, 9, 4, -1, -1, -1, -1, -1, -1, -1, -1, -1}},
-  
-  {{6, 8, 4, 6, 11, 8, 2, 10,  1, -1, -1, -1, -1, -1, -1, -1, -1},
-    {2, 4, 3, 6, 11, 8, 4,  2, 10,  1, -1, -1, -1, -1, -1, -1, -1}},
-  
-  {{1, 2, 10, 3, 0, 11, 0, 6, 11, 0, 4, 6, -1, -1, -1, -1, -1},
-    {2, 3,  5, 1, 2, 10,11, 3,0,4, 6, -1, -1, -1, -1, -1, -1}},
-  
-  /* 150 */
-  {{4, 11, 8, 4, 6, 11, 0, 2, 9, 2, 10, 9, -1, -1, -1, -1, -1},
-    {2,  4, 4, 4, 6, 11, 8, 2,10, 9,  0, -1, -1, -1, -1, -1, -1}},
-  
-  {{10, 9, 3, 10, 3, 2, 9, 4, 3, 11, 3, 6, 4, 6, 3, -1, -1},
-    {1,  7, 10,9, 4, 6, 11, 3, 2, -1, -1, -1, -1, -1, -1, -1, -1}},
-  
-  {{8, 2, 3, 8, 4, 2, 4, 6, 2, -1, -1, -1, -1, -1, -1, -1, -1},
-    {1, 5, 4, 6, 2, 3, 8,-1, -1, -1, -1, -1, -1, -1, -1, -1, -1}},
-  
-  {{0, 4, 2, 4, 6, 2, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1},
-    {1, 4, 4, 6, 2, 0, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1}},
-  
-  {{1, 9, 0, 2, 3, 4, 2, 4, 6, 4, 3, 8, -1, -1, -1, -1, -1},
-    {2, 3, 5, 1, 9, 0, 3, 8, 4, 6, 2, -1, -1, -1, -1, -1, -1}},
-  
-  /* 155 */
-  {{1, 9, 4, 1, 4, 2, 2, 4, 6, -1, -1, -1, -1, -1, -1, -1, -1},
-    {1, 5, 1, 9, 4, 6, 2, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1}},
-  
-  {{8, 1, 3, 8, 6, 1, 8, 4, 6, 6, 10, 1, -1, -1, -1, -1, -1},
-    {1, 6, 1, 3, 8, 4, 6,10, -1, -1, -1, -1, -1, -1, -1, -1, -1}},
-  
-  {{10, 1, 0, 10, 0, 6, 6, 0, 4, -1, -1, -1, -1, -1, -1, -1, -1},
-    { 1, 5,10, 1,0,4,6, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1}},
-  
-  {{4, 6, 3, 4, 3, 8, 6, 10, 3, 0, 3, 9, 10, 9, 3, -1, -1},
-    {1, 7, 4, 6, 10, 9, 0,3, 8, -1, -1, -1, -1, -1, -1, -1, -1}},
-  
-  {{10, 9, 4, 6, 10, 4, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1},
-    { 1, 4, 4, 6, 10, 9, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1}},
-  
-  /* 160 */
-  {{4, 9, 5, 7, 6, 11, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1},
-    {2, 3, 3, 4, 9,  5,  7,  6, 11, -1, -1, -1, -1, -1, -1, -1, -1}},
-  
-  {{0, 8, 3, 4, 9, 5, 11, 7, 6, -1, -1, -1, -1, -1, -1, -1, -1},
-    {3, 3, 3, 3, 0, 8,  3, 4, 9,  5, 11,  7,  6, -1, -1, -1, -1}},
-  
-  {{5, 0, 1, 5, 4, 0, 7, 6, 11, -1, -1, -1, -1, -1, -1, -1, -1},
-    {2, 4, 3, 0, 1, 5, 4, 7,  6, 11, -1, -1, -1, -1, -1, -1, -1}},
-  
-  {{11, 7, 6, 8, 3, 4, 3, 5, 4, 3, 1, 5, -1, -1, -1, -1, -1},
-    { 2, 3, 5,11, 7, 6, 4, 8, 3, 1, 5,-1, -1, -1, -1, -1, -1}},
-  
-  {{9, 5, 4, 10, 1, 2, 7, 6, 11, -1, -1, -1, -1, -1, -1, -1, -1},
-    {3, 3, 3,  3, 9, 5, 4,10,  1,  2,  7,  6, 11, -1, -1, -1, -1}},
-  
-  /* 165 */
-  {{6, 11, 7, 1, 2, 10, 0, 8, 3, 4, 9, 5, -1, -1, -1, -1, -1},
-    {4,  3, 3, 3, 3,  6,11, 7, 1, 2,10, 0,  8,  3,  4,  9, 5}},
-  
-  {{7, 6, 11, 5, 4, 10, 4, 2, 10, 4, 0, 2, -1, -1, -1, -1, -1},
-    {2, 3, 5,  7, 6, 11, 10, 5, 4, 0, 2,-1, -1, -1, -1, -1, -1}},
-  
-  {{3, 4, 8, 3, 5, 4, 3, 2, 5, 10, 5, 2, 11, 7, 6, -1, -1},
-    {3, 4, 4, 3, 5, 3, 2,10, 4, 8, 3, 5, 6, 11, 7, 6, -1}},
-  
-  {{7, 2, 3, 7, 6, 2, 5, 4, 9, -1, -1, -1, -1, -1, -1, -1, -1},
-    {2, 4, 3, 2, 3, 7, 6, 5, 4,  9, -1, -1, -1, -1, -1, -1, -1}},
-  
-  {{9, 5, 4, 0, 8, 6, 0, 6, 2, 6, 8, 7, -1, -1, -1, -1, -1},
-    {2, 3, 5, 9, 5, 4, 8, 7, 6, 2, 0, -1, -1, -1, -1, -1, -1}},
-  
-  /* 170 */
-  {{3, 6, 2, 3, 7, 6, 1, 5, 0, 5, 4, 0, -1, -1, -1, -1, -1},
-    {2, 4, 4, 3, 7, 6, 2, 0, 1, 5, 4, -1, -1, -1, -1, -1, -1}},
-  
-  {{6, 2, 8, 6, 8, 7, 2, 1, 8, 4, 8, 5, 1, 5, 8, -1, -1},
-    {1, 7, 6, 2, 1, 5, 4, 8, 7,-1, -1, -1, -1, -1, -1, -1, -1}},
-  
-  {{9, 5, 4, 10, 1, 6, 1, 7, 6, 1, 3, 7, -1, -1, -1, -1, -1},
-    {2, 3, 5,  9, 5, 4, 6,10, 1, 3, 7,-1, -1, -1, -1, -1, -1}},
-  
-  {{1, 6, 10, 1, 7, 6, 1, 0, 7, 8, 7, 0, 9, 5, 4, -1, -1},
-    {3, 4, 4, 3, 0, 8, 7, 1, 6, 10, 1, 7, 9, 5, 4, -1, -1}},
-  
-  {{4, 0, 10, 4, 10, 5, 0, 3, 10, 6, 10, 7, 3, 7, 10, -1, -1},
-    {1, 7,  4, 0, 3, 7, 6, 10, 5, -1, -1, -1, -1, -1, -1, -1, -1}},
-  
-  /* 175 */
-  {{7, 6, 10, 7, 10, 8, 5, 4, 10, 4, 8, 10, -1, -1, -1, -1, -1},
-    {2, 4, 4, 4,  8, 10, 5, 7,  6,10, 8, -1, -1, -1, -1, -1, -1}},
-  
-  {{6, 9, 5, 6, 11, 9, 11, 8, 9, -1, -1, -1, -1, -1, -1, -1, -1},
-    {1, 5,11, 8, 9, 5, 6,-1, -1, -1, -1, -1, -1, -1, -1, -1, -1}},
-  
-  {{3, 6, 11, 0, 6, 3, 0, 5, 6, 0, 9, 5, -1, -1, -1, -1, -1},
-    {2, 4, 4,  0, 9, 5, 6, 6,11, 3, 0, -1, -1, -1, -1, -1, -1}},
-  
-  {{0, 11, 8, 0, 5, 11, 0, 1, 5, 5, 6, 11, -1, -1, -1, -1, -1},
-    {1,  6, 0, 1, 5,  6,11, 8, -1, -1, -1, -1, -1, -1, -1, -1, -1}},
-  
-  {{6, 11, 3, 6, 3, 5, 5, 3, 1, -1, -1, -1, -1, -1, -1, -1, -1},
-    {1,  5, 6,11, 3, 1, 5, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1}},
-  
-  /*180 */
-  {{1, 2, 10, 9, 5, 11, 9, 11, 8, 11, 5, 6, -1, -1, -1, -1, -1},
-    {2, 3,  5, 1, 2, 10, 5,  6,11,  8, 9, -1, -1, -1, -1, -1, -1}},
-  
-  {{0, 11, 3, 0, 6, 11, 0, 9, 6, 5, 6, 9, 1, 2, 10, -1, -1},
-    {3,  4, 4, 3, 11, 3,0, 6, 9, 5, 6, 0, 2, 10, 1, 2, 10}},
-  
-  {{11, 8, 5, 11, 5, 6, 8, 0, 5, 10, 5, 2, 0, 2, 5, -1, -1},
-    { 1, 7,11, 8, 0, 2,10, 5, 6,-1, -1, -1, -1, -1, -1, -1, -1}},
-  
-  {{6, 11, 3, 6, 3, 5, 2, 10, 3, 10, 5, 3, -1, -1, -1, -1, -1},
-    {2, 4,  4, 6,11, 3, 5, 10, 5,  3, 2, -1, -1, -1, -1, -1, -1}},
-  
-  {{5, 8, 9, 5, 2, 8, 5, 6, 2, 3, 8, 2, -1, -1, -1, -1, -1},
-    {1, 6, 2, 3, 8, 9, 5, 6, -1, -1, -1, -1, -1, -1, -1, -1, -1}},
-  
-  /* 185 */
-  {{9, 5, 6, 9, 6, 0, 0, 6, 2, -1, -1, -1, -1, -1, -1, -1, -1},
-    {1, 5, 9, 5, 6, 2, 0,-1, -1, -1, -1, -1, -1, -1, -1, -1, -1}},
-  
-  {{1, 5, 8, 1, 8, 0, 5, 6, 8, 3, 8, 2, 6, 2, 8, -1, -1},
-    {1, 7, 1, 5, 6, 2, 3, 8, 0, -1, -1, -1, -1, -1, -1, -1, -1}},
-  
-  {{1, 5, 6, 2, 1, 6, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1},
-    {1, 4, 1, 5, 6, 2, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1}},
-  
-  {{1, 3, 6, 1, 6, 10, 3, 8, 6, 5, 6, 9, 8, 9, 6, -1, -1},
-    {1, 7, 1, 3, 8,  9, 5, 6,10, -1, -1, -1, -1, -1, -1, -1, -1}},
-  
-  {{10, 1, 0, 10, 0, 6, 9, 5, 0, 5, 6, 0, -1, -1, -1, -1, -1},
-    { 2, 4, 4, 5,  6, 0, 9, 10, 1, 0, 6, -1, -1, -1, -1, -1, -1}},
-  
-  /* 190 */
-  {{0, 3, 8, 5, 6, 10, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1},
-    {2, 3, 3, 0, 3,  8,  5,  6, 10, -1, -1, -1, -1, -1, -1, -1, -1}},
-  
-  {{10, 5, 6, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1},
-    { 1, 3,10,  5,  6, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1}},
-  
-  {{11, 5, 10, 7, 5, 11, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1},
-    { 1, 4,  5,10, 11, 7,-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1}},
-  
-  {{11, 5, 10, 11, 7, 5, 8, 3, 0, -1, -1, -1, -1, -1, -1, -1, -1},
-    { 2, 4,  3,  5,10,11, 7, 8, 3,  0, -1, -1, -1, -1, -1, -1, -1}},
-  
-  {{5, 11, 7, 5, 10, 11, 1, 9, 0, -1, -1, -1, -1, -1, -1, -1, -1},
-    { 2, 4, 3, 5, 10, 11, 7, 1, 9,  0, -1, -1, -1, -1, -1, -1, -1}},
-  
-  /* 195 */
-  {{10, 7, 5, 10, 11, 7, 9, 8, 1, 8, 3, 1, -1, -1, -1, -1, -1},
-    { 2, 4, 4, 10, 11, 7, 5, 1, 9, 8, 3, -1, -1, -1, -1, -1, -1}},
-  
-  {{11, 1, 2, 11, 7, 1, 7, 5, 1, -1, -1, -1, -1, -1, -1, -1, -1},
-    { 1, 5, 7, 5, 1, 2,11, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1}},
-  
-  {{0, 8, 3, 1, 2, 7, 1, 7, 5, 7, 2, 11, -1, -1, -1, -1, -1},
-    {2, 3, 5, 0, 8, 3, 2,11, 7, 5,1, -1, -1, -1, -1, -1, -1}},
-  
-  {{9, 7, 5, 9, 2, 7, 9, 0, 2, 2, 11, 7, -1, -1, -1, -1, -1},
-    {1, 6, 2,11, 7, 5, 9, 0,-1, -1, -1, -1, -1, -1, -1, -1, -1}},
-  
-  {{7, 5, 2, 7, 2, 11, 5, 9, 2, 3, 2, 8, 9, 8, 2, -1, -1},
-    {1, 7, 7, 5, 9, 8, 3, 2,11,-1, -1, -1, -1, -1, -1, -1, -1}},
-  
-  /* 200 */
-  {{2, 5, 10, 2, 3, 5, 3, 7, 5, -1, -1, -1, -1, -1, -1, -1, -1},
-    {1, 5,  3, 7, 5,10, 2,-1, -1, -1, -1, -1, -1, -1, -1, -1, -1}},
-  
-  {{8, 2, 0, 8, 5, 2, 8, 7, 5, 10, 2, 5, -1, -1, -1, -1, -1},
-    {1, 6, 5,10, 2, 0, 8, 7, -1, -1, -1, -1, -1, -1, -1, -1, -1}},
-  
-  {{9, 0, 1, 5, 10, 3, 5, 3, 7, 3, 10, 2, -1, -1, -1, -1, -1},
-    {2, 3, 5, 9,  0, 1, 10, 2, 3, 7, 5, -1, -1, -1, -1, -1, -1}},
-  
-  {{9, 8, 2, 9, 2, 1, 8, 7, 2, 10, 2, 5, 7, 5, 2, -1, -1},
-    {1, 7, 9, 8, 7, 5,10, 2, 1,-1, -1, -1, -1, -1, -1, -1, -1}},
-  
-  {{1, 3, 5, 3, 7, 5, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1},
-    {1, 4, 3, 7, 5, 1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1}},
-  
-  /* 205 */
-  {{0, 8, 7, 0, 7, 1, 1, 7, 5, -1, -1, -1, -1, -1, -1, -1, -1},
-    {1, 5, 0, 8, 7, 5, 1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1}},
-  
-  {{9, 0, 3, 9, 3, 5, 5, 3, 7, -1, -1, -1, -1, -1, -1, -1, -1},
-    {1, 5, 9, 0, 3, 7, 5,-1, -1, -1, -1, -1, -1, -1, -1, -1, -1}},
-  
-  {{9, 8, 7, 5, 9, 7, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1},
-    {1, 4, 7, 5, 9, 8, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1}},
-  
-  {{5, 8, 4, 5, 10, 8, 10, 11, 8, -1, -1, -1, -1, -1, -1, -1, -1},
-    {1, 5, 10,11, 8, 4, 5, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1}},
-  
-  {{5, 0, 4, 5, 11, 0, 5, 10, 11, 11, 3, 0, -1, -1, -1, -1, -1},
-    {1, 6, 0, 4,  5,10,11,  3, -1, -1, -1, -1, -1, -1, -1, -1, -1}},
-  
-  /* 210 */
-  {{0, 1, 9, 8, 4, 10, 8, 10, 11, 10, 4, 5, -1, -1, -1, -1, -1},
-    {2, 3, 5, 0, 1,  9, 4,  5, 10, 11, 8, -1, -1, -1, -1, -1, -1}},
-  
-  {{10, 11, 4, 10, 4, 5, 11, 3, 4, 9, 4, 1, 3, 1, 4, -1, -1},
-    { 1,  7,10, 11, 3, 1, 9,4, 5,-1, -1, -1, -1, -1, -1, -1}},
-  
-  {{2, 5, 1, 2, 8, 5, 2, 11, 8, 4, 5, 8, -1, -1, -1, -1, -1},
-    {1, 6, 2,11, 8, 4,  5, 1,-1, -1, -1, -1, -1, -1, -1, -1, -1}},
-  
-  {{0, 4, 11, 0, 11, 3, 4, 5, 11, 2, 11, 1, 5, 1, 11, -1, -1},
-    {1, 7,  0, 4, 5, 1,  2, 11, 3,-1, -1, -1, -1, -1, -1, -1, -1}},
-  
-  {{0, 2, 5, 0, 5, 9, 2, 11, 5, 4, 5, 8, 11, 8, 5, -1, -1},
-    {1, 7, 0, 2,11, 8, 4,  5, 9, -1, -1, -1, -1, -1, -1, -1, -1}},
-  
-  /* 215 */
-  {{9, 4, 5, 2, 11, 3, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1},
-    {2, 3, 3, 9,  4, 5,  2, 11,  3, -1, -1, -1, -1, -1, -1, -1, -1}},
-  
-  {{2, 5, 10, 3, 5, 2, 3, 4, 5, 3, 8, 4, -1, -1, -1, -1, -1},
-    {2, 4, 4, 2, 3, 5, 10, 4, 5, 3, 8,-1, -1, -1, -1, -1, -1}},
-  
-  {{5, 10, 2, 5, 2, 4, 4, 2, 0, -1, -1, -1, -1, -1, -1, -1, -1},
-    {1,  5, 5,10, 2, 0, 4,-1, -1, -1, -1, -1, -1, -1, -1, -1, -1}},
-  
-  {{3, 10, 2, 3, 5, 10, 3, 8, 5, 4, 5, 8, 0, 1, 9, -1, -1},
-    {3,  4, 4, 3, 3, 5, 10, 2, 8, 4, 5, 3, 0, 1, 9, -1, -1}},
-  
-  {{5, 10, 2, 5, 2, 4, 1, 9, 2, 9, 4, 2, -1, -1, -1, -1, -1},
-    {1,  6,10, 2, 1, 9, 4, 5, -1, -1, -1, -1, -1, -1, -1, -1, -1}},
-  
-  /* 220 */
-  {{8, 4, 5, 8, 5, 3, 3, 5, 1, -1, -1, -1, -1, -1, -1, -1, -1},
-    {1, 5, 8, 4, 5, 1, 3,-1, -1, -1, -1, -1, -1, -1, -1, -1, -1}},
-  
-  {{0, 4, 5, 1, 0, 5, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1},
-    {1, 4, 0, 4, 5, 1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1}},
-  
-  {{8, 4, 5, 8, 5, 3, 9, 0, 5, 0, 3, 5, -1, -1, -1, -1, -1},
-    {2, 4, 4, 0, 3, 5, 9, 8, 4, 5, 3, -1, -1, -1, -1, -1, -1}},
-  
-  {{9, 4, 5, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1},
-    {1, 3, 9,  4,  5, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1}},
-  
-  {{4, 11, 7, 4, 9, 11, 9, 10, 11, -1, -1, -1, -1, -1, -1, -1, -1},
-    {1,  5, 9,10, 11, 7, 4, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1}},
-  
-  /* 225 */
-  {{0, 8, 3, 4, 9, 7, 9, 11, 7, 9, 10, 11, -1, -1, -1, -1, -1},
-    {2, 3, 5, 0, 8, 3, 7, 4, 9, 10, 11, -1, -1, -1, -1, -1, -1}},
-  
-  {{1, 10, 11, 1, 11, 4, 1, 4, 0, 7, 4, 11, -1, -1, -1, -1, -1},
-    {1,  6,  1, 10,11, 7, 4, 0, -1, -1, -1, -1, -1, -1, -1, -1, -1}},
-  
-  {{3, 1, 4, 3, 4, 8, 1, 10, 4, 7, 4, 11, 10, 11, 4, -1, -1},
-    {1, 7, 3, 1,10,11, 7,  4, 8, -1, -1, -1, -1, -1, -1, -1, -1}},
-  
-  {{4, 11, 7, 9, 11, 4, 9, 2, 11, 9, 1, 2, -1, -1, -1, -1, -1},
-    {2,  4, 4, 2, 11, 9, 1, 4, 9, 11, 7, -1, -1, -1, -1, -1, -1}},
-  
-  {{9, 7, 4, 9, 11, 7, 9, 1, 11, 2, 11, 1, 0, 8, 3, -1, -1},
-    {3, 4, 4, 3, 1, 2, 11, 9, 7, 4,  9,11,  8, 3, 0, 8, 3}},
-  
-  /* 230 */
-  {{11, 7, 4, 11, 4, 2, 2, 4, 0, -1, -1, -1, -1, -1, -1, -1, -1},
-    { 1, 5, 11, 7, 4, 0, 2, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1}},
-  
-  {{11, 7, 4, 11, 4, 2, 8, 3, 4, 3, 2, 4, -1, -1, -1, -1, -1},
-    { 2, 4, 4, 11, 7, 4, 2, 3, 2, 4, 8,-1, -1, -1, -1, -1, -1}},
-  
-  {{2, 9, 10, 2, 7, 9, 2, 3, 7, 7, 4, 9, -1, -1, -1, -1, -1},
-    {1, 6,  2, 3, 7, 4, 9,10, -1, -1, -1, -1, -1, -1, -1, -1, -1}},
-  
-  {{9, 10, 7, 9, 7, 4, 10, 2, 7, 8, 7, 0, 2, 0, 7, -1, -1},
-    {1,  7, 9,10, 2, 0, 8, 7, 4,-1, -1, -1, -1, -1, -1, -1, -1}},
-  
-  {{3, 7, 10, 3, 10, 2, 7, 4, 10, 1, 10, 0, 4, 0, 10, -1, -1},
-    {1, 7,  3, 7, 4, 0, 1,10, 2, -1, -1, -1, -1, -1, -1, -1, -1}},
-  
-  /* 235 */
-  {{1, 10, 2, 8, 7, 4, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1},
-    {2,  3, 3, 1,10, 2,  8,  7,  4, -1, -1, -1, -1, -1, -1, -1, -1}},
-  
-  {{4, 9, 1, 4, 1, 7, 7, 1, 3, -1, -1, -1, -1, -1, -1, -1, -1},
-    {1, 5, 4, 9, 1, 3, 7,-1, -1, -1, -1, -1, -1, -1, -1, -1, -1}},
-  
-  {{4, 9, 1, 4, 1, 7, 0, 8, 1, 8, 7, 1, -1, -1, -1, -1, -1},
-    {2, 4, 4, 8, 7, 1, 0, 4, 9, 1, 7, -1, -1, -1, -1, -1, -1}},
-  
-  {{4, 0, 3, 7, 4, 3, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1},
-    {1, 4, 3, 7, 4, 0,-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1}},
-  
-  {{4, 8, 7, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1},
-    {1, 3, 4,  8,  7, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1}},
-  
-  /* 240 */
-  {{9, 10, 8, 10, 11, 8, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1},
-    {1,  4, 8,  9, 10,11, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1}},
-  
-  {{3, 0, 9, 3, 9, 11, 11, 9, 10, -1, -1, -1, -1, -1, -1, -1, -1},
-    {1, 5, 3, 0, 9, 10, 11, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1}},
-  
-  {{0, 1, 10, 0, 10, 8, 8, 10, 11, -1, -1, -1, -1, -1, -1, -1, -1},
-    {1, 5,  0, 1, 10,11, 8, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1}},
-  
-  {{3, 1, 10, 11, 3, 10, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1},
-    {1, 4,  3,  1,10, 11, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1}},
-  
-  {{1, 2, 11, 1, 11, 9, 9, 11, 8, -1, -1, -1, -1, -1, -1, -1, -1},
-    {1, 5,  1, 2, 11, 8, 9, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1}},
-  
-  /* 245 */
-  {{3, 0, 9, 3, 9, 11, 1, 2, 9, 2, 11, 9, -1, -1, -1, -1, -1},
-    {2, 4, 4, 2,11,  9, 1, 3, 0, 9, 11, -1, -1, -1, -1, -1,-1}},
-  
-  {{0, 2, 11, 8, 0, 11, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1},
-    {1, 4,  0, 2,11,  8, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1}},
-  
-  {{3, 2, 11, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1},
-    {1, 3,  3,  2, 11, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1}},
-  
-  {{2, 3, 8, 2, 8, 10, 10, 8, 9, -1, -1, -1, -1, -1, -1, -1, -1},
-    {1, 5, 2, 3, 8,  9, 10, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1}},
-  
-  {{9, 10, 2, 0, 9, 2, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1},
-    {1,  4, 2, 0, 9,10, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1}},
-  
-  /* 250 */
-  {{2, 3, 8, 2, 8, 10, 0, 1, 8, 1, 10, 8, -1, -1, -1, -1, -1},
-    {2, 4, 4, 2, 3, 8, 10, 1, 10, 8, 0, -1, -1, -1, -1, -1, -1}},
-  
-  {{1, 10, 2, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1},
-    {1,  3, 1, 10,  2, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1}},
-  
-  {{1, 3, 8, 9, 1, 8, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1},
-    {1, 4, 1, 3, 8, 9, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1}},
-  
-  {{0, 9, 1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1},
-    {1, 3, 0,  9,  1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1}},
-  
-  {{0, 3, 8, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1},
-    {1, 3, 0,  3,  8, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1}},
-  
-  {{-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1},
-    { 0, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1}}
-};
-
-
-//-----------------------------------------------------------------------------
-
-
-const int polyTable[8][16] =
-{
-  {-1},
-  {-1},
-  {-1},
-  {0, 1, 2, -1},
-  {0, 1, 2, 2, 3, 0, -1},
-  {0, 1, 2, 0, 2, 4, 4, 2, 3, -1},
-  {0, 1, 2, 2, 3, 4, 4, 5, 0, 0, 2, 4, -1},
-  {0, 1, 5, 0, 5, 6, 1, 2, 5, 4, 5, 3, 2, 3, 5, -1}
-};
-
-
-//=============================================================================
-
-
-//=============================================================================
-#endif // ISOEX_MC_TABLES_HH defined
-//=============================================================================

+ 0 - 38
include/igl/copyleft/opengl2/render_to_tga.h

@@ -1,38 +0,0 @@
-// This file is part of libigl, a simple c++ geometry processing library.
-// 
-// Copyright (C) 2014 Alec Jacobson <[email protected]>
-// 
-// This Source Code Form is subject to the terms of the Mozilla Public License 
-// v. 2.0. If a copy of the MPL was not distributed with this file, You can 
-// obtain one at http://mozilla.org/MPL/2.0/.
-#ifndef IGL_OPENGL_RENDER_TO_TGA_H
-#define IGL_OPENGL_RENDER_TO_TGA_H
-#include "../../igl_inline.h"
-#include <string>
-
-namespace igl
-{
-  namespace opengl
-  {
-    // Render current open GL image to .tga file
-    // Inputs:
-    //   tga_file  path to output .tga file
-    //   width  width of scene and resulting image
-    //   height height of scene and resulting image
-    ///  alpha  whether to include alpha channel
-    // Returns true only if no errors occurred
-    //
-    // See also: png/render_to_png which is slower but writes .png files
-    IGL_INLINE bool render_to_tga(
-      const std::string tga_file,
-      const int width,
-      const int height,
-      const bool alpha);
-  }
-}
-
-#ifndef IGL_STATIC_LIBRARY
-#  include "render_to_tga.cpp"
-#endif
-
-#endif

+ 0 - 31
include/igl/copyleft/opengl2/texture_from_tga.h

@@ -1,31 +0,0 @@
-// This file is part of libigl, a simple c++ geometry processing library.
-// 
-// Copyright (C) 2014 Alec Jacobson <[email protected]>
-// 
-// This Source Code Form is subject to the terms of the Mozilla Public License 
-// v. 2.0. If a copy of the MPL was not distributed with this file, You can 
-// obtain one at http://mozilla.org/MPL/2.0/.
-#ifndef IGL_OPENGL_TEXTURE_FROM_TGA_H
-#define IGL_OPENGL_TEXTURE_FROM_TGA_H
-#include "../../igl_inline.h"
-#include "../../opengl2/gl.h"
-#include <string>
-
-namespace igl
-{
-  namespace opengl
-  {
-    /// Read an image from a .tga file and use it as a texture
-    ///
-    /// @param[in] tga_file  path to .tga file
-    /// @param[out] id  of generated openGL texture
-    /// @return true on success, false on failure
-    IGL_INLINE bool texture_from_tga(const std::string tga_file, GLuint & id);
-  }
-}
-
-#ifndef IGL_STATIC_LIBRARY
-#  include "texture_from_tga.cpp"
-#endif
-
-#endif

+ 0 - 106
include/igl/copyleft/opengl2/tga.h

@@ -1,106 +0,0 @@
-// This file is part of libigl, a simple c++ geometry processing library.
-// 
-// Copyright (C) 2015 Alec Jacobson <[email protected]>
-// 
-// This Source Code Form is subject to the terms of the Mozilla Public License 
-// v. 2.0. If a copy of the MPL was not distributed with this file, You can 
-// obtain one at http://mozilla.org/MPL/2.0/.
-#ifndef IGL_OPENGL_TGA_H
-#define IGL_OPENGL_TGA_H
-#include "../../igl_inline.h"
-
-#include "../../opengl2/gl.h"
-// See license in tga.cpp
-/* tga.h - interface for TrueVision (TGA) image file loader */
-#include <stdio.h>
-#ifdef _WIN32
-#include <windows.h>
-#endif
-
-namespace igl
-{
-namespace opengl
-{
-
-typedef struct {
-
-  GLsizei  width;
-  GLsizei  height;
-  GLint    components;
-  GLenum   format;
-
-  GLsizei  cmapEntries;
-  GLenum   cmapFormat;
-  GLubyte *cmap;
-
-  GLubyte *pixels;
-  
-} gliGenericImage;
-
-typedef struct {
-  unsigned char idLength;
-  unsigned char colorMapType;
-
-  /* The image type. */
-#define TGA_TYPE_MAPPED 1
-#define TGA_TYPE_COLOR 2
-#define TGA_TYPE_GRAY 3
-#define TGA_TYPE_MAPPED_RLE 9
-#define TGA_TYPE_COLOR_RLE 10
-#define TGA_TYPE_GRAY_RLE 11
-  unsigned char imageType;
-
-  /* Color Map Specification. */
-  /* We need to separately specify high and low bytes to avoid endianness
-     and alignment problems. */
-  unsigned char colorMapIndexLo, colorMapIndexHi;
-  unsigned char colorMapLengthLo, colorMapLengthHi;
-  unsigned char colorMapSize;
-
-  /* Image Specification. */
-  unsigned char xOriginLo, xOriginHi;
-  unsigned char yOriginLo, yOriginHi;
-
-  unsigned char widthLo, widthHi;
-  unsigned char heightLo, heightHi;
-
-  unsigned char bpp;
-
-  /* Image descriptor.
-     3-0: attribute bpp
-     4:   left-to-right ordering
-     5:   top-to-bottom ordering
-     7-6: zero
-     */
-#define TGA_DESC_ABITS 0x0f
-#define TGA_DESC_HORIZONTAL 0x10
-#define TGA_DESC_VERTICAL 0x20
-  unsigned char descriptor;
-
-} TgaHeader;
-
-typedef struct {
-  unsigned int extensionAreaOffset;
-  unsigned int developerDirectoryOffset;
-#define TGA_SIGNATURE "TRUEVISION-XFILE"
-  char signature[16];
-  char dot;
-  char null;
-} TgaFooter;
-
-IGL_INLINE extern gliGenericImage *gliReadTGA(FILE *fp, char *name, int hflip, int vflip);
-IGL_INLINE int gli_verbose(int new_verbose);
-IGL_INLINE extern int gliVerbose(int newVerbose);
-
-IGL_INLINE void writeTGA( gliGenericImage* image, FILE *fp);
-
-
-
-} // end of igl namespace
-}
-
-#ifndef IGL_STATIC_LIBRARY
-#  include "tga.cpp"
-#endif
-
-#endif 

+ 0 - 42
include/igl/copyleft/progressive_hulls.h

@@ -1,42 +0,0 @@
-// This file is part of libigl, a simple c++ geometry processing library.
-// 
-// Copyright (C) 2015 Alec Jacobson <[email protected]>
-// 
-// This Source Code Form is subject to the terms of the Mozilla Public License 
-// v. 2.0. If a copy of the MPL was not distributed with this file, You can 
-// obtain one at http://mozilla.org/MPL/2.0/.
-#ifndef IGL_COPYLEFT_PROGRESSIVE_HULLS_H
-#define IGL_COPYLEFT_PROGRESSIVE_HULLS_H
-#include "../igl_inline.h"
-#include <Eigen/Core>
-
-namespace igl
-{
-  namespace copyleft
-  {
-    /// Collapses edges until desired number of faces is achieved but ensures
-    /// that new vertices are placed outside all previous meshes as per
-    /// "progressive hulls" in "Silhouette clipping" [Sander et al. 2000].
-    ///
-    /// \pre Assumes (V,F) is a closed manifold mesh 
-    ///
-    /// @param[in] V  #V by dim list of vertex positions
-    /// @param[in] F  #F by 3 list of face indices into V.
-    /// @param[in] max_m  desired number of output faces
-    /// @param[out] U  #U by dim list of output vertex posistions (can be same ref as V)
-    /// @param[out] G  #G by 3 list of output face indices into U (can be same ref as G)
-    /// @param[out] J  #G list of indices into F of birth faces
-    /// @return true if m was reached (otherwise #G > m)
-    IGL_INLINE bool progressive_hulls(
-      const Eigen::MatrixXd & V,
-      const Eigen::MatrixXi & F,
-      const size_t max_m,
-      Eigen::MatrixXd & U,
-      Eigen::MatrixXi & G,
-      Eigen::VectorXi & J);
-  }
-}
-#ifndef IGL_STATIC_LIBRARY
-#  include "progressive_hulls.cpp"
-#endif
-#endif

+ 0 - 53
include/igl/copyleft/progressive_hulls_cost_and_placement.h

@@ -1,53 +0,0 @@
-// This file is part of libigl, a simple c++ geometry processing library.
-// 
-// Copyright (C) 2015 Alec Jacobson <[email protected]>
-// 
-// This Source Code Form is subject to the terms of the Mozilla Public License 
-// v. 2.0. If a copy of the MPL was not distributed with this file, You can 
-// obtain one at http://mozilla.org/MPL/2.0/.
-#ifndef IGL_COPYLEFT_PROGRESSIVE_HULLS_COST_AND_PLACEMENT_H
-#define IGL_COPYLEFT_PROGRESSIVE_HULLS_COST_AND_PLACEMENT_H
-#include <Eigen/Core>
-#include "../igl_inline.h"
-namespace igl
-{
-  namespace copyleft
-  {
-    /// A "cost and placement" compatible with `igl::decimate` implementing the
-    /// "progressive hulls" algorithm in "Silhouette clipping" [Sander et al.
-    /// 2000]. This implementation fixes an issue that the original linear
-    /// program becomes unstable for flat patches by introducing a small
-    /// quadratic energy term pulling the collapsed edge toward its midpoint.
-    /// This function is not really meant to be called directly but rather
-    /// passed to `igl::decimate` as a handle.
-    ///
-    /// @param[in] e  index of edge to be collapsed
-    /// @param[in] V  #V by 3 list of vertex positions
-    /// @param[in] F  #F by 3 list of faces indices into V
-    /// @param[in] E  #E by 3 list of edges indices into V
-    /// @param[in] EMAP #F*3 list of indices into E, mapping each directed edge to unique
-    ///     unique edge in E
-    /// @param[in] EF  #E by 2 list of edge flaps, EF(e,0)=f means e=(i-->j) is the edge of
-    ///     F(f,:) opposite the vth corner, where EI(e,0)=v. Similarly EF(e,1) "
-    ///     e=(j->i)
-    /// @param[in] EI  #E by 2 list of edge flap corners (see above).
-    /// @param[out] cost  cost of collapsing edge e
-    /// @param[out] p  position to place collapsed vertex
-    ///
-    /// \see igl::decimate, igl::collapse_edge
-    IGL_INLINE void progressive_hulls_cost_and_placement(
-      const int e,
-      const Eigen::MatrixXd & V,
-      const Eigen::MatrixXi & F,
-      const Eigen::MatrixXi & E,
-      const Eigen::VectorXi & EMAP,
-      const Eigen::MatrixXi & EF,
-      const Eigen::MatrixXi & EI,
-      double & cost,
-      Eigen::RowVectorXd & p);
-  }
-}
-#ifndef IGL_STATIC_LIBRARY
-#  include "progressive_hulls_cost_and_placement.cpp"
-#endif
-#endif

+ 0 - 46
include/igl/copyleft/quadprog.h

@@ -1,46 +0,0 @@
-// This file is part of libigl, a simple c++ geometry processing library.
-// 
-// Copyright (C) 2015 Alec Jacobson <[email protected]>
-// 
-// This Source Code Form is subject to the terms of the Mozilla Public License 
-// v. 2.0. If a copy of the MPL was not distributed with this file, You can 
-// obtain one at http://mozilla.org/MPL/2.0/.
-#ifndef IGL_COPYLEFT_QUADPROG_H
-#define IGL_COPYLEFT_QUADPROG_H
-
-#include "../igl_inline.h"
-#include <Eigen/Dense>
-namespace igl
-{
-  namespace copyleft
-  {
-    /// Solve a (dense) convex quadratric program. Given in the form
-    ///
-    ///      min  0.5 x G x + g0 x
-    ///      s.t. CE' x + ce0  = 0
-    ///      and  CI' x + ci0 >= 0
-    ///
-    /// @param[in] G  #x by #x matrix of quadratic coefficients
-    /// @param[in] g0  #x vector of linear coefficients
-    /// @param[in] CE #x by #CE list of linear equality coefficients
-    /// @param[in] ce0 #CE list of linear equality right-hand sides
-    /// @param[in] CI #x by #CI list of linear equality coefficients
-    /// @param[in] ci0 #CI list of linear equality right-hand sides
-    /// @param[out] x  #x vector of solution values
-    /// @return true iff success
-    IGL_INLINE bool quadprog(
-      const Eigen::MatrixXd & G,  
-      const Eigen::VectorXd & g0,  
-      const Eigen::MatrixXd & CE, 
-      const Eigen::VectorXd & ce0,  
-      const Eigen::MatrixXd & CI, 
-      const Eigen::VectorXd & ci0, 
-      Eigen::VectorXd& x);
-  }
-}
-
-#ifndef IGL_STATIC_LIBRARY
-#  include "quadprog.cpp"
-#endif
-
-#endif

+ 0 - 72
include/igl/copyleft/tetgen/cdt.h

@@ -1,72 +0,0 @@
-// This file is part of libigl, a simple c++ geometry processing library.
-// 
-// Copyright (C) 2014 Alec Jacobson <[email protected]>
-// 
-// This Source Code Form is subject to the terms of the Mozilla Public License 
-// v. 2.0. If a copy of the MPL was not distributed with this file, You can 
-// obtain one at http://mozilla.org/MPL/2.0/.
-#ifndef IGL_COPYLEFT_TETGEN_CDT_H
-#define IGL_COPYLEFT_TETGEN_CDT_H
-#include "../../igl_inline.h"
-
-#include <Eigen/Core>
-#include <string>
-#ifndef TETLIBRARY
-#  define TETLIBRARY 
-#endif
-#include "tetgen.h" // Defined REAL
-
-namespace igl
-{
-  namespace copyleft
-  {
-    namespace tetgen
-    {
-      /// Parameters for controling the CDT
-      struct CDTParam
-      {
-        /// Tetgen can compute mesh of convex hull of input (i.e. "c") but often
-        /// chokes. One workaround is to force it to mesh the entire bounding box.
-        /// {false}
-        bool use_bounding_box = false;
-        /// Scale the bounding box a bit so that vertices near it do not give tetgen
-        /// problems. {1.01}
-        double bounding_box_scale = 1.01;
-        /// Flags to tetgen. Do not include the "c" flag here! {"Y"}
-        std::string flags = "Y";
-      };
-      /// Create a constrained delaunay tessellation containing convex hull of the
-      /// given **non-selfintersecting** mesh.
-      ///
-      /// @param[in] V  #V by 3 list of input mesh vertices
-      /// @param[in] F  #F by 3 list of input mesh facets
-      /// @param[in] param  see above
-      /// @param[out] TV  #TV by 3 list of output mesh vertices (V come first)
-      /// @param[out] TT  #TT by 3 list of tetrahedra indices into TV.
-      /// @param[out] TF  #TF by 3 list of facets from F potentially subdivided.
-      /// 
-      template <
-        typename DerivedV, 
-        typename DerivedF, 
-        typename DerivedTV, 
-        typename DerivedTT, 
-        typename DerivedTF>
-      IGL_INLINE bool cdt(
-        const Eigen::PlainObjectBase<DerivedV>& V,
-        const Eigen::PlainObjectBase<DerivedF>& F,
-        const CDTParam & param,
-        Eigen::PlainObjectBase<DerivedTV>& TV,
-        Eigen::PlainObjectBase<DerivedTT>& TT,
-        Eigen::PlainObjectBase<DerivedTF>& TF);
-    }
-  }
-}
-
-
-#ifndef IGL_STATIC_LIBRARY
-#  include "cdt.cpp"
-#endif
-
-#endif
-
-

+ 0 - 66
include/igl/copyleft/tetgen/mesh_to_tetgenio.h

@@ -1,66 +0,0 @@
-// This file is part of libigl, a simple c++ geometry processing library.
-// 
-// Copyright (C) 2013 Alec Jacobson <[email protected]>
-// 
-// This Source Code Form is subject to the terms of the Mozilla Public License 
-// v. 2.0. If a copy of the MPL was not distributed with this file, You can 
-// obtain one at http://mozilla.org/MPL/2.0/.
-#ifndef IGL_COPYLEFT_TETGEN_MESH_TO_TETGENIO_H
-#define IGL_COPYLEFT_TETGEN_MESH_TO_TETGENIO_H
-#include "../../igl_inline.h"
-
-#ifndef TETLIBRARY
-#  define TETLIBRARY 
-#endif
-#include "tetgen.h" // Defined tetgenio, REAL
-#include <vector>
-#include <Eigen/Core>
-
-namespace igl
-{
-  namespace copyleft
-  {
-    namespace tetgen
-    {
-      /// Load a vertex list and face list into a tetgenio object
-      ///
-      /// @param[in] V  #V by 3 vertex position list
-      /// @param[in] F  #F list of polygon face indices into V (0-indexed)
-      /// @param[out] in  tetgenio input object
-      ///  @param[out] H  #H list of seed point inside each hole
-      ///  @param[out] R  #R list of seed point inside each region	
-      /// @return true on success, false on error
-      IGL_INLINE bool mesh_to_tetgenio(
-        const std::vector<std::vector<REAL> > & V,
-	const std::vector<std::vector<int> > & F,
-	const std::vector<std::vector<REAL > > & H, 
-	const std::vector<std::vector<REAL > > & R, 
-	tetgenio & in);	
-      IGL_INLINE bool mesh_to_tetgenio(
-        const std::vector<std::vector<REAL > > & V, 
-        const std::vector<std::vector<int> > & F, 
-        tetgenio & in);
-      /// \overload
-      template <typename DerivedV, typename DerivedF>
-      IGL_INLINE bool mesh_to_tetgenio(
-        const Eigen::PlainObjectBase<DerivedV>& V,
-        const Eigen::PlainObjectBase<DerivedF>& F,
-        tetgenio & in);
-      /// \overload
-      template <typename DerivedV, typename DerivedF, typename DerivedH, typename DerivedR>
-      IGL_INLINE bool mesh_to_tetgenio(
-	const Eigen::PlainObjectBase<DerivedV>& V,
-	const Eigen::PlainObjectBase<DerivedF>& F,
-	const Eigen::PlainObjectBase<DerivedH>& H, 
-	const Eigen::PlainObjectBase<DerivedR>& R, 
-	tetgenio& in);	
-    }
-  }
-}
-
-
-#ifndef IGL_STATIC_LIBRARY
-#  include "mesh_to_tetgenio.cpp"
-#endif
-
-#endif

+ 0 - 70
include/igl/copyleft/tetgen/mesh_with_skeleton.h

@@ -1,70 +0,0 @@
-// This file is part of libigl, a simple c++ geometry processing library.
-// 
-// Copyright (C) 2013 Alec Jacobson <[email protected]>
-// 
-// This Source Code Form is subject to the terms of the Mozilla Public License 
-// v. 2.0. If a copy of the MPL was not distributed with this file, You can 
-// obtain one at http://mozilla.org/MPL/2.0/.
-#ifndef IGL_COPYLEFT_TETGEN_MESH_WITH_SKELETON_H
-#define IGL_COPYLEFT_TETGEN_MESH_WITH_SKELETON_H
-#include "../../igl_inline.h"
-#include <Eigen/Dense>
-#include <string>
-
-namespace igl
-{
-  namespace copyleft
-  {
-    namespace tetgen
-    {
-      /// Mesh the interior of a given surface with tetrahedra which are graded
-      /// (tend to be small near the surface and large inside) and conform to the
-      /// given handles and samplings thereof.
-      ///
-      /// @param[in] V  #V by 3 list of mesh vertex positions
-      /// @param[in] F  #F by 3 list of triangle indices
-      /// @param[in] C  #C by 3 list of vertex positions
-      /// @param[in] P  #P list of point handle indices
-      /// @param[in] BE #BE by 2 list of bone-edge indices
-      /// @param[in] CE #CE by 2 list of cage-edge indices
-      /// @param[in] samples_per_bone  #samples to add per bone
-      /// @param[in] tetgen_flags  flags to pass to tetgen {""-->"pq2Y"} otherwise you're on
-      ///    your own and it's your funeral if you pass nonsense flags
-      /// @param[out] VV  #VV by 3 list of tet-mesh vertex positions
-      /// @param[out] TT  #TT by 4 list of tetrahedra indices
-      /// @param[out] FF  #FF by 3 list of surface triangle indices
-      /// @return true only on success
-      IGL_INLINE bool mesh_with_skeleton(
-        const Eigen::MatrixXd & V,
-        const Eigen::MatrixXi & F,
-        const Eigen::MatrixXd & C,
-        const Eigen::VectorXi & /*P*/,
-        const Eigen::MatrixXi & BE,
-        const Eigen::MatrixXi & CE,
-        const int samples_per_bone,
-        const std::string & tetgen_flags,
-        Eigen::MatrixXd & VV,
-        Eigen::MatrixXi & TT,
-        Eigen::MatrixXi & FF);
-      /// \overload
-      IGL_INLINE bool mesh_with_skeleton(
-        const Eigen::MatrixXd & V,
-        const Eigen::MatrixXi & F,
-        const Eigen::MatrixXd & C,
-        const Eigen::VectorXi & /*P*/,
-        const Eigen::MatrixXi & BE,
-        const Eigen::MatrixXi & CE,
-        const int samples_per_bone,
-        Eigen::MatrixXd & VV,
-        Eigen::MatrixXi & TT,
-        Eigen::MatrixXi & FF);
-    }
-  }
-}
-
-
-#ifndef IGL_STATIC_LIBRARY
-#  include "mesh_with_skeleton.cpp"
-#endif
-
-#endif

+ 0 - 60
include/igl/copyleft/tetgen/read_into_tetgenio.h

@@ -1,60 +0,0 @@
-// This file is part of libigl, a simple c++ geometry processing library.
-// 
-// Copyright (C) 2013 Alec Jacobson <[email protected]>
-// 
-// This Source Code Form is subject to the terms of the Mozilla Public License 
-// v. 2.0. If a copy of the MPL was not distributed with this file, You can 
-// obtain one at http://mozilla.org/MPL/2.0/.
-#ifndef IGL_COPYLEFT_TETGEN_READ_INTO_TETGENIO_H
-#define IGL_COPYLEFT_TETGEN_READ_INTO_TETGENIO_H
-#include "../../igl_inline.h"
-
-#include <string>
-#ifndef TETLIBRARY
-#define TETLIBRARY 
-#endif
-#include "tetgen.h" // Defined tetgenio, REAL
-
-namespace igl
-{
-  namespace copyleft
-  {
-    namespace tetgen
-    {
-      /// Read a mesh or point set into tetgenio (input object for calling
-      /// tetgen).  Many file formats are already supported by tetgen:
-      ///   .off
-      ///   .ply
-      ///   .node
-      ///   .ply
-      ///   .medit
-      ///   .vtk
-      ///   etc.
-      /// Notably it does not support .obj which is loaded by hand here (also
-      /// demonstrating how to load points/faces programmatically)
-      ///
-      /// If the file extension is not recognized the filename is assumed to be
-      /// the basename of a collection describe a tetmesh, (of which at least
-      /// the .node file must exist):
-      ///   [filename].node
-      ///   [filename].ele
-      ///   [filename].face
-      ///   [filename].edge
-      ///   [filename].vol
-      ///
-      /// @param[in] path  path to file or basename to files
-      /// @param[out] in  tetgenio input object
-      /// @return true on success, false on error
-      IGL_INLINE bool read_into_tetgenio(
-        const std::string & path, 
-        tetgenio & in);
-    }
-  }
-}
-
-
-#ifndef IGL_STATIC_LIBRARY
-#  include "read_into_tetgenio.cpp"
-#endif
-
-#endif

+ 0 - 81
include/igl/copyleft/tetgen/tetgenio_to_tetmesh.h

@@ -1,81 +0,0 @@
-// This file is part of libigl, a simple c++ geometry processing library.
-// 
-// Copyright (C) 2013 Alec Jacobson <[email protected]>
-// 
-// This Source Code Form is subject to the terms of the Mozilla Public License 
-// v. 2.0. If a copy of the MPL was not distributed with this file, You can 
-// obtain one at http://mozilla.org/MPL/2.0/.
-#ifndef IGL_COPYLEFT_TETGEN_TETGENIO_TO_TETMESH_H
-#define IGL_COPYLEFT_TETGEN_TETGENIO_TO_TETMESH_H
-#include "../../igl_inline.h"
-
-#ifndef TETLIBRARY
-#define TETLIBRARY 
-#endif
-#include "tetgen.h" // Defined tetgenio, REAL
-#include <vector>
-#include <unordered_map>
-#include <Eigen/Core>
-namespace igl
-{
-  namespace copyleft
-  {
-    namespace tetgen
-    {
-      /// Extract a tetrahedral mesh from a tetgenio object
-      ///
-      /// @param[in] out tetgenio output object
-      /// @param[out] V  #V by 3 vertex position list
-      /// @param[out] T  #T by 4 list of tetrahedra indices into V
-      /// @param[out] F  #F by 3 list of marked facets
-      /// @param[out] R  #T list of region IDs for tetrahedra
-      /// @param[out] N  #T by 2 list of neighbors for each tetrahedron
-      /// @param[out] PT #V list of incident tetrahedron for each vertex
-      /// @param[out] FT #F by 2 list of tetrahedra sharing each face 
-      /// @param[out] nR number of regions in output mesh
-      /// @return true on success, false on error
-      IGL_INLINE bool tetgenio_to_tetmesh(
-        const tetgenio & out,
-	std::vector<std::vector<REAL > > & V,
-	std::vector<std::vector<int> > & T,
-        std::vector<std::vector<int> > & F, 
-	std::vector<std::vector<REAL> > & R,// region marks for tetrahedrons
-	std::vector<std::vector<int > > &N, // neighborlist per tet
-	std::vector<std::vector<int > >	&PT, // Point to tet list per point
-	std::vector<std::vector<int > > &FT, // face to tet list
-	size_t & nR); // number of regions    
-      /// \overload
-      IGL_INLINE bool tetgenio_to_tetmesh(
-        const tetgenio & out,
-        std::vector<std::vector<REAL > > & V, 
-        std::vector<std::vector<int> > & T,
-        std::vector<std::vector<int> > & F);
-      /// \overload
-      IGL_INLINE bool tetgenio_to_tetmesh(
-        const tetgenio & out,
-        std::vector<std::vector<REAL > > & V, 
-        std::vector<std::vector<int> > & T);
-      /// \overload
-      template <typename DerivedV, typename DerivedT, typename DerivedF>
-      IGL_INLINE bool tetgenio_to_tetmesh(
-        const tetgenio & out,
-        Eigen::PlainObjectBase<DerivedV>& V,
-        Eigen::PlainObjectBase<DerivedT>& T,
-        Eigen::PlainObjectBase<DerivedF>& F);
-      /// \overload
-      template <typename DerivedV, typename DerivedT>
-      IGL_INLINE bool tetgenio_to_tetmesh(
-        const tetgenio & out,
-        Eigen::PlainObjectBase<DerivedV>& V,
-        Eigen::PlainObjectBase<DerivedT>& T);
-
-  }
-  }
-}
-
-
-#ifndef IGL_STATIC_LIBRARY
-#  include "tetgenio_to_tetmesh.cpp"
-#endif
-
-#endif

+ 0 - 151
include/igl/copyleft/tetgen/tetrahedralize.h

@@ -1,151 +0,0 @@
-// This file is part of libigl, a simple c++ geometry processing library.
-// 
-// Copyright (C) 2013 Alec Jacobson <[email protected]>
-// 
-// This Source Code Form is subject to the terms of the Mozilla Public License 
-// v. 2.0. If a copy of the MPL was not distributed with this file, You can 
-// obtain one at http://mozilla.org/MPL/2.0/.
-#ifndef IGL_COPYLEFT_TETGEN_TETRAHEDRALIZE_H
-#define IGL_COPYLEFT_TETGEN_TETRAHEDRALIZE_H
-#include "../../igl_inline.h"
-
-#include <vector>
-#include <string>
-#include <Eigen/Core>
-#ifndef TETLIBRARY
-#define TETLIBRARY 
-#endif
-#include <tetgen.h> // Defined REAL
-
-namespace igl
-{
-  namespace copyleft
-  {
-    namespace tetgen
-    {
-      /// Mesh the interior of a surface mesh (V,F) using tetgen
-      ///
-      /// @param[in] V  #V by 3 vertex position list
-      /// @param[in] F  #F list of polygon face indices into V (0-indexed)
-      /// @param[in] H  #H by 3 list of seed points inside holes
-      /// @param[in] R  #R by 5 list of region attributes            
-      /// @param[in] switches  string of tetgen options (See tetgen documentation) e.g.
-      ///     "pq1.414a0.01" tries to mesh the interior of a given surface with
-      ///       quality and area constraints
-      ///     "" will mesh the convex hull constrained to pass through V (ignores F)
-      /// @param[out] TV  #TV by 3 vertex position list
-      /// @param[out] TT  #TT by 4 list of tet face indices
-      /// @param[out] TF  #TF by 3 list of triangle face indices
-      /// @param[out] TR  #TT list of region ID for each tetrahedron      
-      /// @param[out] TN  #TT by 4 list of indices neighbors for each tetrahedron
-      /// @param[out] PT  #TV list of incident tetrahedron for a vertex
-      /// @param[out] FT  #TF by 2 list of tetrahedrons sharing a triface      
-      /// @param[out] numRegions Number of regions in output mesh
-      /// @return status:
-      ///   0 success
-      ///   1 tetgen threw exception
-      ///   2 tetgen did not crash but could not create any tets (probably there are
-      ///     holes, duplicate faces etc.)
-      ///   -1 other error
-      IGL_INLINE int tetrahedralize(
-        const std::vector<std::vector<REAL> > &V, 
-        const std::vector<std::vector<int> >  &F, 
-        const std::vector<std::vector<REAL> > &H, 
-        const std::vector<std::vector<REAL> > &R, 
-        const std::string switches, 
-        std::vector<std::vector<REAL > > & TV,
-        std::vector<std::vector<int > >  & TT,
-        std::vector<std::vector<int > >  & TF,
-        std::vector<std::vector<REAL > > &TR,  
-        std::vector<std::vector<int > > &TN, 
-        std::vector<std::vector<int > > &PT, 
-        std::vector<std::vector<int > > &FT, 
-        size_t & numRegions);           
-      /// \overload
-      IGL_INLINE int tetrahedralize(
-        const std::vector<std::vector<REAL > > & V, 
-        const std::vector<std::vector<int> > & F, 
-        const std::string switches,
-        std::vector<std::vector<REAL > > & TV, 
-        std::vector<std::vector<int > > & TT, 
-        std::vector<std::vector<int> > & TF);
-      /// \overload
-      template <
-        typename DerivedV, 
-        typename DerivedF, 
-        typename DerivedTV, 
-        typename DerivedTT, 
-        typename DerivedTF>
-      IGL_INLINE int tetrahedralize(
-        const Eigen::MatrixBase<DerivedV>& V,
-        const Eigen::MatrixBase<DerivedF>& F,
-        const std::string switches,
-        Eigen::PlainObjectBase<DerivedTV>& TV,
-        Eigen::PlainObjectBase<DerivedTT>& TT,
-        Eigen::PlainObjectBase<DerivedTF>& TF);
-      /// \overload
-      IGL_INLINE int tetrahedralize(
-        const std::vector<std::vector<REAL > > & V, 
-        const std::vector<std::vector<int> > & F, 
-        const std::vector<int> & VM,
-        const std::vector<int> & FM,
-        const std::string switches,
-        std::vector<std::vector<REAL > > & TV, 
-        std::vector<std::vector<int > > & TT, 
-        std::vector<std::vector<int> > & TF,
-        std::vector<int> & TM);
-      /// \overload
-      template <
-        typename DerivedV, 
-        typename DerivedF, 
-        typename DerivedVM,
-        typename DerivedFM,
-        typename DerivedTV, 
-        typename DerivedTT, 
-        typename DerivedTF, 
-        typename DerivedTM>
-      IGL_INLINE int tetrahedralize(
-        const Eigen::MatrixBase<DerivedV>& V,
-        const Eigen::MatrixBase<DerivedF>& F,
-        const Eigen::MatrixBase<DerivedVM>& VM,
-        const Eigen::MatrixBase<DerivedFM>& FM,
-        const std::string switches,
-        Eigen::PlainObjectBase<DerivedTV>& TV,
-        Eigen::PlainObjectBase<DerivedTT>& TT,
-        Eigen::PlainObjectBase<DerivedTF>& TF,
-        Eigen::PlainObjectBase<DerivedTM>& TM);
-      /// \overload
-      template <
-        typename DerivedV,
-        typename DerivedF,
-        typename DerivedH,
-        typename DerivedR,
-        typename DerivedTV,
-        typename DerivedTT,
-        typename DerivedTF,
-        typename DerivedTR>      
-      IGL_INLINE int tetrahedralize(
-        const Eigen::MatrixBase<DerivedV>& V,
-        const Eigen::MatrixBase<DerivedF>& F,
-        const Eigen::MatrixBase<DerivedH>& H,
-        const Eigen::MatrixBase<DerivedR>& R,
-        const std::string switches,
-        Eigen::PlainObjectBase<DerivedTV>& TV,
-        Eigen::PlainObjectBase<DerivedTT>& TT,
-        Eigen::PlainObjectBase<DerivedTF>& TF,
-        Eigen::PlainObjectBase<DerivedTR>& TR, 
-        Eigen::PlainObjectBase<DerivedTT>& TN, 
-        Eigen::PlainObjectBase<DerivedTT>& PT, 
-        Eigen::PlainObjectBase<DerivedTT>& FT, 
-        size_t & numRegions);            
-   }
-  }
-}
-
-
-#ifndef IGL_STATIC_LIBRARY
-#  include "tetrahedralize.cpp"
-#endif
-
-#endif
-

+ 0 - 86
include/igl/embree/EmbreeDevice.h

@@ -1,86 +0,0 @@
-// This file is part of libigl, a simple c++ geometry processing library.
-//
-// Copyright (C) 2020 Vladimir Fonov <[email protected]>
-//               2013 Alec Jacobson <[email protected]>
-//               2014 Christian Schüller <[email protected]>
-//
-// This Source Code Form is subject to the terms of the Mozilla Public License
-// v. 2.0. If a copy of the MPL was not distributed with this file, You can
-// obtain one at http://mozilla.org/MPL/2.0/.
-//
-
-#ifndef IGL_EMBREE_EMBREE_DEVICE_H
-#define IGL_EMBREE_EMBREE_DEVICE_H
-#include <embree3/rtcore.h>
-#include <iostream>
-
-namespace igl
-{
-  namespace embree
-  {
-     /// keep track of embree device instance
-     struct EmbreeDevice
-     {
-        RTCDevice embree_device;
-        int       embree_device_cntr;
-
-        static EmbreeDevice & instance()
-        {
-            static EmbreeDevice s;
-            return s;
-        } // instance
-
-        EmbreeDevice(const EmbreeDevice &) = delete;
-        EmbreeDevice & operator = (const EmbreeDevice &) = delete;
-
-        static RTCDevice get_device(const char *config=nullptr)
-        {
-            return instance().get(config);
-        }
-
-        static void release_device(void)
-        {
-            instance().release();
-        }
-
-    private:
-
-        EmbreeDevice():embree_device(nullptr),embree_device_cntr(0) {}
-
-        ~EmbreeDevice() 
-        { 
-            if(embree_device)
-                rtcReleaseDevice(embree_device);
-        }
-
-        RTCDevice get(const char *config=nullptr) 
-        {
-            if(!embree_device) 
-            {
-                embree_device = rtcNewDevice (config);
-                if(rtcGetDeviceError (embree_device) != RTC_ERROR_NONE)
-                    std::cerr << "Embree: An error occurred while initializing embree core!" << std::endl;
-            #ifdef IGL_VERBOSE
-                else
-                    std::cerr << "Embree: core initialized." << std::endl;
-            #endif
-            }
-            ++embree_device_cntr;
-            return embree_device;
-        }
-
-        void release()
-        {
-            if(!--embree_device_cntr) {
-                rtcReleaseDevice (embree_device);
-                embree_device = nullptr;                
-            #ifdef IGL_VERBOSE
-                    std::cerr << "Embree: core released." << std::endl;
-            #endif
-            }
-        }
-     };
-  }
-}
-
-#endif // IGL_EMBREE_EMBREE_DEVICE_H

+ 0 - 181
include/igl/embree/EmbreeIntersector.h

@@ -1,181 +0,0 @@
-// This file is part of libigl, a simple c++ geometry processing library.
-//
-// Copyright (C) 2013 Alec Jacobson <[email protected]>
-//               2014 Christian Schüller <[email protected]>
-//
-// This Source Code Form is subject to the terms of the Mozilla Public License
-// v. 2.0. If a copy of the MPL was not distributed with this file, You can
-// obtain one at http://mozilla.org/MPL/2.0/.
-// igl function interface for Embree2.2
-//
-// Necessary changes to switch from previous Embree versions:
-// * Use igl:Hit instead of embree:Hit (where id0 -> id)
-// * For Embree2.2
-// * Uncomment #define __USE_RAY_MASK__ in platform.h to enable masking
-
-#ifndef IGL_EMBREE_EMBREE_INTERSECTOR_H
-#define IGL_EMBREE_EMBREE_INTERSECTOR_H
-
-#include "../Hit.h"
-#include <Eigen/Geometry>
-#include <Eigen/Core>
-
-#include <embree3/rtcore.h>
-#include <embree3/rtcore_ray.h>
-#include <iostream>
-#include <vector>
-
-#include "EmbreeDevice.h"
-
-namespace igl
-{
-  namespace embree
-  {
-    /// Simple class to wrap Embree's ray tracing functionality
-    class EmbreeIntersector
-    {
-    public:
-      typedef Eigen::Matrix<float,Eigen::Dynamic,3> PointMatrixType;
-      typedef Eigen::Matrix<int,Eigen::Dynamic,3> FaceMatrixType;
-    public:
-      EmbreeIntersector();
-    private:
-      // Copying and assignment are not allowed.
-      EmbreeIntersector(const EmbreeIntersector & that);
-      EmbreeIntersector & operator=(const EmbreeIntersector &);
-    public:
-      virtual ~EmbreeIntersector();
-
-      /// Initialize with a given mesh.
-      ///
-      /// @param[in] V  #V by 3 list of vertex positions
-      /// @param[in] F  #F by 3 list of Oriented triangles
-      /// @param[in] isStatic  scene is optimized for static geometry
-      /// #### Side effects:
-      ///   The first time this is ever called the embree engine is initialized.
-      void init(
-        const PointMatrixType& V,
-        const FaceMatrixType& F,
-        bool isStatic = false);
-
-      /// Initialize with a given mesh.
-      ///
-      /// @param[in] V  vector of #V by 3 list of vertex positions for each geometry
-      /// @param[in] F  vector of #F by 3 list of Oriented triangles for each geometry
-      /// @param[in] masks  a 32 bit mask to identify active geometries.
-      /// @param[in] isStatic  scene is optimized for static geometry
-      ///
-      /// ##### Side effects:
-      ///   The first time this is ever called the embree engine is initialized.
-      void init(
-        const std::vector<const PointMatrixType*>& V,
-        const std::vector<const FaceMatrixType*>& F,
-        const std::vector<int>& masks,
-        bool isStatic = false);
-
-      /// Deinitialize embree datasctructures for current mesh.  Also called on
-      /// destruction: no need to call if you just want to init() once and
-      /// destroy.
-      void deinit();
-
-      /// Given a ray find the first hit
-      ///
-      /// @param[in] origin     3d origin point of ray
-      /// @param[in] direction  3d (not necessarily normalized) direction vector of ray
-      /// @param[in] tnear      start of ray segment
-      /// @param[in] tfar       end of ray segment
-      /// @param[in] masks      a 32 bit mask to identify active geometries.
-      /// @param[out] hit        information about hit
-      /// @return true if and only if there was a hit
-      bool intersectRay(
-        const Eigen::RowVector3f& origin,
-        const Eigen::RowVector3f& direction,
-        Hit& hit,
-        float tnear = 0,
-        float tfar = std::numeric_limits<float>::infinity(),
-        int mask = 0xFFFFFFFF) const;
-
-      /// Given a ray find the first hit
-      /// This is a conservative hit test where multiple rays within a small radius
-      /// will be tested and only the closesest hit is returned.
-      ///
-      /// @param[in] origin     3d origin point of ray
-      /// @param[in] direction  3d (not necessarily normalized) direction vector of ray
-      /// @param[in] tnear      start of ray segment
-      /// @param[in] tfar       end of ray segment
-      /// @param[in] masks      a 32 bit mask to identify active geometries.
-      /// @param[in] geoId      id of geometry mask (default std::numeric_limits<float>::infinity() if no: no masking)
-      /// @param[in] closestHit true for gets closest hit, false for furthest hit
-      /// @param[out] hit        information about hit
-      /// @return true if and only if there was a hit
-      bool intersectBeam(
-        const Eigen::RowVector3f& origin,
-        const Eigen::RowVector3f& direction,
-        Hit& hit,
-        float tnear = 0,
-        float tfar = std::numeric_limits<float>::infinity(),
-        int mask = 0xFFFFFFFF,
-        int geoId = -1,
-        bool closestHit = true,
-        unsigned int samples = 4) const;
-
-      /// Given a ray find all hits in order
-      ///
-      /// @param[in] origin     3d origin point of ray
-      /// @param[in] direction  3d (not necessarily normalized) direction vector of ray
-      /// @param[in] tnear      start of ray segment
-      /// @param[in] tfar       end of ray segment
-      /// @param[in] masks      a 32 bit mask to identify active geometries.
-      /// @param[out] hit        information about hit
-      /// @param[out] num_rays   number of rays shot (at least one)
-      /// @return true if and only if there was a hit
-      bool intersectRay(
-        const Eigen::RowVector3f& origin,
-        const Eigen::RowVector3f& direction,
-        std::vector<Hit > &hits,
-        int& num_rays,
-        float tnear = 0,
-        float tfar = std::numeric_limits<float>::infinity(),
-        int mask = 0xFFFFFFFF) const;
-
-      /// Given a ray find the first hit
-      ///
-      /// @param[in] a    3d first end point of segment
-      /// @param[in] ab   3d vector from a to other endpoint b
-      /// @param[out] hit  information about hit
-      /// @return true if and only if there was a hit
-      bool intersectSegment(
-        const Eigen::RowVector3f& a,
-        const Eigen::RowVector3f& ab,
-        Hit &hit,
-        int mask = 0xFFFFFFFF) const;
-
-    private:
-
-      struct Vertex   {float x,y,z,a;};
-      struct Triangle {int v0, v1, v2;};
-
-      RTCScene scene;
-      unsigned geomID;
-      Vertex* vertices;
-      Triangle* triangles;
-      bool initialized;
-
-      RTCDevice device;
-
-      void createRay(
-        RTCRayHit& ray,
-        const Eigen::RowVector3f& origin,
-        const Eigen::RowVector3f& direction,
-        float tnear,
-        float tfar,
-        int mask) const;
-    };
-  }
-}
-
-#ifndef IGL_STATIC_LIBRARY
-#  include "EmbreeIntersector.cpp"
-#endif
-
-#endif //EMBREE_INTERSECTOR_H

+ 0 - 262
include/igl/embree/EmbreeRenderer.h

@@ -1,262 +0,0 @@
-// This file is part of libigl, a simple c++ geometry processing library.
-//
-//
-// Copyright (C) 2020 Vladimir Fonov <[email protected]>
-//               2013 Alec Jacobson <[email protected]>
-//               2014 Christian Schüller <[email protected]>
-//
-// This Source Code Form is subject to the terms of the Mozilla Public License
-// v. 2.0. If a copy of the MPL was not distributed with this file, You can
-// obtain one at http://mozilla.org/MPL/2.0/.
-//
-
-#ifndef IGL_EMBREE_EMBREE_RENDERER_H
-#define IGL_EMBREE_EMBREE_RENDERER_H
-
-#include "../colormap.h"
-
-#include <Eigen/Geometry>
-#include <Eigen/Core>
-#include <Eigen/Geometry>
-
-#include <embree3/rtcore.h>
-#include <embree3/rtcore_ray.h>
-#include <iostream>
-#include <vector>
-
-#include "EmbreeDevice.h"
-
-
-namespace igl
-{
-  namespace embree
-  {
-    /// @private
-    /// embree-based mesh renderer
-    class EmbreeRenderer
-    {
-    public:
-      typedef Eigen::RowVector3f Vec3f;
-
-      struct Hit
-      {
-        int id;    // primitive id
-        int gid;   // geometry id
-        float u,v; // barycentric coordinates
-        float t;   // distance = direction*t to intersection
-        Vec3f N;    // element normal
-      };
-
-    public:
-      typedef Eigen::Matrix<float,Eigen::Dynamic,3> PointMatrixType;
-      typedef Eigen::Matrix<float,Eigen::Dynamic,3> ColorMatrixType;
-      typedef Eigen::Matrix<int,  Eigen::Dynamic,3> FaceMatrixType;
-      typedef Eigen::Matrix<unsigned char,Eigen::Dynamic,Eigen::Dynamic> PixelMatrixType;
-
-    public:
-      EmbreeRenderer();
-    private:
-      // Copying and assignment are not allowed.
-      EmbreeRenderer(const EmbreeRenderer & that);
-      EmbreeRenderer & operator=(const EmbreeRenderer &);
-    public:
-      virtual ~EmbreeRenderer();
-
-      // Specify mesh, this call reinitializes embree structures
-      // Inputs:
-      //   V  #V x dim matrix of vertex coordinates
-      //   F  #F x simplex_size  matrix of indices of simplex corners into V
-      //   is_static - optimize for static thene (HQ rendering)
-      template <typename DerivedV, typename DerivedF>
-      void set_mesh(const Eigen::MatrixBase<DerivedV> & V,
-                    const Eigen::MatrixBase<DerivedF> & F,
-                    bool is_static=true);
-
-      // Specify per-vertex or per-face color
-      // Inputs:
-      //   C  #V x 3 matrix of vertex colors
-      //    or #F x 3 matrix of face colors
-      //    or 1 x 3 matrix of uniform color
-      template <typename DerivedC>
-      void set_colors(const Eigen::MatrixBase<DerivedC> & C);
-
-      // Use min(D) and max(D) to set caxis.
-      template <typename DerivedD>
-      void set_data(const Eigen::MatrixBase<DerivedD> & D,
-                    igl::ColorMapType cmap = igl::COLOR_MAP_TYPE_VIRIDIS);
-
-      // Specify per-vertex or per-face scalar field
-      //   that will be converted to color using jet color map
-      // Inputs:
-      //   caxis_min  caxis minimum bound
-      //   caxis_max  caxis maximum bound
-      //   D  #V by 1 list of scalar values
-      //   cmap colormap type
-      //   num_steps number of intervals to discretize the colormap
-      template <typename DerivedD, typename T>
-      void set_data(
-        const Eigen::MatrixBase<DerivedD> & D,
-        T caxis_min,
-        T caxis_max,
-        igl::ColorMapType cmap = igl::COLOR_MAP_TYPE_VIRIDIS);
-
-      // Specify mesh rotation
-      // Inputs:
-      //   r  3 x 3 rotaton matrix
-      template <typename Derivedr>
-      void set_rot(const Eigen::MatrixBase<Derivedr> &r);
-
-      // Specify mesh magnification
-      // Inputs:
-      //   z  magnification ratio
-      template <typename T>
-      void set_zoom(T z);
-
-      // Specify mesh translation
-      // Inputs:
-      //   tr  translation vector
-      template <typename Derivedtr>
-      void set_translation(const Eigen::MatrixBase<Derivedtr> &tr);
-
-      // Specify that color is face based
-      // Inputs:
-      //    f - face or vertex colours
-      void set_face_based(bool f);
-
-      // Use orthographic projection
-      // Inputs:
-      //    f - orthographic or perspective projection
-      void set_orthographic(bool f );
-
-
-      // Render both sides of triangles
-      // Inputs:
-      //    f - double sided
-      void set_double_sided(bool f);
-
-      // render full buffer
-      // Outputs:
-      //   all outputs should have the same size (size of the output picture)
-      //     area outside of the visible object will have zero alpha component (transparant)
-      //   R - red channel
-      //   G - green channel
-      //   B - blue channel
-      //   A - alpha channel
-      void render_buffer(PixelMatrixType &R,
-                         PixelMatrixType &G,
-                         PixelMatrixType &B,
-                         PixelMatrixType &A);
-
-      // Given a ray find the first hit
-      //
-      // Inputs:
-      //   origin     3d origin point of ray
-      //   direction  3d (not necessarily normalized) direction vector of ray
-      //   tnear      start of ray segment
-      //   tfar       end of ray segment
-      //   mask      a 32 bit mask to identify active geometries.
-      // Output:
-      //   hit        information about hit
-      // Returns true if and only if there was a hit
-      bool intersect_ray(
-        const Eigen::RowVector3f& origin,
-        const Eigen::RowVector3f& direction,
-        Hit& hit,
-        float tnear = 0,
-        float tfar = std::numeric_limits<float>::infinity(),
-        int mask = 0xFFFFFFFF) const;
-
-    private:
-
-      // Initialize with a given mesh.
-      //
-      // Inputs:
-      //   V  #V by 3 list of vertex positions
-      //   F  #F by 3 list of Oriented triangles
-      //   isStatic  scene is optimized for static geometry
-      // Side effects:
-      //   The first time this is ever called the embree engine is initialized.
-      void init(
-        const PointMatrixType& V,
-        const FaceMatrixType& F,
-        bool isStatic = false);
-
-      // Initialize embree with a given mesh.
-      //
-      // Inputs:
-      //   V  vector of #V by 3 list of vertex positions for each geometry
-      //   F  vector of #F by 3 list of Oriented triangles for each geometry
-      //   masks  a 32 bit mask to identify active geometries.
-      //   isStatic  scene is optimized for static geometry
-      // Side effects:
-      //   The first time this is ever called the embree engine is initialized.
-      void init(
-        const std::vector<const PointMatrixType*>& V,
-        const std::vector<const FaceMatrixType*>& F,
-        const std::vector<int>& masks,
-        bool isStatic = false);
-
-
-      // Deinitialize embree datasctructures for current mesh.  Also called on
-      // destruction: no need to call if you just want to init() once and
-      // destroy.
-      void deinit();
-      // initialize view parameters
-      void init_view();
-
-      // scene data
-      PointMatrixType V; // vertices
-      FaceMatrixType  F; // faces
-      ColorMatrixType C; // colours
-
-      Eigen::RowVector3f uC; // uniform color
-
-      bool face_based;
-      bool uniform_color;
-      bool double_sided ;
-
-      // Camera parameters
-      float camera_base_zoom;
-      float camera_zoom;
-
-      Eigen::Vector3f camera_base_translation;
-      Eigen::Vector3f camera_translation;
-      Eigen::Vector3f camera_eye;
-      Eigen::Vector3f camera_up;
-      Eigen::Vector3f camera_center;
-      float camera_view_angle;
-      float camera_dnear;
-      float camera_dfar;
-
-      // projection matrixes
-      Eigen::Matrix4f view;
-      Eigen::Matrix4f proj;
-      Eigen::Matrix4f norm;
-
-      Eigen::Matrix3f rot_matrix;
-
-      bool orthographic;
-
-      // embree data
-      RTCScene scene;
-      unsigned geomID;
-      bool initialized;
-
-      RTCDevice device;
-
-      void create_ray(
-        RTCRayHit& ray,
-        const Eigen::RowVector3f& origin,
-        const Eigen::RowVector3f& direction,
-        float tnear,
-        float tfar,
-        int mask) const;
-
-    };
-  }
-}
-
-#ifndef IGL_STATIC_LIBRARY
-#  include "EmbreeRenderer.cpp"
-#endif
-#endif //IGL_EMBREE_EMBREE_RENDERER_H

+ 0 - 61
include/igl/embree/ambient_occlusion.h

@@ -1,61 +0,0 @@
-// This file is part of libigl, a simple c++ geometry processing library.
-// 
-// Copyright (C) 2013 Alec Jacobson <[email protected]>
-// 
-// This Source Code Form is subject to the terms of the Mozilla Public License 
-// v. 2.0. If a copy of the MPL was not distributed with this file, You can 
-// obtain one at http://mozilla.org/MPL/2.0/.
-#ifndef IGL_EMBREE_AMBIENT_OCCLUSION_H
-#define IGL_EMBREE_AMBIENT_OCCLUSION_H
-#include "../igl_inline.h"
-#include <Eigen/Core>
-namespace igl
-{
-  namespace embree
-  {
-    /// Compute ambient occlusion per given point
-    ///
-    /// @param[in] V  #V by 3 list of mesh vertex positiosn
-    /// @param[in] F  #F by 3 list of mesh triangle indices into rows of V
-    /// @param[in] P  #P by 3 list of origin points
-    /// @param[in] N  #P by 3 list of origin normals
-    /// @param[out] S  #P list of ambient occlusion values between 1 (fully occluded) and
-    ///      0 (not occluded)
-    template <
-      typename DerivedV,
-      typename DerivedF,
-      typename DerivedP,
-      typename DerivedN,
-      typename DerivedS >
-    IGL_INLINE void ambient_occlusion(
-      const Eigen::MatrixBase<DerivedV> & V,
-      const Eigen::MatrixBase<DerivedF> & F,
-      const Eigen::MatrixBase<DerivedP> & P,
-      const Eigen::MatrixBase<DerivedN> & N,
-      const int num_samples,
-      Eigen::PlainObjectBase<DerivedS> & S);
-    /// \overload 
-    /// \brief Wrapper which builds new EmbreeIntersector for (V,F). That's expensive so
-    /// avoid this if repeatedly calling.
-    ///
-    /// @param[in] ei  EmbreeIntersector containing (V,F)
-    ///
-    // Forward define
-    class EmbreeIntersector;
-    template <
-      typename DerivedP,
-      typename DerivedN,
-      typename DerivedS >
-    IGL_INLINE void ambient_occlusion(
-      const EmbreeIntersector & ei,
-      const Eigen::MatrixBase<DerivedP> & P,
-      const Eigen::MatrixBase<DerivedN> & N,
-      const int num_samples,
-      Eigen::PlainObjectBase<DerivedS> & S);
-  }
-};
-#ifndef IGL_STATIC_LIBRARY
-#  include "ambient_occlusion.cpp"
-#endif
-
-#endif

+ 0 - 45
include/igl/embree/bone_heat.h

@@ -1,45 +0,0 @@
-// This file is part of libigl, a simple c++ geometry processing library.
-//
-// Copyright (C) 2013 Alec Jacobson <[email protected]>
-//
-// This Source Code Form is subject to the terms of the Mozilla Public License
-// v. 2.0. If a copy of the MPL was not distributed with this file, You can
-// obtain one at http://mozilla.org/MPL/2.0/.
-#ifndef IGL_EMBREE_BONE_HEAT_H
-#define IGL_EMBREE_BONE_HEAT_H
-#include "../igl_inline.h"
-#include <Eigen/Core>
-
-namespace igl
-{
-  namespace embree
-  {
-    /// Compute skinning weights W given a surface mesh (V,F) and an
-    /// internal skeleton (C,BE) according to "Automatic Rigging" [Baran and
-    /// Popovic 2007].
-    ///
-    /// @param[in] V  #V by 3 list of mesh vertex positions
-    /// @param[in] F  #F by 3 list of mesh corner indices into V
-    /// @param[in] C  #C by 3 list of joint locations
-    /// @param[in] P  #P list of point handle indices into C
-    /// @param[in] BE  #BE by 2 list of bone edge indices into C
-    /// @param[in] CE  #CE by 2 list of cage edge indices into **P**
-    /// @param[out] W  #V by #P+#BE matrix of weights.
-    /// @return true only on success.
-    ///
-    IGL_INLINE bool bone_heat(
-      const Eigen::MatrixXd & V,
-      const Eigen::MatrixXi & F,
-      const Eigen::MatrixXd & C,
-      const Eigen::VectorXi & P,
-      const Eigen::MatrixXi & BE,
-      const Eigen::MatrixXi & CE,
-      Eigen::MatrixXd & W);
-  }
-};
-
-#ifndef IGL_STATIC_LIBRARY
-#  include "bone_heat.cpp"
-#endif
-
-#endif

+ 0 - 62
include/igl/embree/bone_visible.h

@@ -1,62 +0,0 @@
-// This file is part of libigl, a simple c++ geometry processing library.
-// 
-// Copyright (C) 2013 Alec Jacobson <[email protected]>
-// 
-// This Source Code Form is subject to the terms of the Mozilla Public License 
-// v. 2.0. If a copy of the MPL was not distributed with this file, You can 
-// obtain one at http://mozilla.org/MPL/2.0/.
-#ifndef IGL_EMBREE_BONE_VISIBLE_H
-#define IGL_EMBREE_BONE_VISIBLE_H
-#include "../igl_inline.h"
-#include <Eigen/Core>
-#include "EmbreeIntersector.h"
-namespace igl
-{
-  namespace embree
-  {
-    /// Test whether vertices of mesh are "visible" to a given bone,
-    /// where "visible" is defined as in [Baran & Popovic 07]. Instead of checking
-    /// whether each point can see *any* of the bone, we just check if each point
-    /// can see its own projection onto the bone segment. In other words, we project
-    /// each vertex v onto the bone, projv. Then we check if there are any
-    /// intersections between the line segment (projv-->v) and the mesh.
-    ///
-    /// @param[in] V  #V by 3 list of vertex positions
-    /// @param[in] F  #F by 3 list of triangle indices
-    /// @param[in] s  row vector of position of start end point of bone
-    /// @param[in] d  row vector of position of dest end point of bone
-    /// @param[out] flag  #V by 1 list of bools (true) visible, (false) obstructed
-    ///
-    /// \note This checks for hits along the segment which are facing in *any*
-    /// direction from the ray.
-    template <
-      typename DerivedV, 
-      typename DerivedF, 
-      typename DerivedSD,
-      typename Derivedflag>
-    IGL_INLINE void bone_visible(
-      const Eigen::PlainObjectBase<DerivedV> & V,
-      const Eigen::PlainObjectBase<DerivedF> & F,
-      const Eigen::PlainObjectBase<DerivedSD> & s,
-      const Eigen::PlainObjectBase<DerivedSD> & d,
-      Eigen::PlainObjectBase<Derivedflag>  & flag);
-    /// \overload
-    /// @param[in] ei  EmbreeIntersector for mesh (V,F) should be double sided
-    template <
-      typename DerivedV, 
-      typename DerivedF, 
-      typename DerivedSD,
-      typename Derivedflag>
-    IGL_INLINE void bone_visible(
-      const Eigen::PlainObjectBase<DerivedV> & V,
-      const Eigen::PlainObjectBase<DerivedF> & F,
-      const EmbreeIntersector & ei,
-      const Eigen::PlainObjectBase<DerivedSD> & s,
-      const Eigen::PlainObjectBase<DerivedSD> & d,
-      Eigen::PlainObjectBase<Derivedflag>  & flag);
-  }
-}
-#ifndef IGL_STATIC_LIBRARY
-#  include "bone_visible.cpp"
-#endif
-#endif

+ 0 - 49
include/igl/embree/line_mesh_intersection.h

@@ -1,49 +0,0 @@
-// This file is part of libigl, a simple c++ geometry processing library.
-// 
-// Copyright (C) 2013 Daniele Panozzo <[email protected]>
-// 
-// This Source Code Form is subject to the terms of the Mozilla Public License 
-// v. 2.0. If a copy of the MPL was not distributed with this file, You can 
-// obtain one at http://mozilla.org/MPL/2.0/.
-#ifndef IGL_EMBREE_LINE_MESH_INTERSECTION_H
-#define IGL_EMBREE_LINE_MESH_INTERSECTION_H
-#include "../igl_inline.h"
-
-#include <Eigen/Dense>
-#include <Eigen/Sparse>
-#include <vector>
-
-namespace igl 
-{
-  namespace embree
-  {
-    /// Project the point cloud V_source onto the triangle mesh
-    /// V_target,F_target. 
-    /// A ray is casted for every vertex in the direction specified by 
-    /// N_source and its opposite.
-    ///
-    /// @param[in] V_source: #Vx3 Vertices of the source mesh
-    /// @param[in] N_source: #Vx3 Normals of the point cloud
-    /// @param[in] V_target: #V2x3 Vertices of the target mesh
-    /// @param[in] F_target: #F2x3 Faces of the target mesh
-    ///
-    /// @return #Vx3 matrix of baricentric coordinate. Each row corresponds to 
-    /// a vertex of the projected mesh and it has the following format:
-    /// id b1 b2. id is the id of a face of the source mesh. b1 and b2 are 
-    /// the barycentric coordinates wrt the first two edges of the triangle
-    /// To convert to standard global coordinates, see barycentric_to_global.h
-    template <typename ScalarMatrix, typename IndexMatrix>
-    IGL_INLINE ScalarMatrix line_mesh_intersection
-    (
-     const ScalarMatrix & V_source,
-     const ScalarMatrix  & N_source,
-     const ScalarMatrix & V_target,
-     const IndexMatrix  & F_target
-     );
-  }
-}
-#ifndef IGL_STATIC_LIBRARY
-#  include "line_mesh_intersection.cpp"
-#endif
-
-#endif

+ 0 - 71
include/igl/embree/reorient_facets_raycast.h

@@ -1,71 +0,0 @@
-// This file is part of libigl, a simple c++ geometry processing library.
-// 
-// Copyright (C) 2013 Alec Jacobson <[email protected]>
-// 
-// This Source Code Form is subject to the terms of the Mozilla Public License 
-// v. 2.0. If a copy of the MPL was not distributed with this file, You can 
-// obtain one at http://mozilla.org/MPL/2.0/.
-#ifndef IGL_EMBREE_REORIENT_FACETS_RAYCAST_H
-#define IGL_EMBREE_REORIENT_FACETS_RAYCAST_H
-#include "../igl_inline.h"
-#include <Eigen/Core>
-namespace igl
-{
-  namespace embree
-  {
-    /// Orient each component (identified by C) of a mesh (V,F) using ambient
-    /// occlusion such that the front side is less occluded than back side, as
-    /// described in "A Simple Method for Correcting Facet Orientations in
-    /// Polygon Meshes Based on Ray Casting" [Takayama et al. 2014].
-    ///
-    /// @param[in] V  #V by 3 list of vertex positions
-    /// @param[in] F  #F by 3 list of triangle indices
-    /// @param[in] rays_total  Total number of rays that will be shot
-    /// @param[in] rays_minimum  Minimum number of rays that each patch should receive
-    /// @param[in] facet_wise  Decision made for each face independently, no use of patches
-    ///     (i.e., each face is treated as a patch)
-    /// @param[in] use_parity  Use parity mode
-    /// @param[in] is_verbose  Verbose output to cout
-    /// @param[out] I  #F list of whether face has been flipped
-    /// @param[out] C  #F list of patch ID (output of bfs_orient > manifold patches)
-    template <
-      typename DerivedV, 
-      typename DerivedF, 
-      typename DerivedI,
-      typename DerivedC>
-    IGL_INLINE void reorient_facets_raycast(
-      const Eigen::PlainObjectBase<DerivedV> & V,
-      const Eigen::PlainObjectBase<DerivedF> & F,
-      int rays_total,
-      int rays_minimum,
-      bool facet_wise,
-      bool use_parity,
-      bool is_verbose,
-      Eigen::PlainObjectBase<DerivedI> & I,
-      Eigen::PlainObjectBase<DerivedC> & C);
-    /// @param[out]  FF  #F by 3 list of reoriented faces
-    ///
-    /// #### Defaults:
-    ///      rays_total = F.rows()*100;
-    ///      rays_minimum = 10;
-    ///      facet_wise = false;
-    ///      use_parity = false;
-    ///      is_verbose = false;
-    template <
-      typename DerivedV, 
-      typename DerivedF, 
-      typename DerivedFF,
-      typename DerivedI>
-    IGL_INLINE void reorient_facets_raycast(
-      const Eigen::PlainObjectBase<DerivedV> & V,
-      const Eigen::PlainObjectBase<DerivedF> & F,
-      Eigen::PlainObjectBase<DerivedFF> & FF,
-      Eigen::PlainObjectBase<DerivedI> & I);
-  }
-};
-
-#ifndef IGL_STATIC_LIBRARY
-#  include "reorient_facets_raycast.cpp"
-#endif
-
-#endif

+ 0 - 61
include/igl/embree/shape_diameter_function.h

@@ -1,61 +0,0 @@
-// This file is part of libigl, a simple c++ geometry processing library.
-// 
-// Copyright (C) 2013 Alec Jacobson <[email protected]>
-// 
-// This Source Code Form is subject to the terms of the Mozilla Public License 
-// v. 2.0. If a copy of the MPL was not distributed with this file, You can 
-// obtain one at http://mozilla.org/MPL/2.0/.
-#ifndef IGL_EMBREE_SHAPE_DIAMETER_FUNCTION_H
-#define IGL_EMBREE_SHAPE_DIAMETER_FUNCTION_H
-#include "../igl_inline.h"
-#include <Eigen/Core>
-namespace igl
-{
-  namespace embree
-  {
-    // Forward define
-    class EmbreeIntersector;
-    /// Compute shape diamter function per given point
-    ///
-    /// @param[in] ei  EmbreeIntersector containing (V,F)
-    /// @param[in] P  #P by 3 list of origin points
-    /// @param[in] N  #P by 3 list of origin normals
-    /// @param[out] S  #P list of shape diamater function values between bounding box
-    ///    diagonal (perfect sphere) and 0 (perfect needle hook)
-    ///
-    template <
-      typename DerivedP,
-      typename DerivedN,
-      typename DerivedS >
-    IGL_INLINE void shape_diameter_function(
-      const EmbreeIntersector & ei,
-      const Eigen::PlainObjectBase<DerivedP> & P,
-      const Eigen::PlainObjectBase<DerivedN> & N,
-      const int num_samples,
-      Eigen::PlainObjectBase<DerivedS> & S);
-    /// \overload
-    /// \brief Wrapper which builds new EmbreeIntersector for (V,F). That's expensive so
-    /// avoid this if repeatedly calling.
-    /// @param[in] V  #V by 3 list of mesh vertex positiosn
-    /// @param[in] F  #F by 3 list of mesh triangle indices into rows of V
-    template <
-      typename DerivedV,
-      typename DerivedF,
-      typename DerivedP,
-      typename DerivedN,
-      typename DerivedS >
-    IGL_INLINE void shape_diameter_function(
-      const Eigen::PlainObjectBase<DerivedV> & V,
-      const Eigen::PlainObjectBase<DerivedF> & F,
-      const Eigen::PlainObjectBase<DerivedP> & P,
-      const Eigen::PlainObjectBase<DerivedN> & N,
-      const int num_samples,
-      Eigen::PlainObjectBase<DerivedS> & S);
-  }
-};
-#ifndef IGL_STATIC_LIBRARY
-#  include "shape_diameter_function.cpp"
-#endif
-
-#endif
-

+ 0 - 71
include/igl/embree/unproject_in_mesh.h

@@ -1,71 +0,0 @@
-// This file is part of libigl, a simple c++ geometry processing library.
-//
-// Copyright (C) 2013 Alec Jacobson <[email protected]>
-//
-// This Source Code Form is subject to the terms of the Mozilla Public License
-// v. 2.0. If a copy of the MPL was not distributed with this file, You can
-// obtain one at http://mozilla.org/MPL/2.0/.
-#ifndef IGL_EMBREE_UNPROJECT_IN_MESH
-#define IGL_EMBREE_UNPROJECT_IN_MESH
-#include "../igl_inline.h"
-#include <Eigen/Core>
-
-#include <vector>
-#include "../Hit.h"
-
-namespace igl
-{
-  namespace embree
-  {
-    // Forward define
-    class EmbreeIntersector;
-  
-    /// Unproject a screen location (using current opengl viewport, projection, and
-    /// model view) to a 3D position _inside_ a given mesh. If the ray through the
-    /// given screen location (x,y) _hits_ the mesh more than twice then the 3D
-    /// midpoint between the first two hits is return. If it hits once, then that
-    /// point is return. If it does not hit the mesh then obj is not set.
-    ///
-    ///
-    /// @param[in] pos        screen space coordinates
-    /// @param[in] model      model matrix
-    /// @param[in] proj       projection matrix
-    /// @param[in] viewport   vieweport vector
-    /// @param[in] ei         EmbreeIntersector containing (V,F)
-    /// @param[out] obj        3d unprojected mouse point in mesh
-    /// @param[out] hits       vector of embree hits
-    /// @return number of hits
-    ///
-    /// \note Previous prototype did not require model, proj, and viewport. This
-    /// has been removed. Instead replace with:
-    ///
-    ///      Eigen::Matrix4f model,proj;
-    ///      Eigen::Vector4f viewport;
-    ///      igl::opengl2::model_proj_viewport(model,proj,viewport);
-    ///      igl::embree::unproject_in_mesh(Vector2f(x,y),model,proj,viewport,ei,obj,hits);
-    ///
-    template < typename Derivedobj>
-    IGL_INLINE int unproject_in_mesh(
-      const Eigen::Vector2f& pos,
-      const Eigen::Matrix4f& model,
-      const Eigen::Matrix4f& proj,
-      const Eigen::Vector4f& viewport,
-      const EmbreeIntersector & ei,
-      Eigen::PlainObjectBase<Derivedobj> & obj,
-      std::vector<igl::Hit > & hits);
-    /// \overload
-    template < typename Derivedobj>
-    IGL_INLINE int unproject_in_mesh(
-      const Eigen::Vector2f& pos,
-      const Eigen::Matrix4f& model,
-      const Eigen::Matrix4f& proj,
-      const Eigen::Vector4f& viewport,
-      const EmbreeIntersector & ei,
-      Eigen::PlainObjectBase<Derivedobj> & obj);
-
-  }
-}
-#ifndef IGL_STATIC_LIBRARY
-#  include "unproject_in_mesh.cpp"
-#endif
-#endif

+ 0 - 58
include/igl/embree/unproject_onto_mesh.h

@@ -1,58 +0,0 @@
-// This file is part of libigl, a simple c++ geometry processing library.
-//
-// Copyright (C) 2014 Daniele Panozzo <[email protected]>
-//
-// This Source Code Form is subject to the terms of the Mozilla Public License
-// v. 2.0. If a copy of the MPL was not distributed with this file, You can
-// obtain one at http://mozilla.org/MPL/2.0/.
-#ifndef IGL_EMBREE_UNPROJECT_ONTO_MESH_H
-#define IGL_EMBREE_UNPROJECT_ONTO_MESH_H
-#include "../igl_inline.h"
-#include <Eigen/Core>
-
-#include <vector>
-
-namespace igl
-{
-  namespace embree
-  {
-    // Forward define
-    class EmbreeIntersector;
-    /// Unproject a screen location (using the given model, proj and viewport) to find
-    /// the first hit on a mesh.
-    ///
-    /// @param[in] pos        screen space coordinates
-    /// @param[in] F          #F by 3 face matrix
-    /// @param[in] model      model matrix
-    /// @param[in] proj       projection matrix
-    /// @param[in] viewport   vieweport vector
-    /// @param[in] ei         EmbreeIntersector containing (V,F)
-    /// @param[out] fid        id of the first face hit
-    /// @param[out] bc         barycentric coordinates of hit
-    /// @return true if there is a hit
-    IGL_INLINE bool unproject_onto_mesh(
-      const Eigen::Vector2f& pos,
-      const Eigen::MatrixXi& F,
-      const Eigen::Matrix4f& model,
-      const Eigen::Matrix4f& proj,
-      const Eigen::Vector4f& viewport,
-      const EmbreeIntersector & ei,
-      int& fid,
-      Eigen::Vector3f& bc);
-    /// \overload
-    /// @param[in] vid        vertex id of the closest vertex hit
-    IGL_INLINE bool unproject_onto_mesh(
-      const Eigen::Vector2f& pos,
-      const Eigen::MatrixXi& F,
-      const Eigen::Matrix4f& model,
-      const Eigen::Matrix4f& proj,
-      const Eigen::Vector4f& viewport,
-      const EmbreeIntersector & ei,
-      int& fid,
-      int& vid);
-  }
-}
-#ifndef IGL_STATIC_LIBRARY
-#  include "unproject_onto_mesh.cpp"
-#endif
-#endif

+ 232 - 0
include/igl/list_to_matrix.cpp

@@ -0,0 +1,232 @@
+// This file is part of libigl, a simple c++ geometry processing library.
+//
+// Copyright (C) 2013 Alec Jacobson <[email protected]>
+//
+// This Source Code Form is subject to the terms of the Mozilla Public License
+// v. 2.0. If a copy of the MPL was not distributed with this file, You can
+// obtain one at http://mozilla.org/MPL/2.0/.
+#include "list_to_matrix.h"
+
+#include <cassert>
+#include <cstdio>
+
+#include <Eigen/Dense>
+
+#include "max_size.h"
+#include "min_size.h"
+
+template <typename T, typename Derived>
+IGL_INLINE bool igl::list_to_matrix(const std::vector<std::vector<T > > & V,Eigen::PlainObjectBase<Derived>& M)
+{
+  // number of rows
+  int m = V.size();
+  if(m == 0)
+  {
+    M.resize(
+            Derived::RowsAtCompileTime>=0?Derived::RowsAtCompileTime:0
+            ,
+            Derived::ColsAtCompileTime>=0?Derived::ColsAtCompileTime:0
+            );
+    return true;
+  }
+  // number of columns
+  int n = igl::min_size(V);
+  if(n != igl::max_size(V))
+  {
+    return false;
+  }
+  assert(n != -1);
+  // Resize output
+  M.resize(m,n);
+
+  // Loop over rows
+  for(int i = 0;i<m;i++)
+  {
+    // Loop over cols
+    for(int j = 0;j<n;j++)
+    {
+      M(i,j) = V[i][j];
+    }
+  }
+
+  return true;
+}
+
+template <typename T, size_t N, typename Derived>
+IGL_INLINE bool igl::list_to_matrix(const std::vector<std::array<T, N> > & V,Eigen::PlainObjectBase<Derived>& M)
+{
+  // number of rows
+  int m = V.size();
+  if(m == 0)
+  {
+    M.resize(
+            Derived::RowsAtCompileTime>=0?Derived::RowsAtCompileTime:0
+            ,
+            Derived::ColsAtCompileTime>=0?Derived::ColsAtCompileTime:0
+            );
+    return true;
+  }
+  // number of columns
+  int n = static_cast<int>(N);
+  assert(n != -1);
+  // Resize output
+  M.resize(m,n);
+
+  // Loop over rows
+  for(int i = 0;i<m;i++)
+  {
+    // Loop over cols
+    for(int j = 0;j<n;j++)
+    {
+      M(i,j) = V[i][j];
+    }
+  }
+
+  return true;
+}
+
+template <typename T, typename Derived>
+IGL_INLINE bool igl::list_to_matrix(
+  const std::vector<std::vector<T > > & V,
+  const int n,
+  const T & padding,
+  Eigen::PlainObjectBase<Derived>& M)
+{
+  const int m = V.size();
+  M.resize(m,n);
+  for(int i = 0;i<m;i++)
+  {
+    const auto & row = V[i];
+    if(row.size()>n)
+    {
+      return false;
+    }
+    int j = 0;
+    for(;j<row.size();j++)
+    {
+      M(i,j) = row[j];
+    }
+    for(;j<n;j++)
+    {
+      M(i,j) = padding;
+    }
+  }
+  return true;
+}
+
+template <typename T, typename Derived>
+IGL_INLINE bool igl::list_to_matrix(const std::vector<T > & V,Eigen::PlainObjectBase<Derived>& M)
+{
+  // number of rows
+  int m = V.size();
+  if(m == 0)
+  {
+    //fprintf(stderr,"Error: list_to_matrix() list is empty()\n");
+    //return false;
+    if(Derived::ColsAtCompileTime == 1)
+    {
+      M.resize(0,1);
+    }else if(Derived::RowsAtCompileTime == 1)
+    {
+      M.resize(1,0);
+    }else
+    {
+      M.resize(0,0);
+    }
+    return true;
+  }
+  // Resize output
+  if(Derived::RowsAtCompileTime == 1)
+  {
+    M.resize(1,m);
+  }else
+  {
+    M.resize(m,1);
+  }
+
+  // Loop over rows
+  for(int i = 0;i<m;i++)
+  {
+    M(i) = V[i];
+  }
+
+  return true;
+}
+
+#ifdef IGL_STATIC_LIBRARY
+// Explicit template instantiation
+// generated by autoexplicit.sh
+template bool igl::list_to_matrix<int, Eigen::Matrix<unsigned int, -1, 3, 1, -1, 3> >(std::vector<std::vector<int, std::allocator<int> >, std::allocator<std::vector<int, std::allocator<int> > > > const&, Eigen::PlainObjectBase<Eigen::Matrix<unsigned int, -1, 3, 1, -1, 3> >&);
+// generated by autoexplicit.sh
+template bool igl::list_to_matrix<double, Eigen::Matrix<float, -1, -1, 0, -1, -1> >(std::vector<std::vector<double, std::allocator<double> >, std::allocator<std::vector<double, std::allocator<double> > > > const&, Eigen::PlainObjectBase<Eigen::Matrix<float, -1, -1, 0, -1, -1> >&);
+// generated by autoexplicit.sh
+template bool igl::list_to_matrix<double, Eigen::Matrix<float, -1, 2, 1, -1, 2> >(std::vector<std::vector<double, std::allocator<double> >, std::allocator<std::vector<double, std::allocator<double> > > > const&, Eigen::PlainObjectBase<Eigen::Matrix<float, -1, 2, 1, -1, 2> >&);
+// generated by autoexplicit.sh
+template bool igl::list_to_matrix<double, Eigen::Matrix<float, -1, 3, 0, -1, 3> >(std::vector<std::vector<double, std::allocator<double> >, std::allocator<std::vector<double, std::allocator<double> > > > const&, Eigen::PlainObjectBase<Eigen::Matrix<float, -1, 3, 0, -1, 3> >&);
+// generated by autoexplicit.sh
+// generated by autoexplicit.sh
+// generated by autoexplicit.sh
+template bool igl::list_to_matrix<long, Eigen::Matrix<int, -1, -1, 0, -1, -1> >(std::vector<std::vector<long, std::allocator<long> >, std::allocator<std::vector<long, std::allocator<long> > > > const&, Eigen::PlainObjectBase<Eigen::Matrix<int, -1, -1, 0, -1, -1> >&);
+// generated by autoexplicit.sh
+template bool igl::list_to_matrix<bool, Eigen::Array<bool, -1, 3, 0, -1, 3> >(std::vector<std::vector<bool, std::allocator<bool> >, std::allocator<std::vector<bool, std::allocator<bool> > > > const&, Eigen::PlainObjectBase<Eigen::Array<bool, -1, 3, 0, -1, 3> >&);
+// generated by autoexplicit.sh
+template bool igl::list_to_matrix<double, Eigen::Matrix<double, -1, -1, 1, -1, -1> >(std::vector<std::vector<double, std::allocator<double> >, std::allocator<std::vector<double, std::allocator<double> > > > const&, Eigen::PlainObjectBase<Eigen::Matrix<double, -1, -1, 1, -1, -1> >&);
+// generated by autoexplicit.sh
+template bool igl::list_to_matrix<int, Eigen::Matrix<int, -1, 2, 0, -1, 2> >(std::vector<std::vector<int, std::allocator<int> >, std::allocator<std::vector<int, std::allocator<int> > > > const&, Eigen::PlainObjectBase<Eigen::Matrix<int, -1, 2, 0, -1, 2> >&);
+// generated by autoexplicit.sh
+template bool igl::list_to_matrix<double, Eigen::Matrix<double, -1, 2, 0, -1, 2> >(std::vector<std::vector<double, std::allocator<double> >, std::allocator<std::vector<double, std::allocator<double> > > > const&, Eigen::PlainObjectBase<Eigen::Matrix<double, -1, 2, 0, -1, 2> >&);
+// generated by autoexplicit.sh
+template bool igl::list_to_matrix<double, Eigen::Matrix<double, 4, 1, 0, 4, 1> >(std::vector<double, std::allocator<double> > const&, Eigen::PlainObjectBase<Eigen::Matrix<double, 4, 1, 0, 4, 1> >&);
+// generated by autoexplicit.sh
+template bool igl::list_to_matrix<double, Eigen::Matrix<double, 3, 1, 0, 3, 1> >(std::vector<double, std::allocator<double> > const&, Eigen::PlainObjectBase<Eigen::Matrix<double, 3, 1, 0, 3, 1> >&);
+// generated by autoexplicit.sh
+template bool igl::list_to_matrix<double, Eigen::Matrix<double, 2, 1, 0, 2, 1> >(std::vector<double, std::allocator<double> > const&, Eigen::PlainObjectBase<Eigen::Matrix<double, 2, 1, 0, 2, 1> >&);
+template bool igl::list_to_matrix<double, Eigen::Matrix<double, -1, 3, 0, -1, 3> >(std::vector<std::vector<double, std::allocator<double> >, std::allocator<std::vector<double, std::allocator<double> > > > const&, Eigen::PlainObjectBase<Eigen::Matrix<double, -1, 3, 0, -1, 3> >&);
+template bool igl::list_to_matrix<double, Eigen::Matrix<double, -1, 3, 1, -1, 3> >(std::vector<std::vector<double, std::allocator<double> >, std::allocator<std::vector<double, std::allocator<double> > > > const&, Eigen::PlainObjectBase<Eigen::Matrix<double, -1, 3, 1, -1, 3> >&);
+template bool igl::list_to_matrix<double, Eigen::Matrix<double, -1, -1, 0, -1, -1> >(std::vector<std::vector<double, std::allocator<double> >, std::allocator<std::vector<double, std::allocator<double> > > > const&, Eigen::PlainObjectBase<Eigen::Matrix<double, -1, -1, 0, -1, -1> >&);
+template bool igl::list_to_matrix<int, Eigen::Matrix<int, -1, 3, 0, -1, 3> >(std::vector<std::vector<int, std::allocator<int> >, std::allocator<std::vector<int, std::allocator<int> > > > const&, Eigen::PlainObjectBase<Eigen::Matrix<int, -1, 3, 0, -1, 3> >&);
+template bool igl::list_to_matrix<int, Eigen::Matrix<int, -1, -1, 0, -1, -1> >(std::vector<std::vector<int, std::allocator<int> >, std::allocator<std::vector<int, std::allocator<int> > > > const&, Eigen::PlainObjectBase<Eigen::Matrix<int, -1, -1, 0, -1, -1> >&);
+template bool igl::list_to_matrix<int, Eigen::Matrix<unsigned int, -1, -1, 1, -1, -1> >(std::vector<std::vector<int, std::allocator<int> >, std::allocator<std::vector<int, std::allocator<int> > > > const&, Eigen::PlainObjectBase<Eigen::Matrix<unsigned int, -1, -1, 1, -1, -1> >&);
+template bool igl::list_to_matrix<double, Eigen::Matrix<float, -1, 3, 1, -1, 3> >(std::vector<std::vector<double, std::allocator<double> >, std::allocator<std::vector<double, std::allocator<double> > > > const&, Eigen::PlainObjectBase<Eigen::Matrix<float, -1, 3, 1, -1, 3> >&);
+template bool igl::list_to_matrix<float, Eigen::Matrix<float, -1, 3, 1, -1, 3> >(std::vector<std::vector<float, std::allocator<float> >, std::allocator<std::vector<float, std::allocator<float> > > > const&, Eigen::PlainObjectBase<Eigen::Matrix<float, -1, 3, 1, -1, 3> >&);
+template bool igl::list_to_matrix<unsigned int, Eigen::Matrix<unsigned int, -1, 3, 1, -1, 3> >(std::vector<std::vector<unsigned int, std::allocator<unsigned int> >, std::allocator<std::vector<unsigned int, std::allocator<unsigned int> > > > const&, Eigen::PlainObjectBase<Eigen::Matrix<unsigned int, -1, 3, 1, -1, 3> >&);
+template bool igl::list_to_matrix<int, Eigen::Matrix<int, -1, 1, 0, -1, 1> >(std::vector<int, std::allocator<int> > const&, Eigen::PlainObjectBase<Eigen::Matrix<int, -1, 1, 0, -1, 1> >&);
+template bool igl::list_to_matrix<unsigned long, Eigen::Matrix<int, -1, 1, 0, -1, 1> >(std::vector<unsigned long, std::allocator<unsigned long> > const&, Eigen::PlainObjectBase<Eigen::Matrix<int, -1, 1, 0, -1, 1> >&);
+template bool igl::list_to_matrix<float, Eigen::Matrix<float, -1, -1, 0, -1, -1> >(std::vector<std::vector<float, std::allocator<float> >, std::allocator<std::vector<float, std::allocator<float> > > > const&, Eigen::PlainObjectBase<Eigen::Matrix<float, -1, -1, 0, -1, -1> >&);
+template bool igl::list_to_matrix<bool, Eigen::Array<bool, -1, 1, 0, -1, 1> >(std::vector<bool, std::allocator<bool> > const&, Eigen::PlainObjectBase<Eigen::Array<bool, -1, 1, 0, -1, 1> >&);
+template bool igl::list_to_matrix<bool, Eigen::Array<bool, -1, -1, 0, -1, -1> >(std::vector<std::vector<bool, std::allocator<bool> >, std::allocator<std::vector<bool, std::allocator<bool> > > > const&, Eigen::PlainObjectBase<Eigen::Array<bool, -1, -1, 0, -1, -1> >&);
+template bool igl::list_to_matrix<bool, Eigen::Matrix<int, -1, -1, 0, -1, -1> >(std::vector<bool, std::allocator<bool> > const&, Eigen::PlainObjectBase<Eigen::Matrix<int, -1, -1, 0, -1, -1> >&);
+template bool igl::list_to_matrix<bool, Eigen::Matrix<int, -1, -1, 0, -1, -1> >(std::vector<std::vector<bool, std::allocator<bool> >, std::allocator<std::vector<bool, std::allocator<bool> > > > const&, Eigen::PlainObjectBase<Eigen::Matrix<int, -1, -1, 0, -1, -1> >&);
+template bool igl::list_to_matrix<double, Eigen::Matrix<double, -1, 1, 0, -1, 1> >(std::vector<double, std::allocator<double> > const&, Eigen::PlainObjectBase<Eigen::Matrix<double, -1, 1, 0, -1, 1> >&);
+template bool igl::list_to_matrix<double, Eigen::Matrix<double, -1, -1, 0, -1, -1> >(std::vector<double, std::allocator<double> > const&, Eigen::PlainObjectBase<Eigen::Matrix<double, -1, -1, 0, -1, -1> >&);
+template bool igl::list_to_matrix<int, Eigen::Matrix<int, -1, -1, 0, -1, -1> >(std::vector<int, std::allocator<int> > const&, Eigen::PlainObjectBase<Eigen::Matrix<int, -1, -1, 0, -1, -1> >&);
+template bool igl::list_to_matrix<unsigned long, Eigen::Matrix<int, -1, -1, 0, -1, -1> >(std::vector<unsigned long, std::allocator<unsigned long> > const&, Eigen::PlainObjectBase<Eigen::Matrix<int, -1, -1, 0, -1, -1> >&);
+template bool igl::list_to_matrix<int, Eigen::Matrix<int, -1, 3, 1, -1, 3> >(std::vector<std::vector<int, std::allocator<int> >, std::allocator<std::vector<int, std::allocator<int> > > > const&, Eigen::PlainObjectBase<Eigen::Matrix<int, -1, 3, 1, -1, 3> >&);
+template bool igl::list_to_matrix<unsigned long, Eigen::Matrix<long, -1, 1, 0, -1, 1> >(std::vector<unsigned long, std::allocator<unsigned long> > const&, Eigen::PlainObjectBase<Eigen::Matrix<long, -1, 1, 0, -1, 1> >&);
+template bool igl::list_to_matrix<bool, Eigen::Matrix<bool, -1, 1, 0, -1, 1> >(std::vector<bool, std::allocator<bool> > const&, Eigen::PlainObjectBase<Eigen::Matrix<bool, -1, 1, 0, -1, 1> >&);
+
+template bool igl::list_to_matrix<double, 3ul, Eigen::Matrix<double, -1, -1, 0, -1, -1> >(std::vector<std::array<double, 3ul>, std::allocator<std::array<double, 3ul> > > const&, Eigen::PlainObjectBase<Eigen::Matrix<double, -1, -1, 0, -1, -1> >&);
+template bool igl::list_to_matrix<double, 3ul, Eigen::Matrix<double, -1, -1, 1, -1, -1> >(std::vector<std::array<double, 3ul>, std::allocator<std::array<double, 3ul> > > const&, Eigen::PlainObjectBase<Eigen::Matrix<double, -1, -1, 1, -1, -1> >&);
+template bool igl::list_to_matrix<double, 3ul, Eigen::Matrix<double, -1, 3, 0, -1, 3> >(std::vector<std::array<double, 3ul>, std::allocator<std::array<double, 3ul> > > const&, Eigen::PlainObjectBase<Eigen::Matrix<double, -1, 3, 0, -1, 3> >&);
+template bool igl::list_to_matrix<double, 3ul, Eigen::Matrix<double, -1, 3, 1, -1, 3> >(std::vector<std::array<double, 3ul>, std::allocator<std::array<double, 3ul> > > const&, Eigen::PlainObjectBase<Eigen::Matrix<double, -1, 3, 1, -1, 3> >&);
+template bool igl::list_to_matrix<float, 3ul, Eigen::Matrix<float, -1, -1, 0, -1, -1> >(std::vector<std::array<float, 3ul>, std::allocator<std::array<float, 3ul> > > const&, Eigen::PlainObjectBase<Eigen::Matrix<float, -1, -1, 0, -1, -1> >&);
+template bool igl::list_to_matrix<float, 3ul, Eigen::Matrix<float, -1, 3, 0, -1, 3> >(std::vector<std::array<float, 3ul>, std::allocator<std::array<float, 3ul> > > const&, Eigen::PlainObjectBase<Eigen::Matrix<float, -1, 3, 0, -1, 3> >&);
+template bool igl::list_to_matrix<float, 3ul, Eigen::Matrix<float, -1, 3, 1, -1, 3> >(std::vector<std::array<float, 3ul>, std::allocator<std::array<float, 3ul> > > const&, Eigen::PlainObjectBase<Eigen::Matrix<float, -1, 3, 1, -1, 3> >&);
+template bool igl::list_to_matrix<int, 3ul, Eigen::Matrix<int, -1, -1, 0, -1, -1> >(std::vector<std::array<int, 3ul>, std::allocator<std::array<int, 3ul> > > const&, Eigen::PlainObjectBase<Eigen::Matrix<int, -1, -1, 0, -1, -1> >&);
+template bool igl::list_to_matrix<int, 3ul, Eigen::Matrix<int, -1, 3, 0, -1, 3> >(std::vector<std::array<int, 3ul>, std::allocator<std::array<int, 3ul> > > const&, Eigen::PlainObjectBase<Eigen::Matrix<int, -1, 3, 0, -1, 3> >&);
+template bool igl::list_to_matrix<int, 3ul, Eigen::Matrix<int, -1, 3, 1, -1, 3> >(std::vector<std::array<int, 3ul>, std::allocator<std::array<int, 3ul> > > const&, Eigen::PlainObjectBase<Eigen::Matrix<int, -1, 3, 1, -1, 3> >&);
+template bool igl::list_to_matrix<unsigned int, 3ul, Eigen::Matrix<unsigned int, -1, 3, 1, -1, 3> >(std::vector<std::array<unsigned int, 3ul>, std::allocator<std::array<unsigned int, 3ul> > > const&, Eigen::PlainObjectBase<Eigen::Matrix<unsigned int, -1, 3, 1, -1, 3> >&);
+
+#ifdef WIN32
+template bool igl::list_to_matrix<double, Eigen::Matrix<double, -1, -1, 0, -1, -1> >(std::vector<double, std::allocator<double> > const&, Eigen::PlainObjectBase<Eigen::Matrix<double, -1, -1, 0, -1, -1> >&);
+template bool igl::list_to_matrix<double, Eigen::Matrix<double, -1, -1, 0, -1, -1> >(std::vector<double, std::allocator<double> > const&, Eigen::PlainObjectBase<Eigen::Matrix<double, -1, -1, 0, -1, -1> >&);
+template bool igl::list_to_matrix<double, Eigen::Matrix<double, -1, -1, 0, -1, -1> >(std::vector<double, std::allocator<double> > const&, Eigen::PlainObjectBase<Eigen::Matrix<double, -1, -1, 0, -1, -1> >&);
+template bool igl::list_to_matrix<double, Eigen::Matrix<double, -1, -1, 0, -1, -1> >(std::vector<double, std::allocator<double> > const&, Eigen::PlainObjectBase<Eigen::Matrix<double, -1, -1, 0, -1, -1> >&);
+template bool igl::list_to_matrix<unsigned __int64, class Eigen::Matrix<int, -1, -1, 0, -1, -1> >(class std::vector<unsigned __int64, class std::allocator<unsigned __int64> > const &, class Eigen::PlainObjectBase<class Eigen::Matrix<int, -1, -1, 0, -1, -1> > &);
+template bool igl::list_to_matrix<unsigned __int64,class Eigen::Matrix<__int64,-1,1,0,-1,1> >(class std::vector<unsigned __int64,class std::allocator<unsigned __int64> > const &,class Eigen::PlainObjectBase<class Eigen::Matrix<__int64,-1,1,0,-1,1> > &);
+template bool igl::list_to_matrix<unsigned __int64,class Eigen::Matrix<long,-1,1,0,-1,1> >(class std::vector<unsigned __int64,class std::allocator<unsigned __int64> > const &,class Eigen::PlainObjectBase<class Eigen::Matrix<long,-1,1,0,-1,1> > &);
+template bool igl::list_to_matrix<unsigned long long,class Eigen::Matrix<int,-1,1,0,-1,1> >(class std::vector<unsigned long long,class std::allocator<unsigned long long> > const &,class Eigen::PlainObjectBase<class Eigen::Matrix<int,-1,1,0,-1,1> > &);
+template bool igl::list_to_matrix<unsigned long, Eigen::Matrix<int, -1, -1, 0, -1, -1> >(std::vector<unsigned long, std::allocator<unsigned long> > const&, Eigen::PlainObjectBase<Eigen::Matrix<int, -1, -1, 0, -1, -1> >&);
+template bool igl::list_to_matrix<__int64,class Eigen::Matrix<int,-1,-1,0,-1,-1> >(class std::vector<class std::vector<__int64,class std::allocator<__int64> >,class std::allocator<class std::vector<__int64,class std::allocator<__int64> > > > const &,class Eigen::PlainObjectBase<class Eigen::Matrix<int,-1,-1,0,-1,-1> > &);
+#endif
+#endif

+ 0 - 581
include/igl/matlab/MatlabWorkspace.h

@@ -1,581 +0,0 @@
-// This file is part of libigl, a simple c++ geometry processing library.
-// 
-// Copyright (C) 2013 Alec Jacobson <[email protected]>
-// 
-// This Source Code Form is subject to the terms of the Mozilla Public License 
-// v. 2.0. If a copy of the MPL was not distributed with this file, You can 
-// obtain one at http://mozilla.org/MPL/2.0/.
-#ifndef IGL_MATLAB_MATLAB_WORKSPACE_H
-#define IGL_MATLAB_MATLAB_WORKSPACE_H
-
-#include <Eigen/Dense>
-#include <Eigen/Sparse>
-
-#include <mat.h>
-
-#include <string>
-#include <vector>
-
-namespace igl
-{
-  namespace matlab
-  {
-    /// Class which contains data of a matlab workspace which can be written to a
-    /// .mat file and loaded from matlab
-    /// 
-    /// This depends on matlab at compile time (though it shouldn't necessarily
-    /// have to) but it does not depend on running the matlab engine at run-time.
-    ///
-    /// \bug Treats all matrices as doubles (this may actually be desired
-    /// for some "index" matrices since matlab's sparse command takes doubles
-    /// rather than int class matrices). It is of course not desired when dealing
-    /// with logicals or uint's for images.
-    ///
-    class MatlabWorkspace
-    {
-      private:
-        /// List of names
-        /// \bug Why not use a map? Any reason to allow duplicate names?
-        std::vector<std::string> names;
-        /// List of data pointers
-        std::vector<mxArray*> data;
-      public:
-        MatlabWorkspace();
-        ~MatlabWorkspace();
-        /// Clear names and data of variables in workspace
-        inline void clear();
-        /// Save current list of variables
-        ///
-        /// @param[in] path  path to .mat file
-        /// @return true on success, false on failure
-        inline bool write(const std::string & path) const;
-        /// Load list of variables from .mat file
-        ///
-        /// @param[in] path  path to .mat file
-        /// @return true on success, false on failure
-        inline bool read(const std::string & path);
-        /// Assign data to a variable name in the workspace
-        ///
-        /// @tparam DerivedM  eigen matrix (e.g. MatrixXd)
-        /// @param[in] M  data (usually a matrix)
-        /// @param[in] name  variable name to save into work space
-        /// @return true on success, false on failure
-        ///
-        /// \bug Assumes DerivedM is using column major ordering
-        template <typename DerivedM>
-        inline MatlabWorkspace& save(
-          const Eigen::PlainObjectBase<DerivedM>& M,
-          const std::string & name);
-        /// \overload
-        /// @tparam MT  sparse matrix type (e.g. double)
-        template <typename MT>
-        inline MatlabWorkspace& save(
-          const Eigen::SparseMatrix<MT>& M,
-          const std::string & name);
-        /// \overload
-        /// @tparam ScalarM scalar type, e.g. double
-        template <typename ScalarM>
-        inline MatlabWorkspace& save(
-          const std::vector<std::vector<ScalarM> > & vM,
-          const std::string & name);
-        /// \overload
-        /// @tparam ScalarV  scalar type, e.g. double
-        template <typename ScalarV>
-        inline MatlabWorkspace& save(
-          const std::vector<ScalarV> & vV,
-          const std::string & name);
-        ///  @tparam Q  quaternion type
-        ///
-        /// NOTE: Eigen stores quaternions coefficients as (i,j,k,1), but most of
-        /// our matlab code stores them as (1,i,j,k) This takes a quaternion and
-        /// saves it as a (1,i,j,k) row vector
-        template <typename Q>
-        inline MatlabWorkspace& save(
-          const Eigen::Quaternion<Q> & q,
-          const std::string & name);
-        /// \overload
-        inline MatlabWorkspace& save(
-          const double d,
-          const std::string & name);
-        /// Same as save() but adds 1 to each element, useful for saving "index"
-        /// matrices like lists of faces or elements
-        /// @tparam DerivedM  eigen matrix (e.g. MatrixXd)
-        template <typename DerivedM>
-        inline MatlabWorkspace& save_index(
-          const Eigen::DenseBase<DerivedM>& M,
-          const std::string & name);
-        /// \overload
-        /// @tparam MT  sparse matrix type (e.g. double)
-        template <typename ScalarM>
-        inline MatlabWorkspace& save_index(
-          const std::vector<std::vector<ScalarM> > & vM,
-          const std::string & name);
-        /// \overload
-        /// @tparam ScalarV  scalar type, e.g. double
-        template <typename ScalarV>
-        inline MatlabWorkspace& save_index(
-          const std::vector<ScalarV> & vV,
-          const std::string & name);
-        /// Find a certain matrix by name.
-        ///
-        /// \bug Outputs the first found (not necessarily unique lists).
-        ///
-        /// @tparam DerivedM  eigen matrix (e.g. MatrixXd)
-        /// @param[in] name  exact name of matrix as string
-        /// @param[out] M  matrix
-        /// @return true only if found.
-        template <typename DerivedM>
-        inline bool find( 
-          const std::string & name,
-          Eigen::PlainObjectBase<DerivedM>& M);
-        /// \overload
-        /// @tparam MT  sparse matrix type (e.g. double)
-        template <typename MT>
-        inline bool find( 
-          const std::string & name,
-          Eigen::SparseMatrix<MT>& M);
-        /// \overload
-        inline bool find( 
-          const std::string & name,
-          double & d);
-        /// \overload
-        inline bool find( 
-          const std::string & name,
-          int & v);
-        /// Subtracts 1 from all entries
-        /// @tparam DerivedM  eigen matrix (e.g. MatrixXd)
-        /// @param[in] name  exact name of matrix as string
-        /// @param[out] M  matrix
-        template <typename DerivedM>
-        inline bool find_index( 
-          const std::string & name,
-          Eigen::PlainObjectBase<DerivedM>& M);
-    };
-  }
-}
-
-// Implementation
-
-// Be sure that this is not compiled into libigl.a
-// http://stackoverflow.com/a/3318993/148668
-
-// IGL
-#include "igl/list_to_matrix.h"
-
-// MATLAB
-#include "mat.h"
-
-// STL
-#include <iostream>
-#include <algorithm>
-#include <vector>
-
-inline igl::matlab::MatlabWorkspace::MatlabWorkspace():
-  names(),
-  data()
-{
-}
-
-inline igl::matlab::MatlabWorkspace::~MatlabWorkspace()
-{
-  // clean up data
-  clear();
-}
-
-inline void igl::matlab::MatlabWorkspace::clear()
-{
-  for_each(data.begin(),data.end(),&mxDestroyArray);
-  data.clear();
-  names.clear();
-}
-
-inline bool igl::matlab::MatlabWorkspace::write(const std::string & path) const
-{
-  using namespace std;
-  MATFile * mat_file = matOpen(path.c_str(), "w");
-  if(mat_file == NULL)
-  {
-    fprintf(stderr,"Error opening file %s\n",path.c_str());
-    return false;
-  }
-  assert(names.size() == data.size());
-  // loop over names and data
-  for(int i = 0;i < (int)names.size(); i++)
-  {
-    // Put variable as LOCAL variable
-    int status = matPutVariable(mat_file,names[i].c_str(), data[i]);
-    if(status != 0) 
-    {
-      cerr<<"^MatlabWorkspace::save Error: matPutVariable ("<<names[i]<<
-        ") failed"<<endl;
-      return false;
-    } 
-  }
-  if(matClose(mat_file) != 0)
-  {
-    fprintf(stderr,"Error closing file %s\n",path.c_str());
-    return false;
-  }
-  return true;
-}
-
-inline bool igl::matlab::MatlabWorkspace::read(const std::string & path)
-{
-  using namespace std;
-
-  MATFile * mat_file;
-
-  mat_file = matOpen(path.c_str(), "r");
-  if (mat_file == NULL) 
-  {
-    cerr<<"Error: failed to open "<<path<<endl;
-    return false;
-  }
-
-  int ndir;
-  const char ** dir = (const char **)matGetDir(mat_file, &ndir);
-  if (dir == NULL) {
-    cerr<<"Error reading directory of file "<< path<<endl;
-    return false;
-  }
-  mxFree(dir);
-
-  // Must close and reopen
-  if(matClose(mat_file) != 0)
-  {
-    cerr<<"Error: failed to close file "<<path<<endl;
-    return false;
-  }
-  mat_file = matOpen(path.c_str(), "r");
-  if (mat_file == NULL) 
-  {
-    cerr<<"Error: failed to open "<<path<<endl;
-    return false;
-  }
-  
-
-  /* Read in each array. */
-  for (int i=0; i<ndir; i++) 
-  {
-    const char * name;
-    mxArray * mx_data = matGetNextVariable(mat_file, &name);
-    if (mx_data == NULL) 
-    {
-      cerr<<"Error: matGetNextVariable failed in "<<path<<endl;
-      return false;
-    } 
-    const int dims = mxGetNumberOfDimensions(mx_data);
-    assert(dims == 2);
-    if(dims != 2)
-    {
-      fprintf(stderr,"Variable '%s' has %d ≠ 2 dimensions. Skipping\n",
-          name,dims);
-      mxDestroyArray(mx_data);
-      continue;
-    }
-    // don't destroy
-    names.push_back(name);
-    data.push_back(mx_data);
-  }
-
-  if(matClose(mat_file) != 0)
-  {
-    cerr<<"Error: failed to close file "<<path<<endl;
-    return false;
-  }
-
-  return true;
-}
-
-// Treat everything as a double
-template <typename DerivedM>
-inline igl::matlab::MatlabWorkspace& igl::matlab::MatlabWorkspace::save(
-  const Eigen::PlainObjectBase<DerivedM>& M,
-  const std::string & name)
-{
-  using namespace std;
-  const int m = M.rows();
-  const int n = M.cols();
-  mxArray * mx_data = mxCreateDoubleMatrix(m,n,mxREAL);
-  data.push_back(mx_data);
-  names.push_back(name);
-  // Copy data immediately
-  // Use Eigen's map and cast to copy
-  Eigen::Map< Eigen::Matrix<double,Eigen::Dynamic,Eigen::Dynamic> > 
-    map(mxGetPr(mx_data),m,n);
-  map = M.template cast<double>();
-  return *this;
-}
-
-// Treat everything as a double
-template <typename MT>
-inline igl::matlab::MatlabWorkspace& igl::matlab::MatlabWorkspace::save(
-  const Eigen::SparseMatrix<MT>& M,
-  const std::string & name)
-{
-  using namespace std;
-  const int m = M.rows();
-  const int n = M.cols();
-  // THIS WILL NOT WORK FOR ROW-MAJOR
-  assert(n==M.outerSize());
-  const int nzmax = M.nonZeros();
-  mxArray * mx_data = mxCreateSparse(m, n, nzmax, mxREAL);
-  data.push_back(mx_data);
-  names.push_back(name);
-  // Copy data immediately
-  double * pr = mxGetPr(mx_data);
-  mwIndex * ir = mxGetIr(mx_data);
-  mwIndex * jc = mxGetJc(mx_data);
-
-  // Iterate over outside
-  int k = 0;
-  for(int j=0; j<M.outerSize();j++)
-  {
-    jc[j] = k;
-    // Iterate over inside
-    for(typename Eigen::SparseMatrix<MT>::InnerIterator it (M,j); it; ++it)
-    {
-      pr[k] = it.value();
-      ir[k] = it.row();
-      k++;
-    }
-  }
-  jc[M.outerSize()] = k;
-
-  return *this;
-}
-
-template <typename ScalarM>
-inline igl::matlab::MatlabWorkspace& igl::matlab::MatlabWorkspace::save(
-  const std::vector<std::vector<ScalarM> > & vM,
-  const std::string & name)
-{
-  Eigen::MatrixXd M;
-  list_to_matrix(vM,M);
-  return this->save(M,name);
-}
-
-template <typename ScalarV>
-inline igl::matlab::MatlabWorkspace& igl::matlab::MatlabWorkspace::save(
-  const std::vector<ScalarV> & vV,
-  const std::string & name)
-{
-  Eigen::MatrixXd V;
-  list_to_matrix(vV,V);
-  return this->save(V,name);
-}
-
-template <typename Q>
-inline igl::matlab::MatlabWorkspace& igl::matlab::MatlabWorkspace::save(
-  const Eigen::Quaternion<Q> & q,
-  const std::string & name)
-{
-  Eigen::Matrix<Q,1,4> qm;
-  qm(0,0) = q.w();
-  qm(0,1) = q.x();
-  qm(0,2) = q.y();
-  qm(0,3) = q.z();
-  return save(qm,name);
-}
-
-inline igl::matlab::MatlabWorkspace& igl::matlab::MatlabWorkspace::save(
-  const double d,
-  const std::string & name)
-{
-  Eigen::VectorXd v(1);
-  v(0) = d;
-  return save(v,name);
-}
-
-template <typename DerivedM>
-inline igl::matlab::MatlabWorkspace& 
-  igl::matlab::MatlabWorkspace::save_index(
-    const Eigen::DenseBase<DerivedM>& M,
-    const std::string & name)
-{
-  DerivedM Mp1 = M;
-  Mp1.array() += 1;
-  return this->save(Mp1,name);
-}
-
-template <typename ScalarM>
-inline igl::matlab::MatlabWorkspace& igl::matlab::MatlabWorkspace::save_index(
-  const std::vector<std::vector<ScalarM> > & vM,
-  const std::string & name)
-{
-  Eigen::MatrixXd M;
-  list_to_matrix(vM,M);
-  return this->save_index(M,name);
-}
-
-template <typename ScalarV>
-inline igl::matlab::MatlabWorkspace& igl::matlab::MatlabWorkspace::save_index(
-  const std::vector<ScalarV> & vV,
-  const std::string & name)
-{
-  Eigen::MatrixXd V;
-  list_to_matrix(vV,V);
-  return this->save_index(V,name);
-}
-
-template <typename DerivedM>
-inline bool igl::matlab::MatlabWorkspace::find( 
-  const std::string & name,
-  Eigen::PlainObjectBase<DerivedM>& M)
-{
-  using namespace std;
-  const int i = std::find(names.begin(), names.end(), name)-names.begin();
-  if(i>=(int)names.size())
-  {
-    return false;
-  }
-  assert(i<=(int)data.size());
-  mxArray * mx_data = data[i];
-  assert(!mxIsSparse(mx_data));
-  assert(mxGetNumberOfDimensions(mx_data) == 2);
-  //cout<<name<<": "<<mxGetM(mx_data)<<" "<<mxGetN(mx_data)<<endl;
-  const int m = mxGetM(mx_data);
-  const int n = mxGetN(mx_data);
-  // Handle vectors: in the sense that anything found becomes a column vector,
-  // whether it was column vector, row vector or matrix
-  if(DerivedM::IsVectorAtCompileTime)
-  {
-    assert(m==1 || n==1 || (m==0 && n==0));
-    M.resize(m*n,1);
-  }else
-  {
-    M.resize(m,n);
-  }
-  assert(mxGetNumberOfElements(mx_data) == M.size());
-  // Use Eigen's map and cast to copy
-  M = Eigen::Map< Eigen::Matrix<double,Eigen::Dynamic,Eigen::Dynamic> > 
-    (mxGetPr(mx_data),M.rows(),M.cols()).cast<typename DerivedM::Scalar>();
-  return true;
-}
-
-template <typename MT>
-inline bool igl::matlab::MatlabWorkspace::find( 
-  const std::string & name,
-  Eigen::SparseMatrix<MT>& M)
-{
-  using namespace std;
-  using namespace Eigen;
-  const int i = std::find(names.begin(), names.end(), name)-names.begin();
-  if(i>=(int)names.size())
-  {
-    return false;
-  }
-  assert(i<=(int)data.size());
-  mxArray * mx_data = data[i];
-  // Handle boring case where matrix is actually an empty dense matrix
-  if(mxGetNumberOfElements(mx_data) == 0)
-  {
-    M.resize(0,0);
-    return true;
-  }
-  assert(mxIsSparse(mx_data));
-  assert(mxGetNumberOfDimensions(mx_data) == 2);
-  //cout<<name<<": "<<mxGetM(mx_data)<<" "<<mxGetN(mx_data)<<endl;
-  const int m = mxGetM(mx_data);
-  const int n = mxGetN(mx_data);
-  // TODO: It should be possible to directly load the data into the sparse
-  // matrix without going through the triplets
-  // Copy data immediately
-  double * pr = mxGetPr(mx_data);
-  mwIndex * ir = mxGetIr(mx_data);
-  mwIndex * jc = mxGetJc(mx_data);
-  vector<Triplet<MT> > MIJV;
-  const int nnz = mxGetNzmax(mx_data);
-  MIJV.reserve(nnz);
-  // Iterate over outside
-  int k = 0;
-  for(int j=0; j<n;j++)
-  {
-    // Iterate over inside
-    while(k<(int)jc[j+1])
-    {
-      //cout<<ir[k]<<" "<<j<<" "<<pr[k]<<endl;
-      assert((int)ir[k]<m);
-      assert((int)j<n);
-      MIJV.push_back(Triplet<MT >(ir[k],j,pr[k]));
-      k++;
-    }
-  }
-  M.resize(m,n);
-  M.setFromTriplets(MIJV.begin(),MIJV.end());
-
-  return true;
-}
-
-inline bool igl::matlab::MatlabWorkspace::find( 
-  const std::string & name,
-  int & v)
-{
-  using namespace std;
-  const int i = std::find(names.begin(), names.end(), name)-names.begin();
-  if(i>=(int)names.size())
-  {
-    return false;
-  }
-  assert(i<=(int)data.size());
-  mxArray * mx_data = data[i];
-  assert(!mxIsSparse(mx_data));
-  assert(mxGetNumberOfDimensions(mx_data) == 2);
-  //cout<<name<<": "<<mxGetM(mx_data)<<" "<<mxGetN(mx_data)<<endl;
-  assert(mxGetNumberOfElements(mx_data) == 1);
-  copy(
-    mxGetPr(mx_data),
-    mxGetPr(mx_data)+mxGetNumberOfElements(mx_data),
-    &v);
-  return true;
-}
-
-inline bool igl::matlab::MatlabWorkspace::find( 
-  const std::string & name,
-  double & d)
-{
-  using namespace std;
-  const int i = std::find(names.begin(), names.end(), name)-names.begin();
-  if(i>=(int)names.size())
-  {
-    return false;
-  }
-  assert(i<=(int)data.size());
-  mxArray * mx_data = data[i];
-  assert(!mxIsSparse(mx_data));
-  assert(mxGetNumberOfDimensions(mx_data) == 2);
-  //cout<<name<<": "<<mxGetM(mx_data)<<" "<<mxGetN(mx_data)<<endl;
-  assert(mxGetNumberOfElements(mx_data) == 1);
-  copy(
-    mxGetPr(mx_data),
-    mxGetPr(mx_data)+mxGetNumberOfElements(mx_data),
-    &d);
-  return true;
-}
-
-template <typename DerivedM>
-inline bool igl::matlab::MatlabWorkspace::find_index( 
-  const std::string & name,
-  Eigen::PlainObjectBase<DerivedM>& M)
-{
-  if(!find(name,M))
-  {
-    return false;
-  }
-  M.array() -= 1;
-  return true;
-}
-
-
-//template <typename Data>
-//bool igl::matlab::MatlabWorkspace::save(const Data & M, const std::string & name)
-//{
-//  using namespace std;
-//  // If I don't know the type then I can't save it
-//  cerr<<"^MatlabWorkspace::save Error: Unknown data type. "<<
-//    name<<" not saved."<<endl;
-//  return false;
-//}
-
-#endif
-

برخی فایل ها در این مقایسه diff نمایش داده نمی شوند زیرا تعداد فایل ها بسیار زیاد است