Simple code cleanup.

This commit is contained in:
Jeremy Wright 2015-05-20 07:40:29 -04:00
parent 17250d9e1c
commit 77e6c4bb5f

View File

@ -21,20 +21,10 @@
"""
import cadquery
#from .verutil import fc_import
#FreeCAD = fc_import("FreeCAD")
import FreeCAD
import tempfile,os,StringIO
import Drawing
#Drawing = fc_import("FreeCAD.Drawing")
#_FCVER = freecad_version()
#if _FCVER>=(0,13):
#import Drawing as FreeCADDrawing #It's in FreeCAD lib path
#elif _FCVER>=(0,12):
#import FreeCAD.Drawing as FreeCADDrawing
#else:
#raise RuntimeError, "Invalid freecad version: %s" % str(".".join(_FCVER))
import tempfile, os, StringIO
try:
@ -42,6 +32,7 @@ try:
except ImportError:
import xml.etree.ElementTree as ET
class ExportTypes:
STL = "STL"
STEP = "STEP"
@ -49,15 +40,17 @@ class ExportTypes:
SVG = "SVG"
TJS = "TJS"
class UNITS:
MM = "mm"
IN = "in"
def toString(shape,exportType,tolerance=0.1):
s= StringIO.StringIO()
exportShape(shape,exportType,s,tolerance)
return s.getvalue()
def toString(shape, exportType, tolerance=0.1):
s = StringIO.StringIO()
exportShape(shape, exportType, s, tolerance)
return s.getvalue()
def exportShape(shape,exportType,fileLike,tolerance=0.1):
"""