Repository: mikedh/trimesh

Issue:
Not able to open exported Dxf's on autoCad when they have text's
I am using trimesh to open and add text labels to a draft dxf like this:

```
        draw=trimesh.load(filename)
        textHeight=5
        l=20
        for e in estacas:
            p=np.array([float(e[-2]), float(e[-1])])
            text = trimesh.path.entities.Text(origin=len(combined.vertices), text=str(e[0]) + "  " + str(e[1]),
                                              height=textHeight)
            draw.vertices = np.vstack((combined.vertices, p))
            draw.entities = np.append(combined.entities, text)
            line = trimesh.path.entities.Line(np.array([len(combined.vertices), len(combined.vertices) + 1]))
            draw.vertices = np.vstack(
                (draw.vertices, np.array([p[0], p[1]+l])))
            draw.vertices = np.vstack(
                (draw.vertices, np.array([p[0], p[1]-l])))
            draw.entities = np.append(draw.entities, line)

        draw.export(filename)
```
Where "estacas" is a list of points and labels of interest. I am also using this library for other things on my project but getting texts to work is being hard. Only LibreCad opened the dxf sucessfully. Draftsight only shows the last added text and Autodesk's AutoCad doesn't open it at all. Autocad asks for pressing enter and fails importing it if you press. The error reported presing F2 is:

```
The following error was encountered while reading
in TEXT starting at line 1822:
Invalid DXF data.
Invalid or incomplete DXF input -- drawing discarded.
```

The resulting file is:
[corrupt.zip](https://github.com/mikedh/trimesh/files/4011157/corrupt.zip)

If i just open this file on librecad and save it it gets fixed and works fine on autocad:
[fixed.zip](https://github.com/mikedh/trimesh/files/4011164/fixed.zip)

Am I missing something or this is really an issue? 




Discussion:

Patch:
diff --git a/trimesh/path/entities.py b/trimesh/path/entities.py
index 07e5dc46..511d0a8a 100644
--- a/trimesh/path/entities.py
+++ b/trimesh/path/entities.py
@@ -251,7 +251,8 @@ class Text(Entity):
                  height=None,
                  vector=None,
                  normal=None,
-                 align=None):
+                 align=None,
+                 layer=None):
         """
         An entity for text labels.
 
@@ -275,12 +276,14 @@ class Text(Entity):
         """
         # where is text placed
         self.origin = origin
-
+        # what direction is the text pointing
         self.vector = vector
+        # what is the normal of the text plane
         self.normal = normal
-
         # how high is the text entity
         self.height = height
+        # what layer is the entity on
+        self.layer = layer
 
         # None or (2,) str
         if align is None:
@@ -663,9 +666,10 @@ class Bezier(Curve):
         discrete : (m, 2) or (m, 3) float
           Curve as line segments
         """
-        discrete = discretize_bezier(vertices[self.points],
-                                     count=count,
-                                     scale=scale)
+        discrete = discretize_bezier(
+            vertices[self.points],
+            count=count,
+            scale=scale)
         return self._orient(discrete)
 
 
diff --git a/trimesh/path/exchange/dxf.py b/trimesh/path/exchange/dxf.py
index c2cd94be..9150c428 100644
--- a/trimesh/path/exchange/dxf.py
+++ b/trimesh/path/exchange/dxf.py
@@ -478,15 +478,19 @@ def load_dxf(file_obj, **kwargs):
 
 def export_dxf(path, layers=None):
     """
-    Export a 2D path object to a DXF file
+    Export a 2D path object to a DXF file.
 
     Parameters
     ----------
-    path: trimesh.path.path.Path2D
+    path : trimesh.path.path.Path2D
+      Input geometry to export
+    layers : None, set or iterable
+      If passed only export the layers specified
 
     Returns
     ----------
-    export: str, path formatted as a DXF file
+    export : str
+      Path formatted as a DXF file
     """
 
     def format_points(points,
@@ -528,7 +532,7 @@ def export_dxf(path, layers=None):
         if as_2D:
             group = group[:, :2]
             three = three[:, :2]
-
+        # join into result string
         packed = '\n'.join('{:d}\n{:.12f}'.format(g, v)
                            for g, v in zip(group.reshape(-1),
                                            three.reshape(-1)))
@@ -553,10 +557,9 @@ def export_dxf(path, layers=None):
         subs = {'COLOR': 255,  # default is ByLayer
                 'LAYER': 0,
                 'NAME': str(id(entity))[:16]}
-
         if hasattr(entity, 'layer'):
-            subs['LAYER'] = str(entity.layer)
-
+            # make sure layer name is forced into ASCII
+            subs['LAYER'] = util.to_ascii(entity.layer)
         return subs
 
     def convert_line(line, vertices):
@@ -664,19 +667,21 @@ def export_dxf(path, layers=None):
         """
         Convert a Text entity to DXF string.
         """
+        # start with layer info
         sub = entity_info(txt)
-
         # get the origin point of the text
-        sub['ORIGIN'] = format_points(vertices[[txt.origin]],
-                                      increment=False)
+        sub['ORIGIN'] = format_points(
+            vertices[[txt.origin]], increment=False)
         # rotation angle in degrees
         sub['ANGLE'] = np.degrees(txt.angle(vertices))
         # actual string of text with spaces escaped
-        sub['TEXT'] = txt.text.replace(' ', _SAFESPACE)
+        # force into ASCII to avoid weird encoding issues
+        sub['TEXT'] = txt.text.replace(' ', _SAFESPACE).encode(
+            'ascii', errors='ignore').decode('ascii')
         # height of text
         sub['HEIGHT'] = txt.height
-
-        return TEMPLATES['text'].substitute(sub)
+        result = TEMPLATES['text'].substitute(sub)
+        return result
 
     def convert_generic(entity, vertices):
         """
@@ -703,20 +708,19 @@ def export_dxf(path, layers=None):
                 continue
         if name in conversions:
             converted = conversions[name](e, path.vertices).strip()
-            # only save if we converted something
             if len(converted) > 0:
+                # only save if we converted something
                 collected.append(converted)
         else:
             log.debug('Entity type %s not exported!', name)
 
+    # join all entities into one string
     entities_str = '\n'.join(collected)
-
     hsub = {'BOUNDS_MIN': format_points([path.bounds[0]]),
             'BOUNDS_MAX': format_points([path.bounds[1]]),
             'LUNITS': '1'}
     if path.units in _UNITS_TO_DXF:
         hsub['LUNITS'] = _UNITS_TO_DXF[path.units]
-
     # sections of the DXF
     header = TEMPLATES['header'].substitute(hsub)
     # entities section
@@ -729,23 +733,21 @@ def export_dxf(path, layers=None):
     # although Draftsight, LibreCAD, and Inkscape don't care
     # what a giant legacy piece of shit
     # strip out all leading and trailing whitespace
