Commit 57e2e074 authored by Christian Mattes's avatar Christian Mattes

Implemented necessary free functions for OpenMesh Vectors

parent 5e7493b3
Pipeline #6783 failed with stage
in 32 minutes and 5 seconds
......@@ -718,6 +718,34 @@ noexcept(noexcept(_v1.swap(_v2))) {
_v1.swap(_v2);
}
/// \relates OpenMesh::VectorT
/// non-member norm
template<typename Scalar, int DIM>
Scalar norm(const VectorT<Scalar, DIM>& _v) {
return _v.norm();
}
/// \relates OpenMesh::VectorT
/// non-member sqrnorm
template<typename Scalar, int DIM>
Scalar sqrnorm(const VectorT<Scalar, DIM>& _v) {
return _v.sqrnorm();
}
/// \relates OpenMesh::VectorT
/// non-member vectorize
template<typename Scalar, int DIM, typename OtherScalar>
VectorT<Scalar, DIM>& vectorize(VectorT<Scalar, DIM>& _v, OtherScalar const& _val) {
return _v.vectorize(_val);
}
/// \relates OpenMesh::VectorT
/// non-member normalize
template<typename Scalar, int DIM>
VectorT<Scalar, DIM>& normalize(VectorT<Scalar, DIM>& _v) {
return _v.normalize();
}
//== TYPEDEFS =================================================================
/** 1-byte signed vector */
......
......@@ -539,7 +539,7 @@ public:
calc_sector_normal(_heh, n0);
calc_sector_normal(this->opposite_halfedge_handle(_heh), n1);
calc_edge_vector(_heh, he);
Scalar denom = length(n0)*length(n1);
Scalar denom = norm(n0)*norm(n1);
if (denom == Scalar(0))
{
return 0;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment