10#include "./curvature.h"
11#include "./weingarten.h"
12#include "./heightField.h"
14#include PONCA_MULTIARCH_INCLUDE_STD(cmath)
35 template <
class DataPo
int,
class _NFilter,
typename T >
38 PONCA_FITTING_DECLARE_DEFAULT_TYPES
39 static_assert ( DataPoint::Dim == 3,
"MongePatch is only valid in 3D");
43 Check = Base::PROVIDES_PLANE &&
44 Base::PROVIDES_TANGENT_PLANE_BASIS &&
45 Base::PROVIDES_HEIGHTFIELD,
68 const VectorType x = Base::worldToTangentPlane(_q);
69 return Base::height(Base::getUFromLocalCoordinates(x),Base::getVFromLocalCoordinates(x)) - Base::getHFromLocalCoordinates(x);
78 Base::getHFromLocalCoordinates(x) = Base::height(Base::getUFromLocalCoordinates(x),Base::getVFromLocalCoordinates(x));
79 return Base::tangentPlaneToWorld(x);
97 VectorType uVect = Base::heightTangentULocal(_localQ);
98 VectorType vVect = Base::heightTangentVLocal(_localQ);
100 VectorType crossN = uVect.normalized().cross(vVect.normalized());
101 return Base::heightTangentULocal(_localQ).cross(Base::heightTangentVLocal(_localQ));
104 PONCA_MULTIARCH
inline void firstFundamentalFormComponents (
Scalar &E,
Scalar &F,
Scalar &G)
const
106 PONCA_MULTIARCH_STD_MATH(sqrt);
114 PONCA_MULTIARCH
inline void secondFundamentalFormComponents (
Scalar &L,
Scalar &M,
Scalar &N)
const
116 PONCA_MULTIARCH_STD_MATH(sqrt);
136 template <
class DataPo
int,
class _NFilter,
typename T>
139 PONCA_FITTING_DECLARE_DEFAULT_TYPES
143 Check = Base::PROVIDES_QUADRIC_HEIGHTFIELD &&
144 Base::PROVIDES_MONGE_PATCH
149 using SampleMatrix = Eigen::Matrix<Scalar,Eigen::Dynamic,Eigen::Dynamic>;
150 using QuadraticHeightFieldCoefficients =
typename Base::HeightFieldCoefficients;
155 QuadraticHeightFieldCoefficients
m_b {QuadraticHeightFieldCoefficients::Zero()};
157 bool m_planeIsReady {
false};
160 PONCA_FITTING_DECLARE_INIT_ADD_FINALIZE
170 template <
class DataPo
int,
class _NFilter,
typename T>
173 PONCA_FITTING_DECLARE_DEFAULT_TYPES
177 Check = Base::PROVIDES_RESTRICTED_QUADRIC_HEIGHTFIELD &&
178 Base::PROVIDES_MONGE_PATCH
183 using SampleMatrix = Eigen::Matrix<Scalar,Eigen::Dynamic,Eigen::Dynamic>;
184 using QuadraticHeightFieldCoefficients =
typename Base::HeightFieldCoefficients;
188 QuadraticHeightFieldCoefficients
m_b {QuadraticHeightFieldCoefficients::Zero()};
190 bool m_planeIsReady {
false};
193 PONCA_FITTING_DECLARE_INIT_ADD_FINALIZE
196template <
class DataPo
int,
class _NFilter,
typename T>
207template <
class DataPo
int,
class _NFilter,
typename T>
218#include "mongePatch.hpp"
Plane fitting procedure using only points position.
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.
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.
@ 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.
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.