-    sections = [i.strip() for i in [header,
-                                    entities,
-                                    footer]
+    sections = [i.strip() for i in
+                [header, entities, footer]
                 if len(i) > 0]
-
+    # create the joined string blob
     blob = '\n'.join(sections).replace(_SAFESPACE, ' ')
-
     # run additional self- checks
     if tol.strict:
         # check that every line pair is (group code, value)
         lines = str.splitlines(str(blob))
-
         # should be even number of lines
         assert (len(lines) % 2) == 0
-
         # group codes should all be convertible to int and positive
         assert all(int(i) >= 0 for i in lines[::2])
+        # make sure we didn't slip any unicode in there
+        blob.encode('ascii')
 
     return blob
 
diff --git a/trimesh/path/path.py b/trimesh/path/path.py
index a61fb5cd..b8af8fe1 100644
--- a/trimesh/path/path.py
+++ b/trimesh/path/path.py
@@ -117,9 +117,8 @@ class Path(object):
 
     def process(self):
         """
-        Apply basic cleaning functions to the Path object, in- place.
+        Apply basic cleaning functions to the Path object in- place.
         """
-        log.debug('Processing drawing')
         with self._cache:
             for func in self._process_functions():
                 func()
@@ -178,6 +177,14 @@ class Path(object):
 
     @property
     def entities(self):
+        """
+        The actual entities making up the path.
+
+        Returns
+        -----------
+        entities : (n,) trimesh.path.entities.Entity
+          Entities such as Line, Arc, or BSpline curves
+        """
         return self._entities
 
     @entities.setter
@@ -190,17 +197,16 @@ class Path(object):
     @property
     def layers(self):
         """
-        If entities have a layer defined, return it.
+        Get a list of the layer for every entity.
 
         Returns
         ---------
-        layers: (len(entities), ) list of str
+        layers : (len(entities), ) any
+          Whatever is stored in each `entity.layer`
         """
-        layer = ['NONE'] * len(self.entities)
-        for i, e in enumerate(self.entities):
-            if hasattr(e, 'layer'):
-                layer[i] = str(e.layer)
-        return layer
+        # layer is a required property for entities
+        layers = [e.layer for e in self.entities]
+        return layers
 
     def crc(self):
         """
diff --git a/trimesh/resources/dxf.json.template b/trimesh/resources/dxf.json.template
index ff39140c..67e1ac64 100644
--- a/trimesh/resources/dxf.json.template
+++ b/trimesh/resources/dxf.json.template
@@ -1,14 +1,11 @@
 {
-    "header": "0\nSECTION\n2\nHEADER\n9\n$$ACADVER\n1\nAC1014\n9\n$$ACADMAINTVER\n70\n9\n9\n$$DWGCODEPAGE\n3\nANSI_1252\n9\n$$INSBASE\n10\n0.0\n20\n0.0\n30\n0.0\n9\n$$EXTMIN\n$BOUNDS_MIN\n9\n$$EXTMAX\n$BOUNDS_MAX\n9\n$$LIMMIN\n10\n0.0\n20\n0.0\n9\n$$LIMMAX\n10\n12.0\n20\n9.0\n9\n$$ORTHOMODE\n70\n0\n9\n$$REGENMODE\n70\n1\n9\n$$FILLMODE\n70\n1\n9\n$$QTEXTMODE\n70\n0\n9\n$$MIRRTEXT\n70\n1\n9\n$$DRAGMODE\n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CLRE\n70\n0\n9\n$$DIMCLRT\n70\n0\n9\n$$DIMTFAC\n40\n1.0\n9\n$$DIMGAP\n40\n0.09\n9\n$$DIMJUST\n70\n0\n9\n$$DIMSD1\n70\n0\n9\n$$DIMSD2\n70\n0\n9\n$$DIMTOLJ\n70\n1\n9\n$$DIMTZIN\n70\n0\n9\n$$DIMALTZ\n70\n0\n9\n$$DIMALTTZ\n70\n0\n9\n$$DIMFIT\n70\n5\n9\n$$DIMUPT\n70\n0\n9\n$$DIMUNIT\n70\n2\n9\n$$DIMDEC\n70\n4\n9\n$$DIMTDEC\n70\n4\n9\n$$DIMALTU\n70\n2\n9\n$$DIMALTTD\n70\n2\n9\n$$DIMTXSTY\n7\nSTANDARD\n9\n$$DIMAUNIT\n70\n0\n9\n$$LUNITS\n70\n1\n9\n$$LUPREC\n70\n4\n9\n$$SKETCHINC\n40\n0.1\n9\n$$FILLETRAD\n40\n0.5\n9\n$$AUNITS\n70\n0\n9\n$$AUPREC\n70\n0\n9\n$$MENU\n1\n.\n9\n$$ELEVATION\n40\n0.0\n9\n$$PELEVATION\n40\n0.0\n9\n$$THICKNESS\n40\n0.0\n9\n$$LIMCHECK\n70\n0\n9\n$$CHAMFERA\n40\n0.0\n9\n$$CHAMFERB\n40\n0.0\n9\n$$CHAMFERC\n40\n0.0\n9\n$$CHAMFERD\n40\n0.0\n9\n$$SKPOLY\n70\n0\n9\n$$TDCREATE\n40\n2447892.833333333\n9\n$$TDUPDATE\n40\n2458393.627430162\n9\n$$TDINDWG\n40\n0.0003091782\n9\n$$TDUSRTIMER\n40\n0.0003091782\n9\n$$USRTIMER\n70\n1\n9\n$$ANGBASE\n50\n0.0\n9\n$$ANGDIR\n70\n0\n9\n$$PDMODE\n70\n0\n9\n$$PDSIZE\n40\n0.0\n9\n$$PLINEWID\n40\n0.0\n9\n$$COORDS\n70\n1\n9\n$$SPLFRAME\n70\n0\n9\n$$SPLINETYPE\n70\n6\n9\n$$SPLINESEGS\n70\n8\n9\n$$ATTDIA\n70\n0\n9\n$$ATTREQ\n70\n1\n9\n$$HANDLING\n70\n1\n9\n$$HANDSEED\n5\n139971082824787\n9\n$$SURFTAB1\n70\n6\n9\n$$SURFTAB2\n70\n6\n9\n$$SURFTYPE\n70\n6\n9\n$$SURFU\n70\n6\n9\n$$SURFV\n70\n6\n9\n$$UCSNAME\n2\n\n9\n$$UCSORG\n10\n0.0\n20\n0.0\n30\n0.0\n9\n$$UCSXDIR\n10\n1.0\n20\n0.0\n30\n0.0\n9\n$$UCSYDIR\n10\n0.0\n20\n1.0\n30\n0.0\n9\n$$PUCSNAME\n2\n\n9\n$$PUCSORG\n10\n0.0\n20\n0.0\n30\n0.0\n9\n$$PUCSXDIR\n10\n1.0\n20\n0.0\n30\n0.0\n9\n$$PUCSYDIR\n10\n0.0\n20\n1.0\n30\n0.0\n9\n$$USERI1\n70\n0\n9\n$$USERI2\n70\n0\n9\n$$USERI3\n70\n0\n9\n$$USERI4\n70\n0\n9\n$$USERI5\n70\n0\n9\n$$USERR1\n40\n0.0\n9\n$$USERR2\n40\n0.0\n9\n$$USERR3\n40\n0.0\n9\n$$USERR4\n40\n0.0\n9\n$$USERR5\n40\n0.0\n9\n$$WORLDVIEW\n70\n1\n9\n$$SHADEDGE\n70\n3\n9\n$$SHADEDIF\n70\n70\n9\n$$TILEMODE\n70\n1\n9\n$$MAXACTVP\n70\n64\n9\n$$PINSBASE\n10\n0.0\n20\n0.0\n30\n0.0\n9\n$$PLIMCHECK\n70\n0\n9\n$$PEXTMIN\n10\n1.000000000000000E+20\n20\n1.000000000000000E+20\n30\n1.000000000000000E+20\n9\n$$PEXTMAX\n10\n-1.000000000000000E+20\n20\n-1.000000000000000E+20\n30\n-1.000000000000000E+20\n9\n$$PLIMMIN\n10\n0.0\n20\n0.0\n9\n$$PLIMMAX\n10\n0.0\n20\n0.0\n9\n$$UNITMODE\n70\n0\n9\n$$VISRETAIN\n70\n1\n9\n$$PLINEGEN\n70\n0\n9\n$$PSLTSCALE\n70\n1\n9\n$$TREEDEPTH\n70\n3020\n9\n$$PICKSTYLE\n70\n1\n9\n$$CMLSTYLE\n2\nSTANDARD\n9\n$$CMLJUST\n70\n0\n9\n$$CMLSCALE\n40\n1.0\n9\n$$PROXYGRAPHICS\n70\n1\n9\n$$MEASUREMENT\n70\n0\n0\nENDSEC\n0\nSECTION\n2\nCLASSES\n0\nCLASS\n1\nACDBDICTIONARYWDFLT\n2\nAcDbDictionaryWithDefault\n3\nObjectDBX|<^>|Classes\n90\n0\n280\n0\n281\n0\n0\nCLASS\n1\nSCALE\n2\nAcDbScale\n3\nObjectDBX|<^>|Classes\n90\n1153\n280\n0\n281\n0\n0\nCLASS\n1\nMATERIAL\n2\nAcDbMaterial\n3\nObjectDBX|<^>|Classes\n90\n1153\n280\n0\n281\n0\n0\nCLASS\n1\nVISUALSTYLE\n2\nAcDbVisualStyle\n3\nObjectDBX|<^>|Classes\n90\n4095\n280\n0\n281\n0\n0\nCLASS\n1\nTABLESTYLE\n2\nAcDbTableStyle\n3\nObjectDBX|<^>|Classes\n90\n4095\n280\n0\n281\n0\n0\nCLASS\n1\nMLEADERSTYLE\n2\nAcDbMLeaderStyle\n3\nACDB_MLEADERSTYLE_CLASS\n90\n4095\n280\n0\n281\n0\n0\nCLASS\n1\nXRECORD\n2\nAcDbXrecord\n3\nObjectDBX|<^>|Classes\n90\n0\n280\n0\n281\n0\n0\nCLASS\n1\nLWPOLYLINE\n2\nAcDbPolyline\n3\nObjectDBX|<^>|Classes\n90\n0\n280\n0\n281\n1\n0\nCLASS\n1\nHATCH\n2\nAcDbHatch\n3\nObjectDBX|<^>|Classes\n90\n0\n280\n0\n281\n1\n0\nCLASS\n1\nDICTIONARYVAR\n2\nAcDbDictionaryVar\n3\nObjectDBX|<^>|Classes\n90\n0\n280\n0\n281\n0\n0\nENDSEC\n0\nSECTION\n2\nTABLES\n0\nTABLE\n2\nVPORT\n5\n13997108282472D\n330\n0\n100\nAcDbSymbolTable\n70\n1\n0\nVPORT\n5\n13997108282472E\n330\n13997108282472D\n100\nAcDbSymbolTableRecord\n100\nAcDbViewportTableRecord\n2\n*ACTIVE\n70\n0\n10\n0.0\n20\n0.0\n11\n1.0\n21\n1.0\n12\n10.42990654205607\n22\n4.5\n13\n0.0\n23\n0.0\n14\n0.5\n24\n0.5\n15\n0.5\n25\n0.5\n16\n0.0\n26\n0.0\n36\n1.0\n17\n0.0\n27\n0.0\n37\n0.0\n40\n9.0\n41\n1.972972972850329\n42\n50.0\n43\n0.0\n44\n0.0\n50\n0.0\n51\n0.0\n71\n0\n72\n100\n73\n1\n74\n3\n75\n0\n76\n0\n77\n0\n78\n0\n0\nENDTAB\n0\nTABLE\n2\nLTYPE\n5\n5\n330\n0\n100\nAcDbSymbolTable\n70\n1\n0\nLTYPE\n5\n14\n330\n5\n100\nAcDbSymbolTableRecord\n100\nAcDbLinetypeTableRecord\n2\nBYBLOCK\n70\n0\n3\n\n72\n65\n73\n0\n40\n0.0\n0\nLTYPE\n5\n15\n330\n5\n100\nAcDbSymbolTableRecord\n100\nAcDbLinetypeTableRecord\n2\nBYLAYER\n70\n0\n3\n\n72\n65\n73\n0\n40\n0.0\n0\nLTYPE\n5\n16\n330\n5\n100\nAcDbSymbolTableRecord\n100\nAcDbLinetypeTableRecord\n2\nCONTINUOUS\n70\n0\n3\nSolidline\n72\n65\n73\n0\n40\n0.0\n0\nENDTAB\n0\nTABLE\n2\nLAYER\n5\n2\n330\n0\n100\nAcDbSymbolTable\n70\n3\n0\nLAYER\n5\n10\n330\n2\n100\nAcDbSymbolTableRecord\n100\nAcDbLayerTableRecord\n2\n0\n70\n0\n62\n7\n6\nCONTINUOUS\n0\nLAYER\n5\n139971082824738\n330\n2\n100\nAcDbSymbolTableRecord\n100\nAcDbLayerTableRecord\n2\nNONE\n70\n0\n62\n7\n6\nCONTINUOUS\n0\nENDTAB\n0\nTABLE\n2\nSTYLE\n5\n139971082824729\n330\n0\n100\nAcDbSymbolTable\n70\n1\n0\nSTYLE\n5\n13997108282472A\n330\n139971082824729\n100\nAcDbSymbolTableRecord\n100\nAcDbTextStyleTableRecord\n2\nSTANDARD\n70\n0\n40\n0.0\n41\n1.0\n50\n0.0\n71\n0\n42\n0.2\n3\ntxt\n4\n\n0\nENDTAB\n0\nTABLE\n2\nVIEW\n5\n6\n330\n0\n100\nAcDbSymbolTable\n70\n0\n0\nENDTAB\n0\nTABLE\n2\nUCS\n5\n7\n330\n0\n100\nAcDbSymbolTable\n70\n0\n0\nENDTAB\n0\nTABLE\n2\nAPPID\n5\n13997108282472F\n330\n0\n100\nAcDbSymbolTable\n70\n1\n0\nAPPID\n5\n139971082824730\n330\n13997108282472F\n100\nAcDbSymbolTableRecord\n100\nAcDbRegAppTableRecord\n2\nACAD\n70\n0\n0\nENDTAB\n0\nTABLE\n2\nDIMSTYLE\n5\n13997108282472B\n330\n0\n100\nAcDbSymbolTable\n70\n1\n0\nDIMSTYLE\n105\n13997108282472C\n330\n13997108282472B\n100\nAcDbSymbolTableRecord\n100\nAcDbDimStyleTableRecord\n2\nSTANDARD\n70\n0\n3\n\n4\n\n5\n\n6\n\n7\n\n40\n1.0\n41\n0.18\n42\n0.0625\n43\n0.38\n44\n0.18\n45\n0.0\n46\n0.0\n47\n0.0\n48\n0.0\n140\n0.18\n141\n0.09\n142\n0.0\n143\n25.4\n144\n1.0\n145\n0.0\n146\n1.0\n147\n0.09\n71\n0\n72\n0\n73\n1\n74\n1\n75\n0\n76\n0\n77\n0\n78\n0\n170\n0\n171\n2\n172\n0\n173\n0\n174\n0\n175\n0\n176\n0\n177\n0\n178\n0\n270\n2\n271\n4\n272\n4\n273\n2\n274\n2\n340\n13997108282472A\n275\n0\n280\n0\n281\n0\n282\n0\n283\n1\n284\n0\n285\n0\n286\n0\n287\n3\n288\n0\n0\nENDTAB\n0\nTABLE\n2\nBLOCK_RECORD\n5\n1\n330\n0\n100\nAcDbSymbolTable\n70\n1\n0\nBLOCK_RECORD\n5\n1F\n330\n1\n100\nAcDbSymbolTableRecord\n100\nAcDbBlockTableRecord\n2\n*MODEL_SPACE\n0\nBLOCK_RECORD\n5\n58\n330\n1\n100\nAcDbSymbolTableRecord\n100\nAcDbBlockTableRecord\n2\n*PAPER_SPACE\n0\nBLOCK_RECORD\n5\n5D\n330\n1\n100\nAcDbSymbolTableRecord\n100\nAcDbBlockTableRecord\n2\n*PAPER_SPACE0\n0\nENDTAB\n0\nENDSEC\n0\nSECTION\n2\nBLOCKS\n0\nBLOCK\n5\n13997108282475E\n330\n1F\n100\nAcDbEntity\n8\n0\n100\nAcDbBlockBegin\n2\n*MODEL_SPACE\n70\n0\n10\n0.0\n20\n0.0\n30\n0.0\n3\n*MODEL_SPACE\n1\n\n0\nENDBLK\n5\n13997108282475F\n330\n1F\n100\nAcDbEntity\n8\n0\n100\nAcDbBlockEnd\n0\nBLOCK\n5\n139971082824760\n330\n58\n100\nAcDbEntity\n67\n1\n8\n0\n100\nAcDbBlockBegin\n2\n*PAPER_SPACE\n70\n0\n10\n0.0\n20\n0.0\n30\n0.0\n3\n*PAPER_SPACE\n1\n\n0\nENDBLK\n5\n139971082824761\n330\n58\n100\nAcDbEntity\n67\n1\n8\n0\n100\nAcDbBlockEnd\n0\nBLOCK\n5\n139971082824762\n330\n5D\n100\nAcDbEntity\n8\n0\n100\nAcDbBlockBegin\n2\n*PAPER_SPACE0\n70\n0\n10\n0.0\n20\n0.0\n30\n0.0\n3\n*PAPER_SPACE0\n1\n\n0\nENDBLK\n5\n139971082824763\n330\n5D\n100\nAcDbEntity\n8\n0\n100\nAcDbBlockEnd\n0\nENDSEC",
+    "header": "0\nSECTION\n2\nHEADER\n9\n$$ACADVER\n1\nAC1014\n9\n$$ACADMAINTVER\n70\n9\n9\n$$DWGCODEPAGE\n3\nANSI_1252\n9\n$$INSBASE\n10\n0.0\n20\n0.0\n30\n0.0\n9\n$$EXTMIN\n$BOUNDS_MIN\n9\n$$EXTMAX\n$BOUNDS_MAX\n9\n$$LIMMIN\n10\n0.0\n20\n0.0\n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IMTIX\n70\n0\n9\n$$DIMSOXD\n70\n0\n9\n$$DIMSAH\n70\n0\n9\n$$DIMBLK1\n1\n\n9\n$$DIMBLK2\n1\n\n9\n$$DIMSTYLE\n2\nSTANDARD\n9\n$$DIMCLRD\n70\n0\n9\n$$DIMCLRE\n70\n0\n9\n$$DIMCLRT\n70\n0\n9\n$$DIMTFAC\n40\n1.0\n9\n$$DIMGAP\n40\n0.09\n9\n$$DIMJUST\n70\n0\n9\n$$DIMSD1\n70\n0\n9\n$$DIMSD2\n70\n0\n9\n$$DIMTOLJ\n70\n1\n9\n$$DIMTZIN\n70\n0\n9\n$$DIMALTZ\n70\n0\n9\n$$DIMALTTZ\n70\n0\n9\n$$DIMFIT\n70\n5\n9\n$$DIMUPT\n70\n0\n9\n$$DIMUNIT\n70\n2\n9\n$$DIMDEC\n70\n4\n9\n$$DIMTDEC\n70\n4\n9\n$$DIMALTU\n70\n2\n9\n$$DIMALTTD\n70\n2\n9\n$$DIMTXSTY\n7\nSTANDARD\n9\n$$DIMAUNIT\n70\n0\n9\n$$LUNITS\n70\n1\n9\n$$LUPREC\n70\n4\n9\n$$SKETCHINC\n40\n0.1\n9\n$$FILLETRAD\n40\n0.5\n9\n$$AUNITS\n70\n0\n9\n$$AUPREC\n70\n0\n9\n$$MENU\n1\n.\n9\n$$ELEVATION\n40\n0.0\n9\n$$PELEVATION\n40\n0.0\n9\n$$THICKNESS\n40\n0.0\n9\n$$LIMCHECK\n70\n0\n9\n$$CHAMFERA\n40\n0.0\n9\n$$CHAMFERB\n40\n0.0\n9\n$$CHAMFERC\n40\n0.0\n9\n$$CHAMFERD\n40\n0.0\n9\n$$SKPOLY\n70\n0\n9\n$$TDCREATE\n40\n2447892.833333333\n9\n$$TDUPDATE\n40\n2458393.627430162\n9\n$$TDINDWG\n40\n0.0003091782\n9\n$$TDUSRTIMER\n40\n0.0003091782\n9\n$$USRTIMER\n70\n1\n9\n$$ANGBASE\n50\n0.0\n9\n$$ANGDIR\n70\n0\n9\n$$PDMODE\n70\n0\n9\n$$PDSIZE\n40\n0.0\n9\n$$PLINEWID\n40\n0.0\n9\n$$COORDS\n70\n1\n9\n$$SPLFRAME\n70\n0\n9\n$$SPLINETYPE\n70\n6\n9\n$$SPLINESEGS\n70\n8\n9\n$$ATTDIA\n70\n0\n9\n$$ATTREQ\n70\n1\n9\n$$HANDLING\n70\n1\n9\n$$HANDSEED\n5\n139971082824787\n9\n$$SURFTAB1\n70\n6\n9\n$$SURFTAB2\n70\n6\n9\n$$SURFTYPE\n70\n6\n9\n$$SURFU\n70\n6\n9\n$$SURFV\n70\n6\n9\n$$UCSNAME\n2\n\n9\n$$UCSORG\n10\n0.0\n20\n0.0\n30\n0.0\n9\n$$UCSXDIR\n10\n1.0\n20\n0.0\n30\n0.0\n9\n$$UCSYDIR\n10\n0.0\n20\n1.0\n30\n0.0\n9\n$$PUCSNAME\n2\n\n9\n$$PUCSORG\n10\n0.0\n20\n0.0\n30\n0.0\n9\n$$PUCSXDIR\n10\n1.0\n20\n0.0\n30\n0.0\n9\n$$PUCSYDIR\n10\n0.0\n20\n1.0\n30\n0.0\n9\n$$USERI1\n70\n0\n9\n$$USERI2\n70\n0\n9\n$$USERI3\n70\n0\n9\n$$USERI4\n70\n0\n9\n$$USERI5\n70\n0\n9\n$$USERR1\n40\n0.0\n9\n$$USERR2\n40\n0.0\n9\n$$USERR3\n40\n0.0\n9\n$$USERR4\n40\n0.0\n9\n$$USERR5\n40\n0.0\n9\n$$WORLDVIEW\n70\n1\n9\n$$SHADEDGE\n70\n3\n9\n$$SHADEDIF\n70\n70\n9\n$$TILEMODE\n70\n1\n9\n$$MAXACTVP\n70\n64\n9\n$$PINSBASE\n10\n0.0\n20\n0.0\n30\n0.0\n9\n$$PLIMCHECK\n70\n0\n9\n$$PEXTMIN\n10\n1.000000000000000E+20\n20\n1.000000000000000E+20\n30\n1.000000000000000E+20\n9\n$$PEXTMAX\n10\n-1.000000000000000E+20\n20\n-1.000000000000000E+20\n30\n-1.000000000000000E+20\n9\n$$PLIMMIN\n10\n0.0\n20\n0.0\n9\n$$PLIMMAX\n10\n0.0\n20\n0.0\n9\n$$UNITMODE\n70\n0\n9\n$$VISRETAIN\n70\n1\n9\n$$PLINEGEN\n70\n0\n9\n$$PSLTSCALE\n70\n1\n9\n$$TREEDEPTH\n70\n3020\n9\n$$PICKSTYLE\n70\n1\n9\n$$CMLSTYLE\n2\nSTANDARD\n9\n$$CMLJUST\n70\n0\n9\n$$CMLSCALE\n40\n1.0\n9\n$$PROXYGRAPHICS\n70\n1\n9\n$$MEASUREMENT\n70\n0\n0\nENDSEC\n0\nSECTION\n2\nCLASSES\n0\nCLASS\n1\nACDBDICTIONARYWDFLT\n2\nAcDbDictionaryWithDefault\n3\nObjectDBX|<^>|Classes\n90\n0\n280\n0\n281\n0\n0\nCLASS\n1\nSCALE\n2\nAcDbScale\n3\nObjectDBX|<^>|Classes\n90\n1153\n280\n0\n281\n0\n0\nCLASS\n1\nMATERIAL\n2\nAcDbMaterial\n3\nObjectDBX|<^>|Classes\n90\n1153\n280\n0\n281\n0\n0\nCLASS\n1\nVISUALSTYLE\n2\nAcDbVisualStyle\n3\nObjectDBX|<^>|Classes\n90\n4095\n280\n0\n281\n0\n0\nCLASS\n1\nTABLESTYLE\n2\nAcDbTableStyle\n3\nObjectDBX|<^>|Classes\n90\n4095\n280\n0\n281\n0\n0\nCLASS\n1\nMLEADERSTYLE\n2\nAcDbMLeaderStyle\n3\nACDB_MLEADERSTYLE_CLASS\n90\n4095\n280\n0\n281\n0\n0\nCLASS\n1\nXRECORD\n2\nAcDbXrecord\n3\nObjectDBX|<^>|Classes\n90\n0\n280\n0\n281\n0\n0\nCLASS\n1\nLWPOLYLINE\n2\nAcDbPolyline\n3\nObjectDBX|<^>|Classes\n90\n0\n280\n0\n281\n1\n0\nCLASS\n1\nHATCH\n2\nAcDbHatch\n3\nObjectDBX|<^>|Classes\n90\n0\n280\n0\n281\n1\n0\nCLASS\n1\nDICTIONARYVAR\n2\nAcDbDictionaryVar\n3\nObjectDBX|<^>|Classes\n90\n0\n280\n0\n281\n0\n0\nENDSEC\n0\nSECTION\n2\nTABLES\n0\nTABLE\n2\nVPORT\n5\n13997108282472D\n330\n0\n100\nAcDbSymbolTable\n70\n1\n0\nVPORT\n5\n13997108282472E\n330\n13997108282472D\n100\nAcDbSymbolTableRecord\n100\nAcDbViewportTableRecord\n2\n*ACTIVE\n70\n0\n10\n0.0\n20\n0.0\n11\n1.0\n21\n1.0\n12\n10.42990654205607\n22\n4.5\n13\n0.0\n23\n0.0\n14\n0.5\n24\n0.5\n15\n0.5\n25\n0.5\n16\n0.0\n26\n0.0\n36\n1.0\n17\n0.0\n27\n0.0\n37\n0.0\n40\n9.0\n41\n1.972972972850329\n42\n50.0\n43\n0.0\n44\n0.0\n50\n0.0\n51\n0.0\n71\n0\n72\n100\n73\n1\n74\n3\n75\n0\n76\n0\n77\n0\n78\n0\n0\nENDTAB\n0\nTABLE\n2\nLTYPE\n5\n5\n330\n0\n100\nAcDbSymbolTable\n70\n1\n0\nLTYPE\n5\n14\n330\n5\n100\nAcDbSymbolTableRecord\n100\nAcDbLinetypeTableRecord\n2\nBYBLOCK\n70\n0\n72\n65\n73\n0\n40\n0.0\n0\nLTYPE\n5\n15\n330\n5\n100\nAcDbSymbolTableRecord\n100\nAcDbLinetypeTableRecord\n2\nBYLAYER\n70\n0\n3\n\n72\n65\n73\n0\n40\n0.0\n0\nLTYPE\n5\n16\n330\n5\n100\nAcDbSymbolTableRecord\n100\nAcDbLinetypeTableRecord\n2\nCONTINUOUS\n70\n0\n3\nSolidline\n72\n65\n73\n0\n40\n0.0\n0\nENDTAB\n0\nTABLE\n2\nLAYER\n5\n2\n330\n0\n100\nAcDbSymbolTable\n70\n3\n0\nLAYER\n5\n10\n330\n2\n100\nAcDbSymbolTableRecord\n100\nAcDbLayerTableRecord\n2\n0\n70\n0\n62\n7\n6\nCONTINUOUS\n0\nLAYER\n5\n139971082824738\n330\n2\n100\nAcDbSymbolTableRecord\n100\nAcDbLayerTableRecord\n2\nNONE\n70\n0\n62\n7\n6\nCONTINUOUS\n0\nENDTAB\n0\nTABLE\n2\nSTYLE\n5\n139971082824729\n330\n0\n100\nAcDbSymbolTable\n70\n1\n0\nSTYLE\n5\n13997108282472A\n330\n139971082824729\n100\nAcDbSymbolTableRecord\n100\nAcDbTextStyleTableRecord\n2\nSTANDARD\n70\n0\n40\n0.0\n41\n1.0\n50\n0.0\n71\n0\n42\n0.2\n3\ntxt\n4\n\n0\nENDTAB\n0\nTABLE\n2\nVIEW\n5\n6\n330\n0\n100\nAcDbSymbolTable\n70\n0\n0\nENDTAB\n0\nTABLE\n2\nUCS\n5\n7\n330\n0\n100\nAcDbSymbolTable\n70\n0\n0\nENDTAB\n0\nTABLE\n2\nAPPID\n5\n13997108282472F\n330\n0\n100\nAcDbSymbolTable\n70\n1\n0\nAPPID\n5\n139971082824730\n330\n13997108282472F\n100\nAcDbSymbolTableRecord\n100\nAcDbRegAppTableRecord\n2\nACAD\n70\n0\n0\nENDTAB\n0\nTABLE\n2\nDIMSTYLE\n5\n13997108282472B\n330\n0\n100\nAcDbSymbolTable\n70\n1\n0\nDIMSTYLE\n105\n13997108282472C\n330\n13997108282472B\n100\nAcDbSymbolTableRecord\n100\nAcDbDimStyleTableRecord\n2\nSTANDARD\n70\n0\n3\n\n4\n\n5\n\n6\n\n7\n\n40\n1.0\n41\n0.18\n42\n0.0625\n43\n0.38\n44\n0.18\n45\n0.0\n46\n0.0\n47\n0.0\n48\n0.0\n140\n0.18\n141\n0.09\n142\n0.0\n143\n25.4\n144\n1.0\n145\n0.0\n146\n1.0\n147\n0.09\n71\n0\n72\n0\n73\n1\n74\n1\n75\n0\n76\n0\n77\n0\n78\n0\n170\n0\n171\n2\n172\n0\n173\n0\n174\n0\n175\n0\n176\n0\n177\n0\n178\n0\n270\n2\n271\n4\n272\n4\n273\n2\n274\n2\n340\n13997108282472A\n275\n0\n280\n0\n281\n0\n282\n0\n283\n1\n284\n0\n285\n0\n286\n0\n287\n3\n288\n0\n0\nENDTAB\n0\nTABLE\n2\nBLOCK_RECORD\n5\n1\n330\n0\n100\nAcDbSymbolTable\n70\n1\n0\nBLOCK_RECORD\n5\n1F\n330\n1\n100\nAcDbSymbolTableRecord\n100\nAcDbBlockTableRecord\n2\n*MODEL_SPACE\n0\nBLOCK_RECORD\n5\n58\n330\n1\n100\nAcDbSymbolTableRecord\n100\nAcDbBlockTableRecord\n2\n*PAPER_SPACE\n0\nBLOCK_RECORD\n5\n5D\n330\n1\n100\nAcDbSymbolTableRecord\n100\nAcDbBlockTableRecord\n2\n*PAPER_SPACE0\n0\nENDTAB\n0\nENDSEC\n0\nSECTION\n2\nBLOCKS\n0\nBLOCK\n5\n13997108282475E\n330\n1F\n100\nAcDbEntity\n8\n0\n100\nAcDbBlockBegin\n2\n*MODEL_SPACE\n70\n0\n10\n0.0\n20\n0.0\n30\n0.0\n3\n*MODEL_SPACE\n1\n\n0\nENDBLK\n5\n13997108282475F\n330\n1F\n100\nAcDbEntity\n8\n0\n100\nAcDbBlockEnd\n0\nBLOCK\n5\n139971082824760\n330\n58\n100\nAcDbEntity\n67\n1\n8\n0\n100\nAcDbBlockBegin\n2\n*PAPER_SPACE\n70\n0\n10\n0.0\n20\n0.0\n30\n0.0\n3\n*PAPER_SPACE\n1\n\n0\nENDBLK\n5\n139971082824761\n330\n58\n100\nAcDbEntity\n67\n1\n8\n0\n100\nAcDbBlockEnd\n0\nBLOCK\n5\n139971082824762\n330\n5D\n100\nAcDbEntity\n8\n0\n100\nAcDbBlockBegin\n2\n*PAPER_SPACE0\n70\n0\n10\n0.0\n20\n0.0\n30\n0.0\n3\n*PAPER_SPACE0\n1\n\n0\nENDBLK\n5\n139971082824763\n330\n5D\n100\nAcDbEntity\n8\n0\n100\nAcDbBlockEnd\n0\nENDSEC",
     "bspline": "0\nSPLINE\n5\n$NAME\n330\n1F\n100\nAcDbEntity\n8\n$LAYER\n6\nCONTINUOUS\n62\n$COLOR\n100\nAcDbSpline\n$NORMAL\n70\n$FLAG\n71\n$DEGREE\n72\n$KCOUNT\n73\n$PCOUNT\n74\n$FCOUNT\n42\n0.000000001\n43\n0.00000001\n$KNOTS\n$POINTS",
-    "header~": "0\nSECTION\n2\nHEADER\n9\n$$ACADVER\n1\nAC1014\n9\n$$ACADMAINTVER\n70\n9\n9\n$$DWGCODEPAGE\n3\nANSI_1252\n9\n$$INSBASE\n10\n0.0\n20\n0.0\n30\n0.0\n9\n$$EXTMIN\n$BOUNDS_MIN\n9\n$$EXTMAX\n$BOUNDS_MAX\n9\n$$LIMMIN\n10\n0.0\n20\n0.0\n9\n$$LIMMAX\n10\n12.0\n20\n9.0\n9\n$$ORTHOMODE\n70\n0\n9\n$$REGENMODE\n70\n1\n9\n$$FILLMODE\n70\n1\n9\n$$QTEXTMODE\n70\n0\n9\n$$MIRRTEXT\n70\n1\n9\n$$DRAGMODE\n70\n2\n9\n$$LTSCALE\n40\n1.0\n9\n$$OSMODE\n70\n511\n9\n$$ATTMODE\n70\n1\n9\n$$TEXTSIZE\n40\n0.2\n9\n$$TRACEWID\n40\n0.05\n9\n$$TEXTSTYLE\n7\nSTANDARD\n9\n$$CLAYER\n8\n0\n9\n$$CELTYPE\n6\nBYBLOCK\n9\n$$CECOLOR\n62\n256\n9\n$$CELTSCALE\n40\n1.0\n9\n$$DELOBJ\n70\n1\n9\n$$DISPSILH\n70\n0\n9\n$$DIMSCALE\n40\n1.0\n9\n$$DIMASZ\n40\n0.18\n9\n$$DIMEXO\n40\n0.0625\n9\n$$DIMDLI\n40\n0.38\n9\n$$DIMRND\n40\n0.0\n9\n$$DIMDLE\n40\n0.0\n9\n$$DIMEXE\n40\n0.18\n9\n$$DIMTP\n40\n0.0\n9\n$$DIMTM\n40\n0.0\n9\n$$DIMTXT\n40\n0.18\n9\n$$DIMCEN\n40\n0.09\n9\n$$DIMTSZ\n40\n0.0\n9\n$$DIMTOL\n70\n0\n9\n$$DIMLIM\n70\n0\n9\n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9\n$$PELEVATION\n40\n0.0\n9\n$$THICKNESS\n40\n0.0\n9\n$$LIMCHECK\n70\n0\n9\n$$CHAMFERA\n40\n0.0\n9\n$$CHAMFERB\n40\n0.0\n9\n$$CHAMFERC\n40\n0.0\n9\n$$CHAMFERD\n40\n0.0\n9\n$$SKPOLY\n70\n0\n9\n$$TDCREATE\n40\n2447892.833333333\n9\n$$TDUPDATE\n40\n2458393.627430162\n9\n$$TDINDWG\n40\n0.0003091782\n9\n$$TDUSRTIMER\n40\n0.0003091782\n9\n$$USRTIMER\n70\n1\n9\n$$ANGBASE\n50\n0.0\n9\n$$ANGDIR\n70\n0\n9\n$$PDMODE\n70\n0\n9\n$$PDSIZE\n40\n0.0\n9\n$$PLINEWID\n40\n0.0\n9\n$$COORDS\n70\n1\n9\n$$SPLFRAME\n70\n0\n9\n$$SPLINETYPE\n70\n6\n9\n$$SPLINESEGS\n70\n8\n9\n$$ATTDIA\n70\n0\n9\n$$ATTREQ\n70\n1\n9\n$$HANDLING\n70\n1\n9\n$$HANDSEED\n5\n139971082824787\n9\n$$SURFTAB1\n70\n6\n9\n$$SURFTAB2\n70\n6\n9\n$$SURFTYPE\n70\n6\n9\n$$SURFU\n70\n6\n9\n$$SURFV\n70\n6\n9\n$$UCSNAME\n2\n\n9\n$$UCSORG\n10\n0.0\n20\n0.0\n30\n0.0\n9\n$$UCSXDIR\n10\n1.0\n20\n0.0\n30\n0.0\n9\n$$UCSYDIR\n10\n0.0\n20\n1.0\n30\n0.0\n9\n$$PUCSNAME\n2\n\n9\n$$PUCSORG\n10\n0.0\n20\n0.0\n30\n0.0\n9\n$$PUCSXDIR\n10\n1.0\n20\n0.0\n30\n0.0\n9\n$$PUCSYDIR\n10\n0.0\n20\n1.0\n30\n0.0\n9\n$$USERI1\n70\n0\n9\n$$USERI2\n70\n0\n9\n$$USERI3\n70\n0\n9\n$$USERI4\n70\n0\n9\n$$USERI5\n70\n0\n9\n$$USERR1\n40\n0.0\n9\n$$USERR2\n40\n0.0\n9\n$$USERR3\n40\n0.0\n9\n$$USERR4\n40\n0.0\n9\n$$USERR5\n40\n0.0\n9\n$$WORLDVIEW\n70\n1\n9\n$$SHADEDGE\n70\n3\n9\n$$SHADEDIF\n70\n70\n9\n$$TILEMODE\n70\n1\n9\n$$MAXACTVP\n70\n64\n9\n$$PINSBASE\n10\n0.0\n20\n0.0\n30\n0.0\n9\n$$PLIMCHECK\n70\n0\n9\n$$PEXTMIN\n10\n1.000000000000000E+20\n20\n1.000000000000000E+20\n30\n1.000000000000000E+20\n9\n$$PEXTMAX\n10\n-1.000000000000000E+20\n20\n-1.000000000000000E+20\n30\n-1.000000000000000E+20\n9\n$$PLIMMIN\n10\n0.0\n20\n0.0\n9\n$$PLIMMAX\n10\n0.0\n20\n0.0\n9\n$$UNITMODE\n70\n0\n9\n$$VISRETAIN\n70\n1\n9\n$$PLINEGEN\n70\n0\n9\n$$PSLTSCALE\n70\n1\n9\n$$TREEDEPTH\n70\n3020\n9\n$$PICKSTYLE\n70\n1\n9\n$$CMLSTYLE\n2\nSTANDARD\n9\n$$CMLJUST\n70\n0\n9\n$$CMLSCALE\n40\n1.0\n9\n$$PROXYGRAPHICS\n70\n1\n9\n$$MEASUREMENT\n70\n0\n0\nENDSEC\n0\nSECTION\n2\nCLASSES\n0\nCLASS\n1\nACDBDICTIONARYWDFLT\n2\nAcDbDictionaryWithDefault\n3\nObjectDBX|<^>|Classes\n90\n0\n280\n0\n281\n0\n0\nCLASS\n1\nSCALE\n2\nAcDbScale\n3\nObjectDBX|<^>|Classes\n90\n1153\n280\n0\n281\n0\n0\nCLASS\n1\nMATERIAL\n2\nAcDbMaterial\n3\nObjectDBX|<^>|Classes\n90\n1153\n280\n0\n281\n0\n0\nCLASS\n1\nVISUALSTYLE\n2\nAcDbVisualStyle\n3\nObjectDBX|<^>|Classes\n90\n4095\n280\n0\n281\n0\n0\nCLASS\n1\nTABLESTYLE\n2\nAcDbTableStyle\n3\nObjectDBX|<^>|Classes\n90\n4095\n280\n0\n281\n0\n0\nCLASS\n1\nMLEADERSTYLE\n2\nAcDbMLeaderStyle\n3\nACDB_MLEADERSTYLE_CLASS\n90\n4095\n280\n0\n281\n0\n0\nCLASS\n1\nXRECORD\n2\nAcDbXrecord\n3\nObjectDBX|<^>|Classes\n90\n0\n280\n0\n281\n0\n0\nCLASS\n1\nLWPOLYLINE\n2\nAcDbPolyline\n3\nObjectDBX|<^>|Classes\n90\n0\n280\n0\n281\n1\n0\nCLASS\n1\nHATCH\n2\nAcDbHatch\n3\nObjectDBX|<^>|Classes\n90\n0\n280\n0\n281\n1\n0\nCLASS\n1\nDICTIONARYVAR\n2\nAcDbDictionaryVar\n3\nObjectDBX|<^>|Classes\n90\n0\n280\n0\n281\n0\n0\nENDSEC\n0\nSECTION\n2\nTABLES\n0\nTABLE\n2\nVPORT\n5\n13997108282472D\n330\n0\n100\nAcDbSymbolTable\n70\n1\n0\nVPORT\n5\n13997108282472E\n330\n13997108282472D\n100\nAcDbSymbolTableRecord\n100\nAcDbViewportTableRecord\n2\n*ACTIVE\n70\n0\n10\n0.0\n20\n0.0\n11\n1.0\n21\n1.0\n12\n10.42990654205607\n22\n4.5\n13\n0.0\n23\n0.0\n14\n0.5\n24\n0.5\n15\n0.5\n25\n0.5\n16\n0.0\n26\n0.0\n36\n1.0\n17\n0.0\n27\n0.0\n37\n0.0\n40\n9.0\n41\n1.972972972850329\n42\n50.0\n43\n0.0\n44\n0.0\n50\n0.0\n51\n0.0\n71\n0\n72\n100\n73\n1\n74\n3\n75\n0\n76\n0\n77\n0\n78\n0\n0\nENDTAB\n0\nTABLE\n2\nLTYPE\n5\n5\n330\n0\n100\nAcDbSymbolTable\n70\n1\n0\nLTYPE\n5\n14\n330\n5\n100\nAcDbSymbolTableRecord\n100\nAcDbLinetypeTableRecord\n2\nBYBLOCK\n70\n0\n3\n\n72\n65\n73\n0\n40\n0.0\n0\nLTYPE\n5\n15\n330\n5\n100\nAcDbSymbolTableRecord\n100\nAcDbLinetypeTableRecord\n2\nBYLAYER\n70\n0\n3\n\n72\n65\n73\n0\n40\n0.0\n0\nLTYPE\n5\n16\n330\n5\n100\nAcDbSymbolTableRecord\n100\nAcDbLinetypeTableRecord\n2\nCONTINUOUS\n70\n0\n3\nSolidline\n72\n65\n73\n0\n40\n0.0\n0\nENDTAB\n0\nTABLE\n2\nLAYER\n5\n2\n330\n0\n100\nAcDbSymbolTable\n70\n3\n0\nLAYER\n5\n10\n330\n2\n100\nAcDbSymbolTableRecord\n100\nAcDbLayerTableRecord\n2\n0\n70\n0\n62\n7\n6\nCONTINUOUS\n0\nLAYER\n5\n139971082824738\n330\n2\n100\nAcDbSymbolTableRecord\n100\nAcDbLayerTableRecord\n2\nNONE\n70\n0\n62\n7\n6\nCONTINUOUS\n0\nENDTAB\n0\nTABLE\n2\nSTYLE\n5\n139971082824729\n330\n0\n100\nAcDbSymbolTable\n70\n1\n0\nSTYLE\n5\n13997108282472A\n330\n139971082824729\n100\nAcDbSymbolTableRecord\n100\nAcDbTextStyleTableRecord\n2\nSTANDARD\n70\n0\n40\n0.0\n41\n1.0\n50\n0.0\n71\n0\n42\n0.2\n3\ntxt\n4\n0\nENDTAB\n0\nTABLE\n2\nVIEW\n5\n6\n330\n0\n100\nAcDbSymbolTable\n70\n0\n0\nENDTAB\n0\nTABLE\n2\nUCS\n5\n7\n330\n0\n100\nAcDbSymbolTable\n70\n0\n0\nENDTAB\n0\nTABLE\n2\nAPPID\n5\n13997108282472F\n330\n0\n100\nAcDbSymbolTable\n70\n1\n0\nAPPID\n5\n139971082824730\n330\n13997108282472F\n100\nAcDbSymbolTableRecord\n100\nAcDbRegAppTableRecord\n2\nACAD\n70\n0\n0\nENDTAB\n0\nTABLE\n2\nDIMSTYLE\n5\n13997108282472B\n330\n0\n100\nAcDbSymbolTable\n70\n1\n0\nDIMSTYLE\n105\n13997108282472C\n330\n13997108282472B\n100\nAcDbSymbolTableRecord\n100\nAcDbDimStyleTableRecord\n2\nSTANDARD\n70\n0\n3\n\n4\n\n5\n\n6\n\n7\n\n40\n1.0\n41\n0.18\n42\n0.0625\n43\n0.38\n44\n0.18\n45\n0.0\n46\n0.0\n47\n0.0\n48\n0.0\n140\n0.18\n141\n0.09\n142\n0.0\n143\n25.4\n144\n1.0\n145\n0.0\n146\n1.0\n147\n0.09\n71\n0\n72\n0\n73\n1\n74\n1\n75\n0\n76\n0\n77\n0\n78\n0\n170\n0\n171\n2\n172\n0\n173\n0\n174\n0\n175\n0\n176\n0\n177\n0\n178\n0\n270\n2\n271\n4\n272\n4\n273\n2\n274\n2\n340\n13997108282472A\n275\n0\n280\n0\n281\n0\n282\n0\n283\n1\n284\n0\n285\n0\n286\n0\n287\n3\n288\n0\n0\nENDTAB\n0\nTABLE\n2\nBLOCK_RECORD\n5\n1\n330\n0\n100\nAcDbSymbolTable\n70\n1\n0\nBLOCK_RECORD\n5\n1F\n330\n1\n100\nAcDbSymbolTableRecord\n100\nAcDbBlockTableRecord\n2\n*MODEL_SPACE\n0\nBLOCK_RECORD\n5\n58\n330\n1\n100\nAcDbSymbolTableRecord\n100\nAcDbBlockTableRecord\n2\n*PAPER_SPACE\n0\nBLOCK_RECORD\n5\n5D\n330\n1\n100\nAcDbSymbolTableRecord\n100\nAcDbBlockTableRecord\n2\n*PAPER_SPACE0\n0\nENDTAB\n0\nENDSEC\n0\nSECTION\n2\nBLOCKS\n0\nBLOCK\n5\n13997108282475E\n330\n1F\n100\nAcDbEntity\n8\n0\n100\nAcDbBlockBegin\n2\n*MODEL_SPACE\n70\n0\n10\n0.0\n20\n0.0\n30\n0.0\n3\n*MODEL_SPACE\n1\n\n0\nENDBLK\n5\n13997108282475F\n330\n1F\n100\nAcDbEntity\n8\n0\n100\nAcDbBlockEnd\n0\nBLOCK\n5\n139971082824760\n330\n58\n100\nAcDbEntity\n67\n1\n8\n0\n100\nAcDbBlockBegin\n2\n*PAPER_SPACE\n70\n0\n10\n0.0\n20\n0.0\n30\n0.0\n3\n*PAPER_SPACE\n1\n0\nENDBLK\n5\n139971082824761\n330\n58\n100\nAcDbEntity\n67\n1\n8\n0\n100\nAcDbBlockEnd\n0\nBLOCK\n5\n139971082824762\n330\n5D\n100\nAcDbEntity\n8\n0\n100\nAcDbBlockBegin\n2\n*PAPER_SPACE0\n70\n0\n10\n0.0\n20\n0.0\n30\n0.0\n3\n*PAPER_SPACE0\n1\n0\nENDBLK\n5\n139971082824763\n330\n5D\n100\nAcDbEntity\n8\n0\n100\nAcDbBlockEnd\n0\nENDSEC",
     "entities": "0\nSECTION\n2\nENTITIES\n${ENTITIES}\n0\nENDSEC",
     "arc": "0\n$TYPE\n5\n$NAME\n330\n1F\n100\nAcDbEntity\n8\n$LAYER\n62\n$COLOR\n100\nAcDbCircle\n$DATA",
-    "text": "0\nTEXT\n5\n4D\n100\nAcDbEntity\n8\n$LAYER\n6\nByLayer\n62\n256\n100\nAcDbText\n$ORIGIN\n40\n$HEIGHT\n1\n$TEXT\n50\n$ANGLE\n41\n1\n51\n0\n7\n\n71\n0\n210\n0\n220\n0\n230\n1\n100\nAcDbText",
-    "entities~": "0\nSECTION\n2\nENTITIES\n${ENTITIES}0\nENDSEC",
+    "text": "0\nTEXT\n5\n$NAME\n100\nAcDbEntity\n8\n$LAYER\n6\nByLayer\n62\n256\n100\nAcDbText\n$ORIGIN\n40\n$HEIGHT\n1\n$TEXT\n50\n$ANGLE\n41\n1\n51\n0\n71\n0\n210\n0\n220\n0\n230\n1\n100\nAcDbText",
     "footer": "0\nSECTION\n2\nOBJECTS\n0\nDICTIONARY\n5\n139971082824731\n330\n0\n100\nAcDbDictionary\n3\nACAD_GROUP\n350\n139971082824732\n3\nACAD_MLINESTYLE\n350\n139971082824733\n3\nACAD_SCALELIST\n350\n139971082824739\n3\nAPPDATA\n350\n139971082824785\n3\nDWGPROPS\n350\n139971082824786\n0\nDICTIONARY\n5\n139971082824732\n102\n{ACAD_REACTORS\n330\n139971082824731\n102\n}\n330\n139971082824731\n100\nAcDbDictionary\n0\nDICTIONARY\n5\n139971082824733\n102\n{ACAD_REACTORS\n330\n139971082824731\n102\n}\n330\n139971082824731\n100\nAcDbDictionary\n3\nSTANDARD\n350\n139971082824734\n0\nDICTIONARY\n5\n139971082824739\n102\n{ACAD_REACTORS\n330\n139971082824731\n102\n}\n330\n139971082824731\n100\nAcDbDictionary\n0\nDICTIONARY\n5\n139971082824785\n102\n{ACAD_REACTORS\n330\n139971082824731\n102\n}\n330\n139971082824731\n100\nAcDbDictionary\n0\nXRECORD\n5\n139971082824786\n102\n{ACAD_REACTORS\n330\n139971082824731\n102\n}\n330\n139971082824731\n100\nAcDbXrecord\n1\nDWGPROPS|<^>|COOKIE\n2\n\n3\n\n4\n\n6\n\n7\n\n8\ntrimesh\n9\n\n300\n=\n301\n=\n302\n=\n303\n=\n304\n=\n305\n=\n306\n=\n307\n=\n308\n=\n309\n=\n40\n0.0\n41\n0.0\n42\n2458393.794096829\n1\n\n90\n0\n0\nMLINESTYLE\n5\n139971082824734\n102\n{ACAD_REACTORS\n330\n139971082824733\n102\n}\n330\n139971082824733\n100\nAcDbMlineStyle\n2\nStandard\n70\n0\n3\n\n62\n256\n51\n90.0\n52\n90.0\n71\n2\n49\n0.5\n62\n256\n6\nBYLAYER\n49\n-0.5\n62\n256\n6\nBYLAYER\n0\nENDSEC\n0\nEOF",
     "xrecord": "100\nAcDbXrecord\n${INDEX}\n${DATA}",
     "line": "0\nLWPOLYLINE\n5\n$NAME\n330\n1F\n100\nAcDbEntity\n8\n$LAYER\n62\n$COLOR\n100\nAcDbPolyline\n90\n$VCOUNT\n70\n$FLAG\n43\n0.0\n$POINTS",
-    "objects": "0\nSECTION\n2\nOBJECTS\n${OBJECTS}\n0\nENDSEC",
-    "arc~": "\n0\n$TYPE\n5\n$NAME\n330\n1F\n100\nAcDbEntity\n8\n$LAYER\n62\n$COLOR\n100\nAcDbCircle\n$DATA"
+    "objects": "0\nSECTION\n2\nOBJECTS\n${OBJECTS}\n0\nENDSEC"
 }
\ No newline at end of file
diff --git a/trimesh/resources/helpers/dxf_helper.py b/trimesh/resources/helpers/dxf_helper.py
index bb7a5c2f..2aea169c 100644
--- a/trimesh/resources/helpers/dxf_helper.py
+++ b/trimesh/resources/helpers/dxf_helper.py
@@ -59,6 +59,9 @@ def read_files(path):
     """
     template = {}
     for file_name in os.listdir(path):
+        # skip emacs buffers
+        if '~' in file_name:
+            continue
         with open(os.path.join(path, file_name), 'r') as f:
             template[file_name] = replace_whitespace(
                 f.read(), insert=True)
diff --git a/trimesh/util.py b/trimesh/util.py
index e57fa124..81bf544a 100644
--- a/trimesh/util.py
+++ b/trimesh/util.py
@@ -2187,3 +2187,28 @@ def decode_text(text, initial='utf-8'):
         # try to decode again, unwrapped in try
         text = text.decode(detect['encoding'])
     return text
+
+
+def to_ascii(text):
+    """
+    Force a string or other to ASCII text ignoring errors.
+
+    Parameters
+    -----------
+    text : any
+      Input to be converted to ASCII string
+
+    Returns
+    -----------
+    ascii : str
+      Input as an ASCII string
+    """
+    if hasattr(text, 'encode'):
+        # case for existing strings
+        return text.encode(
+            'ascii', errors='ignore').decode('ascii')
+    elif hasattr(text, 'decode'):
+        # case for bytes
+        return text.decode('ascii', errors='ignore')
+    # otherwise just wrap as a string
+    return str(text)
diff --git a/trimesh/version.py b/trimesh/version.py
index 8e9d94a6..674bac1e 100644
--- a/trimesh/version.py
+++ b/trimesh/version.py
@@ -1,1 +1,1 @@
-__version__ = '3.5.10'
+__version__ = '3.5.12'


Test patch:
diff --git a/tests/generic.py b/tests/generic.py
index ee7f9c72..86f9fafa 100644
--- a/tests/generic.py
+++ b/tests/generic.py
@@ -11,6 +11,7 @@ import copy
 import time
 import shutil
 import timeit
+import base64
 import inspect
 import logging
 import platform
diff --git a/tests/test_dxf.py b/tests/test_dxf.py
index a8f6f30f..e7a06341 100644
--- a/tests/test_dxf.py
+++ b/tests/test_dxf.py
@@ -185,6 +185,24 @@ class DXFTest(g.unittest.TestCase):
             # angle should be 30 degrees
             assert g.np.isclose(angle, g.np.radians(30.0))
 
+    def test_unicode(self):
+        """
+        Check our handling of unicode. Current approach is to
+        just force everything into ASCII rather than handling
+        the encoding flags in DXF headers.
+        """
+        # get a base 2D model
+        m = g.get_mesh('2D/wrench.dxf')
+        # make one of the entity layers a unicode string
+        # store it as B64 so python2 doesn't get mad
+        layer = g.base64.b64decode(
+            'VFJBw4dBRE9IT1JJWk9OVEFMX1RSQcOHQURPNA==').decode('utf-8')
+        m.entities[0].layer = layer
+        # export to a string
+        export = m.export(file_type='dxf')
+        # if any unicode survived the export this will fail
+        export.encode('ascii')
+
 
 if __name__ == '__main__':
     g.trimesh.util.attach_to_log()
diff --git a/tests/test_paths.py b/tests/test_paths.py
index 8ff8221d..babe1643 100644
--- a/tests/test_paths.py
+++ b/tests/test_paths.py
@@ -123,7 +123,7 @@ class VectorTests(g.unittest.TestCase):
 
         # layers should match entity count
         assert len(p.layers) == len(p.entities)
-        assert len(g.np.unique(p.layers)) > 1
+        assert len(set(p.layers)) > 1
 
         count = len(p.entities)