Beispiel #1
0
def writeOutput(fileName=''):
    "Cleave a GNU Triangulated Surface file.  If no fileName is specified, cleave the first GNU Triangulated Surface file in this folder."
    if fileName == '':
        unmodified = gcodec.getFilesWithFileTypesWithoutWords(
            interpret.getImportPluginFileNames())
        if len(unmodified) == 0:
            print("There are no carvable files in this folder.")
            return
        fileName = unmodified[0]
    startTime = time.time()
    print('File ' + gcodec.getSummarizedFileName(fileName) +
          ' is being cleaved.')
    cleaveGcode = getCraftedText(fileName)
    if cleaveGcode == '':
        return
    suffixFileName = fileName[:fileName.rfind('.')] + '_cleave.svg'
    suffixDirectoryName = os.path.dirname(suffixFileName)
    suffixReplacedBaseName = os.path.basename(suffixFileName).replace(' ', '_')
    suffixFileName = os.path.join(suffixDirectoryName, suffixReplacedBaseName)
    gcodec.writeFileText(suffixFileName, cleaveGcode)
    print('The cleaved file is saved as ' +
          gcodec.getSummarizedFileName(suffixFileName))
    print('It took ' + str(int(round(time.time() - startTime))) +
          ' seconds to cleave the file.')
    settings.openWebPage(suffixFileName)
Beispiel #2
0
def writeOutput( fileName = '' ):
	"Carve a GNU Triangulated Surface file."
	startTime = time.time()
	print( 'File ' + gcodec.getSummarizedFileName( fileName ) + ' is being carved.' )
	carveGcode = getCraftedText( fileName )
	if carveGcode == '':
		return
	suffixFileName = gcodec.getFilePathWithUnderscoredBasename( fileName, '_carve.svg' )
	gcodec.writeFileText( suffixFileName, carveGcode )
	print( 'The carved file is saved as ' + gcodec.getSummarizedFileName( suffixFileName ) )
	print( 'It took ' + str( int( round( time.time() - startTime ) ) ) + ' seconds to carve the file.' )
	settings.openWebPage( suffixFileName )
Beispiel #3
0
def writeOutput(fileName=''):
    "Export a gcode linear move file."
    fileName = interpret.getFirstTranslatorFileNameUnmodified(fileName)
    if fileName == '':
        return
    exportRepository = ExportRepository()
    settings.getReadRepository(exportRepository)
    startTime = time.time()
    print('File ' + gcodec.getSummarizedFileName(fileName) +
          ' is being chain exported.')
    suffixFileName = fileName[:fileName.rfind(
        '.')] + '_export.' + exportRepository.fileExtension.value
    gcodeText = gcodec.getGcodeFileText(fileName, '')
    procedures = consecution.getProcedures('export', gcodeText)
    gcodeText = consecution.getChainTextFromProcedures(fileName,
                                                       procedures[:-1],
                                                       gcodeText)
    if gcodeText == '':
        return
    analyze.writeOutput(suffixFileName, gcodeText)
    if exportRepository.savePenultimateGcode.value:
        penultimateFileName = fileName[:fileName.
                                       rfind('.')] + '_penultimate.gcode'
        gcodec.writeFileText(penultimateFileName, gcodeText)
        print('The penultimate file is saved as ' +
              gcodec.getSummarizedFileName(penultimateFileName))
    exportChainGcode = getCraftedTextFromText(gcodeText, exportRepository)
    replaceableExportChainGcode = None
    selectedPluginModule = getSelectedPluginModule(
        exportRepository.exportPlugins)
    if selectedPluginModule == None:
        replaceableExportChainGcode = exportChainGcode
    else:
        if selectedPluginModule.isReplaceable():
            replaceableExportChainGcode = selectedPluginModule.getOutput(
                exportChainGcode)
        else:
            selectedPluginModule.writeOutput(suffixFileName, exportChainGcode)
    if replaceableExportChainGcode != None:
        replaceableExportChainGcode = getReplaced(replaceableExportChainGcode)
        gcodec.writeFileText(suffixFileName, replaceableExportChainGcode)
        print('The exported file is saved as ' +
              gcodec.getSummarizedFileName(suffixFileName))
    if exportRepository.alsoSendOutputTo.value != '':
        if replaceableExportChainGcode == None:
            replaceableExportChainGcode = selectedPluginModule.getOutput(
                exportChainGcode)
        exec('print >> ' + exportRepository.alsoSendOutputTo.value +
             ', replaceableExportChainGcode')
    print('It took ' + str(int(round(time.time() - startTime))) +
          ' seconds to export the file.')
