This file almost completely replicates (with a few changes) triangle_reader.py.  Can the two be merged into one?  Perhaps based on the optional layers argument.