The following are notes by J. Deklotz with regards to the Edge Collapse function included with the lastest version of the MeshStructure class: Regarding the following variables: Triangle **pt00 = 0, **pt10 = 0; Edge **pe01 = 0, **pe11 = 0; These double pointers point to the pointers that need to be updated. 'pe01', for example, is pointed at triangle nt01's edge pointer that points to edge e01. Later in the code, this double pointer is dereferenced, giving a regular pointer to an edge, and it is assigned e00 (as shown in the following line of code). (*pe01) = e00; (Similarly, 'pe11' is pointed at triangle nt11's edge pointer that points to edge e11. This pointer is dereferenced and updated in the same way as 'pe01'.) The reason I use this approach is to minimize logical if statements. 'pe01' for example can point to one of 3 pointers, either nt01->edge[0], nt01->edge[1], or nt01->edge[2]. Instead of later trying to figure out the index of the pointer that points to e01, I just store the address of the pointer that needs to be changed in a double pointer earlier on. 'pt00' and 'pt10' are similar, except they store the pointers to edge e00 and edge e10's (respectively) pointers to triangles t0 and t1 (respectively), which also need to be updated to point to triangles nt01 and nt11 (again, respectively). Wow that was a complicated sentence... ------ This line of code may need some explaining: nt00 = e00->triangle[0] != t0 ? (pt00 = &e00->triangle[1], e00->triangle[0]) : (pt00 = &e00->triangle[0], e00->triangle[1]); This line does several things at once. The primary purpose of it is to find and assign the appropriate adress value to nt00. The first sub-statement to be executed is the comparison "e00->triangle[0] != t0". This is to figure out which of e00's two triangle pointers (0 or 1) are pointing to t0 and then assigning the other one to nt00. A line of code to do just this would be: nt00 = e00->triangle[0] != t0 ? e00->triangle[0] : e00->triangle[1]; Now, what we also want is for pt00 to point to e00->triangle[1] if nt00 is assigned e00->triangle[0]. To do this, I used the comma operator. (pt00 = &e00->triangle[1], e00->triangle[0]) This statement executes both sub-statements (the "operands" of the comma operator), and returns the second (right-hand) operand. pt00 is assigned &e00->triangle[1] and e00->triangle[0] is returned. The returned value is the one assigned to nt00 in the final statement: nt00 = e00->triangle[0] != t0 ? (pt00 = &e00->triangle[1], e00->triangle[0]) : (pt00 = &e00->triangle[0], e00->triangle[1]); There is another line of code exactly like this that does the same thing, except with nt10, e10, and pt10. ---------------- Please note that the variables Edge *modEdge0, *modEdge1; are only used for debugging. In addition, the double pointers to vertices: //pointers to nt01's and nt11's pointers to vertices v01 and v00 respectively Vertex **pv01 = 0, **pv11 = 0; Are never used and can be removed from the CollapseEdge function.