stt : spherical triangular tessellation(STT) generator

29 Dec 2018

Program Propose

The spherical triangular tessellation is a kind of partition of the spherical surface composed by only triangular cells. This program could generate the STT based on an icosahedron. The STT generated by the program could be refined around given points, lines, polygons and circles on the spherical surface. The exterior and interior outlines of the STT could also be customized.

Installation

You need to compile the executable file stt using the makefile. Please change the variable CC in the makefile to the compiler you use.

If you don’t have gcc installed.

brew install gcc
apt-get install gcc

After the gcc is installed. Use make the compile the program. Then move or symlink the executable file stt to any directory included in your $PATH, for instance, /usr/local/bin.

Usage

Usage: stt -d<minimal-depth>/<maximal-depth> [-r'WGS84'|'Earth'|'Moon'|<equator-radius>/<pole-radius>|<equator_radius>,<flat-rate>] [-o<orient-longitude>/<orient-latitude>] [-m<output-msh-filename>] [-v<output-vert-loc-filename>] [-t<output-tri-cen-filename>] [-n<output-tri-neg-filename>] [-p<control-point-filename>] [-l<control-line-filename>] [-g<control-poly-filename>] [-c<control-circle-filename>] [-s<outline-shape-filename>] [-k<hole-shape-filename>] [-h]

Options

Input File Formats

Point format

The format of the control points’ location is a plain text file. Each line of the file has the information of one control point which contains the spherical coordinates, maximal quad-tree depth, minimal resolution and physical group of the point. The program takes both the tree depth and resolution to control the fineness of the refined STT. The refinement of the STT will stop which ever the two conditions has been reached. Note that any line that starts with ‘#’ or any empty line will be skipped. An example file:

# <longitude> <latitude> <maximal-depth> <minimal-resolution> <physical-group>
-45 -45 5 1.0 7
45 -45 5 1.0 7
45 45 5 1.0 7
-45 45 5 1.0 7

Circle format

The format of the control circles’ location is a plain text file. Each line of the file has the information of one control circle which contains the spherical coordinates, spherical cap degree, maximal quad-tree depth, minimal resolution and physical group of the circle. The program takes both the tree depth and resolution to control the fineness of the refined STT. The refinement of the STT will stop which ever the two conditions has been reached. Note that any line that starts with ‘#’ or any empty line will be skipped. An example file:

# <longitude> <latitude> <spherical-cap-degree> <maximal-depth> <minimal-resolution> <physical-group>
45 60 30 5 0.1 12
-20 -45 20 6 0.1 13

Line format

The format of the control lines’, polygons’, outlines’, and holes’ location is a plain text file. Blocks separated by empty lines contain information of control units. For each block, the first line has the number of the spherical locations, maximal quad-tree depth, minimal resolution and physical group of the unit. Followed by spherical coordinates of the unit.The program takes both the tree depth and resolution to control the fineness of the refined STT. The refinement of the STT will stop which ever the two conditions has been reached. Note that any line that starts with ‘#’ or any empty line will be skipped. An example file:

# <number-of-points> <maximal-depth> <minimal-resolution> <physical-group>
# <longitude> <latitude>
# <longitude> <latitude>
# ... ...
4 6 0.1 5
-10 10
50 15
60 55
-15 50

Examples

An example of multi-resolution STT:

stt -d 3/7 -m example.msh -l doc/control_lines.txt -g doc/control_poly.txt -c doc/control_circle.txt

stt-example

Citation

To cite the program, please use
Zhang, Y., Mooney, W. D., and Chen, C. (2018). Forward calculation of gravitational fields with variable resolution 3d density models using spherical triangular tessellation: Theory and Applications. Geophysical Journal International, 215(1):363–374. https://doi.org/10.1093/gji/ggy278