Esempio n. 1
0
def getEdgeWidth(elementNode):
	'Get the edge width.'
	if elementNode == None:
		return 0.72
	preferences = skeinforge_craft.getCraftPreferences('carve')
	layerHeight = skeinforge_craft.getCraftValue('Layer Height', preferences)
	layerHeight = getCascadeFloatWithoutSelf(layerHeight, elementNode, 'layerHeight')
	edgeWidthOverHeight = skeinforge_craft.getCraftValue('Edge Width over Height', preferences)
	edgeWidthOverHeight = getCascadeFloatWithoutSelf(edgeWidthOverHeight, elementNode, 'edgeWidthOverHeight')
	return getCascadeFloatWithoutSelf(edgeWidthOverHeight * layerHeight, elementNode, 'edgeWidth')
Esempio n. 2
0
def getPerimeterWidth(elementNode):
	'Get the perimeter width.'
	if elementNode == None:
		return 0.72
	preferences = skeinforge_craft.getCraftPreferences('carve')
	layerThickness = skeinforge_craft.getCraftValue('Layer Thickness', preferences)
	layerThickness = getCascadeFloatWithoutSelf(layerThickness, elementNode, 'layerThickness')
	perimeterWidthOverThickness = skeinforge_craft.getCraftValue('Perimeter Width over Thickness', preferences)
	perimeterWidthOverThickness = getCascadeFloatWithoutSelf(perimeterWidthOverThickness, elementNode, 'perimeterWidthOverThickness')
	return getCascadeFloatWithoutSelf(perimeterWidthOverThickness * layerThickness, elementNode, 'perimeterWidth')
Esempio n. 3
0
def getEdgeWidth(elementNode):
	'Get the edge width.'
	if elementNode == None:
		return 0.72
	preferences = skeinforge_craft.getCraftPreferences('carve')
	layerHeight = skeinforge_craft.getCraftValue('Layer Height', preferences)
	layerHeight = getCascadeFloatWithoutSelf(layerHeight, elementNode, 'layerHeight')
	edgeWidthOverHeight = skeinforge_craft.getCraftValue('Edge Width over Height', preferences)
	edgeWidthOverHeight = getCascadeFloatWithoutSelf(edgeWidthOverHeight, elementNode, 'edgeWidthOverHeight')
	return getCascadeFloatWithoutSelf(edgeWidthOverHeight * layerHeight, elementNode, 'edgeWidth')
Esempio n. 4
0
def getImportRadius(elementNode):
	'Get the importRadius.'
	if elementNode == None:
		return 0.36
	preferences = skeinforge_craft.getCraftPreferences('carve')
	importCoarseness = getImportCoarseness(elementNode, preferences)
	layerThickness = skeinforge_craft.getCraftValue('Layer Thickness', preferences)
	layerThickness = getCascadeFloatWithoutSelf(layerThickness, elementNode, 'layerThickness')
	perimeterWidthOverThickness = skeinforge_craft.getCraftValue('Perimeter Width over Thickness', preferences)
	perimeterWidthOverThickness = getCascadeFloatWithoutSelf(perimeterWidthOverThickness, elementNode, 'perimeterWidthOverThickness')
	return getCascadeFloatWithoutSelf(0.5 * importCoarseness * layerThickness * perimeterWidthOverThickness, elementNode, 'importRadius')
Esempio n. 5
0
def getImportRadius(elementNode):
	'Get the importRadius.'
	if elementNode == None:
		return 0.36
	preferences = skeinforge_craft.getCraftPreferences('carve')
	importCoarseness = getImportCoarseness(elementNode, preferences)
	layerHeight = skeinforge_craft.getCraftValue('Layer Height', preferences)
	layerHeight = getCascadeFloatWithoutSelf(layerHeight, elementNode, 'layerHeight')
	edgeWidthOverHeight = skeinforge_craft.getCraftValue('Edge Width over Height', preferences)
	edgeWidthOverHeight = getCascadeFloatWithoutSelf(edgeWidthOverHeight, elementNode, 'edgeWidthOverHeight')
	return getCascadeFloatWithoutSelf(0.5 * importCoarseness * layerHeight * edgeWidthOverHeight, elementNode, 'importRadius')
Esempio n. 6
0
def getImportRadius(elementNode):
	'Get the importRadius.'
	if elementNode == None:
		return 0.36
	preferences = skeinforge_craft.getCraftPreferences('carve')
	importCoarseness = getImportCoarseness(elementNode, preferences)
	layerHeight = skeinforge_craft.getCraftValue('Layer Height', preferences)
	layerHeight = getCascadeFloatWithoutSelf(layerHeight, elementNode, 'layerHeight')
	edgeWidthOverHeight = skeinforge_craft.getCraftValue('Edge Width over Height', preferences)
	edgeWidthOverHeight = getCascadeFloatWithoutSelf(edgeWidthOverHeight, elementNode, 'edgeWidthOverHeight')
	return getCascadeFloatWithoutSelf(0.5 * importCoarseness * layerHeight * edgeWidthOverHeight, elementNode, 'importRadius')
