コード例 #1
0
ファイル: svg_reader.py プロジェクト: 1060460048/Cura
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)
コード例 #2
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)
コード例 #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)
コード例 #4
0
ファイル: svg_reader.py プロジェクト: maestroflema/asimov
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)
コード例 #5
0
ファイル: svg_reader.py プロジェクト: CNCBASHER/skeinforge-1
 def getComplexByExtraIndex(self, extraIndex=0):
     'Get complex from the extraIndex.'
     return euclidean.getComplexByWords(self.words,
                                        self.wordIndex + extraIndex)
コード例 #6
0
ファイル: svg_reader.py プロジェクト: CNCBASHER/skeinforge-1
def getTricomplextranslate(transformWords):
    "Get matrixSVG by transformWords."
    translate = euclidean.getComplexByWords(transformWords)
    return [complex(1.0, 0.0), complex(0.0, 1.0), translate]
コード例 #7
0
ファイル: svg_reader.py プロジェクト: CNCBASHER/skeinforge-1
def getTricomplexscale(transformWords):
    "Get matrixSVG by transformWords."
    scale = euclidean.getComplexByWords(transformWords)
    return [complex(scale.real, 0.0), complex(0.0, scale.imag), complex()]
コード例 #8
0
ファイル: svg_reader.py プロジェクト: CNCBASHER/skeinforge-1
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
コード例 #9
0
	def getComplexByExtraIndex( self, extraIndex=0 ):
		'Get complex from the extraIndex.'
		return euclidean.getComplexByWords(self.words, self.wordIndex + extraIndex)
コード例 #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]
コード例 #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()]
コード例 #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