Jelajahi Sumber

merge with James'

Former-commit-id: 689a9b9d6f20d609ea2f33da31080dba9929e08e
Alec Jacobson 10 tahun lalu
induk
melakukan
c067639487

+ 0 - 1
include/igl/boolean/mesh_boolean.cpp

@@ -245,7 +245,6 @@ IGL_INLINE void igl::mesh_boolean(
   cout<<"clean..."<<endl;
 #endif
   // Deal with duplicate faces
-  if (false)
   {
     VectorXi IA,IC;
     MatrixX3I uG;

+ 0 - 0
include/igl/order_facets_around_edges.cpp → include/igl/cgal/order_facets_around_edges.cpp


+ 1 - 1
include/igl/order_facets_around_edges.h → include/igl/cgal/order_facets_around_edges.h

@@ -1,7 +1,7 @@
 #ifndef ORDER_FACETS_AROUND_EDGES
 #define ORDER_FACETS_AROUND_EDGES
 
-#include "igl_inline.h"
+#include "../igl_inline.h"
 #include <Eigen/Core>
 #include <CGAL/Exact_predicates_exact_constructions_kernel.h>
 

+ 18 - 21
include/igl/outer_hull.cpp → include/igl/cgal/outer_hull.cpp

@@ -1,15 +1,15 @@
 #include "outer_hull.h"
-#include "outer_facet.h"
-#include "sortrows.h"
-#include "facet_components.h"
-#include "winding_number.h"
-#include "triangle_triangle_adjacency.h"
-#include "unique_edge_map.h"
-#include "barycenter.h"
-#include "per_face_normals.h"
-#include "writePLY.h"
-#include "sort_angles.h"
 #include "order_facets_around_edges.h"
+#include "../outer_facet.h"
+#include "../sortrows.h"
+#include "../facet_components.h"
+#include "../winding_number.h"
+#include "../triangle_triangle_adjacency.h"
+#include "../unique_edge_map.h"
+#include "../barycenter.h"
+#include "../per_face_normals.h"
+#include "../writePLY.h"
+#include "../sort_angles.h"
 
 #include <Eigen/Geometry>
 #include <vector>
@@ -396,19 +396,18 @@ IGL_INLINE void igl::outer_hull(
   // Is A inside B? Assuming A and B are consistently oriented but closed and
   // non-intersecting.
   const auto & is_component_inside_other = [](
-    const Eigen::Matrix<double, Eigen::Dynamic, Eigen::Dynamic> & V,
+    const Eigen::MatrixXd & V,
     const MatrixXV & BC,
     const MatrixXG & A,
     const MatrixXJ & AJ,
     const MatrixXG & B)->bool
   {
-      typedef Eigen::Matrix<double, Eigen::Dynamic, Eigen::Dynamic> Matrix;
     const auto & bounding_box = [](
-      const Matrix & V,
+      const Eigen::MatrixXd & V,
       const MatrixXG & F)->
-      Matrix
+      Eigen::MatrixXd
     {
-      Matrix BB(2,3);
+      Eigen::MatrixXd BB(2,3);
       BB<<
          1e26,1e26,1e26,
         -1e26,-1e26,-1e26;
@@ -426,8 +425,8 @@ IGL_INLINE void igl::outer_hull(
     };
     // A lot of the time we're dealing with unrelated, distant components: cull
     // them.
-    Matrix ABB = bounding_box(V,A);
-    Matrix BBB = bounding_box(V,B);
+    Eigen::MatrixXd ABB = bounding_box(V,A);
+    Eigen::MatrixXd BBB = bounding_box(V,B);
     if( (BBB.row(0)-ABB.row(1)).maxCoeff()>0  ||
         (ABB.row(0)-BBB.row(1)).maxCoeff()>0 )
     {
@@ -449,16 +448,14 @@ IGL_INLINE void igl::outer_hull(
         CGAL::to_double(BC(AJ(0), 2)) };
     // In a perfect world, it's enough to test a single point.
     double w;
-    const double * Vdata;
-    Vdata = V.data();
     winding_number_3(
-      Vdata,V.rows(),
+      V.data(),V.rows(),
       B.data(),B.rows(),
       q,1,&w);
     return w > 0.5 || w < -0.5;
   };
 
-  Eigen::Matrix<double, Eigen::Dynamic, Eigen::Dynamic> Vcol(V.rows(), V.cols());
+  Eigen::MatrixXd Vcol(V.rows(), V.cols());
   for (size_t i=0; i<V.rows(); i++) {
       for (size_t j=0; j<V.cols(); j++) {
           Vcol(i, j) = CGAL::to_double(V(i, j));

+ 1 - 1
include/igl/outer_hull.h → include/igl/cgal/outer_hull.h

@@ -1,6 +1,6 @@
 #ifndef IGL_OUTER_HULL_H
 #define IGL_OUTER_HULL_H
-#include "igl_inline.h"
+#include "../igl_inline.h"
 #include <Eigen/Core>
 namespace igl
 {

+ 4 - 4
include/igl/peel_outer_hull_layers.cpp → include/igl/cgal/peel_outer_hull_layers.cpp

@@ -1,13 +1,13 @@
 #include "peel_outer_hull_layers.h"
-#include "per_face_normals.h"
+#include "../per_face_normals.h"
 #include "outer_hull.h"
 #include <vector>
 #include <iostream>
 //#define IGL_PEEL_OUTER_HULL_LAYERS_DEBUG
 #ifdef IGL_PEEL_OUTER_HULL_LAYERS_DEBUG
-#include "writePLY.h"
-#include "writeDMAT.h"
-#include "STR.h"
+#include "../writePLY.h"
+#include "../writeDMAT.h"
+#include "../STR.h"
 #endif
 
 using namespace std;

+ 3 - 3
include/igl/peel_outer_hull_layers.h → include/igl/cgal/peel_outer_hull_layers.h

@@ -1,6 +1,6 @@
-#ifndef PEEL_OUTER_HULL_LAYERS_H
-#define PEEL_OUTER_HULL_LAYERS_H
-#include "igl_inline.h"
+#ifndef IGL_PEEL_OUTER_HULL_LAYERS_H
+#define IGL_PEEL_OUTER_HULL_LAYERS_H
+#include "../igl_inline.h"
 #include <Eigen/Core>
 namespace igl
 {

+ 1 - 1
include/igl/outer_facet.h

@@ -18,7 +18,7 @@ namespace igl
   //   flip  whether facet's orientation should be flipped so that
   //     counter-clockwise normal points outward.
   //
-  // See also: outer_hull.h
+  // See also: cgal/outer_hull.h
   template <
     typename DerivedV,
     typename DerivedF,

+ 1 - 1
include/igl/winding_number.cpp

@@ -101,7 +101,7 @@ IGL_INLINE void igl::winding_number_3(
         // Matlab crashes on NaN
         if(vl[t]!=0)
         {
-          vl[t] /= sqrt(vl[t]);
+          vl[t] = sqrt(vl[t]);
         }
       }
       //printf("\n");