2template <
class DataPo
int,
class _NFilter,
typename T>
3 requires MONGE_PATCH_FIT_REQUIREMENTS
8 m_A = SampleMatrix(6, 6);
13template <
class DataPo
int,
class _NFilter,
typename T>
14 requires MONGE_PATCH_FIT_REQUIREMENTS
16 const DataPoint& attributes)
20 Base::addLocalNeighbor(w, localQ, attributes);
25 const VectorType local = Base::worldToTangentPlane(attributes.pos());
26 const Scalar& h = Base::getHFromLocalCoordinates(local);
27 const Scalar& u = Base::getUFromLocalCoordinates(local);
28 const Scalar& v = Base::getVFromLocalCoordinates(local);
30 Eigen::Matrix<Scalar, 6, 1> p;
31 p << u * u, v * v, u * v, u, v, 1;
32 m_A += w * p * p.transpose();
37template <
class DataPo
int,
class _NFilter,
typename T>
38 requires MONGE_PATCH_FIT_REQUIREMENTS
44 return Base::finalize();
50 Base::quadraticHeightField().setQuadric(
51 m_A.bdcSvd(Eigen::ComputeThinU | Eigen::ComputeThinV | Eigen::NoQRPreconditioner).solve(m_b));
53 return Base::m_eCurrentState =
STABLE;
56template <
class DataPo
int,
class _NFilter,
typename T>
57 requires MONGE_PATCH_FIT_REQUIREMENTS
62 m_A = SampleMatrix(4, 4);
67template <
class DataPo
int,
class _NFilter,
typename T>
68 requires MONGE_PATCH_FIT_REQUIREMENTS
70 const DataPoint& attributes)
74 Base::addLocalNeighbor(w, localQ, attributes);
79 const VectorType local = Base::worldToTangentPlane(attributes.pos());
80 const Scalar& h = Base::getHFromLocalCoordinates(local);
81 const Scalar& u = Base::getUFromLocalCoordinates(local);
82 const Scalar& v = Base::getVFromLocalCoordinates(local);
84 Eigen::Matrix<Scalar, 4, 1> p;
85 p << u * u, v * v, u * v, 1;
86 m_A += w * p * p.transpose();
91template <
class DataPo
int,
class _NFilter,
typename T>
92 requires MONGE_PATCH_FIT_REQUIREMENTS
98 return Base::finalize();
103 Base::quadraticHeightField().setQuadric(
104 m_A.jacobiSvd(Eigen::ComputeThinU | Eigen::ComputeThinV | Eigen::NoQRPreconditioner).solve(m_b));
106 return Base::m_eCurrentState =
STABLE;
Extension to compute the best fit quadric on 3d points expressed as .
typename DataPoint::Scalar Scalar
Alias to scalar type.
typename Base::VectorType VectorType
Alias to vector type.
Extension to compute the best fit restricted quadric on 3d points expressed as .
typename DataPoint::Scalar Scalar
Alias to scalar type.
typename Base::VectorType VectorType
Alias to vector type.
FIT_RESULT
Enum corresponding to the state of a fitting method (and what the finalize function returns)
@ STABLE
The fitting is stable and ready to use.