Multi-Res Modeling Group People Research


Teaching
Publications Software
Multi-Res Modeling Group Multi-Res Modeling Group



MeshEd Basics


Fundamental classes


The mesh topology is determined by some top level triangles we call Faces . It is roughly:
Face
{
  Face*  neighbor[3];
  TTree* root;
}
neighbor points to each of the neighboring Faces.
root points to the root of the triangle tree (TTree).


A TTree is a node in the triangle tree. It is roughly as follows:
TTree
{
  TTree*  parent;
  TTree*  children[4];
  Vertex* vertices[3];
}
It should be obvious what parent and children point to.
vertices point to the three vertices of this particular triangle.
We have affectionate names for the children; we call them T0, T1, T2, and T3. The end of this page shows how these children are arranged within a parent.


A Vertex contains some data about a particular vertex. It stores, among other things, the geometric positions of the vertex at different subdivision levels:
Vertex
{
  CVec3 val[N];
}
CVec3 is just a simple 3-d vector class. N differs for different vertices; for example, say we have a mesh of depth M. A vertex that exists at the top level will have its N = M, whereas a vertex that didn't exist until 2 subdivision iterations will have its N = M - 2. Basically each vertex has high enough N to store all of its positions.

A Mesh is simply the following:
Mesh
{
  Faces*   faces[];
  Vertices vertices[];
}
A Mesh just contains all of the Faces in the structure, as well as pointers to all the level 0 vertices.

Template structure

The simplicity of the class descriptions above is greatly exaggerated. All these classes are defined as templates. A typical definition looks like (take Face as an example):
template<..., class FaceIf, ...>
class FaceTp: public FaceIf, ...
{
  ...
};
Essentially, the classes derive from their template parameters. Since typically these classes depend on the exact definitions of multiple other classes, this gives us a good way maintaining strong type checking while letting us freely add data/method members of each of the related classes.

Layers:

RapidApp
-> Inventor
-> Geometry layer (subdivision stuff)
-> Data Structure Layer ( mesh.cpp ttree face vertex vertind vring tfetcher triind names.h)




Files:

  • Meshed core (templates)
    • mesh.{h,cpp}
    • ttree.{h,cpp}
    • face.h
    • vertex.h
    • vertind.{h,cpp}
    • vring.h
    • tfetcher.h
    • triind.h
    • names.h
  • Geometry
    • onering.{h,cpp} - subdivision functions and analysis
    • ringcoeff.{h,cpp} - coefficient management
    • subdiv.{h,cpp} - define schemes
    • cvec.{h,cpp} - 3D vectors
  • Drawing
    • drawmesh.{h,cpp} - OpenGL drawing, picking
    • ivCB.{h,cpp} - inventor stuff
  • UI
    • states.{h,cpp} - machine independent UI stuff
    • controlsCB.h - abstract interface
    • controlsCB.cpp - implementation
  • Misc
    • OIio.{h,cpp} - inventor io
    • cmdLine.{h,cpp} - command line args
    • options.{h,cpp}
    • psOpenGL.h, print.h - picture output
  • SGI Specific UI
    • rapidapp/ (subdirectory)

Naming Conventions


Note that orientation is not implied in the vertex naming - see last diagram.


Edges are named for their opposite vertex.


Sub-triangles are named according to their nearest vertex, with T0 in the center


Sub-vertices are named for their opposite vertex.


The vertex numbers of the subtriangles are the same as the nearest vertex or sub-vertex of the parent triangle.




Copyright © 1998 Peter Schröder Last modified: Tue Mar 3 17:17:13 PST 1998