Ejemplo n.º 1
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')
Ejemplo n.º 2
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')
Ejemplo n.º 3
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')
Ejemplo n.º 4
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)
Ejemplo n.º 5
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')
Ejemplo n.º 6
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')
Ejemplo n.º 7
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)
Ejemplo n.º 8
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')
Ejemplo n.º 9
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')
Ejemplo n.º 10
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')
Ejemplo n.º 11
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')
Ejemplo n.º 12
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')
Ejemplo n.º 13
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')
Ejemplo 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')