def processSVGElementpolyline(elementNode, svgReader): "Process elementNode by svgReader." if 'points' not in elementNode.attributes: print('Warning, in processSVGElementpolyline in svgReader can not get a value for d in:') print(elementNode.attributes) return loopLayer = svgReader.getLoopLayer() words = getRightStripMinusSplit(elementNode.attributes['points'].replace(',', ' ')) path = [] for wordIndex in xrange(0, len(words), 2): path.append(euclidean.getComplexByWords(words[wordIndex :])) loopLayer.loops += getTransformedOutlineByPath(elementNode, path, svgReader.yAxisPointingUpward)
def processSVGElementpolyline(svgReader, xmlElement): "Process xmlElement by svgReader." if 'points' not in xmlElement.attributeDictionary: print('Warning, in processSVGElementpolyline in svgReader can not get a value for d in:') print(xmlElement.attributeDictionary) return rotatedLoopLayer = svgReader.getRotatedLoopLayer() words = getRightStripMinusSplit(xmlElement.attributeDictionary['points'].replace(',', ' ')) path = [] for wordIndex in xrange(0, len(words), 2): path.append(euclidean.getComplexByWords(words[wordIndex :])) rotatedLoopLayer.loops += getTransformedOutlineByPath(path, xmlElement, svgReader.yAxisPointingUpward)
def getComplexByExtraIndex(self, extraIndex=0): 'Get complex from the extraIndex.' return euclidean.getComplexByWords(self.words, self.wordIndex + extraIndex)
def getTricomplextranslate(transformWords): "Get matrixSVG by transformWords." translate = euclidean.getComplexByWords(transformWords) return [complex(1.0, 0.0), complex(0.0, 1.0), translate]
def getTricomplexscale(transformWords): "Get matrixSVG by transformWords." scale = euclidean.getComplexByWords(transformWords) return [complex(scale.real, 0.0), complex(0.0, scale.imag), complex()]
def getTricomplexmatrix(transformWords): "Get matrixSVG by transformWords." tricomplex = [euclidean.getComplexByWords(transformWords)] tricomplex.append(euclidean.getComplexByWords(transformWords, 2)) tricomplex.append(euclidean.getComplexByWords(transformWords, 4)) return tricomplex
def getComplexByExtraIndex( self, extraIndex=0 ): 'Get complex from the extraIndex.' return euclidean.getComplexByWords(self.words, self.wordIndex + extraIndex)
def getTricomplexscale(transformWords): "Get matrixSVG by transformWords." scale = euclidean.getComplexByWords(transformWords) return [complex(scale.real,0.0), complex(0.0,scale.imag), complex()]