|
|
@@ -1,9 +1,9 @@
|
|
|
// 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
|
|
|
+//
|
|
|
+// 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 "bijective_composite_harmonic_mapping.h"
|
|
|
|
|
|
@@ -51,11 +51,11 @@ IGL_INLINE bool igl::bijective_composite_harmonic_mapping(
|
|
|
assert(F.cols() == 3 && "F should contain triangles");
|
|
|
int tries = 0;
|
|
|
int nsteps = min_steps;
|
|
|
- Derivedbc bc0;
|
|
|
+ Eigen::Matrix<typename Derivedbc::Scalar, Eigen::Dynamic, Eigen::Dynamic> bc0;
|
|
|
slice(V,b,1,bc0);
|
|
|
|
|
|
// It's difficult to check for flips "robustly" in the sense that the input
|
|
|
- // mesh might not have positive/consistent sign to begin with.
|
|
|
+ // mesh might not have positive/consistent sign to begin with.
|
|
|
|
|
|
while(nsteps<=max_steps)
|
|
|
{
|
|
|
@@ -71,7 +71,7 @@ IGL_INLINE bool igl::bijective_composite_harmonic_mapping(
|
|
|
// of the boundary conditions. Something like "Homotopic Morphing of
|
|
|
// Planar Curves" [Dym et al. 2015] but also handling multiple connected
|
|
|
// components.
|
|
|
- Derivedbc bct = bc0 + t*(bc - bc0);
|
|
|
+ Eigen::Matrix<typename Derivedbc::Scalar, Eigen::Dynamic, Eigen::Dynamic> bct = bc0 + t * (bc - bc0);
|
|
|
// Compute dsicrete harmonic map using metric of previous step
|
|
|
for(int iter = 0;iter<num_inner_iters;iter++)
|
|
|
{
|
|
|
@@ -82,7 +82,7 @@ IGL_INLINE bool igl::bijective_composite_harmonic_mapping(
|
|
|
//mw.save_index(b,"b");
|
|
|
//mw.save(bct,"bct");
|
|
|
//mw.write("numerical.mat");
|
|
|
- harmonic(DerivedU(U),F,b,bct,1,U);
|
|
|
+ harmonic(Eigen::Matrix<typename DerivedU::Scalar, Eigen::Dynamic, Eigen::Dynamic>(U), F, b, bct, 1, U);
|
|
|
igl::slice(U,b,1,bct);
|
|
|
nans = (U.array() != U.array()).count();
|
|
|
if(test_for_flips)
|