The Parametric Pseudo-Manifold (PPS) Library 1.0
|
The main class of the PPS library is also called PPS
. The class has a constructor that takes in a triangle mesh and builds a PPS. The PPS
class is abstract, which means you must implement a concrete class from it in order to use the library. The implementation details are given later on. In particular, the derived class must implement several virtual methods related to the data structure representing the triangle mesh, and one virtual method to evaluate a point on a surface defined over the mesh.
Data structure related methods define a generic mesh API, which makes the PPS library independent from any particular mesh data structure. All the user has to do is to implement those virtual methods using her/his own data structure. If the user is not willing to spend time on this extra effort, she/he can use the DCEL data structure provided with the PPS library.
The generic mesh API defines a "virtual" mesh consisting of vertices, half-edges, edges, and faces. Those elements are denoted by Vertex
, Halfedge
, Edge
, and Face
, respectively. If the user data structure does not have one or more of those elements or does not use the exact same name for them, the user must rename them using typedef
.
To be more specific, the PPS
class has a parameter, called Mesh
, which must be instantiated with the type of the input mesh data structure:
template < typename Mesh > class PPS { public: ...
When the user defines a concrete class from the PPS
class, the user can specifiy the actual type of the mesh data structure. For instance, the user can define the class myPPS
specifying the data structure myMesh:
class myPPS : public PPS< myMesh > { public: ...
The PPS
class constructor takes in a pointer to an object of the Mesh
class. This pointer value is then assigned to a private attribute, pps::PPS::_mesh
, of the class:
PPS( Mesh* mesh ) : _mesh( mesh ) , ... {}
In addition to the constructor above, the API of the PPS class contains a method, called pps::PPS::eval_pps
, which computes a point on the surface defined by the class.
The method
void eval_pps( Face* face , double u , double v , double w , double& x , double& y , double& z ) const ;
takes in a pointer to a face (i.e., a triangle) of the triangle mesh and the barycentric coordinates, , of a point in the face. These barycentric coordinates are given with respect to an affine frame defined by the three vertices of the given face. The remaining parameters are the Cartesian coordinates,
, of a point on the surface defined by the PPS. As you may have noticed, there is an implicit one-to-one correspondence between the triangle mesh and the surface: for each point on the mesh, there is a (distinct) point on the surface, and vice-versa. So, the mesh itself can be viewed as a "parameter space". This rationale behind this "user
interface" is to hide the PPS local parametrizations from the user. The same sort of correspondence is employed by the exact evaluation algorithms for subdivision surfaces, as well as algorithms for computing parametric surfaces over arbitrary meshes using the "patch
stitching" paradigm.
Along with several public methods related to the generic mesh API, the methods pps::PPS::PPS
and pps::PPS::eval_pps
are currently the only methods available in the API of the PPS class. I (the developer of the PPS library) am currently working on an extension of this API to include methods for computing derivatives and several differential properties.