From 76a6dd33cdaf4b583b7e8353f198925ddb4a4685 Mon Sep 17 00:00:00 2001 From: Anthony LaTorre Date: Fri, 6 May 2011 18:43:38 -0400 Subject: triangle mesh intersection, stl reader, stl model of a lego minifigure --- stl.py | 15 +++++++++++++++ 1 file changed, 15 insertions(+) create mode 100644 stl.py (limited to 'stl.py') diff --git a/stl.py b/stl.py new file mode 100644 index 0000000..b300554 --- /dev/null +++ b/stl.py @@ -0,0 +1,15 @@ +import numpy as np + +def pull_vertices(filename): + f = open(filename) + + vertices = [] + for line in f: + if not line.strip().startswith('vertex'): + continue + vertices.append([float(s) for s in line.strip().split()[1:]]) + + return np.array(vertices) + +if __name__ == '__main__': + print pull_vertices('models/MiniFig.STL') -- cgit