OpenABF 2.1.0
Loading...
Searching...
No Matches
Classes | Typedefs | Functions
OpenABF::detail::hlscm Namespace Reference

Implementation details for HierarchicalLSCM. More...

Classes

struct  CollapseRecord
 Record of a single half-edge collapse for prolongation. More...
 
class  DecimationMesh
 Lightweight flat-array mesh for decimation. More...
 
struct  HierarchyLevel
 A level in the mesh hierarchy. More...
 
struct  Quadric
 Symmetric 4×4 quadric matrix for QEM error metric (Garland-Heckbert) More...
 

Typedefs

template<typename T >
using UVVector = std::vector< std::optional< Vec< T, 2 > > >
 

Functions

template<typename T , class MeshPtr >
auto BuildHierarchy (const MeshPtr &mesh, const std::vector< std::size_t > &pinIndices, std::size_t levelRatio, std::size_t minCoarseVerts) -> std::pair< std::vector< HierarchyLevel< T > >, std::vector< std::vector< CollapseRecord< T > > > >
 Build a mesh hierarchy by greedy QEM decimation.
 
template<typename T >
auto BuildLevelMesh (const HierarchyLevel< T > &level) -> typename HalfEdgeMesh< T >::Pointer
 Build a HalfEdgeMesh from a hierarchy level.
 
template<typename T >
auto ProlongateUVs (UVVector< T > uvs, const std::vector< CollapseRecord< T > > &collapses) -> UVVector< T >
 Prolongate UV coordinates from a coarser level to a finer level.
 
template<typename T , class SolverType >
auto SolveLSCMLevel (const typename HalfEdgeMesh< T >::Pointer &levelMesh, const detail::hlscm::HierarchyLevel< T > &level, const detail::lscm::PinMap< T > &origPins, std::size_t origVertCount, const UVVector< T > *initialGuess) -> UVVector< T >
 Solve the LSCM system at one hierarchy level.
 

Detailed Description

Implementation details for HierarchicalLSCM.

Typedef Documentation

◆ UVVector

template<typename T >
using OpenABF::detail::hlscm::UVVector = typedef std::vector<std::optional<Vec<T, 2> >>
private

UV vector indexed by original (finest-level) vertex idx. Slots for vertices not yet solved/prolongated hold std::nullopt.

Function Documentation

◆ BuildHierarchy()

template<typename T , class MeshPtr >
auto OpenABF::detail::hlscm::BuildHierarchy ( const MeshPtr mesh,
const std::vector< std::size_t > &  pinIndices,
std::size_t  levelRatio,
std::size_t  minCoarseVerts 
) -> std::pair<std::vector<HierarchyLevel<T>>, std::vector<std::vector<CollapseRecord<T>>>>
private

Build a mesh hierarchy by greedy QEM decimation.

Returns a vector of HierarchyLevel from finest to coarsest, plus the collapse records needed for prolongation (ordered from finest to coarsest).

◆ ProlongateUVs()

template<typename T >
auto OpenABF::detail::hlscm::ProlongateUVs ( UVVector< T >  uvs,
const std::vector< CollapseRecord< T > > &  collapses 
) -> UVVector<T>
private

Prolongate UV coordinates from a coarser level to a finer level.

Surviving vertices keep their existing UVs; vertices that were removed by a collapse get UVs via barycentric interpolation in their containing post-collapse triangle.

Parameters
uvsUV coordinates indexed by original vertex index. Unset slots are std::nullopt. Mutated in place: every vertex removed in collapses is filled in. Returned by move.
collapsesCollapse records for this level transition.

◆ SolveLSCMLevel()

template<typename T , class SolverType >
auto OpenABF::detail::hlscm::SolveLSCMLevel ( const typename HalfEdgeMesh< T >::Pointer &  levelMesh,
const detail::hlscm::HierarchyLevel< T > &  level,
const detail::lscm::PinMap< T > &  origPins,
std::size_t  origVertCount,
const UVVector< T > *  initialGuess 
) -> UVVector<T>
private

Solve the LSCM system at one hierarchy level.

Builds the Lévy et al. Eq. 10 LSCM system on the given level mesh with the given pin vertices. If an initial guess is provided, uses solveWithGuess.

Parameters
origVertCountOriginal (finest-level) vertex count; sizes the output UV vector so it can be indexed by original vertex idx.
Returns
UV coordinates indexed by original vertex index. Slots for vertices not present at this level remain std::nullopt.