Ejemplo n.º 1
0
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)
Ejemplo n.º 3
0
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)
Ejemplo n.º 4
0
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)
Ejemplo n.º 5
0
 def getComplexByExtraIndex(self, extraIndex=0):
     'Get complex from the extraIndex.'
     return euclidean.getComplexByWords(self.words,
                                        self.wordIndex + extraIndex)
Ejemplo n.º 6
0
def getTricomplextranslate(transformWords):
    "Get matrixSVG by transformWords."
    translate = euclidean.getComplexByWords(transformWords)
    return [complex(1.0, 0.0), complex(0.0, 1.0), translate]
Ejemplo n.º 7
0
def getTricomplexscale(transformWords):
    "Get matrixSVG by transformWords."
    scale = euclidean.getComplexByWords(transformWords)
    return [complex(scale.real, 0.0), complex(0.0, scale.imag), complex()]
Ejemplo n.º 8
0
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)
Ejemplo n.º 10
0
def getTricomplextranslate(transformWords):
	"Get matrixSVG by transformWords."
	translate = euclidean.getComplexByWords(transformWords)
	return [complex(1.0, 0.0), complex(0.0, 1.0), translate]
Ejemplo n.º 11
0
def getTricomplexscale(transformWords):
	"Get matrixSVG by transformWords."
	scale = euclidean.getComplexByWords(transformWords)
	return [complex(scale.real,0.0), complex(0.0,scale.imag), complex()]
Ejemplo n.º 12
0
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