@@ -0,0 +1,1189 @@
+#!/usr/bin/env python%0A%22%22%22%0Ausage: plt2xyz.py PLTFILE %3E outfile.xyz%0A%0ADumps an XYZ point cloud from a compiled Compass plot file, with the%0Aassumption that all %22hidden%22 shots are splays which represent the cave's%0Awalls.%0A%0AIf the project is tied to realworld UTM coordinates, then X, Y, and Z will%0Abe in meters. If no UTM zone is specified, then coordinates are exactly as%0Astored in the .PLT file (feet relative to the zero datum).%0A%22%22%22%0A%0Afrom __future__ import print_function%0A%0Afrom davies.compass.plt import CompassPltParser%0A%0A%0AFT_TO_M = 0.3048  # convert feet to meters%0A%0A%0Adef plt2xyz(fname):%0A%09%22%22%22Convert a Compass plot file to XYZ pointcloud%22%22%22%0A%09parser = CompassPltParser(fname)%0A%09plt = parser.parse()%0A%0A%09for segment in plt:%0A%09%09for command in segment:%0A%09%09%09if command.cmd == 'd':%0A%09%09%09%09if plt.utm_zone:%0A%09%09%09%09%09x, y, z = command.x * FT_TO_M, command.y * FT_TO_M, command.z * FT_TO_M%0A%09%09%09%09else:%0A%09%09%09%09%09x, y, z = command.x, command.y, command.z%0A%09%09%09%09print('%25.3f%5Ct%25.3f%5Ct%25.3f' %25 (x, y, z))%0A%0A%0Adef main():%0A%09import sys%0A%09import logging%0A%0A%09logging.basicConfig()%0A%0A%09if len(sys.argv) %3C 2:%0A%09%09print('usage: %25s PLTFILE' %25 sys.argv%5B1%5D, file=sys.stderr)%0A%09%09sys.exit(2)%0A%0A%09plt2xyz(sys.argv%5B1%5D)%0A%0A%0Aif __name__ == '__main__':%0A%09main()%0A

Add example script which converts a Compass .PLT plot file with splay shots to an XYZ pointcloud.