#pragma once #include #include 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 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 { size_t operator()(const internal::helixline_extrude_axis& axis) const { return XXH3_64bits(&axis, sizeof(axis)); } }; template <> struct eq_compare { 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