RINGMesh  Version 5.0.0
A programming library for geological model meshes
RINGMesh::Distance Namespace Reference

Functions

template<index_t DIMENSION>
std::tuple< double, vecn< DIMENSION > > point_to_segment (const Geometry::Point< DIMENSION > &point, const Geometry::Segment< DIMENSION > &segment)
 
template<index_t DIMENSION>
std::tuple< double, vecn< DIMENSION > > point_to_triangle (const Geometry::Point< DIMENSION > &point, const Geometry::Triangle< DIMENSION > &triangle)
 
std::tuple< double, vec3 > RINGMESH_API point_to_tetra (const Geometry::Point3D &point, const Geometry::Tetra &tetra)
 
std::tuple< double, vec3 > RINGMESH_API point_to_plane (const Geometry::Point3D &point, const Geometry::Plane &plane)
 
template<>
std::tuple< double, vec3point_to_triangle (const Geometry::Point3D &point, const Geometry::Triangle3D &triangle)
 
template<>
std::tuple< double, vec2point_to_segment (const Geometry::Point2D &point, const Geometry::Segment2D &segment)
 
template<>
std::tuple< double, vec2point_to_triangle (const Geometry::Point2D &point, const Geometry::Triangle2D &triangle)
 
template<>
std::tuple< double, vec3point_to_segment (const Geometry::Point3D &point, const Geometry::Segment3D &segment)
 
template std::tuple< double, vecn< 2 > > RINGMESH_API point_to_segment (const Geometry::Point< 2 > &, const Geometry::Segment< 2 > &)
 
template std::tuple< double, vecn< 2 > > RINGMESH_API point_to_triangle (const Geometry::Point< 2 > &, const Geometry::Triangle< 2 > &)
 
template std::tuple< double, vecn< 3 > > RINGMESH_API point_to_segment (const Geometry::Point< 3 > &, const Geometry::Segment< 3 > &)
 
template std::tuple< double, vecn< 3 > > RINGMESH_API point_to_triangle (const Geometry::Point< 3 > &, const Geometry::Triangle< 3 > &)
 

Function Documentation

◆ point_to_plane()

std::tuple< double, vec3 > RINGMesh::Distance::point_to_plane ( const Geometry::Point3D &  point,
const Geometry::Plane plane 
)

Computes the distance between a point and a plane

Returns
a tuple containing:
  • the distance between the point and the plane.
  • the nearest point on the plane.

Definition at line 439 of file geometry_distance.cpp.

◆ point_to_segment() [1/5]

template<index_t DIMENSION>
std::tuple< double, vecn< DIMENSION > > RINGMesh::Distance::point_to_segment ( const Geometry::Point< DIMENSION > &  point,
const Geometry::Segment< DIMENSION > &  segment 
)

Computes the smallest distance between a point and a segment

Returns
a tuple containing the following elements (in this order):
  • the smallest distance
  • the closest point on the segment

◆ point_to_segment() [2/5]

template<>
std::tuple< double, vec2 > RINGMesh::Distance::point_to_segment ( const Geometry::Point2D &  point,
const Geometry::Segment2D &  segment 
)

Definition at line 295 of file geometry_distance.cpp.

◆ point_to_segment() [3/5]

template<>
std::tuple< double, vec3 > RINGMesh::Distance::point_to_segment ( const Geometry::Point3D &  point,
const Geometry::Segment3D &  segment 
)

Definition at line 418 of file geometry_distance.cpp.

◆ point_to_segment() [4/5]

template std::tuple< double, vecn< 2 > > RINGMESH_API RINGMesh::Distance::point_to_segment ( const Geometry::Point< 2 > &  ,
const Geometry::Segment< 2 > &   
)

◆ point_to_segment() [5/5]

template std::tuple< double, vecn< 3 > > RINGMESH_API RINGMesh::Distance::point_to_segment ( const Geometry::Point< 3 > &  ,
const Geometry::Segment< 3 > &   
)

◆ point_to_tetra()

std::tuple< double, vec3 > RINGMesh::Distance::point_to_tetra ( const Geometry::Point3D &  point,
const Geometry::Tetra tetra 
)

Computes the distance between a point and a tetrahedron

Returns
a tuple containing:
  • the distance between the point and the tetrahedron facets.
  • the nearest point on the tetrahedron.

Definition at line 388 of file geometry_distance.cpp.

◆ point_to_triangle() [1/5]

template<>
std::tuple< double, vec3 > RINGMesh::Distance::point_to_triangle ( const Geometry::Point3D &  point,
const Geometry::Triangle3D &  triangle 
)

Definition at line 54 of file geometry_distance.cpp.

◆ point_to_triangle() [2/5]

template<index_t DIMENSION>
std::tuple< double, vecn< DIMENSION > > RINGMesh::Distance::point_to_triangle ( const Geometry::Point< DIMENSION > &  point,
const Geometry::Triangle< DIMENSION > &  triangle 
)

Computes the smallest distance between a point and a triangle

Returns
a tuple containing the following elements (in this order):
  • the smallest distance
  • the closest point on the triangle

◆ point_to_triangle() [3/5]

template<>
std::tuple< double, vec2 > RINGMesh::Distance::point_to_triangle ( const Geometry::Point2D &  point,
const Geometry::Triangle2D &  triangle 
)

Definition at line 337 of file geometry_distance.cpp.

◆ point_to_triangle() [4/5]

template std::tuple< double, vecn< 2 > > RINGMESH_API RINGMesh::Distance::point_to_triangle ( const Geometry::Point< 2 > &  ,
const Geometry::Triangle< 2 > &   
)

◆ point_to_triangle() [5/5]

template std::tuple< double, vecn< 3 > > RINGMESH_API RINGMesh::Distance::point_to_triangle ( const Geometry::Point< 3 > &  ,
const Geometry::Triangle< 3 > &   
)