10#include "./curvature.h"
11#include "./weingarten.h"
12#include "./heightField.h"
14#include PONCA_MULTIARCH_INCLUDE_STD(cmath)
18#include <Eigen/Geometry>
38 template <
class DataPo
int,
class _NFilter,
typename T>
41 PONCA_FITTING_DECLARE_DEFAULT_TYPES
42 static_assert(DataPoint::Dim == 3,
"MongePatch is only valid in 3D");
47 Check = Base::PROVIDES_PLANE && Base::PROVIDES_TANGENT_PLANE_BASIS &&
48 Base::PROVIDES_HEIGHTFIELD,
69 return Base::height(Base::getUFromLocalCoordinates(x), Base::getVFromLocalCoordinates(x)) -
70 Base::getHFromLocalCoordinates(x);
79 Base::getHFromLocalCoordinates(x) =
80 Base::height(Base::getUFromLocalCoordinates(x), Base::getVFromLocalCoordinates(x));
81 return Base::tangentPlaneToWorld(x);
104 return Base::heightTangentULocal(
_localQ).cross(Base::heightTangentVLocal(
_localQ));
107 PONCA_MULTIARCH
inline void firstFundamentalFormComponents(Scalar&
E, Scalar&
F, Scalar&
G)
const
109 PONCA_MULTIARCH_STD_MATH(
sqrt);
111 const VectorType fv{Base::dh_dv(),
Scalar(0),
Scalar(1)};
117 PONCA_MULTIARCH
inline void secondFundamentalFormComponents(Scalar& L, Scalar& M, Scalar& N)
const
119 PONCA_MULTIARCH_STD_MATH(sqrt);
120 const VectorType fuu{Base::d2h_duu(),
Scalar(0),
Scalar(0)};
121 const VectorType fuv{Base::d2h_duv(),
Scalar(0),
Scalar(0)};
122 const VectorType fvv{Base::d2h_dvv(),
Scalar(0),
Scalar(0)};
141 template <
class DataPo
int,
class _NFilter,
typename T>
144 PONCA_FITTING_DECLARE_DEFAULT_TYPES
149 Check = Base::PROVIDES_QUADRIC_HEIGHTFIELD && Base::PROVIDES_MONGE_PATCH
154 using SampleMatrix = Eigen::Matrix<Scalar, Eigen::Dynamic, Eigen::Dynamic>;
155 using QuadraticHeightFieldCoefficients =
typename Base::HeightFieldCoefficients;
160 QuadraticHeightFieldCoefficients
m_b{QuadraticHeightFieldCoefficients::Zero()};
162 bool m_planeIsReady{
false};
166 PONCA_FITTING_DECLARE_INIT_ADD_FINALIZE
176 template <
class DataPo
int,
class _NFilter,
typename T>
179 PONCA_FITTING_DECLARE_DEFAULT_TYPES
184 Check = Base::PROVIDES_RESTRICTED_QUADRIC_HEIGHTFIELD && Base::PROVIDES_MONGE_PATCH
189 using SampleMatrix = Eigen::Matrix<Scalar, Eigen::Dynamic, Eigen::Dynamic>;
190 using QuadraticHeightFieldCoefficients =
typename Base::HeightFieldCoefficients;
194 QuadraticHeightFieldCoefficients
m_b{QuadraticHeightFieldCoefficients::Zero()};
196 bool m_planeIsReady{
false};
200 PONCA_FITTING_DECLARE_INIT_ADD_FINALIZE
203 template <
class DataPo
int,
class _NFilter,
typename T>
217 template <
class DataPo
int,
class _NFilter,
typename T>
231#include "mongePatch.hpp"
Aggregator class used to declare specialized structures using CRTP.
Make CurvatureEstimatorBase available to standard Basket object.
Extension to compute the best fit quadric on 3d points expressed as .
MongePatchQuadraticFitImpl< DataPoint, _NFilter, T > & mongePatchQuadraticFit()
Explicit conversion to MongePatchQuadraticFitImpl , to access methods potentially hidden by heritage.
SampleMatrix m_A
Quadric input samples.
QuadraticHeightFieldCoefficients m_b
Observations.
Extension to compute the best fit restricted quadric on 3d points expressed as .
MongePatchRestrictedQuadraticFitImpl< DataPoint, _NFilter, T > & mongePatchQuadraticFit()
Explicit conversion to MongePatchRestrictedQuadraticFitImpl , to access methods potentially hidden by...
QuadraticHeightFieldCoefficients m_b
Observations.
SampleMatrix m_A
Quadric input samples.
Monge Patch primitive, defined as , with defined by a Base class.
typename Base::VectorType VectorType
Alias to vector type.
typename DataPoint::Scalar Scalar
Alias to scalar type.
Scalar potential(const VectorType &_q) const
Value of the scalar field at a given point.
@ Check
Requires a heightfield function.
@ PROVIDES_MONGE_PATCH
Provides MongePatch API.
@ PROVIDES_SECOND_FUNDAMENTAL_FORM_COMPONENTS
Provides second fundamental form.
@ PROVIDES_FIRST_FUNDAMENTAL_FORM_COMPONENTS
Provides first fundamental form.
VectorType primitiveGradient(const VectorType &_q) const
Scalar field gradient direction at .
VectorType primitiveGradient() const
Scalar field gradient direction at the basis center.
MongePatch< DataPoint, _NFilter, T > & mongePatchPrimitive()
Explicit conversion to MongePatch , to access methods potentially hidden by heritage.
VectorType primitiveGradientLocal(const VectorType &_localQ=VectorType::Zero()) const
Scalar field gradient direction, both input and output vectors are expressed in the local basis.
VectorType project(const VectorType &_q) const
Orthogonal projection on the patch.
MongePatch()
Default constructor.
Scalar potential() const
Value of the scalar field at the evaluation point.
T Base
Base class of the procedure.
Quadratic height field defined as .
Quadratic height field defined as .
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.