libsurf
Programmer's Documentation

Public Member Functions | Static Public Member Functions | Private Types | Private Member Functions | Static Private Member Functions | Private Attributes | Static Private Attributes | List of all members
UvMapping Class Reference

Detailed Description

Parameter-space mapping.

UvMapping builds a transformation from surface parameter space (u,v) to a new space (s,t). The aim of the transformation is that a triangle which is well-spaed (in terms of edge-to-circumradius or angles) in (s,t) space is also well-shaped in the 3D space (x,y,z) <- S(u,v).

See Also
UvMapDelaunay, DelaunayCore

#include <uvmapping.h>

Collaboration diagram for UvMapping:
[legend]

Public Member Functions

 UvMapping ()
 undefined mapping
 
 UvMapping (const Surface &srf, const Vector &up, const Vector &vp)
 initialized mapping
 
void init (const Surface &srf, const Vector &up, const Vector &vp)
 construct mapping for surface srf avaluated at given parameter grid
 
void boundaries (Real &tmin, Real &tmax) const
 determine min/max boundaries for t
 
bool empty () const
 check whether mapping is initialized
 
void dump (const std::string &fname) const
 dump mapping to file (debugging)
 
Real eval (Real u, Real v) const
 evaluate mapping t <- (u,v) while implicitly, s <- u
 
Vct2 eval (const Vct2 &uv) const
 convenience interface
 
Vct2 gradient (Real u, Real v) const
 evaluate derivatives of mapping t <- (u,v)
 
Vct2 uvStep (const Vct2 &uv, const Vct2 &dst) const
 solve for step in uv for a given change in st
 
Vct2 invert (const Vct2 &st, Real tol=1e-9) const
 compute (u,v) for known (s,t) without initial guess
 
Vct2 lookup (const Vct2 &st) const
 obtain an initial guess for the inverse mapping (s,t) -> (u,v)
 
bool invert (const Vct2 &st, Vct2 &uv, Real tol=1e-9) const
 compute (u,v) for known (s,t) starting from a initial guess
 
void plane (const Surface &srf, Real u, Real v, Vct3 &Ss, Vct3 &St) const
 compute derivatives of surface coordinates S w.r.t. s,t
 
void clear ()
 clear data
 

Static Public Member Functions

template<int ND>
static Vct2 mappingCriteria (const SVector< ND > &Su, const SVector< ND > &Sv)
 compute the mapping criteria from surface derivatives
 

Private Types

enum  { SDEG = 2 }
 

Private Member Functions

void fitSpline (const Surface &srf)
 solve least-squares problem, assumes spline bases are initialized
 
bool denseFitSpline (const Surface &srf)
 use dense QR from LAPACK for spline fitting
 
bool sparseFitSpline (const Surface &srf)
 use Tim Davis' sparse QR for spline fitting
 
bool lengthRatioMapping (const Surface &srf)
 generate a constant length-based mapping, ignore skew (fallback)
 
void buildLookupTable ()
 generate the inverse mapping
 
Real vlookup (Real t, uint jcol) const
 lookup a value of t in column j, return interpolated v
 

Static Private Member Functions

static void downSample (const Vector &upp, Vector &up)
 down-sample map evaluation grid
 
static void upSample (const Vector &knots, Vector &p)
 utility to generate sampling vector from knots
 

Private Attributes

SplineBasis m_ubas
 spline basis for scalar 2D mapping
 
SplineBasis m_vbas
 
Matrix m_ctp
 control points for forward mapping (u,v) -> t
 
Vector m_ucol
 support for inverse lookup : spacing in s/u (columns of m_tval)
 
Vector m_vrow
 support for inverse lookup : spacing in v (rows of m_tval)
 
Matrix m_tval
 values of t for inverse lookup (s,t) -> v
 

Static Private Attributes

static uint s_max_neval
 used to limit the number of evaluation points for map definition
 

The documentation for this class was generated from the following files:
Generated on Wed Jan 19 2022 03:03:19 for libsurf by   doxygen 1.8.5