summaryrefslogtreecommitdiff
path: root/stl.py
blob: b30055482e5f1d018b721d04d11b4b50c89acc6b (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
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')