Python: module fabmetheus_utilities.svg_reader

fabmetheus_utilities.svg_reader ($Date: 2008/21/04 $) | index /home/enrique/Desktop/backup/babbleold/script/reprap/fabmetheus/fabmetheus_utilities/svg_reader.py

`Svg reader.`

Modules

``

__init__ fabmetheus_utilities.archive fabmetheus_utilities.euclidean | fabmetheus_utilities.gcodec fabmetheus_utilities.intercircle math | os fabmetheus_utilities.settings fabmetheus_utilities.svg_writer | sys traceback fabmetheus_utilities.geometry.solids.triangle_mesh

Classes

``

FontReader
Glyph
MatrixSVG
PathReader
SVGReader

class FontReader
`` | `Class to read a font in the fonts folder. `

Methods defined here:

__init__(self, fontFamily)
  `Initialize.`

getGlyph(self, character, yAxisPointingUpward)
  `Get the glyph for the character.`

class Glyph
`` | `Class to handle a glyph. `

Methods defined here:

__init__(self, elementNode, unitsPerEM, yAxisPointingUpward)
  `Initialize.`

getSizedAdvancedLoops(self, fontSize, horizontalAdvanceX, yAxisPointingUpward=True)
  `Get loops for font size, advanced horizontally.`

class MatrixSVG
`` | `Two by three svg matrix. `

Methods defined here:

__init__(self, tricomplex=None)
  `Initialize.`

__repr__(self)
  `Get the string representation of this two by three svg matrix.`

getOtherTimesSelf(self, otherTricomplex)
  `Get the other matrix multiplied by this matrix.`

getSelfTimesOther(self, otherTricomplex)
  `Get this matrix multiplied by the other matrix.`

getTransformedPath(self, path)
  `Get transformed path.`

getTransformedPaths(self, paths)
  `Get transformed paths.`

class PathReader
`` | `Class to read svg path. `

Methods defined here:

__init__(self, elementNode, loops, yAxisPointingUpward)
  `Add to path string to loops.`

addPathArc(self, end)
  `Add an arc to the path.`

addPathCubic(self, controlPoints, end)
  `Add a cubic curve to the path.`

addPathCubicReflected(self, controlPoint, end)
  `Add a cubic curve to the path from a reflected control point.`

addPathLine(self, lineFunction, point)
  `Add a line to the path.`

addPathLineAxis(self, point)
  `Add an axis line to the path.`

addPathLineByFunction(self, lineFunction)
  `Add a line to the path by line function.`

addPathMove(self, lineFunction, point)
  `Add an axis line to the path.`

addPathQuadratic(self, controlPoint, end)
  `Add a quadratic curve to the path.`

addPathQuadraticReflected(self, end)
  `Add a quadratic curve to the path from a reflected control point.`

getComplexByExtraIndex(self, extraIndex=0)
  `Get complex from the extraIndex.`

getComplexRelative(self)
  `Get relative complex.`

getFloatByExtraIndex(self, extraIndex=0)
  `Get float from the extraIndex.`

getOldPoint(self)
  `Get the old point.`

processPathWordA(self)
  `Process path word A.`

processPathWordC(self)
  `Process path word C.`

processPathWordH(self)
  `Process path word H.`

processPathWordL(self)
  `Process path word L.`

processPathWordM(self)
  `Process path word M.`

processPathWordQ(self)
  `Process path word Q.`

processPathWordS(self)
  `Process path word S.`

processPathWordT(self)
  `Process path word T.`

processPathWordV(self)
  `Process path word V.`

processPathWordZ(self)
  `Process path word Z.`

processPathWorda(self)
  `Process path word a.`

processPathWordc(self)
  `Process path word C.`

processPathWordh(self)
  `Process path word h.`

processPathWordl(self)
  `Process path word l.`

processPathWordm(self)
  `Process path word m.`

processPathWordq(self)
  `Process path word q.`

processPathWords(self)
  `Process path word s.`

processPathWordt(self)
  `Process path word t.`

processPathWordv(self)
  `Process path word v.`

processPathWordz(self)
  `Process path word z.`

