# Python: module skeinforge_tools.multiply

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

`Multiply is a script to multiply the shape into an array of copies arranged in a table.
The default 'Activate Multiply' checkbox is on. When it is on, the functions described below will work, when it is off, the
functions will not be called. The multiply script sets the feedrate, and flowrate. To run multiply, in a shell type:
> python multiply.py
The center of the shape will be moved to the "Center X" and "Center Y" coordinates.
The "Number of Columns" preference is the number of columns in the array table. The "Number of Rows" is the number of rows
in the table. The "Separation over Extrusion Width" is the ratio of separation between the shape copies over the extrusion width.
The following examples multiply the files Screw Holder Bottom.gcode & Screw Holder Bottom.stl. The examples are run in a terminal in the
folder which contains Screw Holder Bottom.gcode, Screw Holder Bottom.stl and multiply.py. The multiply function will multiply if "Activate
Multiply" is true, which can be set in the dialog or by changing the preferences file 'multiply.csv' with a text editor or a
spreadsheet program set to separate tabs. The functions writeOutput and getMultiplyChainGcode check to see if the text has
been multiplied, if not they call getFillChainGcode in fill.py to get filled gcode; once they have the filled text, then they multiply.
> python multiply.py
This brings up the dialog, after clicking 'Multiply', the following is printed:
File Screw Holder Bottom.stl is being chain multiplied.
The multiplied file is saved as Screw Holder Bottom_multiply.gcode
>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 multiply
>>> multiply.main()
This brings up the multiply dialog.
>>> multiply.writeOutput()
Screw Holder Bottom.stl
File Screw Holder Bottom.stl is being chain multiplied.
The multiplied file is saved as Screw Holder Bottom_multiply.gcode
>>> multiply.getMultiplyGcode("
( GCode generated by May 8, 2008 carve.py )
( Extruder Initialization )
..
many lines of gcode
..
")
>>> multiply.getMultiplyChainGcode("
( GCode generated by May 8, 2008 carve.py )
( Extruder Initialization )
..
many lines of gcode
..
")`

Modules

``

__init__ skeinforge_tools.analyze cStringIO skeinforge_tools.skeinforge_utilities.euclidean | skeinforge_tools.fill skeinforge_tools.skeinforge_utilities.gcodec skeinforge_tools.skeinforge_utilities.intercircle skeinforge_tools.skeinforge_utilities.interpret | skeinforge_tools.material math skeinforge_tools.polyfile skeinforge_tools.skeinforge_utilities.preferences | sys time

Classes

``

MultiplyPreferences
MultiplySkein

class MultiplyPreferences
`` | `A class to handle the multiply preferences.`

Methods defined here:

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

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

class MultiplySkein
`` | `A class to multiply a skein of extrusions.`

Methods defined here:

__init__(self)

addElement(self, offset)
  `Add moved element to the output.`

addLayer(self)
  `Add multiplied layer to the output.`

addLine(self, line)
  `Add a line of text and a newline to the output.`

getGcodeFromMovementZ(self, point, z)
  `Get a gcode movement.`

getMovedLocationSetOldLocation(self, offset, splitLine)
  `Get the moved location and set the old location.`

getRounded(self, number)
  `Get number rounded to the number of carried decimal places as a string.`

parseGcode(self, gcodeText, multiplyPreferences)
  `Parse gcode text and store the multiply gcode.`

parseInitialization(self)
  `Parse gcode initialization and store the parameters.`

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

setCorners(self)
  `Set maximum and minimum corners and z.`

Functions

``

getMultiplyChainGcode(fileName, gcodeText, multiplyPreferences=None)
  `Multiply a gcode linear move text. Chain multiply the gcode if it is not already multiplied.`

getMultiplyGcode(gcodeText, multiplyPreferences=None)
  `Multiply a gcode linear move text.`

main()
  `Display the multiply dialog.`

writeOutput(fileName='')
  `Multiply a gcode linear move file. Chain multiply the gcode if it is not already multiplied.
  If no fileName is specified, multiply the first unmodified gcode file in this folder.`

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)