From: Martin Renold Date: Sun, 15 Jul 2012 07:47:50 +0000 (+0200) Subject: Fix loading binary stl X-Git-Tag: 12.08~31^2~1^2 X-Git-Url: http://www.chiark.greenend.org.uk/ucgi/~ianmdlvl/git?a=commitdiff_plain;h=45a361c1ca6a82e10238d8b9259994256b83ec2c;p=cura.git Fix loading binary stl --- diff --git a/Cura/util/stl.py b/Cura/util/stl.py index f157ce31..72b34254 100644 --- a/Cura/util/stl.py +++ b/Cura/util/stl.py @@ -11,8 +11,8 @@ class stlModel(mesh.mesh): f = open(filename, "rb") if f.read(5).lower() == "solid": self._loadAscii(f) - if len(self.faces) < 1: - f.seek(6, os.SEEK_SET) + if not self.faces: + f.seek(5, os.SEEK_SET) self._loadBinary(f) else: self._loadBinary(f) @@ -39,7 +39,7 @@ class stlModel(mesh.mesh): def _loadBinary(self, f): #Skip the header - f.read(80-6) + f.read(80-5) faceCount = struct.unpack('