Ponca  19ef58fd3760f23a8af99a5eeac4f934757e30d9
Point Cloud Analysis library
Loading...
Searching...
No Matches
weingarten.h
1/*
2This Source Code Form is subject to the terms of the Mozilla Public
3 License, v. 2.0. If a copy of the MPL was not distributed with this
4 file, You can obtain one at http://mozilla.org/MPL/2.0/.
5*/
6
7#pragma once
8
9#include "./defines.h"
10
11namespace Ponca
12{
32 template <class DataPoint, class _NFilter, typename T>
34 {
35 PONCA_FITTING_DECLARE_DEFAULT_TYPES
36 using Matrix2 = Eigen::Matrix<Scalar, 2, 2>;
37 static_assert(DataPoint::Dim == 3, "FundamentalFormWeingartenEstimator is only valid in 3D");
38
39 protected:
40 enum
41 {
42 Check =
43 Base::PROVIDES_FIRST_FUNDAMENTAL_FORM_COMPONENTS && Base::PROVIDES_SECOND_FUNDAMENTAL_FORM_COMPONENTS,
44 PROVIDES_WEINGARTEN_MAP
45 };
46
47 public:
49
50
54 PONCA_MULTIARCH [[nodiscard]] inline Matrix2 firstFundamentalForm() const;
55
58 template <typename Matrix2Derived>
59 PONCA_MULTIARCH inline void firstFundamentalForm(Matrix2Derived& first) const;
60
65 PONCA_MULTIARCH [[nodiscard]] inline Matrix2 secondFundamentalForm() const;
66
69 template <typename Matrix2Derived>
70 PONCA_MULTIARCH inline void secondFundamentalForm(Matrix2Derived& second) const;
71
76 PONCA_MULTIARCH [[nodiscard]] inline Matrix2 weingartenMap() const;
77
80 template <typename Matrix2Derived>
81 PONCA_MULTIARCH inline void weingartenMap(Matrix2Derived& w) const;
82
84 PONCA_MULTIARCH inline Scalar kMean() const;
85
87 PONCA_MULTIARCH inline Scalar GaussianCurvature() const;
88 };
89
107 template <class DataPoint, class _NFilter, int DiffType, typename T>
109 {
110 PONCA_FITTING_DECLARE_DEFAULT_TYPES
111 PONCA_FITTING_DECLARE_MATRIX_TYPE
112 PONCA_FITTING_DECLARE_DEFAULT_DER_TYPES
113 using Matrix2 = Eigen::Matrix<Scalar, 2, 2>;
114 static_assert(DataPoint::Dim == 3, "NormalDerivativeWeingartenEstimator is only valid in 3D");
115 static_assert(Base::isSpaceDer(), "NormalDerivativeWeingartenEstimator requires spatial derivation");
116
117 protected:
118 enum
119 {
120 Check = Base::PROVIDES_NORMAL_DERIVATIVE,
121 PROVIDES_WEINGARTEN_MAP,
122 PROVIDES_TANGENT_PLANE_BASIS
123 };
124
125 private:
126 MatrixType m_tangentBasis{MatrixType::Zero()};
127
128 public:
130 PONCA_FITTING_DECLARE_FINALIZE
131
136 PONCA_MULTIARCH [[nodiscard]] inline Matrix2 weingartenMap() const;
137
140 template <typename Matrix2Derived>
141 PONCA_MULTIARCH inline void weingartenMap(Matrix2Derived& w) const;
142
144 PONCA_MULTIARCH inline VectorType worldToTangentPlane(const VectorType& _q,
145 bool _isPositionVector = true) const;
146
148 PONCA_MULTIARCH inline VectorType tangentPlaneToWorld(const VectorType& _q,
149 bool _isPositionVector = true) const;
150 };
151
152 namespace internal
153 {
171 template <class DataPoint, class _NFilter, typename T>
173 {
174 PONCA_FITTING_DECLARE_DEFAULT_TYPES
175 using Matrix2 = Eigen::Matrix<Scalar, 2, 2>;
176 static_assert(DataPoint::Dim == 3, "WeingartenCurvatureEstimator is only valid in 3D");
177
178 protected:
179 enum
180 {
181 Check = Base::PROVIDES_TANGENT_PLANE_BASIS && // required for tangentPlaneToWorld
182 Base::PROVIDES_PRINCIPAL_CURVATURES && // required curvature storage
183 Base::PROVIDES_WEINGARTEN_MAP
184 };
185
186 public:
187 PONCA_FITTING_DECLARE_FINALIZE
188 };
189 } // namespace internal
190
192 template <class DataPoint, class _NFilter, typename T>
194 {
195 PONCA_FITTING_DECLARE_DEFAULT_TYPES
197 };
198
200 template <class DataPoint, class _NFilter, int DiffType, typename T>
202 {
203 PONCA_FITTING_DECLARE_DEFAULT_TYPES
204 PONCA_FITTING_DECLARE_DEFAULT_DER_TYPES
206 };
207
208} // namespace Ponca
209
210#include "weingarten.hpp"
211
Compute a Weingarten map from fundamental forms.
Definition weingarten.h:34
Scalar GaussianCurvature() const
Returns an estimate of the Gaussian curvature directly from the fundamental forms.
Matrix2 secondFundamentalForm() const
Assembles and returns the second fundamental form from the base class.
FundamentalFormWeingartenEstimator< DataPoint, _NFilter, T > & fundamentalFormWeingartenEstimator()
Explicit conversion to FundamentalFormWeingartenEstimator , to access methods potentially hidden by h...
Definition weingarten.h:48
Matrix2 firstFundamentalForm() const
Assembles and returns the first fundamental form from the base class.
Definition weingarten.hpp:9
typename DataPoint::Scalar Scalar
Alias to scalar type.
Definition weingarten.h:35
Scalar kMean() const
Returns an estimate of the mean curvature directly from the fundamental forms.
Matrix2 weingartenMap() const
Returns the Weingarten Map.
Compute a Weingarten map from the spatial derivatives of the normal field .
Definition weingarten.h:109
typename Base::VectorType VectorType
Alias to vector type.
Definition weingarten.h:110
VectorType tangentPlaneToWorld(const VectorType &_q, bool _isPositionVector=true) const
Transform a point from the tangent plane [h, u, v]^T to ambient space.
NormalDerivativeWeingartenEstimator< DataPoint, _NFilter, DiffType, T > & normalDerivativeWeingartenEstimator()
Explicit conversion to NormalDerivativeWeingartenEstimator , to access methods potentially hidden by ...
Definition weingarten.h:129
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.
Definition weingarten.h:111
Matrix2 weingartenMap() const
Returns the Weingarten Map.
Compute principal curvatures from a base class providing fundamental forms.
Definition weingarten.h:173
This Source Code Form is subject to the terms of the Mozilla Public License, v.
Compute principal curvatures from a base class providing fundamental forms.
Definition weingarten.h:202
WeingartenCurvatureEstimatorDer< DataPoint, _NFilter, DiffType, T > & weingartenCurvatureEstimator()
Explicit conversion to WeingartenCurvatureEstimatorDer , to access methods potentially hidden by heri...
Definition weingarten.h:205
Compute principal curvatures from a base class providing fundamental forms.
Definition weingarten.h:194
WeingartenCurvatureEstimator< DataPoint, _NFilter, T > & weingartenCurvatureEstimator()
Explicit conversion to WeingartenCurvatureEstimator , to access methods potentially hidden by heritag...
Definition weingarten.h:196