Two C++ programs are released here as open source, so that the results on this site can be reproduced and the tools reused in other studies. Each archive contains the full source code, CMake build files, the license and a README covering all options, file formats and known limitations.

Both tools share the same geometric foundation — a tessellation grown from an icosahedron — and are designed to work as a pair: STT decides how the sphere is cut, fracSTT assigns data values to the resulting cells. Either can also be compiled and used on its own. If these tools contribute to published work, please cite the study given with the program.

STT — Spherical Triangular Tessellation Generator

Constraint-driven adaptive mesh generation on the sphere

v1.5

STT divides the sphere into triangular cells. Starting from a regular icosahedron, each of its 20 faces is refined as an independent quadtree, so the mesh can be made dense where the physics is detailed and coarse elsewhere. Refinement is steered by points, great-circle lines, polygons, spherical caps and digital elevation data, and the domain can be clipped to an outer outline or cut by interior holes. STT defines how the sphere is cut; the companion fracSTT assigns data values to the resulting cells.

Global spherical mesh refined over topography, displayed in Gmsh
Topography-driven refinement (-z): the mesh is subdivided where the elevation field varies rapidly, so the tessellation becomes dense over the continents and coarse over the oceans. Shown in Gmsh for a -d 6/10 run.
  • ✓Adaptive refinement with a separate depth range per face (-d<min>/<max>).
  • ✓Constraints by point, line, polygon, circle and topography, plus outline clipping and hole cutting.
  • ✓Selectable reference frame (WGS84, spherical Earth, Moon, custom ellipsoid) and icosahedron orientation.
  • ✓Outputs a Gmsh 2.2 ASCII mesh, vertex positions, triangle centres and a neighbour table; optional Python binding (pystt).
  • ✓v1.5: silent by default with a one-line summary (-V for progress bars), 1-based numbering, reproducible clipping.

Quick start

# Multi-resolution mesh with line, polygon and circle constraints
./stt -d 3/7 -m example.msh -l doc/control_lines.txt \
       -g doc/control_poly.txt -c doc/control_circle.txt

Download

FileFormatSizeAction
🗜

stt_v1.5.zip

v1.5 source tree with CMake files, README, example control files and Python binding demos.

ZIP · C++ source 1.1 MB
How to cite this program

Published work that makes use of this program should cite the following study.

Zhang, Y., Sun, S., Mooney, W. D., & Xu, Y. (2026). Lithospheric magnetization derived from petrological and satellite constraints. Journal of Geophysical Research: Solid Earth, 131(1), e2025JB032111. doi:10.1029/2025JB032111

fracSTT — Spherical Fractal Random Data Generator

Multi-scale fractal random fields on a global spherical mesh

v1.0

fracSTT builds a globally closed spherical triangular mesh and assigns a fractal random value to every vertex. Values are generated level by level: each edge midpoint receives the weighted average of the surrounding vertices (the 3 : 3 : √3 : √3 template) plus a random increment whose amplitude decays with depth as `max_random × 2^(−roughness × d)`. This random midpoint-displacement construction yields a self-similar, scale-invariant field, well suited to synthesising test models of laterally varying density, susceptibility or topography.

  • ✓Two numbers control the field: roughness and maximum random amplitude (-p<roughness>/<max_random>).
  • ✓Resolution set by a single depth level (-d, default 6); no geometric constraints required.
  • ✓Reproducible: the same -S<seed> gives byte-identical output.
  • ✓Outputs a lon/lat/radius/value scatter file, a Gmsh mesh with $NodeData and $ElementData, and a neighbour table.

Quick start

# Depth 3, roughness 0.8, max random amplitude 100, WGS84, fixed seed
./fracstt -d3 -p0.8/100.0 -s6356752.3142/6378137.0 \
          -i0.0/0.0 -S42 -t out.xyz -m out.msh -n out.nei

Download

FileFormatSizeAction
🗜

fracstt_v1.0.zip

v1.0 source tree with CMake files, README and LICENSE. Standalone, no STT installation required.

ZIP · C++ source 44 KB
How to cite this program

Published work that makes use of this program should cite the following study.

Zhang, Y., Sun, S., Mooney, W. D., & Xu, Y. (2026). Lithospheric magnetization derived from petrological and satellite constraints. Journal of Geophysical Research: Solid Earth, 131(1), e2025JB032111. doi:10.1029/2025JB032111

License

Both programs are released under a dual license: free for academic and other non-commercial use under AGPL v3 (or any later version); commercial use requires a separate paid license from the author.

Questions, bug reports and license requests: Dr. Yi Zhang — yizhang-geo@zju.edu.cn