14#include <lagrange/SurfaceMesh.h>
15#include <lagrange/geodesic/api.h>
21namespace lagrange::geodesic {
40 std::array<double, 3>
ref_dir = {0.0f, 1.0f, 0.0f};
126template <
typename Scalar,
typename Index>
131 std::vector<std::array<Scalar, 3>>
points;
145template <
typename Scalar,
typename Index>
202 const Mesh& mesh()
const {
return m_mesh.get(); }
203 Mesh& mesh() {
return m_mesh.get(); }
206 std::reference_wrapper<Mesh> m_mesh;
A general purpose polygonal mesh class.
Definition SurfaceMesh.h:73
virtual ~GeodesicEngine()=default
Base class destructor.
virtual SingleSourceGeodesicResult single_source_geodesic(const SingleSourceGeodesicOptions &options)=0
Computes geodesic distance from one source to each vertex on the mesh.
GeodesicEngine(Mesh &mesh)
Base class constructor.
Definition GeodesicEngine.cpp:21
SurfaceMesh< Scalar, Index > Mesh
The mesh type.
Definition GeodesicEngine.h:150
virtual Scalar point_to_point_geodesic(const PointToPointGeodesicOptions &options)
Computes the geodesic distance between two points on the mesh.
Definition GeodesicEngine.cpp:34
virtual GeodesicPathResult< Scalar, Index > point_to_point_geodesic_path(const PointToPointGeodesicPathOptions &options)
Computes the geodesic path between two points on the mesh.
Definition GeodesicEngine.cpp:54
uint32_t AttributeId
Identified to be used to access an attribute.
Definition AttributeFwd.h:73
constexpr AttributeId invalid_attribute_id()
Invalid attribute id.
Definition AttributeFwd.h:76
@ Scalar
Mesh attribute must have exactly 1 channel.
Definition AttributeFwd.h:56
Result of a point-to-point geodesic path computation.
Definition GeodesicEngine.h:128
std::vector< Index > facet_ids
Facet index for each path segment.
Definition GeodesicEngine.h:136
std::vector< std::array< Scalar, 3 > > points
Ordered list of 3D points along the geodesic path from source to target.
Definition GeodesicEngine.h:131
General options for point-to-point geodesic computations.
Definition GeodesicEngine.h:79
std::array< double, 2 > target_facet_bc
Barycentric coordinates of the target point within the target facet.
Definition GeodesicEngine.h:94
size_t target_facet_id
Facets containing the target point.
Definition GeodesicEngine.h:84
std::array< double, 2 > source_facet_bc
Barycentric coordinates of the source point within the source facet.
Definition GeodesicEngine.h:89
size_t source_facet_id
Facet containing the source point.
Definition GeodesicEngine.h:81
Options for point-to-point geodesic path computation.
Definition GeodesicEngine.h:101
std::array< double, 2 > target_facet_bc
Barycentric coordinates of the target point within the target facet.
Definition GeodesicEngine.h:116
size_t target_facet_id
Facet containing the target point.
Definition GeodesicEngine.h:106
std::array< double, 2 > source_facet_bc
Barycentric coordinates of the source point within the source facet.
Definition GeodesicEngine.h:111
size_t source_facet_id
Facet containing the source point.
Definition GeodesicEngine.h:103
General options for one-to-many geodesic computations.
Definition GeodesicEngine.h:27
std::array< double, 3 > second_ref_dir
The secondary reference up direction for the geodesic polar coordinates.
Definition GeodesicEngine.h:46
std::string_view output_geodesic_attribute_name
The name of the output attribute to store the geodesic distance.
Definition GeodesicEngine.h:57
double radius
The maximum geodesic distance from the seed point to consider.
Definition GeodesicEngine.h:54
std::array< double, 2 > source_facet_bc
The barycentric coordinates of the seed facet.
Definition GeodesicEngine.h:34
size_t source_facet_id
The facet id of the seed facet.
Definition GeodesicEngine.h:29
std::array< double, 3 > ref_dir
The reference up direction for the geodesic polar coordinates.
Definition GeodesicEngine.h:40
std::string_view output_polar_angle_attribute_name
The name of the output attribute to store the geodesic polar coordinates.
Definition GeodesicEngine.h:60
Result of a single source geodesic computation.
Definition GeodesicEngine.h:67
AttributeId polar_angle_id
The attribute id of the polar angle attribute, if available.
Definition GeodesicEngine.h:72
AttributeId geodesic_distance_id
The attribute id of the geodesic distance attribute.
Definition GeodesicEngine.h:69