Mark Stock


Rocktools is a collection of command-line tools for the creation and manipulation of open or closed triangular meshes in 3D space. It is especially adept at detailing triangular meshes according to three-dimensional random walks. It is written in ANSI C and only requires libpng and the standard C libraries to compile.

Thanks go to Steven Pigeon for his program POVRockGen 1.0 [link broken], which gave me the idea for creating rocktools. Please see it if you are a POV user. There is also a program called MacRock that uses the above code, but outputs to DXF format.

Meshlab is a very useful GUI triangle mesh manipulation tool that can read and write a number of formats, plus perform a large variety of smoothing and simplification operations. It should be interoperable with Rocktools files, and I highly recommend it.


The current version of Rocktools is 1.1. You can download it here: rocktools_1.1.tar.gz. On a Unix system, just run the following commands:
tar -xzf rocktools_1.1.tar.gz
cd rocktools_1.1
or, if you are on a Mac, try:
make -f Makefile.OSX

Win32 binaries exist for version 0.9 ( and 0.3 (; these are courtesy of Anonymous and Anthony D'Agostino. If anyone wants to compile the current version of Rocktools for Windows/DOS, I would be happy to host it here or include it in the distribution.


Rocktools includes the following programs


An 8-level detailing of an icosahedron illustrating the distance-dependent detaling option; the command was rockdetail icosahedron0.obj -d 8 -dt .1 1 0 0 -oobj > partial8a.obj
A 7-level detailing of a hexagon using the edge-clamping feature; the command was rockdetail hex0.obj -seed 12 -ce -d 7 -n 0.2 -b 0 -oobj > hex7b.obj
A 7-level detailing of a simple rock
Here's a view of the results of the rockerode tool. The erosion algorithm still needs work.
This image is a preview of the threshholding feature in rockdetail. It shows selective triangle splitting based on distance from an arbitrary viewpoint.
A MPEG animation made by varying the rockdetail parameters (1.6 MB), thanks to Jeff Balcerski
Output of rockxray with the "-s" (surface) option
Output of rockxray with the "-v" (volume) option

Future plans

Future versions of Rocktools may include the following:

Please e-mail me if you'd like to see some particular feature in Rocktools, or if you use it to make something creative.


Rocktools has been used in the following research:

C.L. Lin and J.D. Miller, 3D characterization and analysis of particle shape using X-ray microtomography (XMT), Powder Technology 154 (1) 61-69, (2005) [link]