Prusa Slicer 2.6.0
Loading...
Searching...
No Matches
CurvatureCalculator::Quadric Class Reference

Public Member Functions

IGL_INLINE Quadric ()
 
IGL_INLINE Quadric (double av, double bv, double cv, double dv, double ev)
 
IGL_INLINE double & a ()
 
IGL_INLINE double & b ()
 
IGL_INLINE double & c ()
 
IGL_INLINE double & d ()
 
IGL_INLINE double & e ()
 
IGL_INLINE double evaluate (double u, double v)
 
IGL_INLINE double du (double u, double v)
 
IGL_INLINE double dv (double u, double v)
 
IGL_INLINE double duv (double u, double v)
 
IGL_INLINE double duu (double u, double v)
 
IGL_INLINE double dvv (double u, double v)
 

Static Public Member Functions

static IGL_INLINE Quadric fit (const std::vector< Eigen::Vector3d > &VV)
 

Public Attributes

double data [5]
 

Detailed Description

Constructor & Destructor Documentation

◆ Quadric() [1/2]

IGL_INLINE CurvatureCalculator::Quadric::Quadric ( )
inline
56 {
57 a() = b() = c() = d() = e() = 1.0;
58 }
IGL_INLINE double & e()
Definition principal_curvature.cpp:73
IGL_INLINE double & b()
Definition principal_curvature.cpp:70
IGL_INLINE double & c()
Definition principal_curvature.cpp:71
IGL_INLINE double & a()
Definition principal_curvature.cpp:69
IGL_INLINE double & d()
Definition principal_curvature.cpp:72

References a(), b(), c(), d(), and e().

Referenced by fit().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ Quadric() [2/2]

IGL_INLINE CurvatureCalculator::Quadric::Quadric ( double  av,
double  bv,
double  cv,
double  dv,
double  ev 
)
inline
61 {
62 a() = av;
63 b() = bv;
64 c() = cv;
65 d() = dv;
66 e() = ev;
67 }
IGL_INLINE double dv(double u, double v)
Definition principal_curvature.cpp:87

References a(), b(), c(), d(), dv(), and e().

+ Here is the call graph for this function:

Member Function Documentation

◆ a()

IGL_INLINE double & CurvatureCalculator::Quadric::a ( )
inline
69{ return data[0];}
double data[5]
Definition principal_curvature.cpp:75

References data.

Referenced by Quadric(), Quadric(), du(), duu(), evaluate(), and CurvatureCalculator::finalEigenStuff().

+ Here is the caller graph for this function:

◆ b()

IGL_INLINE double & CurvatureCalculator::Quadric::b ( )
inline
70{ return data[1];}

References data.

Referenced by Quadric(), Quadric(), du(), duv(), dv(), evaluate(), CurvatureCalculator::finalEigenStuff(), and fit().

+ Here is the caller graph for this function:

◆ c()

IGL_INLINE double & CurvatureCalculator::Quadric::c ( )
inline
71{ return data[2];}

References data.

Referenced by Quadric(), Quadric(), dv(), dvv(), evaluate(), CurvatureCalculator::finalEigenStuff(), and fit().

+ Here is the caller graph for this function:

◆ d()

IGL_INLINE double & CurvatureCalculator::Quadric::d ( )
inline
72{ return data[3];}

References data.

Referenced by Quadric(), Quadric(), du(), evaluate(), and CurvatureCalculator::finalEigenStuff().

+ Here is the caller graph for this function:

◆ du()

IGL_INLINE double CurvatureCalculator::Quadric::du ( double  u,
double  v 
)
inline
83 {
84 return 2.0*a()*u + b()*v + d();
85 }

References a(), b(), and d().

+ Here is the call graph for this function:

◆ duu()

IGL_INLINE double CurvatureCalculator::Quadric::duu ( double  u,
double  v 
)
inline
98 {
99 return 2.0*a();
100 }

References a().

+ Here is the call graph for this function:

◆ duv()

IGL_INLINE double CurvatureCalculator::Quadric::duv ( double  u,
double  v 
)
inline
93 {
94 return b();
95 }

References b().

+ Here is the call graph for this function:

◆ dv()

IGL_INLINE double CurvatureCalculator::Quadric::dv ( double  u,
double  v 
)
inline
88 {
89 return 2.0*c()*v + b()*u + e();
90 }

References b(), c(), and e().

Referenced by Quadric().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ dvv()

IGL_INLINE double CurvatureCalculator::Quadric::dvv ( double  u,
double  v 
)
inline
103 {
104 return 2.0*c();
105 }

References c().

+ Here is the call graph for this function:

◆ e()

IGL_INLINE double & CurvatureCalculator::Quadric::e ( )
inline
73{ return data[4];}

References data.

Referenced by Quadric(), Quadric(), dv(), evaluate(), and CurvatureCalculator::finalEigenStuff().

+ Here is the caller graph for this function:

◆ evaluate()

IGL_INLINE double CurvatureCalculator::Quadric::evaluate ( double  u,
double  v 
)
inline
78 {
79 return a()*u*u + b()*u*v + c()*v*v + d()*u + e()*v;
80 }

References a(), b(), c(), d(), and e().

+ Here is the call graph for this function:

◆ fit()

static IGL_INLINE Quadric CurvatureCalculator::Quadric::fit ( const std::vector< Eigen::Vector3d > &  VV)
inlinestatic
109 {
110 assert(VV.size() >= 5);
111 if (VV.size() < 5)
112 {
113 std::cerr << "ASSERT FAILED! fit function requires at least 5 points: Only " << VV.size() << " were given." << std::endl;
114 exit(0);
115 }
116
117 Eigen::MatrixXd A(VV.size(),5);
118 Eigen::MatrixXd b(VV.size(),1);
119 Eigen::MatrixXd sol(5,1);
120
121 for(unsigned int c=0; c < VV.size(); ++c)
122 {
123 double u = VV[c][0];
124 double v = VV[c][1];
125 double n = VV[c][2];
126
127 A(c,0) = u*u;
128 A(c,1) = u*v;
129 A(c,2) = v*v;
130 A(c,3) = u;
131 A(c,4) = v;
132
133 b(c) = n;
134 }
135
136 sol=A.jacobiSvd(Eigen::ComputeThinU | Eigen::ComputeThinV).solve(b);
137
138 return Quadric(sol(0),sol(1),sol(2),sol(3),sol(4));
139 }
IGL_INLINE Quadric()
Definition principal_curvature.cpp:55
@ ComputeThinV
Definition Constants.h:389
@ ComputeThinU
Definition Constants.h:385

References Quadric(), b(), c(), Eigen::ComputeThinU, and Eigen::ComputeThinV.

Referenced by CurvatureCalculator::fitQuadric().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

Member Data Documentation

◆ data

double CurvatureCalculator::Quadric::data[5]

Referenced by a(), b(), c(), d(), and e().


The documentation for this class was generated from the following file: