Browse Source

small fix in embree/reorient_facets_raycast.cpp: account for the effect of bfs_orient

Former-commit-id: b7a81ea985d691e7b0335121b918c9addf608573
Kenshi Takayama 11 years ago
parent
commit
b3367ca3f1

+ 3 - 3
examples/patches/example.vcxproj

@@ -1,5 +1,5 @@
 <?xml version="1.0" encoding="utf-8"?>
-<Project DefaultTargets="Build" ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+<Project DefaultTargets="Build" ToolsVersion="12.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
   <ItemGroup Label="ProjectConfigurations">
     <ProjectConfiguration Include="Debug|Win32">
       <Configuration>Debug</Configuration>
@@ -19,14 +19,14 @@
   <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
     <ConfigurationType>Application</ConfigurationType>
     <UseDebugLibraries>false</UseDebugLibraries>
-    <PlatformToolset>v110</PlatformToolset>
+    <PlatformToolset>v120</PlatformToolset>
     <WholeProgramOptimization>true</WholeProgramOptimization>
     <CharacterSet>MultiByte</CharacterSet>
   </PropertyGroup>
   <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
     <ConfigurationType>Application</ConfigurationType>
     <UseDebugLibraries>false</UseDebugLibraries>
-    <PlatformToolset>v110</PlatformToolset>
+    <PlatformToolset>v120</PlatformToolset>
     <WholeProgramOptimization>false</WholeProgramOptimization>
     <CharacterSet>MultiByte</CharacterSet>
   </PropertyGroup>

+ 5 - 2
include/igl/embree/reorient_facets_raycast.cpp

@@ -26,7 +26,7 @@
     const Eigen::PlainObjectBase<DerivedF> & F,
     int rays_total,
     int rays_minimum,
-    bool face_wise,
+    bool facet_wise,
     bool use_parity,
     bool is_verbose,
     Eigen::PlainObjectBase<DerivedI> & I)
@@ -41,7 +41,7 @@
   
   VectorXi C;
   MatrixXi FF = F;
-  if (face_wise) {
+  if (facet_wise) {
     C.resize(m);
     for (int i = 0; i < m; ++i) C(i) = i;
   
@@ -217,6 +217,9 @@
               C_vote_infinity[c].first <  C_vote_infinity[c].second
               ? 1 : 0;
     }
+    // To account for the effect of bfs_orient
+    if (F.row(f) != FF.row(f))
+      I(f) = 1 - I(f);
   }
   if (is_verbose) cout << "done!" << endl;
 }