37 m_cyl_transform_params->axis(), m_cyl_transform_params->orientation());
39 m_cyl_transform_params->orientation(), hcf_frame_y_axis,
40 m_cyl_transform_params->axis(), pos - m_cyl_transform_params->center());
73 auto endpoint_angle = pos_phi;
74 if (std::fabs(pos_phi) < m_central_angle / 2.) {
77 pos_phi > 0. ? m_central_angle / 2. : -m_central_angle / 2.;
84 auto const line_director = (r2_endpoint - r1_endpoint).normalized();
86 auto project_on_line = [](
auto const vec,
auto const line_start,
87 auto const line_director) {
88 return line_start + line_director * ((vec - line_start) * line_director);
91 auto pos_closest_hcf_frame =
92 project_on_line(pos_hcf_frame, r1_endpoint, line_director);
97 if (std::fabs(pos_closest_hcf_frame[2]) > m_length / 2.) {
98 pos_closest_hcf_frame =
99 pos_closest_hcf_frame[2] > 0. ? r1_endpoint : r2_endpoint;
103 auto const u = (pos_hcf_frame - pos_closest_hcf_frame).normalize();
105 (pos_hcf_frame - pos_closest_hcf_frame).norm() - 0.5 * m_thickness;
109 dist = d * m_direction;
112 auto const vec_hcf_frame = d * u;
114 hcf_frame_y_axis, m_cyl_transform_params->axis(),
115 vec_hcf_frame,
true);