You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
|
|
|
|
#pragma once
|
|
|
|
|
|
|
|
|
|
#include <base/subface.hpp>
|
|
|
|
|
|
|
|
|
|
namespace internal
|
|
|
|
|
{
|
|
|
|
|
// local: cylinder face x^2+y^2-1=0
|
|
|
|
|
// u: planar angle from x-axis to z-axis
|
|
|
|
|
// v: depth/height from xz-plane to y-axis
|
|
|
|
|
struct cylinder_face_t final : subface {
|
|
|
|
|
};
|
|
|
|
|
} // namespace internal
|
|
|
|
|
|
|
|
|
|
namespace detail
|
|
|
|
|
{
|
|
|
|
|
// Q' = M^{-T}QM^{-1}
|
|
|
|
|
// Q = {
|
|
|
|
|
// 1, 0, 0, 0
|
|
|
|
|
// 0, 1, 0, 0
|
|
|
|
|
// 0, 0, 0, 0
|
|
|
|
|
// 0, 0, 0, -1
|
|
|
|
|
// }
|
|
|
|
|
const Eigen::Vector4d cylinder_std_diag{1, 1, 0, -1};
|
|
|
|
|
|
|
|
|
|
template <>
|
|
|
|
|
inline size_t hasher<internal::cylinder_face_t>::operator()(const internal::cylinder_face_t& subface) const
|
|
|
|
|
{
|
|
|
|
|
return hash_funcs(get_quadrics_character(cylinder_std_diag, subface));
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
template <>
|
|
|
|
|
inline bool eq_compare<internal::cylinder_face_t>::operator()(const internal::cylinder_face_t& lhs,
|
|
|
|
|
const internal::cylinder_face_t& rhs) const
|
|
|
|
|
{
|
|
|
|
|
return eq_funcs(get_quadrics_character(cylinder_std_diag, lhs), get_quadrics_character(cylinder_std_diag, rhs));
|
|
|
|
|
}
|
|
|
|
|
} // namespace detail
|