class SVGReader
`` | `An svg carving. `

Methods defined here:

__init__(self)
  `Add empty lists.`

flipDirectLayer(self, loopLayer)
  `Flip the y coordinate of the layer and direct the loops.`

getLoopLayer(self)
  `Return the rotated loop layer.`

parseSVG(self, fileName, svgText)
  `Parse SVG text and store the layers.`

parseSVGByElementNode(self, elementNode)
  `Parse SVG by elementNode.`

processElementNode(self, elementNode)
  `Process the xml element.`

Functions

``

addFunctionsToDictionary(dictionary, functions, prefix)
  `Add functions to dictionary.`

getArcComplexes(begin, end, largeArcFlag, radius, sweepFlag, xAxisRotation)
  `Get the arc complexes, procedure at http://www.w3.org/TR/SVG/implnote.html#ArcImplementationNotes`

getChainMatrixSVG(elementNode, matrixSVG)
  `Get chain matrixSVG by svgElement.`

getChainMatrixSVGIfNecessary(elementNode, yAxisPointingUpward)
  `Get chain matrixSVG by svgElement and yAxisPointingUpward.`

getCubicPoint(along, begin, controlPoints, end)
  `Get the cubic point.`

getCubicPoints(begin, controlPoints, end, numberOfBezierPoints=22)
  `Get the cubic points.`

getFontReader(fontFamily)
  `Get the font reader for the fontFamily.`

getFontsDirectoryPath()
  `Get the fonts directory path.`

getLabelString(dictionary)
  `Get the label string for the dictionary.`

getMatrixSVG(elementNode)
  `Get matrixSVG by svgElement.`

getQuadraticPoint(along, begin, controlPoint, end)
  `Get the quadratic point.`

getQuadraticPoints(begin, controlPoint, end, numberOfBezierPoints=22)
  `Get the quadratic points.`

getRightStripAlphabetPercent(word)
  `Get word with alphabet characters and the percent sign stripped from the right.`

getRightStripMinusSplit(lineString)
  `Get string with spaces after the minus sign stripped.`

getStrokeRadius(elementNode)
  `Get the stroke radius.`

getStyleValue(defaultValue, elementNode, key)
  `Get the stroke value string.`

getTextComplexLoops(fontFamily, fontSize, text, yAxisPointingUpward=True)
  `Get text as complex loops.`

getTransformedFillOutline(elementNode, loop, yAxisPointingUpward)
  `Get the loops if fill is on, otherwise get the outlines.`

getTransformedOutlineByPath(elementNode, path, yAxisPointingUpward)
  `Get the outline from the path.`

getTransformedOutlineByPaths(elementNode, paths, yAxisPointingUpward)
  `Get the outline from the paths.`

getTricomplexTimesColumn(firstTricomplex, otherColumn)
  `Get this matrix multiplied by the otherColumn.`

getTricomplexTimesOther(firstTricomplex, otherTricomplex)
  `Get the first tricomplex multiplied by the other tricomplex.`

getTricomplexmatrix(transformWords)
  `Get matrixSVG by transformWords.`

getTricomplexrotate(transformWords)
  `Get matrixSVG by transformWords.`

getTricomplexscale(transformWords)
  `Get matrixSVG by transformWords.`

getTricomplexskewX(transformWords)
  `Get matrixSVG by transformWords.`

getTricomplexskewY(transformWords)
  `Get matrixSVG by transformWords.`

getTricomplextranslate(transformWords)
  `Get matrixSVG by transformWords.`

processSVGElementcircle(elementNode, svgReader)
  `Process elementNode by svgReader.`

processSVGElementellipse(elementNode, svgReader)
  `Process elementNode by svgReader.`

processSVGElementg(elementNode, svgReader)
  `Process elementNode by svgReader.`

processSVGElementline(elementNode, svgReader)
  `Process elementNode by svgReader.`

processSVGElementpath(elementNode, svgReader)
  `Process elementNode by svgReader.`

processSVGElementpolygon(elementNode, svgReader)
  `Process elementNode by svgReader.`

