This is an example of how to use Ponca to compute surface variation on random data with plane fitting.
#include <cmath>
#include <algorithm>
#include <iostream>
#include <Ponca/Fitting>
#include <Ponca/src/Common/pointTypes.h>
#include <Ponca/src/Common/pointGeneration.h>
#include "Eigen/Eigen"
#include <vector>
using namespace std;
using Scalar = MyPoint::Scalar;
using VectorType = MyPoint::VectorType;
template <typename Fit>
{
{
cout <<
"Value of the scalar field at the initial point: " <<
_p.transpose() <<
" is equal to "
cout <<
"It's gradient at this place is equal to: " <<
_fit.primitiveGradient(
_p).transpose() <<
endl;
cout <<
"The initial point " <<
_p.transpose() <<
endl
<<
"Is projected at " <<
_fit.project(
_p).transpose() <<
endl;
cout <<
"Value of the surface variation: " <<
_fit.surfaceVariation() <<
endl;
}
}
{
int n = 10000;
std::cout << "====================\nCovariancePlaneFit:\n";
}
Aggregator class used to declare specialized structures using CRTP.
This Source Code Form is subject to the terms of the Mozilla Public License, v.
FIT_RESULT compute(const IteratorBegin &begin, const IteratorEnd &end)
Convenience function for STL-like iterators Add neighbors stored in a container using STL-like iterat...