1 """
2 Boolean geometry utilities.
3
4 """
5
6 import math
7
8
9 __author__ = 'Enrique Perez (perez_enrique@yahoo.com)'
10 __credits__ = 'Art of Illusion <http://www.artofillusion.org/>'
11 __date__ = '$Date: 2008/02/05 $'
12 __license__ = 'GNU Affero General Public License http://www.gnu.org/licenses/agpl.html'
13
14
20
22 'Get the importRadius.'
23 if key in xmlElement.attributeDictionary:
24 value = xmlElement.attributeDictionary[key]
25 functionName = 'get' + key[0].upper() + key[1 :]
26 if functionName in value:
27 if xmlElement.parentNode == None:
28 return defaultFloat
29 else:
30 xmlElement = xmlElement.parentNode
31 return xmlElement.getCascadeFloat(defaultFloat, key)
32
38
40 'Get the interior overhang support angle in degrees.'
41 return getCascadeFloatWithoutSelf(30.0, 'interiorOverhangAngle', xmlElement)
42
46
48 'Get the layer thickness.'
49 if xmlElement == None:
50 return 0.4
51 return getCascadeFloatWithoutSelf(0.4, 'layerThickness', xmlElement)
52
56
60
62 'Get the overhang support angle in radians.'
63 return math.radians(getOverhangAngle(xmlElement))
64
68
72
76
78 'Get the twist precision in radians.'
79 return math.radians(getTwistPrecision(xmlElement))
80
81
83 'Class to get handle xmlElements in a setting.'
85 'Initialize.'
86 self.xmlElement = xmlElement
87
89 'Get the string representation of this Setting.'
90 return self.xmlElement
91
95
99
103
107
111
113 'Get the overhang support angle in degrees.'
114 return getOverhangAngle(self.xmlElement)
115
117 'Get the overhang support angle in radians.'
118 return getOverhangRadians(self.xmlElement)
119
121 'Get the cascade precision.'
122 return getPrecision(self.xmlElement)
123
127
129 'Get the twist precision in degrees.'
130 return getTwistPrecision(self.xmlElement)
131
135
136
137 globalAccessibleAttributes = 'getImportRadius getInteriorOverhangAngle getInteriorOverhangRadians'.split()
138 globalAccessibleAttributes += 'getLayerThickness getOverhangSpan getOverhangAngle getOverhangRadians'.split()
139 globalAccessibleAttributes += 'getPrecision getSheetThickness getTwistPrecision getTwistPrecisionRadians'.split()
140 globalGetAccessibleAttributeSet = set(globalAccessibleAttributes)
141