Beispiel #4
0
def writeOutput(fileName=''):
    "Carve a GNU Triangulated Surface file."
    startTime = time.time()
    print('File ' + gcodec.getSummarizedFileName(fileName) +
          ' is being carved.')
    carveGcode = getCraftedText(fileName)
    if carveGcode == '':
        return
    suffixFileName = gcodec.getFilePathWithUnderscoredBasename(
        fileName, '_carve.svg')
    gcodec.writeFileText(suffixFileName, carveGcode)
    print('The carved file is saved as ' +
          gcodec.getSummarizedFileName(suffixFileName))
    print('It took ' + str(int(round(time.time() - startTime))) +
          ' seconds to carve the file.')
    settings.openWebPage(suffixFileName)
Beispiel #5
0
def writeOutput( fileName, gcodeText = '' ):
	"Write the exported version of a gcode file."
	gcodeText = gcodec.getGcodeFileText( fileName, gcodeText )
	repository = GcodeStepRepository()
	settings.getReadRepository( repository )
	output = getOutput( gcodeText, repository )
	suffixFileName = fileName[ : fileName.rfind( '.' ) ] + '_gcode_step.gcode'
	gcodec.writeFileText( suffixFileName, output )
	print( 'The converted file is saved as ' + gcodec.getSummarizedFileName( suffixFileName ) )
Beispiel #6
0
def writeOutput( fileName, gcodeText = '' ):
	"Write the exported version of a gcode file."
	binary16ByteRepository = Binary16ByteRepository()
	settings.getReadRepository( binary16ByteRepository )
	gcodeText = gcodec.getGcodeFileText( fileName, gcodeText )
	skeinOutput = getOutput( gcodeText, binary16ByteRepository )
	suffixFileName = fileName[ : fileName.rfind( '.' ) ] + '.' + binary16ByteRepository.fileExtension.value
	gcodec.writeFileText( suffixFileName, skeinOutput )
	print( 'The converted file is saved as ' + gcodec.getSummarizedFileName( suffixFileName ) )
Beispiel #7
0
def writeOutput(fileName, gcodeText=''):
    "Write the exported version of a gcode file."
    binary16ByteRepository = Binary16ByteRepository()
    settings.getReadRepository(binary16ByteRepository)
    gcodeText = gcodec.getGcodeFileText(fileName, gcodeText)
    skeinOutput = getOutput(gcodeText, binary16ByteRepository)
    suffixFileName = fileName[:fileName.rfind(
        '.')] + '.' + binary16ByteRepository.fileExtension.value
    gcodec.writeFileText(suffixFileName, skeinOutput)
    print('The converted file is saved as ' +
          gcodec.getSummarizedFileName(suffixFileName))
