bugfix: principal_curvature returns boolean instead of segfault
Former-commit-id: 8f6a4c4c07
This commit is contained in:
@@ -780,7 +780,7 @@ template <
|
||||
typename DerivedPD2,
|
||||
typename DerivedPV1,
|
||||
typename DerivedPV2>
|
||||
IGL_INLINE void igl::principal_curvature(
|
||||
IGL_INLINE bool igl::principal_curvature(
|
||||
const Eigen::PlainObjectBase<DerivedV>& V,
|
||||
const Eigen::PlainObjectBase<DerivedF>& F,
|
||||
Eigen::PlainObjectBase<DerivedPD1>& PD1,
|
||||
@@ -817,6 +817,8 @@ IGL_INLINE void igl::principal_curvature(
|
||||
|
||||
// Compute
|
||||
cc.computeCurvature();
|
||||
if (!cc.curvatureComputed)
|
||||
return false;
|
||||
|
||||
// Copy it back
|
||||
for (unsigned i=0; i<V.rows(); ++i)
|
||||
@@ -843,6 +845,8 @@ IGL_INLINE void igl::principal_curvature(
|
||||
}
|
||||
}
|
||||
|
||||
return true;
|
||||
|
||||
}
|
||||
|
||||
#ifdef IGL_STATIC_LIBRARY
|
||||
|
||||
@@ -49,7 +49,7 @@ template <
|
||||
typename DerivedPD2,
|
||||
typename DerivedPV1,
|
||||
typename DerivedPV2>
|
||||
IGL_INLINE void principal_curvature(
|
||||
IGL_INLINE bool principal_curvature(
|
||||
const Eigen::PlainObjectBase<DerivedV>& V,
|
||||
const Eigen::PlainObjectBase<DerivedF>& F,
|
||||
Eigen::PlainObjectBase<DerivedPD1>& PD1,
|
||||
|
||||
Reference in New Issue
Block a user