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.
39 lines
1.5 KiB
39 lines
1.5 KiB
|
2 weeks ago
|
#pragma once
|
||
|
|
|
||
|
|
#include <math/math_defs.hpp>
|
||
|
|
#include <primitive/axis/extrude_axis.hpp>
|
||
|
|
|
||
|
|
namespace internal
|
||
|
|
{
|
||
|
|
struct PE_API helixline_extrude_axis final : public extrude_axis {
|
||
|
|
~helixline_extrude_axis() override = default;
|
||
|
|
|
||
|
|
double get_closest_param(Eigen::Vector3d p) const override;
|
||
|
|
std::pair<Eigen::Vector2d, Eigen::Projective2d> to_pattern_local(double t, Eigen::Vector3d p) const override;
|
||
|
|
Eigen::AffineCompact3d get_local_cap_mat(double t) const override;
|
||
|
|
|
||
|
|
aabb_t get_local_aabb() const override { return k_aabb_up_unit; }
|
||
|
|
|
||
|
|
double scale_coeff_x; // x缩放倍率(r)
|
||
|
|
double scale_coeff_y; // y缩放倍率(rh*sqrt((theta^2+1)/(r^2theta^2+h^2)))
|
||
|
|
double total_theta; // 总旋转角度(<0时为左旋,>0时为右旋)
|
||
|
|
};
|
||
|
|
} // namespace internal
|
||
|
|
|
||
|
|
namespace detail
|
||
|
|
{
|
||
|
|
template <>
|
||
|
|
struct hasher<internal::helixline_extrude_axis> {
|
||
|
|
size_t operator()(const internal::helixline_extrude_axis& axis) const { return XXH3_64bits(&axis, sizeof(axis)); }
|
||
|
|
};
|
||
|
|
|
||
|
|
template <>
|
||
|
|
struct eq_compare<internal::helixline_extrude_axis> {
|
||
|
|
bool operator()(const internal::helixline_extrude_axis& lhs, const internal::helixline_extrude_axis& rhs) const
|
||
|
|
{
|
||
|
|
return std::abs(lhs.scale_coeff_x - rhs.scale_coeff_x) <= epsilon //
|
||
|
|
&& std::abs(lhs.scale_coeff_y - rhs.scale_coeff_y) <= epsilon //
|
||
|
|
&& std::abs(lhs.total_theta - rhs.total_theta) <= epsilon;
|
||
|
|
}
|
||
|
|
};
|
||
|
|
} // namespace detail
|