Octree optimization

A number of algorithms search large 3D arrays (computation space) for features of interest. Marching cubes isosurface generation described by Lorenson and Cline1 is an example. The speed of these algorithms is dependent on the time necessary to find the features of interest in the data and to compute their graphic representation. Efficiently searching for these features is the topic of this paper. I describe an optimizing search using octrees to divide computation space. When the tree is walked, information stored in the branch nodes is used to prune portions of computation space thus avoiding unnecessary memory references and tests for features of interest. This technique was implemented for marching cubes isosurface generation on computational fluid dynamics data. The code was then adapted to continuing particle traces in multiply zoned data sets when a trace leaves one zone and enters another. For multiple isosurfaces, numerical experiments indicate a factor of 3.8 9.0 overall performance increase, measured by stopwatch; and a factor of 3.9 9.9 speedup in calculation times as measured by the UNIX timesO2 utility. The overhead is a one time cost of 0.2 2.8 times the time to compute an average isosurface and 0(n) space with a constant factor less than one. 'n' is the number of grid points. Introduction Octree optimization can significantly speed up algorithms that repeatedly search a large computational space, e.g., a large 3D array of real numbers representing a scalar field. Octree optimization uses divide and conquer to prune the search space. The octree technique, originally developed for solid modeling, has been described by Jackins and Tanimoto3 and Meagher. In octree optimization, the root node represents all of computation space. It is recursively subdivided into eight children each representing approximately one-eighth of the space. Recursion ceases when each node represents less than a certain number of data points. Criteria for dividing computation space can be manipulated to produce trees with various properties, e.g., well balanced, desired shapes in computation space, etc. A small amount of information characterizing the data represented is stored in each node. The tree is then walked repeatedly with different parameters. The parameter is tested against the characterizing information stored in each node. If the test fails, the rest of the branch need not be examined, if it succeeds the tree walk continues. If a leaf node test succeeds, then the data represented is examined for features of interest and the appropriate computations performed. For octree optimization to be effective there must be: • Some means for the regular subdivision of computational space • A fast, space efficient test to prune the search tree 2 / SPIE Vol. 1459 Extracting Meaning from Complex Data: Processing, Display, Interaction II (1991) O-8194-0558-2/91/$4.OO • Features of interest that are somewhat sparse and clumpy. They must be sparse so that much of the space can be pruned away. They should be clumpy so that each branch taken yields a large number of feature 'hits'. • Poor current performance. • The need to apply the algorithm repeatedly over the same data with different parameters. Otherwise, the overhead of tree building is not worthwhile. As an illustration, a binary optimization tree for one dimensional data might look something like this: ___ Data Connectivity Tree Connectivity Previous work includes a paper by Woodwark5 who used a similar technique in a different context. The kD tree search techniques developed by Bently6 in the data base world are closely related. Wilhelm at the University of California at Santa Cruz has also implemented an octree based computation space optimization technique for marching cube isosurface generation [personal communication]. Glassner7 uses octrees in physical space to reduce the number of objects to test for ray trace intersections. Kerlick8 describes a competitive technique using sorting to limit searches for isosurfaces generated using marching cubes. There is an analytic comparison of sorting versus octree optimization below. SPIE Vol. 1459 Extracting Meaning from Complex Data: Processing, Display, Interaction 11(1991) / 3 Root Node