summaryrefslogtreecommitdiff
path: root/stl.py
diff options
context:
space:
mode:
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')