libsurf
Programmer's Documentation

Public Member Functions | Private Member Functions | Private Attributes | List of all members
UvMapDelaunay Class Reference

Detailed Description

Mapped Delaunay surface mesh generation.

This is the main interface for Delaunay triangulation of arbitrary surfaces using the mapped plane approach. The parameter domain (u,v) is mapped to a proxy domain (s,t) in which stretch and skew are similar to the values encountered in three dimensions. To achieve this, the mapping (s,t) is constructed such that the ratio of the partial derivatives and the angle between them is as close as possible to the same ratios in 3D space. Hence, the 2D Delaunay property which guarantees optimality in a certain sense can be used to efficiently generate a quality surface mesh even on highly stretched and skewed surfaces such as a highly swept delta wing.

See Also
DelaunayCore, DcGeometry

#include <uvmapdelaunay.h>

Collaboration diagram for UvMapDelaunay:
[legend]

Public Member Functions

 UvMapDelaunay ()
 create empty surface mesh generator
 
 UvMapDelaunay (SurfacePtr psf)
 determine pattern from surface functions (initGridPattern)
 
 UvMapDelaunay (SurfacePtr psf, const UvMapping &uvmap, Real mergeTol=1e-6)
 copy existing mapping
 
 UvMapDelaunay (SurfacePtr psf, const Vector &up, const Vector &vp, Real mergeTol=1e-6)
 create initialized surface mesh generator
 
void init (SurfacePtr psf, const UvMapping &uvmap, Real mergeTol=1e-6)
 initialize from surface and existing mapping
 
void init (SurfacePtr psf, const Vector &up, const Vector &vp, Real mergeTol=1e-6)
 initialize from surface and (s,t)-map sampling grid
 
void enableExtension (bool flag)
 enable/disable extension of meshed domain when vertex inserted
 
const UvMappingmap () const
 access mapping (u,v) to (s,t)
 
Real sqMergeTolerance () const
 access point merge tolerance (squared distance)
 
uint nfaces () const
 number of triangles present
 
void twoQuads ()
 simplest possible mesh initialization with two triangles
 
void initEnclosing ()
 initialize with enclosing rectangle
 
void removeOutsideCorners ()
 remove four enclosing vertices after initial constraint insertion
 
void enableConstraintSplitting (bool flag)
 enable splitting of constrained edges
 
void initMesh (const PointList< 2 > &uv, const Indices &tri)
 initialization with given mesh (result may not be Delaunay in (s,t)-domain)
 
void initMesh (const Vector &up, const Vector &vp)
 initialization with given grid
 
void insertVertex (const Vct2 &uv, bool legalizeEdges=true)
 insert a single vertex
 
uint insertConstraint (const Indices &cvi, int edgeflags=DcEdge::Constrained, bool legalizeEdges=true)
 insert constraint polygon connecting previously inserted vertices
 
uint insertConstraint (const PointList< 2 > &uvc, int edgeflags=DcEdge::Constrained, bool legalizeEdges=true)
 insert constraint polygon in (u,v) coordinate
 
uint insertConstraint (const PointList< 2 > &uvc, Indices &cvi, int edgeflags=DcEdge::Constrained, bool legalizeEdges=true)
 insert constraint polygon in (u,v) coordinate
 
uint refineBoundaries (DcMeshCritBase &c)
 refine mesh boundaries using criterion
 
uint refineInternal (DcMeshCritBase &c)
 refine internal edges using criterion
 
void smooth (uint niter=1, Real omega=0.5)
 apply some iterations of lapacian smoothing to vertex positions
 
uint punchHole (const Vct2 &phole)
 start removing triangles starting from hole marker point
 
void triangles (Indices &tri) const
 access mesh triangles
 
void sortedBoundary (Indices &bvx) const
 sorted set of boundary vertices
 
const PointList< 2 > & uvVertices () const
 access mesh vertices in (u,v) plane
 
const PointList< 2 > & stVertices () const
 access vertices in (s,t) plane
 
const PointList< 3 > & xyzVertices () const
 access mesh vertices in (x,y,z) space
 
const PointList< 3 > & xyzNormals () const
 access surface normals at vertices
 
const Indices & verticesOnConstraints () const
 access vertices which where inserted on constrained edges
 
Indices & verticesOnConstraints ()
 access vertices which where inserted on constrained edges
 
void clear ()
 clear out all data
 
void dbgDump (const std::string &fname) const
 dump mapping and mesh (debugging)
 

Private Member Functions

uint append (const Vct2 &uv)
 evaluate surface and mapping, append vertex
 
uint stAppend (const Vct2 &st)
 append vertex without evaluating surface
 
void smoothVertex (uint iv, uint nnb, const uint *nbf, Real omega)
 apply Laplacian smoothing to vertex i
 
bool uvCircumCenter (uint fi, Vct2 &uv) const
 compute circumcenter of face fi in (u,v)-plane
 

Private Attributes

SurfacePtr srf
 surface to mesh
 
DcPlaneGeometry geo
 plane geometry in the (s,t)-plane
 
DelaunayCore core
 Delaunay topology management.
 
PointList< 2 > puv
 triangulation vertices in the (u,v) plane
 
PointList< 3 > pxy
 triangulation vertices in (x,y,z) space
 
PointList< 3 > pnm
 surface normals in (x,y,z) space
 
UvMapping uvm
 plane mapping (u,v) -> (s,t)
 
Indices virtVertices
 list of vertices used for virtual (enclosing) triangles
 

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