Partial Iteration of Triangles

The central idea behind the grid of LOCSMITH is its self-adaptiveness: The grid should have many nodes in interesting areas and few in non-interesting areas. To achieve this, the program has to decide which triangles to iterate. Once this decision is made, the iteration process for these chosen triangles is the same as if all triangles were iterated. Since the fitness function is known only at the positions of the nodes, the decision must be based on the given nodes.

To illustrate the problem, I wrote a program which is supposed to construct a grid that spans the earth's surface and is fine on land and coarse on water. The program starts with an icosahedron.

The first idea is to iterate all triangles that have at least one node on land. But since the intial icosahedron has only three nodes on land, the result of this method is not very convincing:

Node map of the inital icosahedron
Node map after 4 iterations

It is far better not only to iterate those triangles that have one or more nodes on land, but also all their neighbour triangles.

Triangles are considered to be neighbours if their circumcircles overlap or kiss. The circumcircle of a triangle is the circle which is uniquely defined by its three corners. If a triangle is subdivided into daughter triangles, the circumcircles of the daughters are all inside the circumcircle of the parent triangle. This allows for an efficient neighbour-search algorithm: if a triangle B is NOT a neighbour of a triangle A, then all daughter triangles of B are also not neighbours of A, so no explicit testing is necessary for these daughter triangles, what saves a big amount of CPU time.

Neighbourhood concept: The green triangles are neighbours of the blue triangle, because their circumcircles overlap with the circumcircle of the blue triangle. The yellow triangle is also a neighbour of the blue one, because their circumcircles kiss. The red triangles are not neigbours of the bue triangle. The smaller black triangles in the right half of the diagram are also not neighbours of the blue triangle, since their parent triangle is not a neighbour - it is not necessary to do any computations with the black triangles.

It's center is constructed as the intersection of the perpendicular bisectors of the three sides of the triangle. This construction is carried out by the MKCIRCUMCICRLE function for arbitrary 3D triangles.

Circumcircle of a 3D triangle (extended to a sphere, because a sphere is easier to plot than a circle in an arbitrary plane)

In spherical coordinates, the representation of the circumcircle differs from the representation in cartesian corrdinates: The circumcircle must be interpreted as a small circle on the sphere surface. It's center is therefore not in the plane of the circle and it's radius is given by a distance angle on the sphere. This spherical representation of circumcircles is produced by MKCIRCUMCIRCLESPH.

By iterating the neighbourhood, the resulting distribution of nodes becomes far better.

Node map after 4 iterations, with iteration of neighbour triangles.

The circumcircle as neighbourhood criterion also gives rise to an efficient search scheme: it is not necessary to test each triangle for being a neighbour of being a given Triangle. Assume Tblue is the triangle for which we search the neighbours (the blue triangle in the figure above). Then if Tred is a triangle which is recognized as not being a neigbour of Tblue (like the red triangles in the figure), then it is immediately clear that all daughter triangles Tblack of Tred (the black triangles in the figure) are also not neighbours of Tblue. It is then not necessary to carry out any computations for testing the Tblack triangles. The triangle tree can therefore be searched recursively from parent triangles to child triangles. This speeds up the search for neighbours considerably.


eof.