54 gsMappedBasis<2,T> & mbasis) ;
84 hybrid_pdm_tdm_boundary_pdm,
85 hybrid_error_pdm_tdm_boundary_pdm,
86 hybrid_curvature_pdm_tdm_boundary_pdm,
98 tdm_method method = hybrid_curvature_pdm_tdm_boundary_pdm);
174 void get_Error(std::vector<T>& errors,
int type = 0)
const;
185 return m_pointErrors;
192 std::count_if(m_pointErrors.begin(), m_pointErrors.end(),
193 GS_BIND2ND(std::less<T>(), threshold));
304 gsInfo <<
"Parametric domain: ["
305 << m_uMin <<
", " << m_uMax <<
"] x ["
306 << m_vMin <<
", " << m_vMax <<
"]" << std::endl;
336 result.resize(points.rows() * 3, 1);
337 result << points.col(0), points.col(1), points.col(2);
363 std::vector<T> m_pointErrors;
368 mutable T m_last_lambda;
388 T m_uMin, m_uMax, m_vMin, m_vMax;
396#ifdef GISMO_WITH_PYBIND11
401 void pybind11_init_gsFitting(pybind11::module &m);
409#ifndef GISMO_BUILD_LIB
410#include GISMO_HPP_HEADER(gsFitting.hpp)
A B-spline function of one argument, with arbitrary target dimension.
Definition gsBSpline.h:51
A basis represents a family of scalar basis functions defined over a common parameter domain.
Definition gsBasis.h:79
Class for performing a fit of a parametrized point cloud with a gsGeometry.
Definition gsFitting.h:32
gsMappedSpline< 2, T > m_mresult
Pointer keeping the resulting multipatch geometry.
Definition gsFitting.h:360
gsMatrix< T > m_param_values
the parameter values of the point cloud
Definition gsFitting.h:345
gsFitting()
default constructor
Definition gsFitting.h:35
tdm_method
choose the method for computing the coefficients: TDM, PDM, HDM with different blending weights
Definition gsFitting.h:81
size_t numPointsBelow(T threshold) const
Computes the number of points below the error threshold (or zero if not fitted)
Definition gsFitting.h:189
bool is_point_within_cell(const gsMatrix< T > ¶meter, const gsMatrix< T > &element)
check if the given parameter parameter is within the cell element
gsGeometry< T > * result() const
gives back the computed approximation
Definition gsFitting.h:252
gsMatrix< T > fill_pointWiseErrors(const index_t &num_int, T &max_err_int)
vector of length num_int containing all the point-wise errors; store also the max err value in max_er...
Definition gsFitting.hpp:222
void assembleBlockB(const gsMatrix< T > &points, const gsMatrix< T > ¶ms, index_t num_basis, gsSparseMatrix< T > &result) const
Assembles 3xblock collocation matrix.
Definition gsFitting.h:320
void assembleBlockX(const gsMatrix< T > &points, gsMatrix< T > &result) const
Assembles the right hand side vectors for PDM/TDM.
Definition gsFitting.h:333
void extendSystem(gsSparseMatrix< T > &A_mat, gsMatrix< T > &m_B)
Extends the system of equations by taking constraints into account.
Definition gsFitting.hpp:773
void computeApproxError(T &error, int type=0) const
Definition gsFitting.hpp:1011
void assembleSystem(gsSparseMatrix< T > &A_mat, gsMatrix< T > &B)
Assembles system for the least square fit.
Definition gsFitting.hpp:731
bool is_point_inside_support(const T x, const T y, const gsMatrix< T > &support)
check if the given parameter x, y is inside the support support; same as is_point_inside_support,...
const std::vector< T > & pointWiseErrors() const
Return the errors for each point.
Definition gsFitting.h:183
void initParametricDomain()
Initialize the parametric domain of the point cloud.
Definition gsFitting.h:297
void parameterCorrectionSepBoundary_tdm(T accuracy, index_t maxIter, T mu, T sigma, const std::vector< index_t > &sepIndex, tdm_method method=hybrid_curvature_pdm_tdm_boundary_pdm)
parameterCorrectionSepBoundary_tdm: apply maxIter steps of parameter correction for HDM method,...
Definition gsFitting.hpp:646
void applySmoothing(T lambda, gsSparseMatrix< T > &A_mat)
Adds to the matrix A_mat terms for minimization of second derivative, weighted with parameter lambda.
Definition gsFitting.hpp:816
gsGeometry< T > * m_result
Pointer keeping the resulting geometry.
Definition gsFitting.h:357
T m_max_error
Maximum point-wise error.
Definition gsFitting.h:371
void initializeGeometry(const gsMatrix< T > &coefficients, const gsMatrix< T > ¶meters)
initializeGeometry: Initializes the fitted geometry with given coefficients and parameters
Definition gsFitting.hpp:175
gsMatrix< T > inverse_principal_curvatures(const index_t &num_int, const gsMatrix< T > ¶ms_int)
vector of length num_int containing rho = 1/max(c1, c2), where c1, c2 are the principal curvature val...
Definition gsFitting.hpp:266
gsMatrix< T > & returnParamValues()
returns the parameter values
Definition gsFitting.h:263
gsFunctionSet< T > * m_basis
Pointer keeping the basis.
Definition gsFitting.h:354
void compute_normals(const index_t &num_int, const gsMatrix< T > ¶ms_int, gsSparseMatrix< T > &N_int)
compute_normals: Computes the normals of the fitted geometry at the input parameter values params_int
Definition gsFitting.hpp:195
const gsMappedSpline< 2, T > & mresult() const
gives back the computed approximation for multipatch geometry
Definition gsFitting.h:255
void compute_tdm(T lambda, T mu, T sigma, const std::vector< index_t > &interpIdx, tdm_method method=hybrid_curvature_pdm_tdm_boundary_pdm)
compute_hdm: computes the coefficients of the spline geometry via Hybrid Distance Minimization (HDM)
Definition gsFitting.hpp:375
void setConstraints(const gsSparseMatrix< T > &lhs, const gsMatrix< T > &rhs)
Definition gsFitting.h:272
T minPointError() const
Returns the minimum point-wise error from the pount cloud (or zero if not fitted)
Definition gsFitting.h:177
void parameterProjectionSepBoundary(T accuracy, const std::vector< index_t > &interpIdx)
parameterProjectionSepBoundary: project the points onto the fitted geometry, separating interior and ...
Definition gsFitting.hpp:554
const gsBasis< T > & getBasis() const
Returns the basis of the approximation.
Definition gsFitting.h:258
T m_min_error
Minimum point-wise error.
Definition gsFitting.h:374
void get_Error(std::vector< T > &errors, int type=0) const
Definition gsFitting.hpp:1053
void compute(T lambda=0)
compute: Computes the coefficients of the spline geometry via penalized least squares
Definition gsFitting.hpp:77
void computeMaxNormErrors()
Definition gsFitting.hpp:979
gsMatrix< T > returnPoints() const
returns the points
Definition gsFitting.h:266
virtual ~gsFitting()
Destructor.
Definition gsFitting.hpp:31
void parameterCorrectionSepBoundary_pdm(T accuracy, index_t maxIter, const std::vector< index_t > &sepIndex)
parameterCorrectionSepBoundary_pdm: apply maxIter steps of parameter correction for PDM method,...
Definition gsFitting.hpp:670
gsSparseMatrix< T > m_constraintsLHS
Definition gsFitting.h:380
T lambda() const
Returns the smoothing weight used in the last fitting.
Definition gsFitting.h:310
bool is_point_within_cell(const T x, const T y, const gsMatrix< T > &element)
check if the given parameter x, y is within the cell element; same as is_point_within_cell,...
void parameterCorrection(T accuracy=1e-8, index_t maxIter=10, T tolOrth=1e-6)
parameterCorrection: globally apply maxIter steps of parameter correction to the least squares fitted...
Definition gsFitting.hpp:692
gsMatrix< T > m_constraintsRHS
Definition gsFitting.h:386
void blending_weights(const gsSparseMatrix< T > &N_int, const index_t &num_int, const T &mu, const T &sigma, const gsMatrix< T > ¶ms_int, tdm_method method, gsSparseMatrix< T > &NNT)
blending_weights: computes the blending weights mu and sigma for the balance mu * PDM + sigma * TDM i...
Definition gsFitting.hpp:294
void updateGeometry(gsMatrix< T > coefficients, gsMatrix< T > parameters)
updateGeometry: Updates the fitted geometry with new coefficients and parameters
Definition gsFitting.hpp:154
gsMatrix< T > principal_curvatures(const gsMatrix< T > ¶ms)
compute the principal curvatures (c1, c2) at the given parameters params
Definition gsFitting.hpp:237
void iterativeCompute(T const &tolerance, unsigned const &num_iters=10)
Computes the least squares fit for a gsBasis.
gsMatrix< T > m_points
the points of the point cloud
Definition gsFitting.h:348
T maxPointError() const
Returns the maximum point-wise error from the pount cloud (or zero if not fitted)
Definition gsFitting.h:180
bool is_corner(gsMatrix< T > ¶metric_domain, gsVector< T > ¶meter)
check if the given parameter parameter is a corner of the domain parametric_domain
Definition gsFitting.hpp:484
bool is_point_inside_support(const gsMatrix< T > ¶meter, const gsMatrix< T > &support)
void computeErrors()
Definition gsFitting.hpp:907
Interface for the set of functions defined on a domain (the total number of functions in the set equa...
Definition gsFunctionSet.h:219
Abstract base class representing a geometry map.
Definition gsGeometry.h:93
A matrix with arbitrary coefficient type and fixed or dynamic size.
Definition gsMatrix.h:41
Sparse matrix class, based on gsEigen::SparseMatrix.
Definition gsSparseMatrix.h:139
A vector with arbitrary coefficient type and fixed or dynamic size.
Definition gsVector.h:37
#define index_t
Definition gsConfig.h:32
#define GISMO_UNUSED(x)
Definition gsDebug.h:112
#define gsInfo
Definition gsDebug.h:43
Provides forward declarations of types and structs.
Provides declaration of Basis abstract interface.
Provides declaration of Basis abstract interface.
The G+Smo namespace, containing all definitions for the library.
void threeOnDiag(const gsSparseMatrix< T > &block, gsSparseMatrix< T > &result)
Definition gsModelingUtils.hpp:664
GISMO_DEPRECATED bool parameter(int s)
Returns the parameter value (false=0=start, true=1=end) that corresponds to side s.
Definition gsBoundary.h:1069