summaryrefslogtreecommitdiff
path: root/stl.py
diff options
context:
space:
mode:
authorAnthony LaTorre <telatorre@gmail.com>2011-05-06 18:43:38 -0400
committerAnthony LaTorre <telatorre@gmail.com>2011-05-06 18:43:38 -0400
commit76a6dd33cdaf4b583b7e8353f198925ddb4a4685 (patch)
tree5613cd1934763d9f452088f7f905d1fd78fe3b12 /stl.py
parent53c20f9b347e9aa3b1844f194d86eb056afc2341 (diff)
downloadchroma-76a6dd33cdaf4b583b7e8353f198925ddb4a4685.tar.gz
chroma-76a6dd33cdaf4b583b7e8353f198925ddb4a4685.tar.bz2
chroma-76a6dd33cdaf4b583b7e8353f198925ddb4a4685.zip
triangle mesh intersection, stl reader, stl model of a lego minifigure
Diffstat (limited to 'stl.py')
-rw-r--r--stl.py15
1 files changed, 15 insertions, 0 deletions
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')