73 template <
typename DataPo
int>
76 using MatrixType =
typename DataPoint::MatrixType;
77 using Scalar =
typename DataPoint::Scalar;
78 using VectorType =
typename DataPoint::VectorType;
80 static constexpr Scalar
epsilon = Eigen::NumTraits<Scalar>::epsilon();
86 static bool isDegenerate(
const VectorType&
a,
const VectorType& b,
const VectorType&
c)
102 static void polarTriangle(
const VectorType&
a,
const VectorType& b,
const VectorType&
c, VectorType&
Ap,
103 VectorType&
Bp, VectorType&
Cp)
129 if (
Ta == VectorType::Zero() ||
Tb == VectorType::Zero() ||
Tc == VectorType::Zero())
133 Scalar
ca = std::max(Scalar(-1.0), std::min(Scalar(1.0),
Tb.dot(
Tc)));
134 Scalar
cb = std::max(Scalar(-1.0), std::min(Scalar(1.0),
Tc.dot(
Ta)));
135 Scalar
cc = std::max(Scalar(-1.0), std::min(Scalar(1.0),
Ta.dot(
Tb)));
143 static Scalar
area(
const VectorType&
a,
const VectorType& b,
const VectorType&
c)
155 static Scalar
algebraicArea(
const VectorType&
a,
const VectorType& b,
const VectorType&
c)
158 VectorType
M =
a + b +
c;
162 return M.dot(
X) < 0.0 ? -
S :
S;
184 const VectorType&
ua,
const VectorType&
ub,
const VectorType&
uc,
189 VectorType
uM = (
ua +
ub +
uc) / 3.0;
211 const VectorType&
ua,
const VectorType&
ub,
const VectorType&
uc,
215 VectorType
uM = (
ua +
ub +
uc) / Scalar(3.0);
218 return Scalar(0.25) * (
uM.cross(
uc -
ub).dot(
a) +
uM.cross(
ua -
uc).dot(b) +
uM.cross(
ub -
ua).dot(
c));
234 const VectorType&
ua,
const VectorType&
ub,
const VectorType&
uc,
243 return Scalar(0.5) * (
ua.cross(
ub).dot(
uc));
256 const VectorType&
ua,
const VectorType&
ub,
const VectorType&
uc,
259 MatrixType T = MatrixType::Zero();
260 VectorType
uM = (
ua +
ub +
uc) / 3.0;
263 const VectorType
uac =
uc -
ua;
264 const VectorType
uab =
ub -
ua;
265 const VectorType
ab = b -
a;
266 const VectorType
ac =
c -
a;
267 for (
size_t i = 0;
i < 3; ++
i)
269 VectorType
X = VectorType::Zero();
271 for (
size_t j = 0;
j < 3; ++
j)
301 const Scalar
coef_N = Scalar(1000.0) * area;
303 for (
int j = 0;
j < 3;
j++)
304 for (
int k = 0; k < 3; k++)
307 Eigen::SelfAdjointEigenSolver<MatrixType>
eigensolver(
M);
317 return std::pair<VectorType, VectorType>(
v1,
v2);
333 const Scalar
coef_N = Scalar(1000.0) * area;
335 for (
int j = 0;
j < 3;
j++)
336 for (
int k = 0; k < 3; k++)
339 Eigen::SelfAdjointEigenSolver<MatrixType>
eigensolver(
M);
353 return std::make_tuple(Scalar(0.0), Scalar(0.0),
v1,
v2);
Aggregator class used to declare specialized structures using CRTP.
Copyright (c) 2022 Jacques-Olivier Lachaud (jacques-olivier.lachaud@univ-savoie.fr) Laboratory of Mat...
Represents a triangle on a sphere of radius one.
static void polarTriangle(const VectorType &a, const VectorType &b, const VectorType &c, VectorType &Ap, VectorType &Bp, VectorType &Cp)
static Scalar area(const VectorType &a, const VectorType &b, const VectorType &c)
static Scalar algebraicArea(const VectorType &a, const VectorType &b, const VectorType &c)
static bool isDegenerate(const VectorType &a, const VectorType &b, const VectorType &c)
Spherical point data type.
static void interiorAngles(const VectorType &a, const VectorType &b, const VectorType &c, Scalar &alpha, Scalar &beta, Scalar &gamma)
Returns the interior angles of the spherical triangle ABC.
This class contains some stand-alone CorrectedNormalCurrent formulas for triangles,...
static Scalar mu2InterpolatedU(const VectorType &a, const VectorType &b, const VectorType &c, const VectorType &ua, const VectorType &ub, const VectorType &uc, bool unit_u=false)
Computes mu2 measure (Gaussian curvature) of triangle abc given an interpolated corrected normal vect...
static Scalar mu0InterpolatedU(const VectorType &a, const VectorType &b, const VectorType &c, const VectorType &ua, const VectorType &ub, const VectorType &uc, bool unit_u=false)
Computes mu0 measure (area) of triangle abc given an interpolated corrected normal vector ua,...
static MatrixType muXYInterpolatedU(const VectorType &a, const VectorType &b, const VectorType &c, const VectorType &ua, const VectorType &ub, const VectorType &uc, bool unit_u=false)
Computes muXY measure (anisotropic curvature) of triangle abc given an interpolated corrected normal ...
static std::tuple< Scalar, Scalar, VectorType, VectorType > curvaturesFromTensor(const MatrixType &tensor, const Scalar area, const VectorType &N)
Computing principal curvatures k1 and k2 from tensor.
static Scalar mu1InterpolatedU(const VectorType &a, const VectorType &b, const VectorType &c, const VectorType &ua, const VectorType &ub, const VectorType &uc, bool unit_u=false)
Computes mu1 measure (mean curvature) of triangle abc given an interpolated corrected normal vector u...
static constexpr Scalar epsilon
Small constant used to approximate zero.
static std::pair< VectorType, VectorType > curvDirFromTensor(const MatrixType &tensor, const Scalar area, const VectorType &N)
Computing principal curvatures k1 and k2 from tensor.