Beispiel #8
0
def writeOutput(fileName=""):
    "Chop a GNU Triangulated Surface file.  If no fileName is specified, chop the first GNU Triangulated Surface file in this folder."
    if fileName == "":
        unmodified = gcodec.getFilesWithFileTypesWithoutWords(interpret.getImportPluginFileNames())
        if len(unmodified) == 0:
            print("There are no carvable files in this folder.")
            return
        fileName = unmodified[0]
    startTime = time.time()
    print("File " + gcodec.getSummarizedFileName(fileName) + " is being chopped.")
    chopGcode = getCraftedText(fileName)
    if chopGcode == "":
        return
    suffixFileName = fileName[: fileName.rfind(".")] + "_chop.svg"
    suffixDirectoryName = os.path.dirname(suffixFileName)
    suffixReplacedBaseName = os.path.basename(suffixFileName).replace(" ", "_")
    suffixFileName = os.path.join(suffixDirectoryName, suffixReplacedBaseName)
    gcodec.writeFileText(suffixFileName, chopGcode)
    print("The chopped file is saved as " + gcodec.getSummarizedFileName(suffixFileName))
    print("It took " + str(int(round(time.time() - startTime))) + " seconds to chop the file.")
    settings.openWebPage(suffixFileName)
Beispiel #9
0
def writeOutput( fileName = '' ):
	"Cleave a GNU Triangulated Surface file.  If no fileName is specified, cleave the first GNU Triangulated Surface file in this folder."
	if fileName == '':
		unmodified = gcodec.getFilesWithFileTypesWithoutWords( interpret.getImportPluginFileNames() )
		if len( unmodified ) == 0:
			print( "There are no carvable files in this folder." )
			return
		fileName = unmodified[ 0 ]
	startTime = time.time()
	print( 'File ' + gcodec.getSummarizedFileName( fileName ) + ' is being cleaved.' )
	cleaveGcode = getCraftedText( fileName )
	if cleaveGcode == '':
		return
	suffixFileName = fileName[ : fileName.rfind( '.' ) ] + '_cleave.svg'
	suffixDirectoryName = os.path.dirname( suffixFileName )
	suffixReplacedBaseName = os.path.basename( suffixFileName ).replace( ' ', '_' )
	suffixFileName = os.path.join( suffixDirectoryName, suffixReplacedBaseName )
	gcodec.writeFileText( suffixFileName, cleaveGcode )
	print( 'The cleaved file is saved as ' + gcodec.getSummarizedFileName( suffixFileName ) )
	print( 'It took ' + str( int( round( time.time() - startTime ) ) ) + ' seconds to cleave the file.' )
	settings.openWebPage( suffixFileName )
Beispiel #10
0
def writeOutput( fileName = '' ):
	"Export a gcode linear move file."
	fileName = interpret.getFirstTranslatorFileNameUnmodified( fileName )
	if fileName == '':
		return
	exportRepository = ExportRepository()
	settings.getReadRepository( exportRepository )
	startTime = time.time()
	print( 'File ' + gcodec.getSummarizedFileName( fileName ) + ' is being chain exported.' )
	suffixFileName = fileName[ : fileName.rfind( '.' ) ] + '_export.' + exportRepository.fileExtension.value
	gcodeText = gcodec.getGcodeFileText( fileName, '' )
	procedures = consecution.getProcedures( 'export', gcodeText )
	gcodeText = consecution.getChainTextFromProcedures( fileName, procedures[ : - 1 ], gcodeText )
	if gcodeText == '':
		return
	analyze.writeOutput( suffixFileName, gcodeText )
	if exportRepository.savePenultimateGcode.value:
		penultimateFileName = fileName[ : fileName.rfind( '.' ) ] + '_penultimate.gcode'
		gcodec.writeFileText( penultimateFileName, gcodeText )
		print( 'The penultimate file is saved as ' + gcodec.getSummarizedFileName( penultimateFileName ) )
	exportChainGcode = getCraftedTextFromText( gcodeText, exportRepository )
	replaceableExportChainGcode = None
	selectedPluginModule = getSelectedPluginModule( exportRepository.exportPlugins )
	if selectedPluginModule == None:
		replaceableExportChainGcode = exportChainGcode
	else:
		if selectedPluginModule.isReplaceable():
			replaceableExportChainGcode = selectedPluginModule.getOutput( exportChainGcode )
		else:
			selectedPluginModule.writeOutput( suffixFileName, exportChainGcode )
	if replaceableExportChainGcode != None:
		replaceableExportChainGcode = getReplaced( replaceableExportChainGcode )
		gcodec.writeFileText( suffixFileName, replaceableExportChainGcode )
		print( 'The exported file is saved as ' + gcodec.getSummarizedFileName( suffixFileName ) )
	if exportRepository.alsoSendOutputTo.value != '':
		if replaceableExportChainGcode == None:
			replaceableExportChainGcode = selectedPluginModule.getOutput( exportChainGcode )
		exec( 'print >> ' + exportRepository.alsoSendOutputTo.value + ', replaceableExportChainGcode' )
	print( 'It took ' + str( int( round( time.time() - startTime ) ) ) + ' seconds to export the file.' )
