diff options
author | Anthony LaTorre <tlatorre9@gmail.com> | 2011-08-03 14:33:39 -0400 |
---|---|---|
committer | Anthony LaTorre <tlatorre9@gmail.com> | 2011-08-03 14:33:39 -0400 |
commit | 4e1047698bad5a600dd6a2aaa825667fc3617b07 (patch) | |
tree | 0fe658ce1f3fd2ef272997d800757056cfd18291 /stl.py | |
parent | 4bf95f452e3275c12026b16b51dc646846598f19 (diff) | |
parent | 91bf7a2e2371a321b3bd402810cfe3b2774e2777 (diff) | |
download | chroma-4e1047698bad5a600dd6a2aaa825667fc3617b07.tar.gz chroma-4e1047698bad5a600dd6a2aaa825667fc3617b07.tar.bz2 chroma-4e1047698bad5a600dd6a2aaa825667fc3617b07.zip |
merge heads
Diffstat (limited to 'stl.py')
-rw-r--r-- | stl.py | 11 |
1 files changed, 9 insertions, 2 deletions
@@ -2,9 +2,13 @@ import numpy as np import string import struct from geometry import Mesh +import bz2 def mesh_from_stl(filename): - f = open(filename) + if filename.endswith('.bz2'): + f = bz2.BZ2File(filename) + else: + f = open(filename) buf = f.read(200) f.close() @@ -15,7 +19,10 @@ def mesh_from_stl(filename): return mesh_from_ascii_stl(filename) def mesh_from_ascii_stl(filename): - f = open(filename) + if filename.endswith('.bz2'): + f = bz2.BZ2File(filename) + else: + f = open(filename) vertices = [] triangles = [] |