# Python: module skeinforge_tools.analyze_plugins.skeinview

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

`Skeinview is a script to display each layer of a gcode file.
The default 'Activate Skeinview' 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 Skeinview' checkbox is on, when skeinview is run directly. Skeinview has trouble separating the layers
when it reads gcode without comments.
If "Draw Arrows" is selected, arrows will be drawn at the end of each line segment, the default is on. If "Go Around Extruder
Off Travel" is selected, the display will include the travel when the extruder is off, which means it will include the nozzle wipe
path if any. The "Pixels over Extrusion Width" preference is the scale of the image, the higher the number, the greater the
size of the display. The "Screen Horizontal Inset" determines how much the display will be inset in the horizontal direction
from the edge of screen, the higher the number the more it will be inset and the smaller it will be, the default is one hundred.
The "Screen Vertical Inset" determines how much the display will be inset in the vertical direction from the edge of screen,
the default is fifty.
On the skeinview display window, the up button increases the layer index shown by one, and the down button decreases the
layer index by one. When the index displayed in the index field is changed then "<return>" is hit, the layer index shown will
be set to the index field, to a mimimum of zero and to a maximum of the highest index layer.
To run skeinview, in a shell in the folder which skeinview is in type:
> python skeinview.py
An explanation of the gcodes is at:
http://reprap.org/bin/view/Main/Arduino_GCode_Interpreter
and at:
http://reprap.org/bin/view/Main/MCodeReference
A gode example is at:
http://forums.reprap.org/file.php?12,file=565
This example displays a skein view for the gcode file Screw Holder.gcode. This example is run in a terminal in the folder which
contains Screw Holder.gcode and skeinview.py.
> python skeinview.py
This brings up the skeinview dialog.
> python skeinview.py Screw Holder.gcode
This brings up a skein window to view each layer of a gcode file.
> 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 skeinview
>>> skeinview.main()
This brings up the skeinview dialog.
>>> skeinview.skeinviewFile()
This brings up a skein window to view each layer of a gcode file.`

Modules

``

__init__ cStringIO | skeinforge_tools.skeinforge_utilities.euclidean skeinforge_tools.skeinforge_utilities.gcodec | skeinforge_tools.polyfile skeinforge_tools.skeinforge_utilities.preferences | sys

Classes

``

ColoredLine
SkeinWindow
SkeinviewPreferences
SkeinviewSkein

class ColoredLine
`` | `A colored line.`

Methods defined here:

__init__(self, colorName, complexBegin, complexEnd, line, lineIndex, width)
  `Set the color name and corners.`

__repr__(self)
  `Get the string representation of this colored line.`

class SkeinWindow

``

Methods defined here:

__init__(self, arrowType, screenHorizontalInset, screenVerticalInset, size, skeinPanes)

buttonOneClicked(self, event)

down(self)

indexEntryReturnPressed(self, event)

up(self)

update(self)

class SkeinviewPreferences
`` | `A class to handle the skeinview preferences.`

Methods defined here:

__init__(self)
  `Set the default preferences, execute title & preferences fileName.`

execute(self)
  `Write button has been clicked.`

class SkeinviewSkein
`` | `A class to write a get a scalable vector graphics text for a gcode skein.`

Methods defined here:

__init__(self)

addToPath(self, line, location)
  `Add a point to travel and maybe extrusion.`

initializeActiveLocation(self)
  `Set variables to default.`

isLayerStart(self, firstWord, splitLine)
  `Parse a gcode line and add it to the vector output.`

linearCorner(self, splitLine)
  `Update the bounding corners.`

linearMove(self, line, splitLine)
  `Get statistics for a linear move.`

parseCorner(self, line)
  `Parse a gcode line and use the location to update the bounding corners.`

parseGcode(self, gcodeText, skeinviewPreferences)
  `Parse gcode text and store the vector output.`

parseLine(self, line)
  `Parse a gcode line and add it to the vector output.`

Functions

``

displaySkeinviewFileGivenText(gcodeText, skeinviewPreferences=None)
  `Display a skeinviewed gcode file for a gcode file.`

main()
  `Display the skeinview dialog.`

skeinviewFile(fileName='')
  `Skeinview a gcode file. If no fileName is specified, skeinview the first gcode file in this folder that is not modified.`

writeOutput(fileName, gcodeText='')
  `Write a skeinviewed gcode file for a skeinforge gcode file, if 'Activate Skeinview' is selected.`

Data
`` |  | __author__ = 'Enrique Perez (perez_enrique@yahoo.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)