예제 #1
0
	def getLineWithTruncatedNumber(self, character, line, splitLine):
		'Get a line with the number after the character truncated.'
		numberString = gcodec.getStringFromCharacterSplitLine(character, splitLine)
		if numberString == None:
			return line
		roundedNumberString = euclidean.getRoundedToPlacesString(self.decimalPlacesExported, float(numberString))
		return gcodec.getLineWithValueString(character, line, splitLine, roundedNumberString)
예제 #2
0
파일: export.py 프로젝트: folksjos/RepG
	def getLineWithTruncatedNumber(self, character, line, splitLine):
		'Get a line with the number after the character truncated.'
		numberString = gcodec.getStringFromCharacterSplitLine(character, splitLine)
		if numberString == None:
			return line
		roundedNumberString = euclidean.getRoundedToPlacesString(self.decimalPlacesExported, float(numberString))
		return gcodec.getLineWithValueString(character, line, splitLine, roundedNumberString)
예제 #3
0
def setSliceElementZ(decimalPlacesCarried, sliceElement, sliceElementIndex, z):
	"Set the slice element z."
	roundedZ = euclidean.getRoundedToPlacesString(decimalPlacesCarried, z)
	idValue = 'z:%s' % roundedZ
	sliceElement.attributeDictionary['id'] = idValue
	textElement = sliceElement.getFirstChildWithClassName('text')
	textElement.text = 'Layer %s, %s' % (sliceElementIndex, idValue)
예제 #4
0
	def getRoundedRulingText( self, extraDecimalPlaces, number ):
		'Get the rounded ruling text.'
		rulingText = euclidean.getRoundedToPlacesString( extraDecimalPlaces - math.floor( math.log10( self.rulingSeparationWidthMillimeters ) ), number )
		if self.rulingSeparationWidthMillimeters < .99:
			return rulingText
		if rulingText[ - len('.0') : ] == '.0':
			return rulingText[ : - len('.0') ]
		return rulingText
예제 #5
0
	def getRoundedRulingText( self, extraDecimalPlaces, number ):
		'Get the rounded ruling text.'
		rulingText = euclidean.getRoundedToPlacesString( extraDecimalPlaces - math.floor( math.log10( self.rulingSeparationWidthMillimeters ) ), number )
		if self.rulingSeparationWidthMillimeters < .99:
			return rulingText
		if rulingText[ - len('.0') : ] == '.0':
			return rulingText[ : - len('.0') ]
		return rulingText
예제 #6
0
 def getRounded(self, number):
     'Get number rounded to the number of carried decimal places as a string.'
     return euclidean.getRoundedToPlacesString(self.decimalPlacesCarried,
                                               number)
예제 #7
0
	def getRounded(self, number):
		'Get number rounded to the number of carried decimal places as a string.'
		return euclidean.getRoundedToPlacesString(self.decimalPlacesCarried, number)