Selaa lähdekoodia

comments in boundary* and map_vert*

Former-commit-id: 826b5f9d0c6d036792f1881fe425b6817db91711
Alec Jacobson 11 vuotta sitten
vanhempi
commit
3674980304

+ 6 - 2
include/igl/boundary_vertices_sorted.cpp

@@ -7,8 +7,8 @@
 // obtain one at http://mozilla.org/MPL/2.0/.
 #include "boundary_vertices_sorted.h"
 
-#include "igl/tt.h"
-#include "igl/vf.h"
+#include "tt.h"
+#include "vf.h"
 
 IGL_INLINE void igl::boundary_vertices_sorted(
     const Eigen::MatrixXd& V,
@@ -19,6 +19,10 @@ IGL_INLINE void igl::boundary_vertices_sorted(
   bnd.clear();
   std::vector<bool> isVisited(V.rows(),false);
 
+  // Actually mesh only needs to be manifold near boundary, so this is
+  // over zealous (see gptoolbox's outline_loop for a more general
+  // (and probably faster) implementation)
+  assert(is_manifold(V,F) && "Mesh must be manifold");
   Eigen::MatrixXi TT,TTi;
   std::vector<std::vector<int> > VF, VFi;
   igl::tt(V,F,TT,TTi);

+ 5 - 4
include/igl/boundary_vertices_sorted.h

@@ -5,8 +5,8 @@
 // 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_BOUNDARYVERTICESSORTED_H
-#define IGL_BOUNDARYVERTICESSORTED_H
+#ifndef IGL_BOUNDARY_VERTICES_SORTED_H
+#define IGL_BOUNDARY_VERTICES_SORTED_H
 #include <igl/igl_inline.h>
 
 #include <Eigen/Dense>
@@ -15,7 +15,8 @@
 namespace igl
 {
 
-  // Compute sorted list of boundary vertices for mesh with single boundary.
+  // Compute sorted list of boundary vertices for a manifold mesh with single
+  // boundary.
   //
   // Inputs:
   //   V  #V by dim list of mesh vertex positions
@@ -32,4 +33,4 @@ namespace igl
 #  include "boundary_vertices_sorted.cpp"
 #endif
 
-#endif
+#endif

+ 1 - 4
include/igl/map_vertices_to_circle.cpp

@@ -8,10 +8,7 @@
 
 #include "map_vertices_to_circle.h"
 
-#include <Eigen/Sparse>
-
-#include "igl/cotmatrix.h"
-#include "igl/boundary_vertices_sorted.h"
+#include "boundary_vertices_sorted.h"
 
 IGL_INLINE void igl::map_vertices_to_circle(
   const Eigen::MatrixXd& V,

+ 6 - 5
include/igl/map_vertices_to_circle.h

@@ -5,8 +5,8 @@
 // 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_MAPVERTICESTOCIRCLE_H
-#define IGL_MAPVERTICESTOCIRCLE_H
+#ifndef IGL_MAP_VERTICES_TO_CIRCLE_H
+#define IGL_MAP_VERTICES_TO_CIRCLE_H
 #include <igl/igl_inline.h>
 
 #include <Eigen/Dense>
@@ -15,18 +15,19 @@
 namespace igl
 {
 
-  // Map the vertices whose indices are in b on the unit circle.
+  // Map the vertices whose indices are in a given boundary loop (bnd) on the
+  // unit circle with spacing proportional to the original boundary edge
+  // lengths.
   //
   // Inputs:
   //   V  #V by dim list of mesh vertex positions
-  //   F  #V by dim list of mesh faces
   //   b  #W list of vertex ids
   // Outputs:
   //   UV   #W by 2 list of 2D position on the unit circle for the vertices in b
   IGL_INLINE void map_vertices_to_circle(
   	const Eigen::MatrixXd& V,
   	const Eigen::MatrixXi& F,
-    const Eigen::VectorXi& b,
+    const Eigen::VectorXi& bnd,
   	Eigen::MatrixXd& UV);
 }