Beispiel #11
0
def analyzeFileGivenText( fileName, gcodeText, repository = None ):
	"Write statistics for a gcode file."
	print( '' )
	print( '' )
	print( 'Statistics are being generated for the file ' + gcodec.getSummarizedFileName( fileName ) )
	if repository == None:
		repository = settings.getReadRepository( StatisticRepository() )
	skein = StatisticSkein()
	statisticGcode = skein.getCraftedGcode( gcodeText, repository )
	if repository.printStatistics.value:
		print( statisticGcode )
	if repository.saveStatistics.value:
		gcodec.writeFileMessageEnd( '.txt', fileName, statisticGcode, 'The statistics file is saved as ' )
Beispiel #12
0
def analyzeFileGivenText(fileName, gcodeText, repository=None):
    "Write statistics for a gcode file."
    print('')
    print('')
    print('Statistics are being generated for the file ' +
          gcodec.getSummarizedFileName(fileName))
    if repository == None:
        repository = settings.getReadRepository(StatisticRepository())
    skein = StatisticSkein()
    statisticGcode = skein.getCraftedGcode(gcodeText, repository)
    if repository.printStatistics.value:
        print(statisticGcode)
    if repository.saveStatistics.value:
        gcodec.writeFileMessageEnd('.txt', fileName, statisticGcode,
                                   'The statistics file is saved as ')
Beispiel #13
0
	def execute( self ):
		"Export the canvas as an svg file."
		svgFileName = gcodec.getFilePathWithUnderscoredBasename( self.fileName, self.suffix )
		boundingBox = self.canvas.bbox( settings.Tkinter.ALL ) # tuple (w, n, e, s)
		self.boxW = boundingBox[ 0 ]
		self.boxN = boundingBox[ 1 ]
		boxWidth = boundingBox[ 2 ] - self.boxW
		boxHeight = boundingBox[ 3 ] - self.boxN
		print( 'Exported svg file saved as ' + svgFileName )
		svgTemplateText = gcodec.getFileTextInFileDirectory( settings.__file__, 'svg_canvas.template' )
		output = cStringIO.StringIO()
		lines = gcodec.getTextLines( svgTemplateText )
		firstWordTable = {}
		firstWordTable[ 'height="999px"' ] = '		height="%spx"' % int( round( boxHeight ) )
		firstWordTable[ '<!--replaceLineWith_coloredLines-->' ] = self.getCanvasLinesOutput()
		firstWordTable[ 'replaceLineWithTitle' ] = gcodec.getSummarizedFileName( self.fileName )
		firstWordTable[ 'width="999px"' ] = '		width="%spx"' % int( round( boxWidth ) )
		for line in lines:
			parseLineReplace( firstWordTable, line, output )
		gcodec.writeFileText( svgFileName, output.getvalue() )
		fileExtension = self.fileExtension.value
		svgProgram = self.svgProgram.value
		if svgProgram == '':
			return
		if svgProgram == 'webbrowser':
			settings.openWebPage( svgFileName )
			return
		svgFilePath = '"' + os.path.normpath( svgFileName ) + '"' # " to send in file name with spaces
		shellCommand = svgProgram + ' ' + svgFilePath
		print( '' )
		if fileExtension == '':
			print( 'Sending the shell command:' )
			print( shellCommand )
			commandResult = os.system( shellCommand )
			if commandResult != 0:
				print( 'It may be that the system could not find the %s program.' % svgProgram )
				print( 'If so, try installing the %s program or look for another one, like the Gnu Image Manipulation Program (Gimp) which can be found at:' % svgProgram )
				print( 'http://www.gimp.org/' )
			return
		convertedFileName = gcodec.getFilePathWithUnderscoredBasename( svgFilePath, '.' + fileExtension + '"' )
		shellCommand += ' ' + convertedFileName
		print( 'Sending the shell command:' )
		print( shellCommand )
		commandResult = os.system( shellCommand )
		if commandResult != 0:
			print( 'The %s program could not convert the svg to the %s file format.' % ( svgProgram, fileExtension ) )
			print( 'Try installing the %s program or look for another one, like Image Magick which can be found at:' % svgProgram )
			print( 'http://www.imagemagick.org/script/index.php' )
