10#include "./curvature.h"
11#include "./weingarten.h"
12#include "./heightField.h"
14#include PONCA_MULTIARCH_INCLUDE_STD(cmath)
36 template <
class DataPo
int,
class _NFilter,
typename T>
39 PONCA_FITTING_DECLARE_DEFAULT_TYPES
40 static_assert(DataPoint::Dim == 3,
"MongePatch is only valid in 3D");
45 Check = Base::PROVIDES_PLANE && Base::PROVIDES_TANGENT_PLANE_BASIS &&
46 Base::PROVIDES_HEIGHTFIELD,
66 const VectorType x = Base::worldToTangentPlane(_q);
67 return Base::height(Base::getUFromLocalCoordinates(x), Base::getVFromLocalCoordinates(x)) -
68 Base::getHFromLocalCoordinates(x);
77 Base::getHFromLocalCoordinates(x) =
78 Base::height(Base::getUFromLocalCoordinates(x), Base::getVFromLocalCoordinates(x));
79 return Base::tangentPlaneToWorld(x);
96 const VectorType& _localQ = VectorType::Zero())
const
98 VectorType uVect = Base::heightTangentULocal(_localQ);
99 VectorType vVect = Base::heightTangentVLocal(_localQ);
101 VectorType crossN = uVect.normalized().cross(vVect.normalized());
102 return Base::heightTangentULocal(_localQ).cross(Base::heightTangentVLocal(_localQ));
105 PONCA_MULTIARCH
inline void firstFundamentalFormComponents(Scalar& E, Scalar& F, Scalar& G)
const
107 PONCA_MULTIARCH_STD_MATH(sqrt);
108 const VectorType fu{Base::dh_du(),
Scalar(1),
Scalar(0)};
109 const VectorType fv{Base::dh_dv(),
Scalar(0),
Scalar(1)};
115 PONCA_MULTIARCH
inline void secondFundamentalFormComponents(Scalar& L, Scalar& M, Scalar& N)
const
117 PONCA_MULTIARCH_STD_MATH(sqrt);
118 const VectorType fuu{Base::d2h_duu(),
Scalar(0),
Scalar(0)};
119 const VectorType fuv{Base::d2h_duv(),
Scalar(0),
Scalar(0)};
120 const VectorType fvv{Base::d2h_dvv(),
Scalar(0),
Scalar(0)};
139 template <
class DataPo
int,
class _NFilter,
typename T>
142 PONCA_FITTING_DECLARE_DEFAULT_TYPES
147 Check = Base::PROVIDES_QUADRIC_HEIGHTFIELD && Base::PROVIDES_MONGE_PATCH
152 using SampleMatrix = Eigen::Matrix<Scalar, Eigen::Dynamic, Eigen::Dynamic>;
153 using QuadraticHeightFieldCoefficients =
typename Base::HeightFieldCoefficients;
158 QuadraticHeightFieldCoefficients
m_b{QuadraticHeightFieldCoefficients::Zero()};
160 bool m_planeIsReady{
false};
164 PONCA_FITTING_DECLARE_INIT_ADD_FINALIZE
174 template <
class DataPo
int,
class _NFilter,
typename T>
177 PONCA_FITTING_DECLARE_DEFAULT_TYPES
182 Check = Base::PROVIDES_RESTRICTED_QUADRIC_HEIGHTFIELD && Base::PROVIDES_MONGE_PATCH
187 using SampleMatrix = Eigen::Matrix<Scalar, Eigen::Dynamic, Eigen::Dynamic>;
188 using QuadraticHeightFieldCoefficients =
typename Base::HeightFieldCoefficients;
192 QuadraticHeightFieldCoefficients
m_b{QuadraticHeightFieldCoefficients::Zero()};
194 bool m_planeIsReady{
false};
198 PONCA_FITTING_DECLARE_INIT_ADD_FINALIZE
201 template <
class DataPo
int,
class _NFilter,
typename T>
215 template <
class DataPo
int,
class _NFilter,
typename T>
229#include "mongePatch.hpp"
Make CurvatureEstimatorBase available to standard Basket object.
Internal base classe for height fields.
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.