Esempio n. 7
0
def getPerimeterWidth(elementNode):
    'Get the perimeter width.'
    if elementNode is None:
        return 0.72
    preferences = skeinforge_craft.getCraftPreferences('carve')
    layerThickness = skeinforge_craft.getCraftValue('Layer Thickness',
                                                    preferences)
    layerThickness = getCascadeFloatWithoutSelf(layerThickness, elementNode,
                                                'layerThickness')
    perimeterWidthOverThickness = skeinforge_craft.getCraftValue(
        'Perimeter Width over Thickness', preferences)
    perimeterWidthOverThickness = getCascadeFloatWithoutSelf(
        perimeterWidthOverThickness, elementNode,
        'perimeterWidthOverThickness')
    return getCascadeFloatWithoutSelf(perimeterWidthOverThickness, elementNode,
                                      'perimeterWidth')
Esempio n. 8
0
def getImportCoarseness(elementNode, preferences=None):
	'Get the importCoarseness.'
	if elementNode == None:
		return 1.0
	if preferences == None:
		preferences = skeinforge_craft.getCraftPreferences('carve')
	importCoarseness = skeinforge_craft.getCraftValue('Import Coarseness', preferences)
	return getCascadeFloatWithoutSelf(importCoarseness, elementNode, 'importCoarseness')
Esempio n. 9
0
def getLayerThickness(elementNode):
    'Get the layer thickness.'
    if elementNode == None:
        return 0.4
    preferences = skeinforge_craft.getCraftPreferences('carve')
    return getCascadeFloatWithoutSelf(
        skeinforge_craft.getCraftValue('Layer Thickness', preferences),
        elementNode, 'layerThickness')
Esempio n. 10
0
def getImportCoarseness(elementNode, preferences=None):
	'Get the importCoarseness.'
	if elementNode == None:
		return 1.0
	if preferences == None:
		preferences = skeinforge_craft.getCraftPreferences('carve')
	importCoarseness = skeinforge_craft.getCraftValue('Import Coarseness', preferences)
	return getCascadeFloatWithoutSelf(importCoarseness, elementNode, 'importCoarseness')
Esempio n. 11
0
def getImportRadius(elementNode):
    'Get the importRadius.'
    if elementNode == None:
        return 0.36
    preferences = skeinforge_craft.getCraftPreferences('carve')
    importCoarseness = getImportCoarseness(elementNode, preferences)
    layerThickness = skeinforge_craft.getCraftValue('Layer Thickness',
                                                    preferences)
    layerThickness = getCascadeFloatWithoutSelf(layerThickness, elementNode,
                                                'layerThickness')
    perimeterWidthOverThickness = skeinforge_craft.getCraftValue(
        'Perimeter Width over Thickness', preferences)
    perimeterWidthOverThickness = getCascadeFloatWithoutSelf(
        perimeterWidthOverThickness, elementNode,
        'perimeterWidthOverThickness')
    return getCascadeFloatWithoutSelf(
        0.5 * importCoarseness * layerThickness * perimeterWidthOverThickness,
        elementNode, 'importRadius')
Esempio n. 12
0
	def addToolSettingLines(self, pluginName):
		"Add tool setting lines."
		preferences = skeinforge_craft.getCraftPreferences(pluginName)
		if skeinforge_craft.getCraftValue('Activate %s' % pluginName.capitalize(), preferences) != True:
			return
		for preference in preferences:
			valueWithoutReturn = str(preference.value).replace('\n', ' ').replace('\r', ' ')
			if preference.name != 'WindowPosition' and not preference.name.startswith('Open File'):
				line = '%s %s %s' % (pluginName, preference.name.replace(' ', '_'), valueWithoutReturn)
				self.distanceFeedRate.addTagBracketedLine('setting', line)
Esempio n. 13
0
 def addToolSettingLines(self, pluginName):
     "Add tool setting lines."
     preferences = skeinforge_craft.getCraftPreferences(pluginName)
     if skeinforge_craft.getCraftValue("Activate %s" % pluginName.capitalize(), preferences) != True:
         return
     for preference in preferences:
         valueWithoutReturn = str(preference.value).replace("\n", " ").replace("\r", " ")
         if preference.name != "WindowPosition" and not preference.name.startswith("Open File"):
             line = "%s %s %s" % (pluginName, preference.name.replace(" ", "_"), valueWithoutReturn)
             self.distanceFeedRate.addTagBracketedLine("setting", line)
Esempio n. 14
0
def getLayerThickness(elementNode):
	'Get the layer thickness.'
	if elementNode == None:
		return 0.4
	preferences = skeinforge_craft.getCraftPreferences('carve')
	return getCascadeFloatWithoutSelf(skeinforge_craft.getCraftValue('Layer Thickness', preferences), elementNode, 'layerThickness')