skeinforge_tools.analyze_plugins.vectorwrite ($Date: 2008/21/04 $)
index
/home/enrique/Desktop/backup/babbleold/script/reprap/pyRepRap/skeinforge_tools/analyze_plugins/vectorwrite.py

Vectorwrite is a script to write Scalable Vector Graphics for a gcode file.

The default 'Activate Vectorwrite' checkbox is on. When it is on, the functions described below will work when called from the skeinforge toolchain, when it is off, the functions will not be called from the toolchain. The functions will still be called, whether or not the 'Activate Vectorwrite' checkbox is on, when vectorwrite is run directly.

The "Layer From" is the index of the bottom layer that will be displayed. If the layer from is the default zero, the display will start from the lowest layer. If the the layer from index is negative, then the display will start from the layer from index below the top layer. The "Layer To" is the index of the top layer that will be displayed. If the layer to index is a huge number like the default 999999999, the display will go to the top of the model, at least until we model habitats:) If the layer to index is negative, then the display will go to the layer to index below the top layer. The layer from until layer to index is a python slice.

To run vectorwrite, in a shell in the folder which vectorwrite is in type:
> python vectorwrite.py

The Scalable Vector Graphics file can be opened by an SVG viewer or an SVG capable browser like Mozilla:
http://www.mozilla.com/firefox/

This example writes vector graphics for the gcode file Screw Holder.gcode. This example is run in a terminal in the folder which contains Screw Holder.gcode and vectorwrite.py.


> python vectorwrite.py
This brings up the vectorwrite dialog.


> python vectorwrite.py Screw Holder.gcode
The vectorwrite file is saved as Screw_Holder_vectorwrite.svg


> python
Python 2.5.1 (r251:54863, Sep 22 2007, 01:43:31)
[GCC 4.2.1 (SUSE Linux)] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> import vectorwrite
>>> vectorwrite.main()
This brings up the vectorwrite dialog.

 
Modules
       
__init__
cStringIO
skeinforge_tools.skeinforge_utilities.euclidean
skeinforge_tools.skeinforge_utilities.gcodec
os
skeinforge_tools.meta_plugins.polyfile
skeinforge_tools.skeinforge_utilities.preferences
skeinforge_tools.skeinforge_utilities.svg_codec
sys
time

 
Classes
       
VectorwritePreferences
skeinforge_tools.skeinforge_utilities.svg_codec.SVGCodecSkein
VectorwriteSkein

 
class VectorwritePreferences
    A class to handle the vectorwrite preferences.
 
  Methods defined here:
__init__(self)
Set the default preferences, execute title & preferences fileName.
execute(self)
Write button has been clicked.

 
class VectorwriteSkein(skeinforge_tools.skeinforge_utilities.svg_codec.SVGCodecSkein)
    A class to vectorwrite a carving.
 
  Methods defined here:
addRotatedLoopLayer(self, z)
Add rotated loop layer.
addRotatedLoopLayerToOutput(self, layerIndex, rotatedBoundaryLayer)
Add rotated boundary layer to the output.
addRotatedLoopLayersToOutput(self, rotatedBoundaryLayers)
Add rotated boundary layers to the output.
getSVG(self, fileName, gcodeText, vectorwritePreferences)
Parse gnu triangulated surface text and store the vectorwrite gcode.
linearMove(self, splitLine)
Get statistics for a linear move.
parseInitialization(self)
Parse gcode initialization and store the parameters.
parseLine(self, lineIndex)
Parse a gcode line and add it to the outset skein.

Methods inherited from skeinforge_tools.skeinforge_utilities.svg_codec.SVGCodecSkein:
__init__(self)
addInitializationToOutputSVG(self, procedureName)
Add initialization gcode to the output.
addLayerStart(self, layerIndex, z)
Add the start lines for the layer.
addLine(self, line)
Add a line of text and a newline to the output.
addLines(self, lines)
Add lines of text to the output.
addShutdownToOutput(self)
Add shutdown svg to the output.
getReplacedSVGTemplateLines(self, fileName, rotatedBoundaryLayers)
Get the lines of text from the svg_template.tmpl file.
getRounded(self, number)
Get number rounded to the number of carried decimal places as a string.
getRoundedComplexString(self, point)
Get the rounded complex string.
getSVGLoopString(self, loop)
Get the svg loop string.
getSVGPathString(self, path)
Get the svg path string.

 
Functions
       
getRepositoryConstructor()
Get the repository constructor.
main()
Display the vectorwrite dialog.
writeGivenPreferences(fileName, gcodeText, vectorwritePreferences)
Write scalable vector graphics for a gcode file given the preferences.
writeOutput(fileName, gcodeText='')
Write scalable vector graphics for a skeinforge gcode file, if activate vectorwrite is selected.
writeRegardless(fileName)
Write scalable vector graphics for a gcode file.

 
Data
        __author__ = 'Enrique Perez (perez_enrique@yahoo.com)'
__credits__ = 'Nophead <http://hydraraptor.blogspot.com/>'
__date__ = '$Date: 2008/21/04 $'
__license__ = 'GPL 3.0'
absolute_import = _Feature((2, 5, 0, 'alpha', 1), (2, 7, 0, 'alpha', 0), 16384)

 
Author
        Enrique Perez (perez_enrique@yahoo.com)

 
Credits
        Nophead <http://hydraraptor.blogspot.com/>