Преглед изворни кода

Merge branch 'master' of https://github.com/libigl/libigl

Former-commit-id: 99a1db569e87f5e57a3040e29a40bff818f073c5
Alec Jacobson пре 9 година
родитељ
комит
8c1b73c568
4 измењених фајлова са 24 додато и 9 уклоњено
  1. 3 1
      .appveyor.yml
  2. 7 6
      file-formats/bf.html
  3. 0 1
      include/igl/eigs.cpp
  4. 14 1
      include/igl/read_triangle_mesh.cpp

+ 3 - 1
.appveyor.yml

@@ -14,6 +14,8 @@ build_script:
   - mkdir build
   - cd build
   - cmake -D "LIBIGL_USE_STATIC_LIBRARY=ON" -G "Visual Studio 14 2015 Win64" ../
+#  - cmake -G "Visual Studio 14 2015 Win64" ../
   - set MSBuildLogger="C:\Program Files\AppVeyor\BuildAgent\Appveyor.MSBuildLogger.dll"
-  - set MSBuildOptions=/v:m /p:Configuration=Release /logger:%MSBuildLogger%
+#  - set MSBuildOptions=/v:m /p:Configuration=Release /logger:%MSBuildLogger%
+  - set MSBuildOptions=/v:m /p:Configuration=Debug /logger:%MSBuildLogger%
   - msbuild %MSBuildOptions% libigl_tutorials.sln

+ 7 - 6
file-formats/bf.html

@@ -10,17 +10,18 @@
     <h1>.bf - bone forests</h1>
     <hr>
     <p>
-A .bf file contains a bone forest. That is possibly multiple bone trees, or
-skeletons. Singleton trees will be interpreted as point handles. Otherwise
-each edge in a tree will be interpreted as a bone segment.
-    </p>
+A .bf file contains a "bone forest". Normally a skeleton for linear blend
+skinning is a "bone tree" with a single root. But this format may store
+multiple trees, hence a forest.
     <p>
-Each line contains data about a vertex (joint) of a bone tree:
+Each line contains data about a vertex (joint) of the bone forest:
     </p>
     <pre><code>[weight index] [parent index] [x] [y] [z] [undocument optional data]</code></pre>
     <p>
 Indices begin with 0.  The weight index is -1 if the bone does not have an
-associated weight. The parent index is -1 for root nodes.
+associated weight. The parent index is -1 for root nodes. The x,y,z coordinates
+are offset vectors from this joint's parent's location (for roots, an offset
+from the origin).
     </p>
     <p>See also: <a href=.>file formats</a></p>
   </div>

+ 0 - 1
include/igl/eigs.cpp

@@ -1,6 +1,5 @@
 #include "eigs.h"
 
-#include "read_triangle_mesh.h"
 #include "cotmatrix.h"
 #include "sort.h"
 #include "slice.h"

+ 14 - 1
include/igl/read_triangle_mesh.cpp

@@ -39,7 +39,14 @@ IGL_INLINE bool igl::read_triangle_mesh(
   vector<vector<Index> > FTC, FN;
   if(e == "obj")
   {
-    return readOBJ(str,V,TC,N,F,FTC,FN);
+    // Annoyingly obj can store 4 coordinates, truncate to xyz for this generic
+    // read_triangle_mesh
+    bool success = readOBJ(str,V,TC,N,F,FTC,FN);
+    for(auto & v : V)
+    {
+      v.resize(std::min(v.size(),(size_t)3));
+    }
+    return success;
   }else if(e == "off")
   {
     return readOFF(str,V,F,N);
@@ -98,6 +105,12 @@ IGL_INLINE bool igl::read_triangle_mesh(
     {
       return false;
     }
+    // Annoyingly obj can store 4 coordinates, truncate to xyz for this generic
+    // read_triangle_mesh
+    for(auto & v : vV)
+    {
+      v.resize(std::min(v.size(),(size_t)3));
+    }
   }else if(ext == "off")
   {
     if(!readOFF(filename,vV,vF,vN))