Beispiel #14
0
def analyzeFileGivenText( fileName, gcodeText, repository = None ):
	"Write scalable vector graphics for a gcode file given the settings."
	if gcodeText == '':
		return ''
	if repository == None:
		repository = settings.getReadRepository( VectorwriteRepository() )
	startTime = time.time()
	vectorwriteGcode = VectorwriteSkein().getSVG( fileName, gcodeText, repository )
	if vectorwriteGcode == '':
		return
	suffixFileName = fileName[ : fileName.rfind( '.' ) ] + '_vectorwrite.svg'
	suffixDirectoryName = os.path.dirname( suffixFileName )
	suffixReplacedBaseName = os.path.basename( suffixFileName ).replace( ' ', '_' )
	suffixFileName = os.path.join( suffixDirectoryName, suffixReplacedBaseName )
	gcodec.writeFileText( suffixFileName, vectorwriteGcode )
	print( 'The vectorwrite file is saved as ' + gcodec.getSummarizedFileName( suffixFileName ) )
	print( 'It took ' + str( int( round( time.time() - startTime ) ) ) + ' seconds to vectorwrite the file.' )
	settings.openWebPage( suffixFileName )
Beispiel #15
0
def analyzeFileGivenText(fileName, gcodeText, repository=None):
    "Write scalable vector graphics for a gcode file given the settings."
    if gcodeText == '':
        return ''
    if repository == None:
        repository = settings.getReadRepository(VectorwriteRepository())
    startTime = time.time()
    vectorwriteGcode = VectorwriteSkein().getSVG(fileName, gcodeText,
                                                 repository)
    if vectorwriteGcode == '':
        return
    suffixFileName = fileName[:fileName.rfind('.')] + '_vectorwrite.svg'
    suffixDirectoryName = os.path.dirname(suffixFileName)
    suffixReplacedBaseName = os.path.basename(suffixFileName).replace(' ', '_')
    suffixFileName = os.path.join(suffixDirectoryName, suffixReplacedBaseName)
    gcodec.writeFileText(suffixFileName, vectorwriteGcode)
    print('The vectorwrite file is saved as ' +
          gcodec.getSummarizedFileName(suffixFileName))
    print('It took ' + str(int(round(time.time() - startTime))) +
          ' seconds to vectorwrite the file.')
    settings.openWebPage(suffixFileName)
Beispiel #16
0
	def getReplacedSVGTemplate( self, fileName, procedureName, rotatedBoundaryLayers ):
		"Get the lines of text from the svg_layer.template file."
