#!/usr/bin/env python # writing js data structure for a mesh import sys from numpy import * from struct import unpack def read_binary_stl(fname): #all numpy binary stl reader #adapted from http://sukhbinder.wordpress.com/2013/11/28/binary-stl-file-reader-in-python-powered-by-numpy/ #but use numpy.unique instead of python set conversion fp = open(fname, 'rb') Header = fp.read(80) nn = fp.read(4) Numtri = unpack('i', nn)[0] record_dtype = dtype([ ('normals', float32,(3,)), ('Vertex1', float32,(3,)), ('Vertex2', float32,(3,)), ('Vertex3', float32,(3,)) , ('atttr', '