OpenABF 2.1.0
Loading...
Searching...
No Matches
Namespaces | Classes | Typedefs | Enumerations | Functions | Variables
OpenABF Namespace Reference

OpenABF top-level namespace More...

Namespaces

namespace  detail
 Implementation details.
 
namespace  io_formats
 Mesh IO support for various file formats.
 
namespace  io_utils
 Mesh IO utility functions.
 
namespace  traits
 Traits for meshes and algorithms.
 

Classes

class  ABF
 Compute parameterized interior angles using Angle-based flattening. More...
 
class  ABFPlusPlus
 Compute parameterized interior angles using ABF++. More...
 
class  AngleBasedLSCM
 Compute parameterized mesh using Angle-based LSCM. More...
 
class  HalfEdgeMesh
 Half-edge mesh class. More...
 
class  HierarchicalLSCM
 Compute parameterized mesh using Hierarchical LSCM. More...
 
class  MeshException
 Solver exception. More...
 
class  SolverException
 Solver exception. More...
 
class  Vec
 N-dimensional vector class. More...
 

Typedefs

using Vec3f = Vec< float, 3 >
 3D, 32-bit float vector
 
using Vec3d = Vec< double, 3 >
 3D, 64-bit float vector
 

Enumerations

enum class  Norm { L1 , L2 , LInf }
 Norm type enumeration. More...
 

Functions

template<typename T1 , typename T2 >
auto dot (const T1 &a, const T2 &b)
 Vector dot product (inner product)
 
template<typename T1 , typename T2 >
auto cross (const T1 &a, const T2 &b) -> T1
 Vector cross product.
 
template<class Vector >
auto norm (const Vector &v, Norm norm=Norm::L2)
 Compute vector norm.
 
template<class Vector >
auto normalize (Vector v)
 Normalize a vector (i.e. compute a unit vector)
 
template<class Vector1 , class Vector2 >
auto interior_angle (const Vector1 &a, const Vector2 &b)
 Compute the interior angle between two vectors.
 
template<typename T = float, typename T2 , std::enable_if_t< std::is_floating_point_v< T >, bool > = true>
constexpr auto to_radians (T2 deg) -> T
 Convert degrees to radians.
 
template<typename T = float, typename T2 , std::enable_if_t< std::is_floating_point_v< T >, bool > = true>
constexpr auto to_degrees (T2 rad) -> T
 Convert radians to degrees.
 
template<typename T , std::size_t Dims>
std::ostream & operator<< (std::ostream &os, const Vec< T, Dims > &vec)
 
template<class FacePtr >
void ComputeFaceAngles (FacePtr &face)
 Compute the internal angles of a face.
 
template<class MeshPtr >
void ComputeMeshAngles (MeshPtr &mesh)
 Compute the internal angles for all faces in a mesh.
 
template<class MeshPtr >
auto HasBoundary (const MeshPtr &mesh) -> bool
 Determines if mesh is open or closed.
 
template<class MeshPtr >
auto HasUnreferencedVertices (const MeshPtr &mesh) -> bool
 Check if a mesh has unreferenced vertices.
 
template<class MeshPtr >
auto UnreferencedVertices (const MeshPtr &mesh) -> std::vector< std::size_t >
 Get a list of unreferenced vertices.
 
template<class MeshPtr >
auto IsManifold (const MeshPtr &mesh) -> bool
 Check if mesh is manifold.
 
template<class MeshPtr >
auto FindEdgePath (const MeshPtr &mesh, std::size_t from, std::size_t to)
 Find an edge path between two vertices.
 
template<class MeshType >
auto ReadMesh (const std::filesystem::path &path)
 Load a HalfEdgeMesh from a file.
 
template<class MeshPtr >
void WriteMesh (const std::filesystem::path &path, const MeshPtr &mesh)
 Write a HalfEdgeMesh to a file.
 

Variables

template<class T >
constexprPI = T(3.1415926535897932385L)
 Pi, templated for floating-point type.
 
template<class T >
constexpr T INF = std::numeric_limits<T>::infinity()
 Inf, templated for floating-point type.
 

Detailed Description

OpenABF top-level namespace

Enumeration Type Documentation

◆ Norm

Norm type enumeration.

Enumerator
L1 

$L_1$ norm

L2 

$L_2$ norm

LInf 

$L_{Inf}$ norm

Function Documentation

◆ ComputeFaceAngles()

template<class FacePtr >
void OpenABF::ComputeFaceAngles ( FacePtr &  face)
private

Compute the internal angles of a face.

Updates the current angle (DefaultEdgeTraits::alpha) with the internal angles derived from the face's vertex positions. Useful if you want to reset a face after being processed by ABF or ABFPlusPlus.

Template Parameters
FacePtrA Face-type pointer implementing DefaultEdgeTraits
Exceptions
MeshExceptionIf interior angle is NaN or Inf

◆ ComputeMeshAngles()

template<class MeshPtr >
void OpenABF::ComputeMeshAngles ( MeshPtr mesh)
private

Compute the internal angles for all faces in a mesh.

Runs ComputeFaceAngles on all faces in the mesh. Useful if you want to reset a mesh after running through ABF or ABFPlusPlus.

Template Parameters
MeshPtrA Mesh-type pointer with faces implementing DefaultEdgeTraits

◆ FindEdgePath()

template<class MeshPtr >
auto OpenABF::FindEdgePath ( const MeshPtr mesh,
std::size_t  from,
std::size_t  to 
)
private

Find an edge path between two vertices.

Uses Dijkstra's algorithm to find the shortest path between two vertices. Distance is measured using the edge lengths of the mesh. The returned mesh is not guaranteed to be the only shortest path (there may be many which have the same length), but only the first discovered.

If the returned list is empty, the endpoints are the same or a path between the two endpoints does not exist (i.e. the mesh has multiple connected components).

Returns
std::vector<EdgePtr>

◆ HasUnreferencedVertices()

template<class MeshPtr >
auto OpenABF::HasUnreferencedVertices ( const MeshPtr mesh) -> bool
private

Check if a mesh has unreferenced vertices.

Note
This only checks if the vertex is associated with at least one edge. A face is not currently guaranteed.

◆ operator<<()

template<typename T , std::size_t Dims>
std::ostream & OpenABF::operator<< ( std::ostream &  os,
const Vec< T, Dims > &  vec 
)

Debug: Print a vector to a std::ostream

◆ UnreferencedVertices()

template<class MeshPtr >
auto OpenABF::UnreferencedVertices ( const MeshPtr mesh) -> std::vector<std::size_t>
private

Get a list of unreferenced vertices.

Note
This only checks if the vertex is associated with at least one edge. A face is not currently guaranteed.