#( layers.length + 1 ) * (margin + sliceDimY * unitScale + txtHeight) + margin + txtHeight + margin + 110
		self.extent = self.cornerMaximum - self.cornerMinimum
		self.addRotatedLoopLayersToOutput( rotatedBoundaryLayers )
		svgTemplateText = gcodec.getFileTextInFileDirectory( __file__, 'svg_layer.template' )
		svgTemplateText = getReplacedWordAndInQuotes( 'layerThickness', self.getRounded( self.layerThickness ), svgTemplateText )
		svgTemplateText = getReplacedWordAndInQuotes( 'maxX', self.getRounded( self.cornerMaximum.x ), svgTemplateText )
		svgTemplateText = getReplacedWordAndInQuotes( 'minX', self.getRounded( self.cornerMinimum.x ), svgTemplateText )
		svgTemplateText = getReplacedWordAndInQuotes( 'maxY', self.getRounded( self.cornerMaximum.y ), svgTemplateText )
		svgTemplateText = getReplacedWordAndInQuotes( 'minY', self.getRounded( self.cornerMinimum.y ), svgTemplateText )
		svgTemplateText = getReplacedWordAndInQuotes( 'maxZ', self.getRounded( self.cornerMaximum.z ), svgTemplateText )
		svgTemplateText = getReplacedWordAndInQuotes( 'minZ', self.getRounded( self.cornerMinimum.z ), svgTemplateText )
		lines = gcodec.getTextLines( svgTemplateText )
		self.margin = getParameterFromJavascript( lines, 'margin', self.margin )
		self.textHeight = getParameterFromJavascript( lines, 'textHeight', self.textHeight )
		javascriptControlsWidth = getParameterFromJavascript( lines, 'javascripControlBoxX', 510.0 )
		noJavascriptControlsHeight = getParameterFromJavascript( lines, 'noJavascriptControlBoxY', 110.0 )
		controlTop = len( rotatedBoundaryLayers ) * ( self.margin + self.extent.y * self.unitScale + self.textHeight ) + 2.0 * self.margin + self.textHeight
#	width = margin + (sliceDimX * unitScale) + margin;
		width = 2.0 * self.margin + max( self.extent.x * self.unitScale, javascriptControlsWidth )
		summarizedFileName = gcodec.getSummarizedFileName( fileName ) + ' SVG Slice File'
		noJavascriptControlsTagString = '	<g id="noJavascriptControls" fill="#000" transform="translate(%s, %s)">' % ( self.getRounded( self.margin ), self.getRounded( controlTop ) )
		firstWordTable = {}
		firstWordTable[ 'height="999px"' ] = '	height="%spx"' % self.getRounded( controlTop + noJavascriptControlsHeight + self.margin )
		firstWordTable[ 'width="999px"' ] = '	width="%spx"' % self.getRounded( width )
		firstWordTable[ '<!--replaceLineWith_boundaryLayerLines-->' ] = self.output.getvalue()
		firstWordTable[ '<!--replaceLineWith_emptyString-->' ] = ''
		firstWordTable[ '<!--replaceLineWith_noJavascriptControls-->' ] = noJavascriptControlsTagString
		firstWordTable[ '<!--replaceLineWith_sliceVariableLines-->' ] = self.getInitializationForOutputSVG( procedureName )
		replaceWithTable = {}
		replaceWithTable[ 'replaceWith_Title' ] = summarizedFileName
		replaceWithTable[ 'replaceWith_dimX' ] = self.getRounded( self.extent.x )
		replaceWithTable[ 'replaceWith_dimY' ] = self.getRounded( self.extent.y )
		replaceWithTable[ 'replaceWith_dimZ' ] = self.getRounded( self.extent.z )
		output = cStringIO.StringIO()
		for line in lines:
			parseLineReplaceWithTable( firstWordTable, line, output, replaceWithTable )
		return output.getvalue()