processSVGElementpolyline(elementNode, svgReader)
  `Process elementNode by svgReader.`

processSVGElementrect(elementNode, svgReader)
  `Process elementNode by svgReader.`

processSVGElementtext(elementNode, svgReader)
  `Process elementNode by svgReader.`

Data

``

__author__ = 'Enrique Perez (perez_enrique@yahoo.com)'
__credits__ = 'Nophead <http://hydraraptor.blogspot.com/>\nArt of Illusion <http://www.artofillusion.org/>'
__date__ = '$Date: 2008/21/04 $'
__license__ = 'GNU Affero General Public License http://www.gnu.org/licenses/agpl.html'
absolute_import = _Feature((2, 5, 0, 'alpha', 1), (2, 7, 0, 'alpha', 0), 16384)
globalFontFileNames = None
globalFontReaderDictionary = {}
globalGetTricomplexDictionary = {'matrix': <function getTricomplexmatrix>, 'rotate': <function getTricomplexrotate>, 'scale': <function getTricomplexscale>, 'skewX': <function getTricomplexskewX>, 'skewY': <function getTricomplexskewY>, 'translate': <function getTricomplextranslate>}
globalGetTricomplexFunctions = [<function getTricomplexmatrix>, <function getTricomplexrotate>, <function getTricomplexscale>, <function getTricomplexskewX>, <function getTricomplexskewY>, <function getTricomplextranslate>]
globalNumberOfBezierPoints = 22
globalNumberOfCirclePoints = 44
globalNumberOfCornerPoints = 11
globalProcessPathWordDictionary = {'A': <unbound method PathReader.processPathWordA>, 'C': <unbound method PathReader.processPathWordC>, 'H': <unbound method PathReader.processPathWordH>, 'L': <unbound method PathReader.processPathWordL>, 'M': <unbound method PathReader.processPathWordM>, 'Q': <unbound method PathReader.processPathWordQ>, 'S': <unbound method PathReader.processPathWordS>, 'T': <unbound method PathReader.processPathWordT>, 'V': <unbound method PathReader.processPathWordV>, 'Z': <unbound method PathReader.processPathWordZ>, ...}
globalProcessPathWordFunctions = [<unbound method PathReader.processPathWordA>, <unbound method PathReader.processPathWorda>, <unbound method PathReader.processPathWordC>, <unbound method PathReader.processPathWordc>, <unbound method PathReader.processPathWordH>, <unbound method PathReader.processPathWordh>, <unbound method PathReader.processPathWordL>, <unbound method PathReader.processPathWordl>, <unbound method PathReader.processPathWordM>, <unbound method PathReader.processPathWordm>, <unbound method PathReader.processPathWordQ>, <unbound method PathReader.processPathWordq>, <unbound method PathReader.processPathWordS>, <unbound method PathReader.processPathWords>, <unbound method PathReader.processPathWordT>, <unbound method PathReader.processPathWordt>, <unbound method PathReader.processPathWordV>, <unbound method PathReader.processPathWordv>, <unbound method PathReader.processPathWordZ>, <unbound method PathReader.processPathWordz>]
globalProcessSVGElementDictionary = {'circle': <function processSVGElementcircle>, 'ellipse': <function processSVGElementellipse>, 'g': <function processSVGElementg>, 'line': <function processSVGElementline>, 'path': <function processSVGElementpath>, 'polygon': <function processSVGElementpolygon>, 'polyline': <function processSVGElementpolyline>, 'rect': <function processSVGElementrect>, 'text': <function processSVGElementtext>}
globalProcessSVGElementFunctions = [<function processSVGElementcircle>, <function processSVGElementellipse>, <function processSVGElementg>, <function processSVGElementline>, <function processSVGElementpath>, <function processSVGElementpolygon>, <function processSVGElementpolyline>, <function processSVGElementrect>, <function processSVGElementtext>]
globalSideAngle = 0.14279966607226333

Author
`` |  | Enrique Perez (perez_enrique@yahoo.com)

Credits
`` |  | Nophead <http://hydraraptor.blogspot.com/> Art of Illusion <http://www.artofillusion.org/>