1#include <Eigen/Eigenvalues>
7 template <
class DataPo
int,
class _NFilter,
typename T>
8 requires FUNDAMENTAL_FORM_WEINGARTEN_ESTIMATOR_REQUIREMENTS
9 typename FundamentalFormWeingartenEstimator<DataPoint, _NFilter, T>::Matrix2 FundamentalFormWeingartenEstimator<
10 DataPoint,
_NFilter, T>::firstFundamentalForm()
const
13 firstFundamentalForm(
first);
17 template <
class DataPo
int,
class _NFilter,
typename T>
18 requires FUNDAMENTAL_FORM_WEINGARTEN_ESTIMATOR_REQUIREMENTS
19 template <
typename Matrix2Derived>
22 Base::firstFundamentalFormComponents(
first(0, 0),
first(1, 0),
first(1, 1));
26 template <
class DataPo
int,
class _NFilter,
typename T>
27 requires FUNDAMENTAL_FORM_WEINGARTEN_ESTIMATOR_REQUIREMENTS
29 DataPoint,
_NFilter, T>::secondFundamentalForm()
const
32 secondFundamentalForm(
second);
36 template <
class DataPo
int,
class _NFilter,
typename T>
37 requires FUNDAMENTAL_FORM_WEINGARTEN_ESTIMATOR_REQUIREMENTS
38 template <
typename Matrix2Derived>
45 template <
class DataPo
int,
class _NFilter,
typename T>
46 requires FUNDAMENTAL_FORM_WEINGARTEN_ESTIMATOR_REQUIREMENTS
55 template <
class DataPo
int,
class _NFilter,
typename T>
56 requires FUNDAMENTAL_FORM_WEINGARTEN_ESTIMATOR_REQUIREMENTS
57 template <
typename Matrix2Derived>
60 w = firstFundamentalForm().inverse() * secondFundamentalForm();
63 template <
class DataPo
int,
class _NFilter,
typename T>
64 requires FUNDAMENTAL_FORM_WEINGARTEN_ESTIMATOR_REQUIREMENTS
69 Base::firstFundamentalFormComponents(
E,
F,
G);
70 Base::secondFundamentalFormComponents(
L,
M,
N);
74 template <
class DataPo
int,
class _NFilter,
typename T>
75 requires FUNDAMENTAL_FORM_WEINGARTEN_ESTIMATOR_REQUIREMENTS
77 DataPoint,
_NFilter, T>::GaussianCurvature()
const
80 Base::firstFundamentalFormComponents(
E,
F,
G);
81 Base::secondFundamentalFormComponents(
L,
M,
N);
82 return (
L *
N -
M *
M) / (
E *
G -
F *
F);
86 template <
class DataPo
int,
class _NFilter,
int DiffType,
typename T>
87 typename NormalDerivativeWeingartenEstimator<DataPoint, _NFilter, DiffType, T>::Matrix2
95 template <
class DataPo
int,
class _NFilter,
int DiffType,
typename T>
99 PONCA_MULTIARCH_STD_MATH(
abs);
100 PONCA_MULTIARCH_STD_MATH(
sqrt);
102 using Index =
typename VectorType::Index;
108 Index
i0 = Index(-1),
i1 = Index(-1),
i2 = Index(-1);
113 n.array().abs().minCoeff(&
i0);
117 m_tangentBasis.col(0) = n;
119 m_tangentBasis.col(1)[
i0] = 0;
120 m_tangentBasis.col(1)[
i1] = n[
i2];
121 m_tangentBasis.col(1)[
i2] = -n[
i1];
123 m_tangentBasis.col(1).normalize();
124 m_tangentBasis.col(2) = m_tangentBasis.col(1).cross(n);
126 return Base::m_eCurrentState;
129 template <
class DataPo
int,
class _NFilter,
int DiffType,
typename T>
130 template <
typename Matrix2Derived>
133 PONCA_MULTIARCH_STD_MATH(
abs);
134 PONCA_MULTIARCH_STD_MATH(
sqrt);
136 using Index =
typename VectorType::Index;
137 using Matrix32 = Eigen::Matrix<Scalar, 3, 2>;
147 W =
B.transpose() *
dN *
B;
163 W(0, 1) =
W(1, 0) = (
W(0, 1) +
W(1, 0)) /
Scalar(2);
166 template <
class DataPo
int,
class _NFilter,
int DiffType,
typename T>
171 return m_tangentBasis.normalized().transpose() *
175 template <
class DataPo
int,
class _NFilter,
int DiffType,
typename T>
180 return Base::getNeighborFrame().convertToGlobalBasis(m_tangentBasis.normalized().transpose().inverse() *
_lq,
187 template <
class DataPo
int,
class _NFilter,
typename T>
188 requires WIENGARTEN_CURVATURE_ESTIMATOR_REQUIREMENTS
191 if (Base::finalize() !=
STABLE)
192 return Base::m_eCurrentState;
195 Base::weingartenMap(
w);
196 m_solver.computeDirect(
w);
198 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.
FIT_RESULT finalize()
Finalize the procedure.
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.