9#include "../../defines.h"
10#include "../concepts.h"
12#define FUNDAMENTAL_FORM_WEINGARTEN_ESTIMATOR_REQUIREMENTS \
13 ProvidesFirstFondamentalFormComponents<T>&& ProvidesSecondFondamentalFormComponents<T>&& Is3D<DataPoint>
14#define NORMAL_DERIVATIVE_WEINGARTEN_ESTIMATOR_REQUIREMENTS Is3D<DataPoint>&& ProvidesSpaceDerivative<T>
15#define WIENGARTEN_CURVATURE_ESTIMATOR_REQUIREMENTS \
16 ProvidesTangentPlaneBasis<T>&& ProvidesWeingartenMap<T>&& Is3D<DataPoint>
39 template <
class DataPo
int,
class _NFilter,
typename T>
40 requires FUNDAMENTAL_FORM_WEINGARTEN_ESTIMATOR_REQUIREMENTS
43 PONCA_FITTING_DECLARE_DEFAULT_TYPES
44 using Matrix2 = Eigen::Matrix<Scalar, 2, 2>;
59 template <typename Matrix2Derived>
70 template <typename Matrix2Derived>
77 PONCA_MULTIARCH [[nodiscard]] inline Matrix2
weingartenMap() const;
81 template <typename Matrix2Derived>
82 PONCA_MULTIARCH inline
void weingartenMap(Matrix2Derived& w) const;
108 template <class DataPoint, class _NFilter,
int DiffType, typename T>
109 requires NORMAL_DERIVATIVE_WEINGARTEN_ESTIMATOR_REQUIREMENTS
112 PONCA_FITTING_DECLARE_DEFAULT_TYPES
113 PONCA_FITTING_DECLARE_MATRIX_TYPE
114 PONCA_FITTING_DECLARE_DEFAULT_DER_TYPES
115 using Matrix2 = Eigen::Matrix<Scalar, 2, 2>;
118 MatrixType m_tangentBasis{MatrixType::Zero()};
123 PONCA_FITTING_DECLARE_FINALIZE
129 PONCA_MULTIARCH [[nodiscard]] inline Matrix2
weingartenMap() const;
133 template <typename Matrix2Derived>
134 PONCA_MULTIARCH inline
void weingartenMap(Matrix2Derived& w) const;
138 bool _isPositionVector = true) const;
142 bool _isPositionVector = true) const;
164 template <
class DataPo
int,
class _NFilter,
typename T>
165 requires WIENGARTEN_CURVATURE_ESTIMATOR_REQUIREMENTS
168 PONCA_FITTING_DECLARE_DEFAULT_TYPES
169 using Matrix2 = Eigen::Matrix<Scalar, 2, 2>;
172 Eigen::SelfAdjointEigenSolver<Matrix2> m_solver;
175 PONCA_FITTING_DECLARE_FINALIZE
178 PONCA_MULTIARCH [[nodiscard]]
inline Scalar kmin()
const {
return m_solver.eigenvalues().x(); }
181 PONCA_MULTIARCH [[nodiscard]]
inline Scalar kmax()
const {
return m_solver.eigenvalues().y(); }
188 vmin.template bottomRows<2>() = m_solver.eigenvectors().col(0);
189 vmin = Base::tangentPlaneToWorld(vmin,
false);
198 vmax.template bottomRows<2>() = m_solver.eigenvectors().col(1);
199 vmax = Base::tangentPlaneToWorld(vmax,
false);
204 PONCA_MULTIARCH [[nodiscard]]
inline Scalar kMean()
const {
return (kmin() + kmax()) /
Scalar(2); }
212 template <
class DataPo
int,
class _NFilter,
typename T>
215 PONCA_FITTING_DECLARE_DEFAULT_TYPES
221 template <class DataPoint, class _NFilter,
int DiffType, typename T>
224 PONCA_FITTING_DECLARE_DEFAULT_TYPES
225 PONCA_FITTING_DECLARE_DEFAULT_DER_TYPES
232#include "weingarten.hpp"
Compute a Weingarten map from the spatial derivatives of the normal field .
typename Base::VectorType VectorType
Alias to vector type.
typename DataPoint::MatrixType MatrixType
Alias to matrix type.
Compute principal curvatures from a base class providing fundamental forms.
Scalar GaussianCurvature() const
Returns an estimate of the Gaussian curvature.
typename Base::VectorType VectorType
Alias to vector type.
Scalar kmax() const
Returns an estimate of the maximal principal curvature value.
Scalar kmin() const
Returns an estimate of the minimal principal curvature value.
VectorType kmaxDirection() const
Returns an estimate of the maximal principal curvature direction.
Scalar kMean() const
Returns an estimate of the mean curvature.
typename DataPoint::Scalar Scalar
Alias to scalar type.
VectorType kminDirection() const
Returns an estimate of the minimal principal curvature direction.
This Source Code Form is subject to the terms of the Mozilla Public License, v.
DiffType
Flags defining which derivatives need to be computed.
Compute principal curvatures from a base class providing fundamental forms.
Compute principal curvatures from a base class providing fundamental forms.