9#include "../../defines.h"
10#include "../concepts.h"
12#include "../../../Common/Solver/Eigen2x2Solver.h"
14#define FUNDAMENTAL_FORM_WEINGARTEN_ESTIMATOR_REQUIREMENTS \
15 ProvidesFirstFondamentalFormComponents<T>&& ProvidesSecondFondamentalFormComponents<T>&& Is3D<DataPoint>
16#define NORMAL_DERIVATIVE_WEINGARTEN_ESTIMATOR_REQUIREMENTS Is3D<DataPoint>&& ProvidesSpaceDerivative<T>
17#define WIENGARTEN_CURVATURE_ESTIMATOR_REQUIREMENTS \
18 ProvidesTangentPlaneBasis<T>&& ProvidesWeingartenMap<T>&& Is3D<DataPoint>
41 template <
class DataPo
int,
class _NFilter,
typename T>
42 requires FUNDAMENTAL_FORM_WEINGARTEN_ESTIMATOR_REQUIREMENTS
45 PONCA_FITTING_DECLARE_DEFAULT_TYPES
46 using Matrix2 = Eigen::Matrix<Scalar, 2, 2>;
61 template <typename Matrix2Derived>
72 template <typename Matrix2Derived>
79 PONCA_MULTIARCH [[nodiscard]] inline Matrix2
weingartenMap() const;
83 template <typename Matrix2Derived>
84 PONCA_MULTIARCH inline
void weingartenMap(Matrix2Derived& w) const;
110 template <class DataPoint, class _NFilter,
int DiffType, typename T>
111 requires NORMAL_DERIVATIVE_WEINGARTEN_ESTIMATOR_REQUIREMENTS
114 PONCA_FITTING_DECLARE_DEFAULT_TYPES
115 PONCA_FITTING_DECLARE_MATRIX_TYPE
116 PONCA_FITTING_DECLARE_DEFAULT_DER_TYPES
117 using Matrix2 = Eigen::Matrix<Scalar, 2, 2>;
120 MatrixType m_tangentBasis{MatrixType::Zero()};
126 PONCA_FITTING_DECLARE_FINALIZE
128 PONCA_MULTIARCH inline
void init()
133 m_tangentBasis.setZero();
140 PONCA_MULTIARCH [[nodiscard]]
inline Matrix2
weingartenMap()
const;
144 template <
typename Matrix2Derived>
145 PONCA_MULTIARCH
inline void weingartenMap(Matrix2Derived& w)
const;
148 PONCA_MULTIARCH
inline VectorType worldToTangentPlane(
const VectorType& _q,
149 bool _isPositionVector =
true)
const;
152 PONCA_MULTIARCH
inline VectorType tangentPlaneToWorld(
const VectorType& _q,
153 bool _isPositionVector =
true)
const;
155 PONCA_MULTIARCH [[nodiscard]]
inline bool operator==(
158 return Base::operator==(_other) && internal::isApprox(m_tangentBasis, _other.m_tangentBasis);
182 template <
class DataPo
int,
class _NFilter,
typename T>
183 requires WIENGARTEN_CURVATURE_ESTIMATOR_REQUIREMENTS
186 PONCA_FITTING_DECLARE_DEFAULT_TYPES
187 using Matrix2 = Eigen::Matrix<Scalar, 2, 2>;
193 PONCA_FITTING_DECLARE_FINALIZE
195 PONCA_MULTIARCH
inline void init()
200 m_solver.computeDirect(Matrix2::Zero());
204 PONCA_MULTIARCH [[nodiscard]]
inline Scalar kmin()
const {
return m_solver.eigenvalues().x(); }
207 PONCA_MULTIARCH [[nodiscard]]
inline Scalar kmax()
const {
return m_solver.eigenvalues().y(); }
214 vmin.template bottomRows<2>() = m_solver.eigenvectors().col(0);
215 vmin = Base::tangentPlaneToWorld(vmin,
false);
224 vmax.template bottomRows<2>() = m_solver.eigenvectors().col(1);
225 vmax = Base::tangentPlaneToWorld(vmax,
false);
235 PONCA_MULTIARCH [[nodiscard]]
inline bool operator==(
238 return Base::operator==(_other) && m_solver == _other.m_solver;
244 template <
class DataPo
int,
class _NFilter,
typename T>
247 PONCA_FITTING_DECLARE_DEFAULT_TYPES
253 template <class DataPoint, class _NFilter,
int DiffType, typename T>
256 PONCA_FITTING_DECLARE_DEFAULT_TYPES
257 PONCA_FITTING_DECLARE_DEFAULT_DER_TYPES
264#include "weingarten.hpp"
Compute a Weingarten map from the spatial derivatives of the normal field .
NormalDerivativeWeingartenEstimator< DataPoint, _NFilter, DiffType, T > & tangentPlaneBasis()
Explicit conversion to CLASSNAME, to access methods potentially hidden by heritage.
NormalDerivativeWeingartenEstimator< DataPoint, _NFilter, DiffType, T > & normalDerivativeWeingartenEstimator()
Explicit conversion to CLASSNAME, to access methods potentially hidden by heritage.
typename DataPoint::MatrixType MatrixType
Alias to matrix type.
Closed-form eigen decomposition of a 2x2 matrix with real eigenvalues, not necessarily symmetric.
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.
Copyright (c) 2022 Jacques-Olivier Lachaud (jacques-olivier.lachaud@univ-savoie.fr) Laboratory of Mat...
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.
WeingartenCurvatureEstimatorDer< DataPoint, _NFilter, DiffType, T > & curvatureTensor()
Explicit conversion to CLASSNAME, to access methods potentially hidden by heritage.
WeingartenCurvatureEstimatorDer< DataPoint, _NFilter, DiffType, T > & meanCurvature()
Explicit conversion to CLASSNAME, to access methods potentially hidden by heritage.
Compute principal curvatures from a base class providing fundamental forms.
Ponca::WeingartenCurvatureEstimator< DataPoint, _NFilter, FundamentalFormWeingartenEstimator< DataPoint, _NFilter, MongePatchQuadraticFitImpl< DataPoint, _NFilter, MongePatch< DataPoint, _NFilter, QuadraticHeightField< DataPoint, _NFilter, HeightField< DataPoint, _NFilter, CovariancePlaneFit< DataPoint, _NFilter, T > > > > > > >::meanCurvature WeingartenCurvatureEstimator< DataPoint, _NFilter, T > & meanCurvature()
Ponca::WeingartenCurvatureEstimator< DataPoint, _NFilter, FundamentalFormWeingartenEstimator< DataPoint, _NFilter, MongePatchQuadraticFitImpl< DataPoint, _NFilter, MongePatch< DataPoint, _NFilter, QuadraticHeightField< DataPoint, _NFilter, HeightField< DataPoint, _NFilter, CovariancePlaneFit< DataPoint, _NFilter, T > > > > > > >::curvatureTensor WeingartenCurvatureEstimator< DataPoint, _NFilter, T > & curvatureTensor()