Wildmeshing Toolkit
Loading...
Searching...
No Matches
Quadrics.hpp
1#pragma once
2
3#include <wmtk/Types.hpp>
4
5namespace wmtk::components::topological_offset {
6
15{
16public:
20 Quadrics(const double a, const double b, const double c, const double d);
21
25 Quadrics(const Vector3d& p0, const Vector3d& n);
26
27 Quadrics(const Eigen::Ref<const Matrix4d>& matrix);
28
29 Quadrics(const Quadrics& other) = default;
30
31 Quadrics& operator+=(const Quadrics& other);
32 Quadrics operator+(const Quadrics& other) const;
33 Quadrics operator*(const double scalar) const;
34 Quadrics& operator*=(const double scalar);
35
47 Vector3d solve(const Eigen::Ref<const Vector3d>& p, double svd_threshold = 1e-2) const;
48
49 double squared_distance_to_optimum(
50 const Eigen::Ref<const Vector3d>& p,
51 double svd_threshold = 1e-2) const;
52
53private:
54 Matrix4d m_matrix = Matrix4d::Zero();
55};
56
57} // namespace wmtk::components::topological_offset
A quadric error metric (QEM), represented as a 4x4 matrix built from weighted plane samples....
Definition Quadrics.hpp:15
Vector3d solve(const Eigen::Ref< const Vector3d > &p, double svd_threshold=1e-2) const
solve for the position minimizing the quadric error, regularized toward p along directions the quadri...
Definition Quadrics.cpp:50