diff --git a/io_import_dxf/__init__.py b/io_import_dxf/__init__.py index 131655024..c75b79b0c 100644 --- a/io_import_dxf/__init__.py +++ b/io_import_dxf/__init__.py @@ -16,7 +16,7 @@ except: bl_info = { "name": "Import AutoCAD DXF Format (.dxf)", "author": "Lukas Treyer, Manfred Moitzi (support + dxfgrabber library), Vladimir Elistratov, Bastien Montagne, Remigiusz Fiedler (AKA migius)", - "version": (0, 9, 7), + "version": (0, 9, 8), "blender": (2, 80, 0), "location": "File > Import > AutoCAD DXF", "description": "Import files in the Autocad DXF format (.dxf)", diff --git a/io_import_dxf/dxfgrabber/dxfentities.py b/io_import_dxf/dxfgrabber/dxfentities.py index f9c9e4bcd..ccf5b69a2 100644 --- a/io_import_dxf/dxfgrabber/dxfentities.py +++ b/io_import_dxf/dxfgrabber/dxfentities.py @@ -9,6 +9,8 @@ __author__ = "mozman " import math +from mathutils import Vector + from . import const from .color import TrueColor from .styles import default_text_style @@ -733,11 +735,6 @@ def deg2vec(deg): return math.cos(rad), math.sin(rad), 0. -def normalized(vector): - x, y, z = vector - m = (x**2 + y**2 + z**2)**0.5 - return x/m, y/m, z/m - ################################################## # MTEXT inline codes # \L Start underline @@ -850,7 +847,7 @@ class MText(DXFEntity): self.raw_text = "".join(lines) if xdir is None: xdir = deg2vec(rotation) - self.xdirection = normalized(xdir) + self.xdirection = Vector(xdir).normalized() self.set_default_extrusion() def lines(self):