Beispiel #17
0
 def getReplacedSVGTemplate(self, fileName, procedureName,
                            rotatedBoundaryLayers):
     "Get the lines of text from the svg_layer.template file."
     #( layers.length + 1 ) * (margin + sliceDimY * unitScale + txtHeight) + margin + txtHeight + margin + 110
     self.extent = self.cornerMaximum - self.cornerMinimum
     self.addRotatedLoopLayersToOutput(rotatedBoundaryLayers)
     svgTemplateText = gcodec.getFileTextInFileDirectory(
         __file__, 'svg_layer.template')
     svgTemplateText = getReplacedWordAndInQuotes(
         'layerThickness', self.getRounded(self.layerThickness),
         svgTemplateText)
     svgTemplateText = getReplacedWordAndInQuotes(
         'maxX', self.getRounded(self.cornerMaximum.x), svgTemplateText)
     svgTemplateText = getReplacedWordAndInQuotes(
         'minX', self.getRounded(self.cornerMinimum.x), svgTemplateText)
     svgTemplateText = getReplacedWordAndInQuotes(
         'maxY', self.getRounded(self.cornerMaximum.y), svgTemplateText)
     svgTemplateText = getReplacedWordAndInQuotes(
         'minY', self.getRounded(self.cornerMinimum.y), svgTemplateText)
     svgTemplateText = getReplacedWordAndInQuotes(
         'maxZ', self.getRounded(self.cornerMaximum.z), svgTemplateText)
     svgTemplateText = getReplacedWordAndInQuotes(
         'minZ', self.getRounded(self.cornerMinimum.z), svgTemplateText)
     lines = gcodec.getTextLines(svgTemplateText)
     self.margin = getParameterFromJavascript(lines, 'margin', self.margin)
     self.textHeight = getParameterFromJavascript(lines, 'textHeight',
                                                  self.textHeight)
     javascriptControlsWidth = getParameterFromJavascript(
         lines, 'javascripControlBoxX', 510.0)
     noJavascriptControlsHeight = getParameterFromJavascript(
         lines, 'noJavascriptControlBoxY', 110.0)
     controlTop = len(rotatedBoundaryLayers) * (
         self.margin + self.extent.y * self.unitScale +
         self.textHeight) + 2.0 * self.margin + self.textHeight
     #	width = margin + (sliceDimX * unitScale) + margin;
     width = 2.0 * self.margin + max(self.extent.x * self.unitScale,
                                     javascriptControlsWidth)
     summarizedFileName = gcodec.getSummarizedFileName(
         fileName) + ' SVG Slice File'
     noJavascriptControlsTagString = '	<g id="noJavascriptControls" fill="#000" transform="translate(%s, %s)">' % (
         self.getRounded(self.margin), self.getRounded(controlTop))
     firstWordTable = {}
     firstWordTable['height="999px"'] = '	height="%spx"' % self.getRounded(
         controlTop + noJavascriptControlsHeight + self.margin)
     firstWordTable['width="999px"'] = '	width="%spx"' % self.getRounded(
         width)
     firstWordTable[
         '<!--replaceLineWith_boundaryLayerLines-->'] = self.output.getvalue(
         )
     firstWordTable['<!--replaceLineWith_emptyString-->'] = ''
     firstWordTable[
         '<!--replaceLineWith_noJavascriptControls-->'] = noJavascriptControlsTagString
     firstWordTable[
         '<!--replaceLineWith_sliceVariableLines-->'] = self.getInitializationForOutputSVG(
             procedureName)
     replaceWithTable = {}
     replaceWithTable['replaceWith_Title'] = summarizedFileName
     replaceWithTable['replaceWith_dimX'] = self.getRounded(self.extent.x)
     replaceWithTable['replaceWith_dimY'] = self.getRounded(self.extent.y)
     replaceWithTable['replaceWith_dimZ'] = self.getRounded(self.extent.z)
     output = cStringIO.StringIO()
     for line in lines:
         parseLineReplaceWithTable(firstWordTable, line, output,
                                   replaceWithTable)
     return output.getvalue()