예제 #1
0
 def execute(self):
     "Comb button has been clicked."
     fileNames = skeinforge_polyfile.getFileOrDirectoryTypesUnmodifiedGcode(
         self.fileNameInput.value, fabmetheus_interpret.getImportPluginFileNames(), self.fileNameInput.wasCancelled
     )
     for fileName in fileNames:
         writeOutput(fileName)
예제 #2
0
 def execute(self):
     "Inset button has been clicked."
     fileNames = skeinforge_polyfile.getFileOrDirectoryTypesUnmodifiedGcode(
         self.fileNameInput.value,
         fabmetheus_interpret.getImportPluginFileNames(),
         self.fileNameInput.wasCancelled)
     for fileName in fileNames:
         writeOutput(fileName)
예제 #3
0
파일: skeinforge.py 프로젝트: folksjos/RepG
 def execute(self):
     'Skeinforge button has been clicked.'
     fileNames = skeinforge_polyfile.getFileOrDirectoryTypesUnmodifiedGcode(
         self.fileNameInput.value,
         fabmetheus_interpret.getImportPluginFileNames(),
         self.fileNameInput.wasCancelled)
     window = None
     for fileName in fileNames:
         window = skeinforge_craft.writeOutput(fileName)
     return window
예제 #4
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( fabmetheus_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 )
예제 #5
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( fabmetheus_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 %s to chop the file.' % euclidean.getDurationString( time.time() - startTime ) )
	settings.openWebPage( suffixFileName )