1#include <Eigen/Eigenvalues>
7 template <
class DataPo
int,
class _NFilter,
typename T>
8 typename FundamentalFormWeingartenEstimator<DataPoint, _NFilter, T>::Matrix2 FundamentalFormWeingartenEstimator<
9 DataPoint,
_NFilter, T>::firstFundamentalForm()
const
12 firstFundamentalForm(
first);
16 template <
class DataPo
int,
class _NFilter,
typename T>
17 template <
typename Matrix2Derived>
20 Base::firstFundamentalFormComponents(
first(0, 0),
first(1, 0),
first(1, 1));
24 template <
class DataPo
int,
class _NFilter,
typename T>
26 DataPoint,
_NFilter, T>::secondFundamentalForm()
const
29 secondFundamentalForm(
second);
33 template <
class DataPo
int,
class _NFilter,
typename T>
34 template <
typename Matrix2Derived>
41 template <
class DataPo
int,
class _NFilter,
typename T>
50 template <
class DataPo
int,
class _NFilter,
typename T>
51 template <
typename Matrix2Derived>
54 w = firstFundamentalForm().inverse() * secondFundamentalForm();
57 template <
class DataPo
int,
class _NFilter,
typename T>
62 Base::firstFundamentalFormComponents(
E,
F,
G);
63 Base::secondFundamentalFormComponents(
L,
M,
N);
67 template <
class DataPo
int,
class _NFilter,
typename T>
69 DataPoint,
_NFilter, T>::GaussianCurvature()
const
72 Base::firstFundamentalFormComponents(
E,
F,
G);
73 Base::secondFundamentalFormComponents(
L,
M,
N);
74 return (
L *
N -
M *
M) / (
E *
G -
F *
F);
78 template <
class DataPo
int,
class _NFilter,
int DiffType,
typename T>
79 typename NormalDerivativeWeingartenEstimator<DataPoint, _NFilter, DiffType, T>::Matrix2
87 template <
class DataPo
int,
class _NFilter,
int DiffType,
typename T>
91 PONCA_MULTIARCH_STD_MATH(
abs);
92 PONCA_MULTIARCH_STD_MATH(
sqrt);
94 using Index =
typename VectorType::Index;
100 Index
i0 = Index(-1),
i1 = Index(-1),
i2 = Index(-1);
105 n.array().abs().minCoeff(&
i0);
109 m_tangentBasis.col(0) = n;
111 m_tangentBasis.col(1)[
i0] = 0;
112 m_tangentBasis.col(1)[
i1] = n[
i2];
113 m_tangentBasis.col(1)[
i2] = -n[
i1];
115 m_tangentBasis.col(1).normalize();
116 m_tangentBasis.col(2) = m_tangentBasis.col(1).cross(n);
118 return Base::m_eCurrentState;
121 template <
class DataPo
int,
class _NFilter,
int DiffType,
typename T>
122 template <
typename Matrix2Derived>
125 PONCA_MULTIARCH_STD_MATH(
abs);
126 PONCA_MULTIARCH_STD_MATH(
sqrt);
128 using Index =
typename VectorType::Index;
129 using Matrix32 = Eigen::Matrix<Scalar, 3, 2>;
139 W =
B.transpose() *
dN *
B;
155 W(0, 1) =
W(1, 0) = (
W(0, 1) +
W(1, 0)) /
Scalar(2);
158 template <
class DataPo
int,
class _NFilter,
int DiffType,
typename T>
163 return m_tangentBasis.normalized().transpose() *
167 template <
class DataPo
int,
class _NFilter,
int DiffType,
typename T>
172 return Base::getNeighborFilter().convertToGlobalBasis(m_tangentBasis.normalized().transpose().inverse() *
_lq,
179 template <
class DataPo
int,
class _NFilter,
typename T>
183 if (Base::finalize() !=
STABLE)
184 return Base::m_eCurrentState;
187 Base::weingartenMap(
w);
190 Eigen::SelfAdjointEigenSolver<Matrix2> solver;
191 solver.computeDirect(
w);
193 Scalar kmin = solver.eigenvalues().x();
194 Scalar kmax = solver.eigenvalues().y();
202 vmin = Base::tangentPlaneToWorld(
vmin,
false);
203 vmax = Base::tangentPlaneToWorld(
vmax,
false);
205 Base::setCurvatureValues(kmin, kmax,
vmin,
vmax);
207 return Base::m_eCurrentState;
Aggregator class used to declare specialized structures using CRTP.
typename P::Scalar Scalar
Scalar type used for computation, as defined from template parameter P
typename Base::VectorType VectorType
Alias to vector type.
VectorType tangentPlaneToWorld(const VectorType &_q, bool _isPositionVector=true) const
Transform a point from the tangent plane [h, u, v]^T to ambient space.
VectorType worldToTangentPlane(const VectorType &_q, bool _isPositionVector=true) const
Express a point in ambient space relatively to the tangent plane.
typename DataPoint::MatrixType MatrixType
Alias to matrix type.
Matrix2 weingartenMap() const
Returns the Weingarten Map.
FIT_RESULT finalize()
Finalize the procedure.
typename Base::VectorType VectorType
Alias to vector type.
FIT_RESULT finalize()
Finalize the procedure.
typename DataPoint::Scalar Scalar
Alias to scalar type.
This Source Code Form is subject to the terms of the Mozilla Public License, v.
FIT_RESULT
Enum corresponding to the state of a fitting method (and what the finalize function returns)
@ STABLE
The fitting is stable and ready to use.