22#include <shapes/Cylinder.hpp>
47 return {-(r -
m_rad), 0};
56 return {
m_rad - r, 0};
64 auto const z =
e_z * c_dist;
65 auto const r_vec = c_dist - z *
e_z;
66 auto const r = r_vec.
norm();
70 auto const e_r = (r == 0) ?
e_r_axis : r_vec / r;
85 dist = std::sqrt(dr * dr + dz * dz) *
m_direction * side;
86 vec = -dr * e_r - dz *
e_z;
Vector implementation and trait types for boost qvm interoperability.
bool m_open
whether to ignore bottom and top cap of cylinder
double m_half_length
Center of smoothing circle.
double m_rad
cylinder radius.
Utils::Vector3d e_r_axis
Alternative e_r for corner case.
Utils::Vector3d e_z
Unit vector in z direction.
void calculate_dist(const Utils::Vector3d &pos, double &dist, Utils::Vector3d &vec) const override
double m_direction
direction -1: inside, +1 outside
Utils::Vector3d m_center
center of the cylinder.
std::pair< double, double > dist_half_pore(double r, double z) const