#pragma once #include namespace internal { // local: plane x=0 // u: planar local x-axis // v: planar local y-axis struct plane_t final : subface { }; } // namespace internal namespace detail { inline auto get_plane_character(const internal::plane_t& subface) { // CAUTION: we use vec4d to contain translation info here // to do this, we have to use the first row of world_to_local instead of the first column of local_to_world // since the later one does not contain translation info Eigen::Vector4d vec = subface.world_to_local.matrix().row(0); auto norm = vec.head<3>().norm(); vec /= norm; return vec; } template <> inline size_t hasher::operator()(const internal::plane_t& subface) const { return hash_funcs(get_plane_character(subface)); } template <> inline bool eq_compare::operator()(const internal::plane_t& lhs, const internal::plane_t& rhs) const { return eq_funcs(get_plane_character(lhs), get_plane_character(rhs)); } } // namespace detail