def getFloatByPrefixSide(defaultValue, elementNode, prefix, side): 'Get float by prefix and side.' if elementNode == None: return defaultValue if side != None: key = prefix + 'OverSide' if key in elementNode.attributes: defaultValue = euclidean.getFloatFromValue(evaluate.getEvaluatedValueObliviously(elementNode, key)) * side return evaluate.getEvaluatedFloat(defaultValue, elementNode, prefix)
def getFloatByPrefixSide(defaultValue, elementNode, prefix, side): 'Get float by prefix and side.' if elementNode == None: return defaultValue if side != None: key = prefix + 'OverSide' if key in elementNode.attributes: defaultValue = euclidean.getFloatFromValue(evaluate.getEvaluatedValueObliviously(elementNode, key)) * side return evaluate.getEvaluatedFloat(defaultValue, elementNode, prefix)
def rotate(self, elementNode): 'Rotate.' rotation = math.radians(evaluate.getEvaluatedFloat(0.0, elementNode, 'rotation')) rotation += evaluate.getEvaluatedFloat(0.0, elementNode, 'rotationOverSide') * self.sideAngle if rotation != 0.0: planeRotation = euclidean.getWiddershinsUnitPolar( rotation ) for vertex in self.loop: rotatedComplex = vertex.dropAxis() * planeRotation vertex.x = rotatedComplex.real vertex.y = rotatedComplex.imag if 'clockwise' in elementNode.attributes: isClockwise = euclidean.getBooleanFromValue(evaluate.getEvaluatedValueObliviously(elementNode, 'clockwise')) if isClockwise == euclidean.getIsWiddershinsByVector3( self.loop ): self.loop.reverse()
def rotate(self, xmlElement): "Rotate." rotation = math.radians( evaluate.getEvaluatedFloatDefault(0.0, 'rotation', xmlElement ) ) rotation += evaluate.getEvaluatedFloatDefault(0.0, 'rotationOverSide', xmlElement ) * self.sideAngle if rotation != 0.0: planeRotation = euclidean.getWiddershinsUnitPolar( rotation ) for vertex in self.loop: rotatedComplex = vertex.dropAxis() * planeRotation vertex.x = rotatedComplex.real vertex.y = rotatedComplex.imag if 'clockwise' in xmlElement.attributeDictionary: isClockwise = euclidean.getBooleanFromValue( evaluate.getEvaluatedValueObliviously('clockwise', xmlElement ) ) if isClockwise == euclidean.getIsWiddershinsByVector3( self.loop ): self.loop.reverse()
def rotate(self, elementNode): 'Rotate.' rotation = math.radians(evaluate.getEvaluatedFloat(0.0, elementNode, 'rotation')) rotation += evaluate.getEvaluatedFloat(0.0, elementNode, 'rotationOverSide') * self.sideAngle if rotation != 0.0: planeRotation = euclidean.getWiddershinsUnitPolar( rotation ) for vertex in self.loop: rotatedComplex = vertex.dropAxis() * planeRotation vertex.x = rotatedComplex.real vertex.y = rotatedComplex.imag if 'clockwise' in elementNode.attributes: isClockwise = euclidean.getBooleanFromValue(evaluate.getEvaluatedValueObliviously(elementNode, 'clockwise')) if isClockwise == euclidean.getIsWiddershinsByVector3( self.loop ): self.loop.reverse()
def rotate(self, xmlElement): "Rotate." rotation = math.radians( evaluate.getEvaluatedFloatDefault(0.0, 'rotation', xmlElement)) rotation += evaluate.getEvaluatedFloatDefault( 0.0, 'rotationOverSide', xmlElement) * self.sideAngle if rotation != 0.0: planeRotation = euclidean.getWiddershinsUnitPolar(rotation) for vertex in self.loop: rotatedComplex = vertex.dropAxis() * planeRotation vertex.x = rotatedComplex.real vertex.y = rotatedComplex.imag if 'clockwise' in xmlElement.attributeDictionary: isClockwise = euclidean.getBooleanFromValue( evaluate.getEvaluatedValueObliviously('clockwise', xmlElement)) if isClockwise == euclidean.getIsWiddershinsByVector3(self.loop): self.loop.reverse()
def centerRotate( self, xmlElement ): "Add a wedge center and rotate." wedgeCenter = evaluate.getVector3ByKey( 'wedgecenter', None, xmlElement ) if wedgeCenter != None: self.loop.append( wedgeCenter ) rotation = math.radians( evaluate.getEvaluatedFloatZero( 'rotation', xmlElement ) ) rotation += evaluate.getEvaluatedFloatZero( 'rotationoverside', xmlElement ) * self.sideAngle if rotation != 0.0: planeRotation = euclidean.getWiddershinsUnitPolar( rotation ) for vertex in self.loop: rotatedComplex = vertex.dropAxis() * planeRotation vertex.x = rotatedComplex.real vertex.y = rotatedComplex.imag if 'clockwise' in xmlElement.attributeDictionary: isClockwise = euclidean.getBooleanFromValue( evaluate.getEvaluatedValueObliviously( 'clockwise', xmlElement ) ) if isClockwise == euclidean.getIsWiddershinsByVector3( self.loop ): self.loop.reverse()