From 6dbf66b2a9542d217a5000a24fc4e44d8fe3b348 Mon Sep 17 00:00:00 2001 From: Yorik van Havre Date: Thu, 11 Apr 2013 14:20:50 -0300 Subject: [PATCH] 0001042: Draft DXF export with projection direction The DXF exporter now features an option in Draft preferences to project the selected objects along the current view direction on export. --- src/Mod/Draft/Draft.py | 38 +- src/Mod/Draft/DraftGeomUtils.py | 114 ++++- src/Mod/Draft/Draft_rc.py | 423 +++++++++--------- .../Draft/Resources/ui/userprefs-import.ui | 20 + src/Mod/Draft/importDXF.py | 92 +++- 5 files changed, 394 insertions(+), 293 deletions(-) diff --git a/src/Mod/Draft/Draft.py b/src/Mod/Draft/Draft.py index 8d2a39a97..296ea3f6a 100644 --- a/src/Mod/Draft/Draft.py +++ b/src/Mod/Draft/Draft.py @@ -3371,42 +3371,6 @@ class _Shape2DView(_DraftObject): if prop in ["Projection","Base","ProjectionMode","FaceNumbers"]: self.createGeometry(obj) - def clean(self,shape): - "returns a valid compound of edges, by recreating them" - # this is because the projection algorithm somehow creates wrong shapes. - # they dispay fine, but on loading the file the shape is invalid - import Part,DraftGeomUtils - oldedges = shape.Edges - newedges = [] - for e in oldedges: - try: - if DraftGeomUtils.geomType(e) == "Line": - newedges.append(e.Curve.toShape()) - elif DraftGeomUtils.geomType(e) == "Circle": - if len(e.Vertexes) > 1: - mp = DraftGeomUtils.findMidpoint(e) - a = Part.Arc(e.Vertexes[0].Point,mp,e.Vertexes[-1].Point).toShape() - newedges.append(a) - else: - newedges.append(e.Curve.toShape()) - elif DraftGeomUtils.geomType(e) == "Ellipse": - if len(e.Vertexes) > 1: - a = Part.Arc(e.Curve,e.FirstParameter,e.LastParameter).toShape() - newedges.append(a) - else: - newedges.append(e.Curve.toShape()) - elif DraftGeomUtils.geomType(e) == "BSplineCurve": - if DraftGeomUtils.isLine(e.Curve): - l = Part.Line(e.Vertexes[0].Point,e.Vertexes[-1].Point).toShape() - newedges.append(l) - else: - newedges.append(e.Curve.toShape()) - else: - newedges.append(e) - except: - print "Debug: error cleaning edge ",e - return Part.makeCompound(newedges) - def getProjected(self,obj,shape,direction): "returns projected edges from a shape and a direction" import Part,Drawing @@ -3420,7 +3384,7 @@ class _Shape2DView(_DraftObject): for g in groups[5:]: edges.append(g) #return Part.makeCompound(edges) - return self.clean(Part.makeCompound(edges)) + return DraftGeomUtils.cleanProjection(Part.makeCompound(edges)) def createGeometry(self,obj): import DraftGeomUtils diff --git a/src/Mod/Draft/DraftGeomUtils.py b/src/Mod/Draft/DraftGeomUtils.py index f378baf26..1ae0d693f 100755 --- a/src/Mod/Draft/DraftGeomUtils.py +++ b/src/Mod/Draft/DraftGeomUtils.py @@ -195,30 +195,13 @@ def findIntersection(edge1,edge2,infinite1=False,infinite2=False,ex1=False,ex2=F returns a list containing the intersection point(s) of 2 edges. You can also feed 4 points instead of edge1 and edge2''' - pt1 = None - - if isinstance(edge1,FreeCAD.Vector) and isinstance(edge2,FreeCAD.Vector): - # we got points directly - pt1 = edge1 - pt2 = edge2 - pt3 = infinite1 - pt4 = infinite2 - infinite1 = ex1 - infinite2 = ex2 - - elif (geomType(edge1) == "Line") and (geomType(edge2) == "Line") : - # we have 2 straight lines - pt1, pt2, pt3, pt4 = [edge1.Vertexes[0].Point, - edge1.Vertexes[1].Point, - edge2.Vertexes[0].Point, - edge2.Vertexes[1].Point] - + def getLineIntersections(pt1,pt2,pt3,pt4,infinite1,infinite2): if pt1: - # first check if we don't already have coincident endpoints - if (pt1 in [pt3,pt4]): - return [pt1] - elif (pt2 in [pt3,pt4]): - return [pt2] + # first check if we don't already have coincident endpoints + if (pt1 in [pt3,pt4]): + return [pt1] + elif (pt2 in [pt3,pt4]): + return [pt2] norm1 = pt2.sub(pt1).cross(pt3.sub(pt1)) norm2 = pt2.sub(pt4).cross(pt3.sub(pt4)) if not DraftVecUtils.isNull(norm1): @@ -250,6 +233,26 @@ def findIntersection(edge1,edge2,infinite1=False,infinite2=False,ex1=False,ex2=F return [] # Lines have same direction else : return [] # Lines aren't on same plane + + pt1 = None + + if isinstance(edge1,FreeCAD.Vector) and isinstance(edge2,FreeCAD.Vector): + # we got points directly + pt1 = edge1 + pt2 = edge2 + pt3 = infinite1 + pt4 = infinite2 + infinite1 = ex1 + infinite2 = ex2 + return getLineIntersections(pt1,pt2,pt3,pt4,infinite1,infinite2) + + elif (geomType(edge1) == "Line") and (geomType(edge2) == "Line") : + # we have 2 straight lines + pt1, pt2, pt3, pt4 = [edge1.Vertexes[0].Point, + edge1.Vertexes[1].Point, + edge2.Vertexes[0].Point, + edge2.Vertexes[1].Point] + return getLineIntersections(pt1,pt2,pt3,pt4,infinite1,infinite2) elif (geomType(edge1) == "Circle") and (geomType(edge2) == "Line") \ or (geomType(edge1) == "Line") and (geomType(edge2) == "Circle") : @@ -1667,6 +1670,71 @@ def filletWire(aWire,r,chamfer=False): filEdges[-1:] = result[0:2] filEdges[0] = result[2] return Part.Wire(filEdges) + +def getCircleFromSpline(edge): + "returns a circle-based edge from a bspline-based edge" + if geomType(edge) != "BSplineCurve": + return None + if len(edge.Vertexes) != 1: + return None + # get 2 points + p1 = edge.Curve.value(0) + p2 = edge.Curve.value(math.pi/2) + # get 2 tangents + t1 = edge.Curve.tangent(0)[0] + t2 = edge.Curve.tangent(math.pi/2)[0] + # get normal + n = p1.cross(p2) + if DraftVecUtils.isNull(n): + return None + # get rays + r1 = DraftVecUtils.rotate(t1,math.pi/2,n) + r2 = DraftVecUtils.rotate(t2,math.pi/2,n) + # get center (intersection of rays) + i = findIntersection(p1,p1.add(r1),p2,p2.add(r2),True,True) + if not i: + return None + c = i[0] + r = (p1.sub(c)).Length + circle = Part.makeCircle(r,c,n) + #print circle.Curve + return circle + +def cleanProjection(shape): + "returns a valid compound of edges, by recreating them" + # this is because the projection algorithm somehow creates wrong shapes. + # they dispay fine, but on loading the file the shape is invalid + oldedges = shape.Edges + newedges = [] + for e in oldedges: + try: + if geomType(e) == "Line": + newedges.append(e.Curve.toShape()) + elif geomType(e) == "Circle": + if len(e.Vertexes) > 1: + mp = findMidpoint(e) + a = Part.Arc(e.Vertexes[0].Point,mp,e.Vertexes[-1].Point).toShape() + newedges.append(a) + else: + newedges.append(e.Curve.toShape()) + elif geomType(e) == "Ellipse": + if len(e.Vertexes) > 1: + a = Part.Arc(e.Curve,e.FirstParameter,e.LastParameter).toShape() + newedges.append(a) + else: + newedges.append(e.Curve.toShape()) + elif geomType(e) == "BSplineCurve": + if isLine(e.Curve): + l = Part.Line(e.Vertexes[0].Point,e.Vertexes[-1].Point).toShape() + newedges.append(l) + else: + newedges.append(e.Curve.toShape()) + else: + newedges.append(e) + except: + print "Debug: error cleaning edge ",e + return Part.makeCompound(newedges) + # circle functions ********************************************************* diff --git a/src/Mod/Draft/Draft_rc.py b/src/Mod/Draft/Draft_rc.py index 37e3e5fc2..995e6ab1b 100644 --- a/src/Mod/Draft/Draft_rc.py +++ b/src/Mod/Draft/Draft_rc.py @@ -2,7 +2,7 @@ # Resource object code # -# Created: Tue Apr 2 18:58:00 2013 +# Created: Thu Apr 11 13:50:17 2013 # by: The Resource Compiler for PyQt (Qt v4.8.2) # # WARNING! All changes made in this file will be lost! @@ -41254,159 +41254,164 @@ qt_resource_data = "\ \x00\x6c\x00\x6b\x00\x79\x08\x00\x00\x00\x00\x06\x00\x00\x00\x11\ \x64\x72\x61\x66\x74\x20\x43\x6f\x6d\x6d\x61\x6e\x64\x20\x42\x61\ \x72\x07\x00\x00\x00\x05\x64\x72\x61\x66\x74\x01\ -\x00\x00\x09\x69\ +\x00\x00\x09\xb5\ \x00\ -\x00\x48\x24\x78\x9c\xed\x5c\x5b\x73\xdb\xb6\x12\x7e\xf7\xaf\xc0\ -\xe8\xe1\x9c\xb4\xe3\x5a\x92\xaf\x49\x8e\xac\x4e\x62\xd7\x49\x3a\ -\xc9\x69\x5a\xb9\x49\xdf\x3c\x10\x09\x89\xa8\x49\x42\x05\x40\x4b\ -\xea\xaf\xef\x2e\x00\x8a\x14\x45\xdd\x2d\xc9\x71\x35\xe3\x19\x8b\ -\x00\x88\x5d\x2c\xbe\x5d\xec\x2e\x56\x6a\xfc\x38\x88\x42\xf2\xc0\ -\xa4\xe2\x22\xbe\xac\xd4\x8f\x6a\x15\xc2\x62\x4f\xf8\x3c\xee\x5e\ -\x56\x7e\xbf\xbd\xf9\xe1\x65\xe5\xc7\xe6\x41\x23\xe1\xd9\xa0\x53\ -\x18\xd4\x3c\x20\x0d\x2f\xa4\x4a\x35\xdf\x25\xfc\xf5\xeb\x6b\x4e\ -\x43\xd1\x85\xff\x61\xb7\xc5\xb4\x86\x97\xd5\xb5\xa4\x1d\xdd\xa8\ -\xda\x41\x30\xba\xcf\xfd\x2e\xd3\xc4\x3c\x5f\x56\x7e\xfd\x6a\x1e\ -\x2b\x24\xa6\x11\xbb\xac\xcc\x9c\x04\x89\x91\x46\x4f\x8a\x1e\x93\ -\x7a\xe8\xde\xe8\x32\x11\x31\x2d\x87\xa6\x93\x34\x24\xf3\xb4\xf9\ -\x44\x1a\x83\x66\xad\x51\x1d\xb8\x87\x21\x3e\x0c\xdd\x03\xb0\xa0\ -\x83\xe6\xd9\xc5\x59\xa3\x6a\x3f\xda\xe6\x80\xf1\x6e\xa0\x9b\xe7\ -\xc7\xaf\x1a\x55\xf7\xd9\xcc\x59\x4d\x27\x6d\x54\x53\xe2\x65\x9c\ -\xf4\x79\xec\x8b\xfe\x2d\xd7\x21\x73\xcc\x28\x2d\x81\xf9\xe6\x87\ -\xa8\x27\xa4\xae\xfe\x34\xc0\x7f\x8d\xaa\x6b\x9d\x9c\x2f\xa4\x43\ -\x91\x64\x92\xf9\xf2\x56\x0c\x3e\x9a\x26\x37\x5d\x81\x9e\xea\x51\ -\x0f\x26\xaa\x38\xee\xe3\x24\x6a\x33\xd9\x3c\x6f\x54\xdd\x27\xcb\ -\x7b\x9e\xc2\xc4\x14\x11\x95\x5d\x1e\x17\x66\x78\x35\x73\x06\xae\ -\x59\x94\x89\x31\xbf\x93\xef\xa4\x48\x7a\xc0\xf3\x68\x2f\xdd\x73\ -\xfd\xd8\x11\x98\x20\xaf\x33\x59\xe5\xc4\x75\xfd\xc7\x0d\xe9\x08\ -\x19\x51\x4d\x44\x4f\x03\xd2\x54\x5e\x66\x93\x2c\xcd\x97\xdc\x5c\ -\xe1\x4d\x95\x5f\x19\xb5\xd9\x52\x9c\x2a\xc8\xf2\xa9\x32\x71\x96\ -\xac\xe3\xfd\xe4\x3a\x16\x58\xc9\x8c\xb5\x94\xb1\x30\x7f\x3d\xd9\ -\x84\xb5\x05\x27\x1c\x5b\xd5\x24\x52\x3e\xd2\x36\x0b\x53\x98\x68\ -\x36\xd0\xa6\xa1\x7e\x77\x92\xa7\x39\x89\x16\x18\x38\x36\xa0\xa0\ -\x60\x44\xe9\x61\xc8\x0a\x58\x99\xca\x23\x31\xba\x0f\x5c\xe5\x97\ -\x32\xce\xf7\x9c\x65\x18\x5b\xf5\x59\xb2\xce\x95\x88\xda\x22\x07\ -\xfc\x2e\x76\xf4\xa0\xc3\xc3\x8e\x36\x74\xcc\x5c\x96\x10\xe1\x2d\ -\xef\x95\xaf\xec\x36\xe0\x8a\xc0\x9f\x0e\x18\x01\x33\x17\x08\x9f\ -\x78\x81\x10\x8a\xf9\xa8\x22\x84\x9b\x85\xc3\x40\x02\x0f\x5a\xd2\ -\x58\x85\xd4\x3c\xa2\x0e\x89\xf6\x9f\x60\xb7\x88\x27\x42\x1c\x19\ -\x6b\x41\x6e\x24\x63\x57\x6f\xae\x8f\xc8\xc1\x87\x8e\x6b\x8f\x68\ -\xaf\x87\x2f\x00\x0d\x37\xf1\x21\x01\xc0\x91\x28\x51\xda\xb5\x10\ -\x5a\x18\xdb\xe1\x21\x83\xa6\x58\x53\x1e\xe3\x33\xcd\x48\x8b\x98\ -\x68\xda\x86\x6e\x1d\x80\xfa\xf6\x79\x18\xe2\x40\x38\x31\x1c\x1f\ -\xca\x32\x12\xf2\x98\x19\xcb\xab\x8e\x0e\x16\xde\xb0\x09\xc9\x79\ -\x89\x94\x2c\xd6\x1f\x62\x9f\x0d\x0a\xe2\x9b\x8e\xd7\x45\x27\xc7\ -\xfd\xfb\x29\xc6\x83\x05\x70\xe5\x2b\xa6\x2f\x2b\xb5\x02\x11\xcf\ -\x31\xee\x0f\x3a\x0e\x7a\xde\xaa\x4b\x41\x6a\x9f\xa9\x0e\xe6\x13\ -\xfb\x24\xfc\x6a\x7a\xa4\x2e\x4c\xad\x00\xe4\x45\x74\x6b\x04\xc1\ -\xff\x8b\x98\x91\x17\x1d\xaa\x34\x53\xfa\xbb\xb2\xdd\x9a\x46\xb5\ -\x5a\x24\xbb\x16\x1f\xbf\x03\x12\x7d\xd6\xa1\x49\x98\x62\x9a\xc6\ -\x7e\x86\xa4\xdd\x31\xf6\x8b\xe4\x60\x2e\x69\xf8\xb4\xb8\xba\x1a\ -\xa9\x2c\xd8\x8a\xbc\xca\xed\x90\x25\xc9\xa8\x66\xa4\x47\x25\x45\ -\x97\x8d\x7b\xce\x44\x15\xcf\xf7\xed\xb3\xd4\xba\x67\xda\x0b\xd8\ -\x5a\x8c\xcc\x3d\x4f\x1a\x55\x7b\xbc\x67\xde\x40\xbe\x7b\x61\x4f\ -\xc0\x2d\x2a\x10\x92\xff\x8d\x36\x38\x9c\xf4\x10\x96\x39\x7e\x43\ -\x7c\xb8\xbb\x58\xf1\xe4\xfd\x44\x07\xa4\xd5\x43\x6c\x91\x16\xeb\ -\x46\x60\x8d\x77\x70\xfe\xb6\xe0\x54\x2a\x3b\x7e\x15\xb4\xc3\xe9\ -\x7b\x77\x3c\x73\x71\x11\x1d\xf0\x28\x89\x5a\xfc\x6f\x56\x5c\x23\ -\x34\x15\x60\x63\xc3\x85\xf3\xda\x58\xe0\x30\xea\x75\x41\x43\xfd\ -\xfc\xe2\xe2\xe2\xb8\x7e\x36\x16\x45\x64\x8b\x2c\x4e\xbb\xd8\x09\ -\x31\xd3\x4d\xf8\x1a\xb0\x98\xb0\x41\xea\x0c\x28\xb3\x23\x0a\xd5\ -\x1e\x1c\x81\x43\xf4\x1e\x86\x84\x4a\x66\xcf\x69\xf4\xad\xc1\x26\ -\xf0\x98\xf4\x44\x38\x34\x23\x8f\x88\x71\x34\x1e\x68\x98\xb0\x91\ -\xbb\x61\xe5\x42\x42\x16\x77\x75\x40\x44\x87\x30\xea\x99\xff\xd8\ -\x9b\xbe\x4a\x94\xdd\x76\x98\x02\x7c\x8a\x9a\xa1\x15\x9b\x11\xfd\ -\x40\x80\x1f\x60\x59\x31\x73\x1a\x55\xf3\x09\x55\xe0\x30\x00\xdf\ -\x14\x45\x93\xbe\x7e\xb4\xba\x17\x60\x98\x2e\x3f\xfe\xcf\xb6\x72\ -\xfc\x83\xa0\x9c\xc0\x53\x0d\x78\x9a\x6e\xc0\x8e\x0d\xd4\x98\x77\ -\xbf\xbc\x89\x5a\xd1\x40\x5d\x4d\x78\xae\x3b\x30\x50\x37\x40\xf6\ -\xca\xf8\xd2\x72\xc2\x48\x21\x4b\x9e\xeb\x9b\x69\xa6\xc0\xd7\x5e\ -\xd2\x4c\x9d\xd4\x66\xdb\xa9\xda\xf6\x0c\xd4\x6d\xc0\xca\x82\x88\ -\x4e\x21\x6c\x01\x4f\x7a\x4a\x9c\xb0\xba\x7d\x58\xce\x91\x77\xec\ -\x59\xa0\xec\xf5\xb8\x4c\x8f\x2f\x16\xd7\xe3\x2c\x44\x0e\x98\x77\ -\x5f\x1a\x22\x63\xc7\xfc\x43\x7a\x26\xb8\x38\x1e\x49\x36\x4e\x4e\ -\x62\x33\x21\x46\xb1\x68\x13\x54\x35\x32\xff\x48\x5f\xc4\xff\xd5\ -\xa4\xcd\x5c\xc4\xcc\xfc\xd5\xf1\x34\x37\x0d\x61\x29\x62\x18\xe0\ -\x73\x38\x0f\x54\x49\x06\x6b\x49\x28\x2d\x0e\x5f\xa4\xbd\xc7\x6d\ -\x39\x6e\x8f\x37\x82\xdb\x39\x39\xab\x05\x71\x3b\x42\x6d\x8f\xc2\ -\xeb\x04\x73\x7a\x2c\x8d\x8e\x6c\x1a\x25\x87\x5d\xf0\xeb\xc4\x06\ -\xf1\x6b\x25\xbb\x35\xc8\x5a\x72\x7b\xd0\x96\x83\xf6\x74\x23\xa0\ -\x9d\x13\xee\xcd\x02\xad\x99\xdc\xe1\xb6\x63\x52\x85\x7d\x1a\x6b\ -\xe3\xf1\xc7\x22\xfe\x01\x67\xf0\x49\x3b\x14\xde\xbd\x22\x2f\xda\ -\xac\xcb\x63\x93\x23\xec\x73\x88\x21\x28\xf9\xfe\x3b\x0c\x4a\xb6\ -\x87\xe5\xef\x2d\x27\xdb\xc2\xb2\xd2\x54\xa6\x14\xf7\x78\x2e\xc3\ -\xf3\xcb\x8d\xe0\xf9\xec\x71\x8d\x70\x6a\x78\x3b\x52\x44\x06\xd9\ -\x0a\xe6\x41\xbb\xc8\x64\x66\x8d\xff\x14\xe0\x9c\xfa\xd6\x4f\x35\ -\x9b\x40\xde\x9a\x9d\x07\xcf\x23\x91\x06\xf3\xf8\xa6\xcf\x21\x36\ -\xa4\x43\x62\xf2\xa7\xf2\x90\xb4\x41\x5c\x11\xbd\x77\xdd\x18\x5d\ -\x2b\x05\x81\xb5\xe2\xe1\x90\x30\x9f\x9b\xe4\xf9\x26\xf4\xc1\x5c\ -\xc6\xa5\x4b\x30\x3c\x6f\x51\x33\xba\x48\xfc\xa3\xa1\xbd\xd7\x8b\ -\x72\xbd\x38\xdb\x88\x5e\xbc\x5a\x5d\x2f\xf0\x86\x28\xd5\x87\x8e\ -\x64\xcc\xa3\xbe\x85\x3e\xec\x38\xda\x70\x84\x3f\x26\xe2\x79\xec\ -\x71\x9f\xc1\xc7\x54\x69\x0c\xb8\xfa\x5c\x62\x56\xe9\x2d\xeb\x53\ -\xc9\x0e\xad\x86\x79\x14\x2f\x87\xee\xf1\x3e\xa9\x1f\x40\x7c\x75\ -\x74\xb4\x46\xd6\x67\x3a\xd2\x7f\x06\x96\x48\x5a\x15\xb0\x15\x78\ -\xa3\x28\x32\x82\x7b\x7c\x97\xe1\xfb\x7c\x13\xf8\x5e\x0b\xdd\x13\ -\x56\x9f\x02\xb8\x53\x10\xe7\x6e\x37\x3b\xe0\x8a\x67\x56\xdf\x26\ -\x59\x6d\x1a\xf3\xc4\x37\x69\x50\x33\x60\x13\x48\xb6\x05\x23\xe4\ -\xe4\x7a\xc4\x16\x10\x4d\x29\x92\x88\xa9\x29\x37\x16\x1b\xc9\x8b\ -\x00\xb5\x3d\xb6\xcb\xb1\x5d\xaf\x6f\xc4\x78\xbf\x7c\x5c\x78\x67\ -\x1e\xb7\xcd\x88\x20\xa0\x91\x31\xe3\xdf\x68\x1a\xfb\x54\xfa\xce\ -\x91\xc1\x11\x04\xb3\x80\xf0\x56\x0c\x7e\x0b\x98\x7e\x97\xf6\xc7\ -\x46\x7b\x9d\x10\xd0\x07\x86\x77\x08\xd8\x8a\xd5\x06\xbe\xf0\x92\ -\xa5\xee\x7f\x96\x50\x04\xbc\xfa\x1d\xb1\xd8\x01\xd1\x5b\x3e\x4c\ -\xf6\x10\x17\xb3\x2d\x25\x68\x69\x1f\xf3\xaf\x7b\x3d\x98\xa2\x07\ -\x9b\xc9\xb0\xd4\x6b\x8f\xab\x08\x01\x35\x77\xbd\x23\x93\xee\x0a\ -\x54\x52\x5f\x5e\x81\xa2\x84\xcc\x7a\x30\x1b\x8c\x4c\x0d\x17\xa4\ -\x2d\x12\x44\x35\x67\xc6\xb6\xaf\x49\x73\x09\x30\x5b\x63\x70\x3d\ -\xe8\xbc\xa7\xee\xe2\x7b\x0f\xe9\x52\x48\x2f\x71\x69\xb5\x0c\xa4\ -\xeb\x8f\x0b\xe9\x3e\x5e\xba\x8e\x6e\x73\xad\x6d\x06\x2f\x1b\x6f\ -\x4e\xb0\x66\x06\x03\x55\x77\x0b\x9c\x82\x5e\xb2\xd8\x67\xd2\xfa\ -\x31\x5e\x68\x0a\xca\x0c\xfa\x6c\xa2\x46\x9b\xeb\x1a\x89\x75\xaf\ -\x64\x6a\xd1\xc8\xba\x8a\xf0\x9b\x61\x21\xc7\xb6\x21\xbd\x26\xb9\ -\x25\x74\xc0\x8a\xe0\xb3\x23\xff\xd5\xd2\x7d\x8e\x6a\x30\xde\x39\ -\x36\x57\x6e\xdc\x4a\x95\xbd\x77\x4b\xd6\xf6\xb6\xbe\xbc\x7b\xbc\ -\xda\x5e\x47\x29\x97\x82\xff\xd6\xab\x7c\xd3\x15\x8d\x65\x7d\x9f\ -\x6f\xbd\xef\x9c\xb4\xdd\xce\xeb\x7d\xcd\x35\x8c\x9c\x38\x1b\x5a\ -\xa6\x79\x2c\xa4\x9d\xe4\x1e\x46\x83\x37\x6c\x4a\x62\x0b\x8b\x60\ -\x20\xd2\xe6\xaf\xfa\xf5\xeb\xf7\xa3\x19\x1b\x55\xd3\xb8\xb4\xd1\ -\x41\x37\xf8\x3d\x78\x2d\xd3\x8d\xce\xd4\xe2\x80\xd3\xd9\xb5\x01\ -\xc7\x6b\x15\x07\xc0\x30\x23\xa3\x25\x64\xbd\x6a\x6d\xf5\x3a\x17\ -\x70\x0b\x57\x57\xa3\xd9\x9a\x5e\x4e\xfd\xed\x57\x30\xab\x87\xee\ -\xbe\x82\x79\xe3\xc5\xa6\xff\xba\x0a\xe6\x5d\x7b\xef\xaf\x16\x77\ -\xde\xcb\x8a\x62\xe7\x94\xa4\xcc\xcb\xdb\xb5\x9e\xc8\xd7\x51\x40\ -\xb9\xef\x6c\xda\xf2\xce\x28\xf9\xdd\xfa\x5f\x4b\x31\x4b\xc3\x9c\ -\x90\xf1\xe7\xb0\x92\x0b\x73\xfe\x12\x18\xb4\xa1\x48\x56\x8a\x4a\ -\x5d\x6d\xf5\xf3\x30\x92\x63\x72\x7c\x9e\xc6\xf2\xd6\x95\xe3\xc1\ -\x19\xf8\x02\x0f\xc1\x9e\xc4\x7b\x9e\xff\xd0\xa8\xf7\xbf\xf4\x32\ -\x73\x87\x26\xf4\x37\xda\xb7\x6c\x5d\xbd\xf9\xb4\x16\x1b\xbb\x36\ -\x4d\x63\x49\xad\xc7\x4b\x2c\xcc\xf6\x49\x97\xa9\x21\x47\xcd\x7e\ -\xe0\xac\xaf\x0e\xf1\xbe\x9a\x99\xdb\x91\x7e\x80\x1a\x6e\x8e\x06\ -\x21\xef\x09\x7e\xb7\x84\xa2\x2f\x44\xda\x21\xf5\xee\x0f\x8d\xd3\ -\xd4\x66\x5a\x83\xcf\x2c\x19\xf5\x69\x9b\x87\x1c\x88\xd3\x2e\xc5\ -\x34\xb2\x7b\xbd\x0d\x43\xf1\x42\x38\xf6\x37\x92\x5e\x1b\xe1\x37\ -\xc7\xad\x3b\xd7\xcc\xa5\x37\x50\x5f\xc3\x14\xd9\x84\x4b\x81\x72\ -\x1b\xc4\xda\xd4\x32\x01\x8b\x60\x3e\x6e\xd2\x08\xb5\x1e\xba\x1f\ -\x31\x59\xf2\xd6\x2e\xe4\x69\x5a\xa0\xa7\x9b\xae\x18\x05\x0b\x8b\ -\xa5\x2b\x7e\xb9\x7a\xf3\xf8\xe9\x8a\x4c\x47\x9f\x4b\xba\x62\xac\ -\x22\xf8\x9b\x4f\x57\x2c\x61\x6e\x4f\x57\x37\xb7\x33\xea\xe8\x28\ -\x18\x4f\x45\x5e\x9c\x5c\xdb\xbb\xe7\xb2\x92\xb9\x8d\x54\x4e\xb8\ -\xb4\x0a\x82\xde\xb0\xb0\x95\x2c\xac\xf0\xa8\x23\xb6\xb7\x65\x66\ -\x2f\xf2\x39\x27\xbc\x97\xe2\x5e\x9a\x71\x9a\x66\xbb\xca\x52\x4d\ -\x59\x96\xe9\x8b\x9b\x63\x2c\xc7\x34\x69\xb7\x96\xc8\x2c\x8d\x27\ -\x95\x5c\x3e\xe9\x78\x22\x9f\x94\xa6\x92\x4e\x27\x52\x49\x63\x59\ -\xa4\x22\x2b\x63\xb9\xa3\x4c\x48\x39\x49\xe6\xc4\xe8\x8c\x53\x1a\ -\x55\x3b\x63\x73\x59\x39\xaf\x10\x6b\x26\x2e\x2b\xf5\x7a\xa5\x8a\ -\x23\x7b\x7c\x10\xd1\x5e\x27\x89\x3d\x14\x54\xf3\xaf\xcf\xe6\xf9\ -\x46\x8a\xe8\x13\x8f\x58\x4b\x24\xd2\x83\x03\xbc\x30\x0a\x7f\xdd\ -\x24\x51\x5a\x44\x96\xa2\x32\x9c\xe4\x5b\x2c\x97\xb9\x5f\x40\xc9\ -\x7d\xd7\x27\xfb\xd1\x13\xdc\x8f\x81\x66\xe0\xf2\x34\xdd\x0f\x9e\ -\xc0\x6e\xb8\x86\x03\x2b\x2a\xea\xc3\x92\x61\x86\x2a\x4e\x60\x7f\ -\x01\xe5\x28\x40\xc1\x99\x0e\x23\x80\x22\xdd\xd9\x8c\x14\xbe\x78\ -\x54\xca\xcc\x24\xc7\xd3\xb8\xc2\xd9\x2c\xe7\x6a\x7d\xb6\xdc\x17\ -\x36\xcb\xe5\x33\xea\xdc\x0a\x2b\xa9\x8d\x2f\xe7\x25\xeb\xdd\x0e\ -\x33\x2e\x72\x9f\xc2\xcc\xa8\x77\x7d\x66\xc6\x1b\xcc\xef\xf2\x48\ -\xa6\x8c\x0e\x28\xa3\x2d\x9e\x88\x63\x66\x74\x00\x9f\x1b\xd5\x84\ -\x37\x0f\xfe\x01\xbd\x89\x17\xfc\ +\x00\x4b\x27\x78\x9c\xed\x5c\x5b\x73\xdb\xb6\x12\x7e\xf7\xaf\xc0\ +\xe8\xe1\x34\xed\xb8\x96\xe5\x6b\x92\x23\xab\x93\xd8\x71\x92\x4e\ +\xd2\xba\x95\x9b\x9c\x37\x0f\x44\x42\x22\x6a\x92\x50\x01\xd0\x92\ +\xfa\xeb\xcf\x2e\x00\x8a\x14\x49\xdd\x2d\xd9\xc9\x68\xc6\x33\x16\ +\x01\x10\xbb\x58\x7e\xbb\xd8\x5d\x2c\xd9\xfc\x65\x18\x85\xe4\x81\ +\x49\xc5\x45\x7c\x51\x6b\x1c\x1c\xd6\x08\x8b\x3d\xe1\xf3\xb8\x77\ +\x51\xfb\xeb\xf6\xfa\xe7\x97\xb5\x5f\x5a\x7b\xcd\x84\x67\x83\x4e\ +\x60\x50\x6b\x8f\x34\xbd\x90\x2a\xd5\x7a\x9f\xf0\xd7\xaf\xaf\x38\ +\x0d\x45\x0f\xfe\x87\xbd\x36\xd3\x1a\x6e\x56\x57\x92\x76\x75\xb3\ +\x6e\x07\xc1\xe8\x01\xf7\x7b\x4c\x13\x73\x7d\x51\xfb\xe3\xab\xb9\ +\xac\x91\x98\x46\xec\xa2\x36\x73\x12\x24\x46\x9a\x7d\x29\xfa\x4c\ +\xea\x91\xbb\xa3\xc7\x44\xc4\xb4\x1c\x99\x4e\xd2\x94\xcc\xd3\xe6\ +\x17\x69\x0e\x5b\x87\xcd\xfa\xd0\x5d\x8c\xf0\x62\xe4\x2e\x80\x05\ +\x1d\xb4\x4e\xcf\x4f\x9b\x75\xfb\xd3\x36\x07\x8c\xf7\x02\xdd\x3a\ +\x3b\x7a\xd5\xac\xbb\xdf\x66\xce\x7a\x3a\x69\xb3\x9e\x12\xaf\xe2\ +\x64\xc0\x63\x5f\x0c\x6e\xb9\x0e\x99\x63\x46\x69\x09\xcc\xb7\x3e\ +\x46\x7d\x21\x75\xfd\xdd\x10\xff\x35\xeb\xae\xb5\x3c\x5f\x48\x47\ +\x22\xc9\x24\xf3\xe5\xad\x18\x7e\x32\x4d\x6e\xba\x02\x3d\xd5\xa7\ +\x1e\x4c\x54\x73\xdc\xc7\x49\xd4\x61\xb2\x75\xd6\xac\xbb\x5f\x96\ +\xf7\x3c\x85\xd2\x14\x11\x95\x3d\x1e\x17\x66\x78\x35\x73\x06\xae\ +\x59\x94\x89\x31\xff\x24\xdf\x4b\x91\xf4\x81\xe7\xf1\xb3\x74\xd7\ +\x8d\x23\x47\xa0\x44\x5e\x67\xb2\xca\x89\xeb\xea\x7f\xd7\xa4\x2b\ +\x64\x44\x35\x11\x7d\x0d\x48\x53\x79\x99\x95\x59\x9a\x2f\xb9\xb9\ +\xc2\x9b\x2a\xbf\x2a\x6a\xb3\xa5\x38\x55\x90\xd5\x53\x65\xe2\xac\ +\x58\xc7\x87\xf2\x3a\x16\x58\xc9\x8c\xb5\x54\xb1\x30\x7f\x3d\xd9\ +\x84\x87\x0b\x4e\x38\xb1\xaa\x32\x52\x3e\xd1\x0e\x0b\x53\x98\x68\ +\x36\xd4\xa6\xa1\x71\x77\x9c\xa7\x59\x46\x0b\x0c\x9c\x18\x50\x50\ +\x30\xa2\xf4\x28\x64\x05\xac\x4c\xe5\x91\x18\xdd\x07\xae\xf2\x4b\ +\x99\xe4\x7b\xce\x32\x8c\xad\xba\x91\xac\x7b\x29\xa2\x8e\xc8\x01\ +\xbf\x87\x1d\x7d\xe8\xf0\xb0\xa3\x03\x1d\x33\x97\x25\x44\x78\xcb\ +\xfb\xd5\x2b\xbb\x0d\xb8\x22\xf0\xa7\x03\x46\xc0\xcc\x05\xc2\x27\ +\x5e\x20\x84\x62\x3e\xaa\x08\xe1\x66\xe1\x30\x90\xc0\x85\x96\x34\ +\x56\x21\x35\x97\xa8\x43\xa2\xf3\x37\xd8\x2d\xe2\x89\x10\x47\xc6\ +\x5a\x90\x6b\xc9\xd8\xe5\x9b\xab\x03\xb2\xf7\xb1\xeb\xda\x23\xda\ +\xef\xe3\x0d\x40\xc3\x4d\xbc\x4f\x00\x70\x24\x4a\x94\x76\x2d\x84\ +\x16\xc6\x76\x79\xc8\xa0\x29\xd6\x94\xc7\x78\x4d\x33\xd2\x22\x26\ +\x9a\x76\xa0\x5b\x07\xa0\xbe\x03\x1e\x86\x38\x10\x76\x0c\xc7\x87\ +\xb2\x8c\x84\x3c\x66\xc6\xf2\xaa\x83\xbd\x85\x1f\x58\x49\x72\x5e\ +\x22\x25\x8b\xf5\xc7\xd8\x67\xc3\x82\xf8\xa6\xe3\x75\xd1\xc9\xf1\ +\xf9\xbd\x8b\x71\x63\x01\x5c\xf9\x8a\xe9\x8b\xda\x61\x81\x88\xe7\ +\x18\xf7\x87\x5d\x07\x3d\x6f\xd5\xa5\x20\xb5\x1b\xaa\x83\xf9\xc4\ +\x3e\x0b\xbf\x9e\x6e\xa9\x0b\x53\x2b\x00\x79\x11\xdd\x1a\x43\xf0\ +\x37\x11\x33\xf2\xa2\x4b\x95\x66\x4a\xff\x58\xf5\xb4\xa6\x51\xad\ +\x17\xc9\xae\xc5\xc7\x5f\x80\x44\x9f\x75\x69\x12\xa6\x98\xa6\xb1\ +\x9f\x21\xe9\xe9\x18\xfb\x5d\x72\x30\x97\x34\x7c\x5e\x5c\x5d\x8e\ +\x55\x16\x6c\x45\x5e\xe5\x9e\x90\x25\xc9\xa8\x66\xa4\x4f\x25\x45\ +\x97\x8d\x7b\xce\x44\x15\xf7\xf7\xed\xb3\xd4\xbe\x67\xda\x0b\xd8\ +\x5a\x8c\xcc\xdd\x4f\x9a\x75\xbb\xbd\x67\xde\x40\xbe\x7b\x61\x4f\ +\xc0\x2d\x2a\x10\x92\xff\x8b\x36\x38\x2c\x7b\x08\xcb\x6c\xbf\x21\ +\x5e\xdc\x9d\xaf\xb8\xf3\x7e\xa6\x43\xd2\xee\x23\xb6\x48\x9b\xf5\ +\x22\xb0\xc6\x4f\xb0\xff\xb6\x61\x57\xaa\xda\x7e\x15\xb4\xc3\xee\ +\x7b\x77\x34\x73\x71\x11\x1d\xf2\x28\x89\xda\xfc\x5f\x56\x5c\x23\ +\x34\x15\x60\x63\xc3\x85\xb3\xc3\x89\xc0\x61\xdc\xeb\x82\x86\xc6\ +\xd9\xf9\xf9\xf9\x51\xe3\x74\x22\x8a\xc8\x16\x59\x9c\x76\xb1\x1d\ +\x62\xa6\x9b\xf0\x35\x60\x31\x61\xc3\xd4\x19\x50\xe6\x89\x28\x54\ +\x7b\x70\x04\xf6\xd1\x7b\x18\x11\x2a\x99\xdd\xa7\xd1\xb7\x06\x9b\ +\xc0\x63\xd2\x17\xe1\xc8\x8c\x3c\x20\xc6\xd1\x78\xa0\x61\xc2\xc6\ +\xee\x86\x95\x0b\x09\x59\xdc\xd3\x01\x11\x5d\xc2\xa8\x67\xfe\x63\ +\x6f\x7a\x2b\x51\xf6\xb1\xc3\x14\xe0\x53\x1c\x1a\x5a\xb1\x19\x31\ +\x08\x04\xf8\x01\x96\x15\x33\xa7\x51\x35\x9f\x50\x05\x0e\x03\xf0\ +\x4d\x51\x34\xe9\xed\x07\xab\x7b\x01\x86\xe9\xea\xed\xff\x74\x2b\ +\xdb\x3f\x08\xca\x09\x3c\xd5\x80\xe7\xe9\x06\x3c\xb1\x81\x9a\xf0\ +\xee\x97\x37\x51\x2b\x1a\xa8\xcb\x92\xe7\xfa\x04\x06\xea\x1a\xc8\ +\x5e\x1a\x5f\x5a\x96\x8c\x14\xb2\xe4\xb9\xbe\x99\x66\x0a\x7c\xed\ +\x25\xcd\xd4\xf1\xe1\x6c\x3b\x75\xb8\x3d\x03\x75\x1b\xb0\xaa\x20\ +\xa2\x5b\x08\x5b\xc0\x93\x9e\x12\x27\xac\x6e\x1f\x96\x73\xe4\x1d\ +\x7b\x16\x28\x3b\x3d\xae\xd2\xe3\xf3\xc5\xf5\x38\x0b\x91\x03\xe6\ +\xdd\x57\x86\xc8\xd8\x31\x7f\x93\x9e\x09\x2e\x8e\x5b\x92\x8d\x93\ +\x93\xd8\x4c\x88\x51\x2c\xda\x04\x55\x8f\xcc\x3f\x32\x10\xf1\x0f\ +\x9a\x74\x98\x8b\x98\x99\xbf\x3a\x9e\xe6\xa6\x21\x2c\x45\x0c\x03\ +\x7c\x0e\xfb\x81\xaa\xc8\x60\x2d\x09\xa5\xc5\xe1\x8b\xb4\x77\xb8\ +\xad\xc6\xed\xd1\x46\x70\x3b\x27\x67\xb5\x20\x6e\xc7\xa8\xed\x53\ +\xb8\x9d\x60\x4e\x8f\xa5\xd1\x91\x4d\xa3\xe4\xb0\x0b\x7e\x9d\xd8\ +\x20\x7e\xad\x64\xb7\x06\x59\x4b\x6e\x07\xda\x6a\xd0\x9e\x6c\x04\ +\xb4\x73\xc2\xbd\x59\xa0\x35\x93\x3b\xdc\x76\x4d\xaa\x70\x40\x63\ +\x6d\x3c\xfe\x58\xc4\x3f\xe3\x0c\x3e\xe9\x84\xc2\xbb\x57\xe4\x45\ +\x87\xf5\x78\x6c\x72\x84\x03\x0e\x31\x04\x25\x3f\xfd\x88\x41\xc9\ +\xf6\xb0\xfc\x93\xe5\x64\x5b\x58\x56\x9a\xca\x94\xe2\x0e\xcf\x55\ +\x78\x7e\xb9\x11\x3c\x9f\x3e\xae\x11\x4e\x0d\x6f\x57\x8a\xc8\x20\ +\x5b\xc1\x3c\x68\x17\x99\xcc\xac\xf1\xdf\x02\x9c\x53\xdf\xfa\xa9\ +\xe6\x21\x90\xb7\xe6\xc9\x83\xe7\x91\x48\x83\x79\xbc\xd3\xe7\x10\ +\x1b\xd2\x11\x31\xf9\x53\xb9\x4f\x3a\x20\xae\x88\xde\xbb\x6e\x8c\ +\xae\x95\x82\xc0\x5a\xf1\x70\x44\x98\xcf\x4d\xf2\x7c\x13\xfa\x60\ +\x0e\xe3\xd2\x25\x18\x9e\xb7\xa8\x19\x3d\x24\xfe\xc9\xd0\xde\xe9\ +\x45\xb5\x5e\x9c\x6e\x44\x2f\x5e\xad\xae\x17\x78\x42\x94\xea\x43\ +\x57\x32\xe6\x51\xdf\x42\x1f\x9e\x38\xda\x70\x84\x3f\x26\xe2\x79\ +\xec\x71\x9f\xc1\xcf\x54\x69\x0c\xb8\x06\x5c\x62\x56\xe9\x2d\x1b\ +\x50\xc9\xf6\xad\x86\x79\x14\x0f\x87\xee\xf1\x3c\x69\x10\x40\x7c\ +\x75\x70\xb0\x46\xd6\x67\x3a\xd2\x7f\x05\x96\x48\x5a\x15\xb0\x15\ +\x78\xa3\x28\x32\x82\x3b\x7c\x57\xe1\xfb\x6c\x13\xf8\x5e\x0b\xdd\ +\x25\xab\x4f\x01\xdc\x29\x88\x73\xa7\x9b\x5d\x70\xc5\x33\xab\x6f\ +\x93\xac\x36\x8d\x79\xec\x9b\x34\xa8\x19\xb0\x09\x24\xdb\x82\x11\ +\x72\x7c\x35\x66\x0b\x88\xa6\x14\x49\xc4\xd4\x94\x13\x8b\x8d\xe4\ +\x45\x80\xda\x0e\xdb\xd5\xd8\x6e\x6c\xc6\x49\x6f\xac\x91\x12\xa9\ +\xc2\x37\xba\x23\x63\xf8\x16\x63\x4b\x98\x1c\x1b\xec\x59\x21\x70\ +\x11\x62\xe9\x00\xde\xe1\x0e\xd9\xc9\x03\x67\x03\xf0\x66\xb0\x14\ +\x8a\x8b\x78\x13\x70\xbf\xb1\x2c\x94\x79\xa4\xa1\x00\x3d\x7c\x6c\ +\x46\x96\xc3\xbf\x93\xcf\x4e\x05\xa6\xa8\x40\x63\x23\x2a\xf0\xf2\ +\x71\x35\x20\x0b\x3a\x6d\x52\x10\xb1\x8f\x8c\x19\x17\x5f\xd3\xd8\ +\xa7\xd2\x77\xbe\x3c\x8e\x20\x98\x08\x87\xbb\x62\x70\xdd\xc1\xfb\ +\x71\x27\x5f\xd8\x68\x4f\xd4\x02\xfa\xc0\xf0\x18\x0d\x5b\xb1\xe0\ +\xc6\x17\x5e\xb2\xd4\x11\xe8\x12\xca\x81\xd5\x0f\x63\x16\xbb\x20\ +\x7a\xcb\x87\x49\xa0\xe3\x62\xb6\xa5\x07\x6d\xed\xe3\x11\xc4\x4e\ +\x0f\xa6\xe8\xc1\x66\x92\x8c\x8d\xc3\xc7\x55\x84\x80\x9a\x72\x87\ +\xb1\xf5\x77\x35\x5a\x69\x38\xab\x40\x51\x42\x66\x9d\xf8\x0d\x26\ +\x67\x0c\x17\xa4\x23\x12\x44\x35\x67\xc6\xbd\x59\x93\xe6\x12\x60\ +\xb6\xc6\xe0\x6a\xd8\xfd\x40\x5d\xed\xc7\x0e\xd2\x95\x90\x5e\xe2\ +\xdc\x76\x19\x48\x37\x1e\x17\xd2\x03\xac\x3b\x18\x17\x34\x58\xdb\ +\x0c\x81\x26\x1e\x1e\x62\xd9\x18\xe6\x6a\x5c\x21\x44\x0a\x7a\xf0\ +\x26\x7c\x26\xad\x2b\xef\x85\xa6\xa6\xd2\xa0\xcf\xe6\x2a\x8d\xef\ +\x23\x24\xba\x19\x64\x6a\xdd\xd4\xba\x8a\xf0\xa7\x61\x21\xc7\xb6\ +\x21\xbd\x26\xb9\x25\x74\xc0\x8a\xe0\xc6\x91\xff\x6a\xe9\x7e\x8f\ +\x6a\x30\xd9\x39\x31\x57\x6e\xdc\x4a\xc5\xed\x77\x4b\x96\xb7\xb7\ +\xbf\xbc\x7f\xbc\xf2\x76\x47\x29\x77\x0a\xf5\xad\x17\xba\xa7\x2b\ +\x9a\x88\xa9\xe6\xad\x69\xc6\xaa\xaa\xe1\xf4\x6c\x4a\xde\xe7\x64\ +\xae\x9f\xbc\xe4\xdd\x9c\x44\xca\xd2\xde\xd0\x36\xcd\x13\x59\x9d\ +\x32\xf7\x30\x1a\xbc\x61\x53\x15\x5e\x58\x04\x03\x91\xb6\xfe\xd0\ +\xaf\x5f\x7f\x18\xcf\xd8\xac\x9b\xc6\xa5\x8d\x0e\xba\xc1\x1f\xc0\ +\x6b\x99\x6e\x74\xa6\xd6\xc7\x9c\xcc\x2e\x8f\x39\x5a\xab\x3e\x06\ +\x86\x19\x19\x2d\x21\xeb\x55\x5f\x2f\x58\xe7\x0c\x7a\xe1\x17\x0c\ +\xd0\x6c\x4d\x7f\xa3\xe0\xdb\x2f\xe2\x57\x0f\xbd\x5d\x11\xff\x02\ +\x65\xce\xbb\x22\xfe\xa5\xb8\x7a\x6a\xef\xfd\xd5\xe2\xce\x7b\x55\ +\x5d\xf8\x9c\x14\xe4\xbc\xd4\x75\xfb\x99\xbc\x91\x05\xca\x7d\x67\ +\xd3\x8a\x77\x46\xc9\xef\xd6\x7f\x33\xcb\x2c\x0d\x73\x42\xc6\x9f\ +\xc3\x62\x46\x3c\xf6\x92\xc0\xa0\x0d\x45\xb2\x6a\x6c\xea\x5e\x2f\ +\xf8\x3e\x8c\xe4\x84\x1c\xbf\x4f\x63\x79\xeb\x2a\x52\x61\x0f\x7c\ +\x81\x9b\x60\x5f\xe2\x51\xe7\x7f\x68\xd4\xff\x6f\x7a\x9e\xff\x84\ +\x26\xf4\x4f\x3a\xb0\x6c\x5d\xbe\xf9\xbc\x16\x1b\x4f\x6d\x9a\x26\ +\x92\x5a\x8f\x97\x58\x98\xed\x93\x2e\xf3\x1a\x05\x6a\x36\x9e\x36\ +\xa8\x7d\x2c\xd9\x60\xe6\x80\x70\x10\xa0\x86\x9b\xad\x41\xc8\x7b\ +\x82\xaf\x57\x51\xf4\x85\x48\x27\xa4\xde\xfd\xbe\x71\x9a\x3a\x4c\ +\x6b\xf0\x99\x25\xa3\x3e\xed\xf0\x90\x03\x71\xda\xa3\x98\x46\x76\ +\xb7\x77\x60\x28\xd6\x44\xc4\xfe\x46\xd2\x6b\x63\xfc\xe6\xb8\x75\ +\xfb\x9a\xa9\xfb\x00\xea\x6b\x98\x22\x9b\x70\x29\x50\xee\x80\x58\ +\x5b\x5a\x26\x60\x11\xcc\xcf\x4d\x1a\xa1\xf6\x43\xef\x13\x26\x4b\ +\xde\xda\x85\x3c\x4f\x0b\xf4\x7c\xd3\x15\xe3\x60\x61\xb1\x74\xc5\ +\xef\x97\x6f\x1e\x3f\x5d\x91\xe9\xe8\xf7\x92\xae\x98\x28\x8a\xff\ +\xe6\xd3\x15\x4b\x98\xdb\x93\xd5\xcd\xed\x8c\x52\x52\x0a\xc6\x53\ +\x91\x17\xc7\x57\xb6\xfc\xa2\xaa\x6a\x74\x23\xc5\x43\x2e\xad\x82\ +\xa0\x37\x2c\x6c\x25\x0b\x2b\x3c\xea\x88\xed\x6c\x99\x79\x16\xf9\ +\x9c\x13\x9e\x4b\x71\x2f\xcd\x38\x4d\xb3\x5d\x55\xa9\xa6\x2c\xcb\ +\xf4\xc5\xcd\x31\x91\x63\x2a\xdb\xad\x25\x32\x4b\x93\x49\x25\x97\ +\x4f\x3a\x2a\xe5\x93\xd2\x54\xd2\x49\x29\x95\x34\x91\x45\x2a\xb2\ +\x32\x91\x3b\xca\x84\x94\x93\x64\x4e\x8c\xce\x38\xa5\x51\xb5\x33\ +\x36\x17\xb5\xb3\x1a\xb1\x66\xe2\xa2\xd6\x68\xd4\xea\x38\xb2\xcf\ +\x87\x11\xed\x77\x93\xd8\x94\x4e\xb4\xfe\xb9\x31\xd7\xd7\x52\x44\ +\x9f\x79\xc4\xda\x22\x91\x1e\x6c\xe0\x85\x51\xf8\x81\x9f\x44\x69\ +\x11\x59\x8a\xca\x70\x92\x6f\xb1\x5c\xe6\x3e\x02\x94\x7b\xdd\x2d\ +\xfb\xee\x0f\x3e\x8f\xa1\x66\xe0\xf2\xb4\xdc\x37\x7f\xe0\x69\xb8\ +\x86\x3d\x2b\x2a\xea\xc3\x92\x61\x86\x3a\x4e\x60\x3f\x02\x74\x10\ +\xa0\xe0\x4c\x87\x11\x40\x91\xee\x6c\x46\x0a\xef\xde\x55\x32\x53\ +\xe6\x78\x1a\x57\x38\x9b\xe5\x5c\xad\xcf\x96\x7b\x67\xb9\x5a\x3e\ +\xe3\xce\xad\xb0\x92\xda\xf8\x6a\x5e\xb2\xde\xed\x30\xe3\x22\xf7\ +\x29\xcc\x8c\x7b\xd7\x67\x66\xb2\xc1\x7c\x9a\x4a\x32\x65\x74\x40\ +\x19\x6d\xf1\x44\x1c\xdb\x22\x23\xbc\x6e\xd6\x13\xde\xda\xfb\x3f\ +\x76\xfc\xff\x17\ \x00\x00\x10\x85\ \x00\ \x00\xa9\x59\x78\x9c\xed\x1d\x6b\x6f\xdb\x38\xf2\x7b\x7e\x05\x91\ @@ -53119,63 +53124,63 @@ qt_resource_struct = "\ \x00\x00\x00\x64\x00\x00\x00\x00\x00\x01\x00\x00\x01\x64\ \x00\x00\x00\x96\x00\x00\x00\x00\x00\x01\x00\x00\x04\xc4\ \x00\x00\x00\x7c\x00\x00\x00\x00\x00\x01\x00\x00\x03\x12\ -\x00\x00\x06\xce\x00\x01\x00\x00\x00\x01\x00\x0a\xf8\x2f\ -\x00\x00\x04\x7c\x00\x00\x00\x00\x00\x01\x00\x0a\x55\x18\ -\x00\x00\x09\x04\x00\x01\x00\x00\x00\x01\x00\x0b\xbc\xa1\ -\x00\x00\x0b\x94\x00\x01\x00\x00\x00\x01\x00\x0c\x98\xac\ -\x00\x00\x05\x86\x00\x01\x00\x00\x00\x01\x00\x0a\x94\xc3\ -\x00\x00\x07\x16\x00\x00\x00\x00\x00\x01\x00\x0b\x15\x79\ -\x00\x00\x08\x2a\x00\x01\x00\x00\x00\x01\x00\x0b\x7e\x27\ -\x00\x00\x0a\xf6\x00\x01\x00\x00\x00\x01\x00\x0c\x6f\x69\ -\x00\x00\x07\x8a\x00\x00\x00\x00\x00\x01\x00\x0b\x3f\x48\ -\x00\x00\x09\x9e\x00\x01\x00\x00\x00\x01\x00\x0b\xfd\x42\ -\x00\x00\x0b\xe4\x00\x01\x00\x00\x00\x01\x00\x0c\xb4\xd0\ -\x00\x00\x04\xc2\x00\x01\x00\x00\x00\x01\x00\x0a\x6e\x3a\ -\x00\x00\x08\x50\x00\x01\x00\x00\x00\x01\x00\x0b\x83\xeb\ -\x00\x00\x06\xf0\x00\x00\x00\x00\x00\x01\x00\x0b\x02\xe3\ -\x00\x00\x04\xe6\x00\x01\x00\x00\x00\x01\x00\x0a\x73\xb9\ -\x00\x00\x07\x5e\x00\x01\x00\x00\x00\x01\x00\x0b\x2e\x3e\ -\x00\x00\x04\x9e\x00\x01\x00\x00\x00\x01\x00\x0a\x63\xce\ -\x00\x00\x0b\x1e\x00\x00\x00\x00\x00\x01\x00\x0c\x7a\xd8\ -\x00\x00\x03\xfc\x00\x01\x00\x00\x00\x01\x00\x0a\x2f\x86\ -\x00\x00\x05\xd6\x00\x01\x00\x00\x00\x01\x00\x0a\xaf\xe2\ -\x00\x00\x0a\xae\x00\x01\x00\x00\x00\x01\x00\x0c\x58\x3a\ -\x00\x00\x0a\xd0\x00\x01\x00\x00\x00\x01\x00\x0c\x65\xd5\ -\x00\x00\x05\xb4\x00\x00\x00\x00\x00\x01\x00\x0a\x9d\xc9\ -\x00\x00\x03\xca\x00\x01\x00\x00\x00\x01\x00\x0a\x27\xcd\ -\x00\x00\x08\xba\x00\x01\x00\x00\x00\x01\x00\x0b\xa5\x77\ -\x00\x00\x09\xf8\x00\x00\x00\x00\x00\x01\x00\x0c\x0d\x8a\ -\x00\x00\x06\x2a\x00\x01\x00\x00\x00\x01\x00\x0a\xc1\x52\ -\x00\x00\x0a\x1c\x00\x00\x00\x00\x00\x01\x00\x0c\x24\x3d\ -\x00\x00\x07\xe4\x00\x00\x00\x00\x00\x01\x00\x0b\x56\xfb\ -\x00\x00\x05\x38\x00\x01\x00\x00\x00\x01\x00\x0a\x83\xb9\ -\x00\x00\x0b\xb4\x00\x00\x00\x00\x00\x01\x00\x0c\xa3\x5a\ -\x00\x00\x06\x84\x00\x00\x00\x00\x00\x01\x00\x0a\xd8\x91\ -\x00\x00\x04\x28\x00\x00\x00\x00\x00\x01\x00\x0a\x37\x8d\ -\x00\x00\x0c\x14\x00\x00\x00\x00\x00\x01\x00\x0c\xc0\xa9\ -\x00\x00\x0a\x64\x00\x00\x00\x00\x00\x01\x00\x0c\x41\xc4\ -\x00\x00\x04\x4c\x00\x01\x00\x00\x00\x01\x00\x0a\x4c\xad\ -\x00\x00\x0a\x8c\x00\x01\x00\x00\x00\x01\x00\x0c\x50\xeb\ -\x00\x00\x09\x26\x00\x01\x00\x00\x00\x01\x00\x0b\xc5\x4a\ -\x00\x00\x0b\x44\x00\x01\x00\x00\x00\x01\x00\x0c\x83\x65\ -\x00\x00\x06\xac\x00\x01\x00\x00\x00\x01\x00\x0a\xea\xd0\ -\x00\x00\x07\xbc\x00\x01\x00\x00\x00\x01\x00\x0b\x4d\x4a\ -\x00\x00\x09\x7c\x00\x00\x00\x00\x00\x01\x00\x0b\xe8\xb1\ -\x00\x00\x05\x5c\x00\x01\x00\x00\x00\x01\x00\x0a\x8a\x82\ -\x00\x00\x08\x0a\x00\x00\x00\x00\x00\x01\x00\x0b\x68\xb3\ -\x00\x00\x06\x0a\x00\x01\x00\x00\x00\x01\x00\x0a\xbb\xd3\ -\x00\x00\x09\xc8\x00\x01\x00\x00\x00\x01\x00\x0c\x03\xb7\ -\x00\x00\x08\x92\x00\x01\x00\x00\x00\x01\x00\x0b\x9a\x05\ -\x00\x00\x08\xdc\x00\x01\x00\x00\x00\x01\x00\x0b\xac\xcb\ -\x00\x00\x0b\x6a\x00\x01\x00\x00\x00\x01\x00\x0c\x8e\x2a\ -\x00\x00\x0a\x40\x00\x01\x00\x00\x00\x01\x00\x0c\x37\x14\ -\x00\x00\x05\x08\x00\x01\x00\x00\x00\x01\x00\x0a\x7b\x97\ -\x00\x00\x08\x72\x00\x00\x00\x00\x00\x01\x00\x0b\x8a\x33\ -\x00\x00\x06\x58\x00\x00\x00\x00\x00\x01\x00\x0a\xc9\x37\ -\x00\x00\x07\x3e\x00\x01\x00\x00\x00\x01\x00\x0b\x24\xca\ -\x00\x00\x09\x4a\x00\x00\x00\x00\x00\x01\x00\x0b\xcc\x9b\ +\x00\x00\x06\xce\x00\x01\x00\x00\x00\x01\x00\x0a\xf8\x7b\ +\x00\x00\x04\x7c\x00\x00\x00\x00\x00\x01\x00\x0a\x55\x64\ +\x00\x00\x09\x04\x00\x01\x00\x00\x00\x01\x00\x0b\xbc\xed\ +\x00\x00\x0b\x94\x00\x01\x00\x00\x00\x01\x00\x0c\x98\xf8\ +\x00\x00\x05\x86\x00\x01\x00\x00\x00\x01\x00\x0a\x95\x0f\ +\x00\x00\x07\x16\x00\x00\x00\x00\x00\x01\x00\x0b\x15\xc5\ +\x00\x00\x08\x2a\x00\x01\x00\x00\x00\x01\x00\x0b\x7e\x73\ +\x00\x00\x0a\xf6\x00\x01\x00\x00\x00\x01\x00\x0c\x6f\xb5\ +\x00\x00\x07\x8a\x00\x00\x00\x00\x00\x01\x00\x0b\x3f\x94\ +\x00\x00\x09\x9e\x00\x01\x00\x00\x00\x01\x00\x0b\xfd\x8e\ +\x00\x00\x0b\xe4\x00\x01\x00\x00\x00\x01\x00\x0c\xb5\x1c\ +\x00\x00\x04\xc2\x00\x01\x00\x00\x00\x01\x00\x0a\x6e\x86\ +\x00\x00\x08\x50\x00\x01\x00\x00\x00\x01\x00\x0b\x84\x37\ +\x00\x00\x06\xf0\x00\x00\x00\x00\x00\x01\x00\x0b\x03\x2f\ +\x00\x00\x04\xe6\x00\x01\x00\x00\x00\x01\x00\x0a\x74\x05\ +\x00\x00\x07\x5e\x00\x01\x00\x00\x00\x01\x00\x0b\x2e\x8a\ +\x00\x00\x04\x9e\x00\x01\x00\x00\x00\x01\x00\x0a\x64\x1a\ +\x00\x00\x0b\x1e\x00\x00\x00\x00\x00\x01\x00\x0c\x7b\x24\ +\x00\x00\x03\xfc\x00\x01\x00\x00\x00\x01\x00\x0a\x2f\xd2\ +\x00\x00\x05\xd6\x00\x01\x00\x00\x00\x01\x00\x0a\xb0\x2e\ +\x00\x00\x0a\xae\x00\x01\x00\x00\x00\x01\x00\x0c\x58\x86\ +\x00\x00\x0a\xd0\x00\x01\x00\x00\x00\x01\x00\x0c\x66\x21\ +\x00\x00\x05\xb4\x00\x00\x00\x00\x00\x01\x00\x0a\x9e\x15\ +\x00\x00\x03\xca\x00\x01\x00\x00\x00\x01\x00\x0a\x28\x19\ +\x00\x00\x08\xba\x00\x01\x00\x00\x00\x01\x00\x0b\xa5\xc3\ +\x00\x00\x09\xf8\x00\x00\x00\x00\x00\x01\x00\x0c\x0d\xd6\ +\x00\x00\x06\x2a\x00\x01\x00\x00\x00\x01\x00\x0a\xc1\x9e\ +\x00\x00\x0a\x1c\x00\x00\x00\x00\x00\x01\x00\x0c\x24\x89\ +\x00\x00\x07\xe4\x00\x00\x00\x00\x00\x01\x00\x0b\x57\x47\ +\x00\x00\x05\x38\x00\x01\x00\x00\x00\x01\x00\x0a\x84\x05\ +\x00\x00\x0b\xb4\x00\x00\x00\x00\x00\x01\x00\x0c\xa3\xa6\ +\x00\x00\x06\x84\x00\x00\x00\x00\x00\x01\x00\x0a\xd8\xdd\ +\x00\x00\x04\x28\x00\x00\x00\x00\x00\x01\x00\x0a\x37\xd9\ +\x00\x00\x0c\x14\x00\x00\x00\x00\x00\x01\x00\x0c\xc0\xf5\ +\x00\x00\x0a\x64\x00\x00\x00\x00\x00\x01\x00\x0c\x42\x10\ +\x00\x00\x04\x4c\x00\x01\x00\x00\x00\x01\x00\x0a\x4c\xf9\ +\x00\x00\x0a\x8c\x00\x01\x00\x00\x00\x01\x00\x0c\x51\x37\ +\x00\x00\x09\x26\x00\x01\x00\x00\x00\x01\x00\x0b\xc5\x96\ +\x00\x00\x0b\x44\x00\x01\x00\x00\x00\x01\x00\x0c\x83\xb1\ +\x00\x00\x06\xac\x00\x01\x00\x00\x00\x01\x00\x0a\xeb\x1c\ +\x00\x00\x07\xbc\x00\x01\x00\x00\x00\x01\x00\x0b\x4d\x96\ +\x00\x00\x09\x7c\x00\x00\x00\x00\x00\x01\x00\x0b\xe8\xfd\ +\x00\x00\x05\x5c\x00\x01\x00\x00\x00\x01\x00\x0a\x8a\xce\ +\x00\x00\x08\x0a\x00\x00\x00\x00\x00\x01\x00\x0b\x68\xff\ +\x00\x00\x06\x0a\x00\x01\x00\x00\x00\x01\x00\x0a\xbc\x1f\ +\x00\x00\x09\xc8\x00\x01\x00\x00\x00\x01\x00\x0c\x04\x03\ +\x00\x00\x08\x92\x00\x01\x00\x00\x00\x01\x00\x0b\x9a\x51\ +\x00\x00\x08\xdc\x00\x01\x00\x00\x00\x01\x00\x0b\xad\x17\ +\x00\x00\x0b\x6a\x00\x01\x00\x00\x00\x01\x00\x0c\x8e\x76\ +\x00\x00\x0a\x40\x00\x01\x00\x00\x00\x01\x00\x0c\x37\x60\ +\x00\x00\x05\x08\x00\x01\x00\x00\x00\x01\x00\x0a\x7b\xe3\ +\x00\x00\x08\x72\x00\x00\x00\x00\x00\x01\x00\x0b\x8a\x7f\ +\x00\x00\x06\x58\x00\x00\x00\x00\x00\x01\x00\x0a\xc9\x83\ +\x00\x00\x07\x3e\x00\x01\x00\x00\x00\x01\x00\x0b\x25\x16\ +\x00\x00\x09\x4a\x00\x00\x00\x00\x00\x01\x00\x0b\xcc\xe7\ \x00\x00\x03\x76\x00\x01\x00\x00\x00\x01\x00\x0a\x0d\xd7\ -\x00\x00\x03\xa2\x00\x01\x00\x00\x00\x01\x00\x0a\x17\x44\ +\x00\x00\x03\xa2\x00\x01\x00\x00\x00\x01\x00\x0a\x17\x90\ " def qInitResources(): diff --git a/src/Mod/Draft/Resources/ui/userprefs-import.ui b/src/Mod/Draft/Resources/ui/userprefs-import.ui index a14084d3b..95b64c308 100755 --- a/src/Mod/Draft/Resources/ui/userprefs-import.ui +++ b/src/Mod/Draft/Resources/ui/userprefs-import.ui @@ -280,6 +280,26 @@ If color mapping is choosed, you must choose a color mapping file containing a t + + + + + + If this is checked, the exported objects will be projected to reflect the current view direction + + + Project exported objects along current view direction + + + dxfproject + + + Mod/Draft + + + + + diff --git a/src/Mod/Draft/importDXF.py b/src/Mod/Draft/importDXF.py index 0cb2656eb..35ef8a2b6 100644 --- a/src/Mod/Draft/importDXF.py +++ b/src/Mod/Draft/importDXF.py @@ -1190,13 +1190,27 @@ def insert(filename,docname): # EXPORT ######################################################################## +def projectShape(shape,direction): + import Drawing + edges = [] + try: + groups = Drawing.projectEx(shape,direction) + except: + print "unable to project shape" + return shape + else: + for g in groups[0:5]: + if g: + edges.append(g) + return DraftGeomUtils.cleanProjection(Part.makeCompound(edges)) + def getArcData(edge): "returns center, radius, start and end angles of a circle-based edge" ce = edge.Curve.Center radius = edge.Curve.Radius if len(edge.Vertexes) == 1: # closed circle - return ce, radius, 0, 0 + return DraftVecUtils.tup(ce), radius, 0, 0 else: # find direction of arc tang1 = edge.Curve.tangent(edge.ParameterRange[0]) @@ -1218,7 +1232,15 @@ def getArcData(edge): ang2 = -math.degrees(DraftVecUtils.angle(ve2.sub(ce))) ve3 = DraftGeomUtils.findMidpoint(edge) ang3 = -math.degrees(DraftVecUtils.angle(ve3.sub(ce))) + print "edge ",edge.hashCode()," data ",ang1, " , ",ang2," , ", ang3 if (ang3 < ang1) and (ang2 < ang3): + print "inverting, case1" + ang1, ang2 = ang2, ang1 + elif (ang3 > ang1) and (ang3 > ang2): + print "inverting, case2" + ang1, ang2 = ang2, ang1 + elif (ang3 < ang1) and (ang3 < ang2): + print "inverting, case3" ang1, ang2 = ang2, ang1 return DraftVecUtils.tup(ce), radius, ang1, ang2 @@ -1246,6 +1268,7 @@ def getWire(wire,nospline=False): "returns an array of dxf-ready points and bulges from a wire" edges = DraftGeomUtils.sortEdges(wire.Edges) points = [] + # print "processing wire ",wire.Edges for edge in edges: v1 = edge.Vertexes[0].Point if len(edge.Vertexes) < 2: @@ -1256,7 +1279,8 @@ def getWire(wire,nospline=False): c = edge.Curve.Center angle = abs(DraftVecUtils.angle(v1.sub(c),v2.sub(c))) if DraftGeomUtils.isWideAngle(edge): - angle = math.pi*2 - angle + if angle < math.pi: + angle = math.pi*2 - angle # if (DraftVecUtils.angle(v2.sub(c)) < DraftVecUtils.angle(v1.sub(c))): # angle = -angle # polyline bulge -> negative makes the arc go clockwise @@ -1293,16 +1317,16 @@ def getWire(wire,nospline=False): # print "wire verts: ",points return points -def getBlock(obj): +def getBlock(sh,obj): "returns a dxf block with the contents of the object" block = dxfLibrary.Block(name=obj.Name,layer=getGroup(obj,exportList)) - writeShape(obj,block) + writeShape(sh,obj,block) return block -def writeShape(ob,dxfobject,nospline=False): +def writeShape(sh,ob,dxfobject,nospline=False): "writes the object's shape contents in the given dxf object" processededges = [] - for wire in ob.Shape.Wires: # polylines + for wire in sh.Wires: # polylines for e in wire.Edges: processededges.append(e.hashCode()) if (len(wire.Edges) == 1) and (DraftGeomUtils.geomType(wire.Edges[0]) == "Circle"): @@ -1319,22 +1343,32 @@ def writeShape(ob,dxfobject,nospline=False): dxfobject.append(dxfLibrary.PolyLine(getWire(wire,nospline), [0.0,0.0,0.0], int(DraftGeomUtils.isReallyClosed(wire)), color=getACI(ob), layer=getGroup(ob,exportList))) - if len(processededges) < len(ob.Shape.Edges): # lone edges + if len(processededges) < len(sh.Edges): # lone edges loneedges = [] - for e in ob.Shape.Edges: + for e in sh.Edges: if not(e.hashCode() in processededges): loneedges.append(e) # print "lone edges ",loneedges for edge in loneedges: if (DraftGeomUtils.geomType(edge) == "BSplineCurve") and ((not nospline) or (len(edge.Vertexes) == 1)): # splines - points = [] - spline = getSplineSegs(edge) - for p in spline: - points.append((p.x,p.y,p.z,None,None,0.0)) - dxfobject.append(dxfLibrary.PolyLine(points, [0.0,0.0,0.0], - 0, color=getACI(ob), - layer=getGroup(ob,exportList))) + if (len(edge.Vertexes) == 1) and (edge.Curve.isClosed()): + # special case: 1-vert closed spline, approximate as a circle + c = DraftGeomUtils.getCircleFromSpline(edge) + if c: + dxfobject.append(dxfLibrary.Circle(DraftVecUtils.tup(c.Curve.Center), c.Curve.Radius, + color=getACI(ob), + layer=getGroup(ob,exportList))) + else: + points = [] + spline = getSplineSegs(edge) + for p in spline: + points.append((p.x,p.y,p.z,None,None,0.0)) + dxfobject.append(dxfLibrary.PolyLine(points, [0.0,0.0,0.0], + 0, color=getACI(ob), + layer=getGroup(ob,exportList))) elif DraftGeomUtils.geomType(edge) == "Circle": # curves center, radius, ang1, ang2 = getArcData(edge) + if not isinstance(center,tuple): + center = DraftVecUtils.tup(center) if len(edge.Vertexes) == 1: # circles dxfobject.append(dxfLibrary.Circle(center, radius, color=getACI(ob), @@ -1389,27 +1423,37 @@ def export(objectslist,filename,nospline=False): for ob in exportList: print "processing ",ob.Name if ob.isDerivedFrom("Part::Feature"): - if not ob.Shape.isNull(): - if FreeCAD.ParamGet("User parameter:BaseApp/Preferences/Mod/Draft").GetBool("dxfmesh"): + if FreeCAD.ParamGet("User parameter:BaseApp/Preferences/Mod/Draft").GetBool("dxfmesh"): + sh = None + if not ob.Shape.isNull(): writeMesh(ob,dxf) + elif FreeCAD.ParamGet("User parameter:BaseApp/Preferences/Mod/Draft").GetBool("dxfproject"): + direction = FreeCADGui.ActiveDocument.ActiveView.getViewDirection() + sh = projectShape(ob.Shape,direction) + else: + if ob.Shape.Volume > 0: + sh = projectShape(ob.Shape,Vector(0,0,1)) else: - if ob.Shape.ShapeType == 'Compound': - if (len(ob.Shape.Wires) == 1): + sh = ob.Shape + if sh: + if not sh.isNull(): + if sh.ShapeType == 'Compound': + if (len(sh.Wires) == 1): # only one wire in this compound, no lone edge -> polyline - if (len(ob.Shape.Wires[0].Edges) == len(ob.Shape.Edges)): - writeShape(ob,dxf,nospline) + if (len(sh.Wires[0].Edges) == len(sh.Edges)): + writeShape(sh,ob,dxf,nospline) else: # 1 wire + lone edges -> block - block = getBlock(ob) + block = getBlock(sh,ob) dxf.blocks.append(block) dxf.append(dxfLibrary.Insert(name=ob.Name.upper())) else: # all other cases: block - block = getBlock(ob) + block = getBlock(sh,ob) dxf.blocks.append(block) dxf.append(dxfLibrary.Insert(name=ob.Name.upper())) else: - writeShape(ob,dxf,nospline) + writeShape(sh,ob,dxf,nospline) elif Draft.getType(ob) == "Annotation": # texts