Commit 160bf6ff authored by sumpfralle's avatar sumpfralle

added "Vector" instances for normals in STLImporter


git-svn-id: https://pycam.svn.sourceforge.net/svnroot/pycam/trunk@579 bbaffbd6-741e-11dd-a85d-61de82d9cad9
parent fab715d7
...@@ -21,7 +21,7 @@ You should have received a copy of the GNU General Public License ...@@ -21,7 +21,7 @@ You should have received a copy of the GNU General Public License
along with PyCAM. If not, see <http://www.gnu.org/licenses/>. along with PyCAM. If not, see <http://www.gnu.org/licenses/>.
""" """
from pycam.Geometry.Point import Point from pycam.Geometry.Point import Point, Vector
from pycam.Geometry.Line import Line from pycam.Geometry.Line import Line
from pycam.Geometry.Triangle import Triangle from pycam.Geometry.Triangle import Triangle
from pycam.Geometry.PointKdtree import PointKdtree from pycam.Geometry.PointKdtree import PointKdtree
...@@ -129,7 +129,7 @@ def ImportModel(filename, use_kdtree=True, program_locations=None): ...@@ -129,7 +129,7 @@ def ImportModel(filename, use_kdtree=True, program_locations=None):
a2 = unpack("<f", f.read(4))[0] a2 = unpack("<f", f.read(4))[0]
a3 = unpack("<f", f.read(4))[0] a3 = unpack("<f", f.read(4))[0]
n = Point(float(a1), float(a2), float(a3)) n = Vector(float(a1), float(a2), float(a3))
v11 = unpack("<f", f.read(4))[0] v11 = unpack("<f", f.read(4))[0]
v12 = unpack("<f", f.read(4))[0] v12 = unpack("<f", f.read(4))[0]
...@@ -172,7 +172,7 @@ def ImportModel(filename, use_kdtree=True, program_locations=None): ...@@ -172,7 +172,7 @@ def ImportModel(filename, use_kdtree=True, program_locations=None):
+ "is too high?)") + "is too high?)")
continue continue
if n: if n:
t._normal = n t.normal = n
model.append(t) model.append(t)
else: else:
...@@ -204,7 +204,7 @@ def ImportModel(filename, use_kdtree=True, program_locations=None): ...@@ -204,7 +204,7 @@ def ImportModel(filename, use_kdtree=True, program_locations=None):
if m: if m:
m = normal.match(line) m = normal.match(line)
if m: if m:
n = Point(float(m.group('x')), float(m.group('y')), n = Vector(float(m.group('x')), float(m.group('y')),
float(m.group('z'))) float(m.group('z')))
else: else:
n = None n = None
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment