| 1420 | } |
| 1421 | |
| 1422 | std::tuple< double, Point3D > point_disk_distance( |
| 1423 | const Point3D& point, const Disk& disk ) |
| 1424 | { |
| 1425 | const Vector3D center_to_point{ disk.plane().origin(), point }; |
| 1426 | const auto distance_to_plane = |
| 1427 | center_to_point.dot( disk.plane().normal() ); |
| 1428 | const auto projected_on_plane = |
| 1429 | point - disk.plane().normal() * distance_to_plane; |
| 1430 | if( point_point_distance( disk.plane().origin(), projected_on_plane ) |
| 1431 | <= disk.radius() ) |
| 1432 | { |
| 1433 | return std::make_tuple( |
| 1434 | std::fabs( distance_to_plane ), projected_on_plane ); |
| 1435 | } |
| 1436 | return point_circle_distance( point, disk ); |
| 1437 | } |
| 1438 | |
| 1439 | template < index_t dimension > |
| 1440 | double Bisector( const geode::index_t number_of_components, |