Skip to content
phma edited this page May 1, 2016 · 1 revision

A winged edge data structure consists of three classes: points, edges, and faces; all of which contain pointers to each other. It is thus a **tangled hierarchy**. The winged edge structure used in Bezitopo is different from the standard one for two reasons:

  • I'd never heard of a winged edge when I invented it.
  • Bezitopo's faces are all triangles.
The data structure consists of three classes:

point.h

 class point: public xyz, public drawobj
 {
   friend class edge;
   edge *line; // a line incident on this point in the TIN. Used to arrange the lines in order around their endpoints.
   edge *edg(triangle *tri);
   // tri.a->edg(tri) is the side opposite tri.b
 };

tin.h

 class edge
 {
 public:
   point *a,*b;
   edge *nexta,*nextb;
   triangle *tria,*trib;
   point* otherend(point* end);
   triangle* othertri(triangle* t);
   edge* next(point* end);
   triangle* tri(point* end);
 };

bezier.h

 class triangle
 {
 public:
   point *a,*b,*c; //corners
   double ctrl[7]; //There are 10 control points; the corners are three, and these are the elevations of the others.
   triangle *aneigh,*bneigh,*cneigh;
   triangle *nexttoward(xy pnt);
   triangle *findt(xy pnt,bool clip=false);
 };

These classes need to be manipulated very carefully. The maketin routine has a McCabe complexity of 63, and it took me years to get it right.

Clone this wiki locally