271 lines
19 KiB
HTML
271 lines
19 KiB
HTML
|
|
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
|
|
<html><head><title>Python: module skeinforge_application.skeinforge_plugins.craft_plugins.export</title>
|
|
</head><body bgcolor="#f0f0f8">
|
|
|
|
<table width="100%" cellspacing=0 cellpadding=2 border=0 summary="heading">
|
|
<tr bgcolor="#7799ee">
|
|
<td valign=bottom> <br>
|
|
<font color="#ffffff" face="helvetica, arial"> <br><big><big><strong><a href="skeinforge_application.html"><font color="#ffffff">skeinforge_application</font></a>.<a href="skeinforge_application.skeinforge_plugins.html"><font color="#ffffff">skeinforge_plugins</font></a>.<a href="skeinforge_application.skeinforge_plugins.craft_plugins.html"><font color="#ffffff">craft_plugins</font></a>.export</strong></big></big> ($Date: 2008/21/04 $)</font></td
|
|
><td align=right valign=bottom
|
|
><font color="#ffffff" face="helvetica, arial"><a href=".">index</a><br><a href="file:/home/enrique/Desktop/backup/babbleold/script/reprap/fabmetheus/skeinforge_application/skeinforge_plugins/craft_plugins/export.py">/home/enrique/Desktop/backup/babbleold/script/reprap/fabmetheus/skeinforge_application/skeinforge_plugins/craft_plugins/export.py</a></font></td></tr></table>
|
|
<p>
|
|
<a href="skeinforge_application.skeinforge_plugins.craft_plugins.dwindle.html">Previous</a> / <a href="skeinforge_application.skeinforge_plugins.craft_plugins.export_plugins.binary_16_byte.html">Next</a> / <a href="contents.html">Contents</a>
|
|
</p>
|
|
<p><tt><br>
|
|
Export is a craft tool to pick an export plugin, add information to the file name, and delete comments.<br>
|
|
<br>
|
|
The export manual page is at:<br>
|
|
<a href="http://fabmetheus.crsndoo.com/wiki/index.php/Skeinforge_Export">http://fabmetheus.crsndoo.com/wiki/index.php/Skeinforge_Export</a><br>
|
|
<br>
|
|
<br />
|
|
<a href="#Operation">Operation</a><br />
|
|
<a href="#Settings">Settings</a><br />
|
|
<a href="#Add Descriptive Extension">Add Descriptive Extension</a><br />
|
|
<a href="#Add Profile Extension">Add Profile Extension</a><br />
|
|
<a href="#Add Timestamp Extension">Add Timestamp Extension</a><br />
|
|
<a href="#Also Send Output To">Also Send Output To</a><br />
|
|
<a href="#Analyze Gcode">Analyze Gcode</a><br />
|
|
<a href="#Comment Choice">Comment Choice</a><br />
|
|
<a href="#Do Not Delete Comments">Do Not Delete Comments</a><br />
|
|
<a href="#Delete Crafting Comments">Delete Crafting Comments</a><br />
|
|
<a href="#Delete All Comments">Delete All Comments</a><br />
|
|
<a href="#Export Operations">Export Operations</a><br />
|
|
<a href="#File Extension">File Extension</a><br />
|
|
<a href="#Name of Replace File">Name of Replace File</a><br />
|
|
<a href="#Save Penultimate Gcode">Save Penultimate Gcode</a><br />
|
|
<a href="#Examples">Examples</a><br />
|
|
<br />
|
|
<a name="Operation" id="Operation"></a><h2>Operation</h2>
|
|
<hr>
|
|
|
|
The default 'Activate Export' checkbox is on. When it is on, the functions described below will work, when it is off, the functions will not be called.<br>
|
|
<br>
|
|
<a name="Settings" id="Settings"></a><h2>Settings</h2>
|
|
<hr>
|
|
|
|
<a name="Add Descriptive Extension" id="Add Descriptive Extension"></a><h3>Add Descriptive Extension</h3>
|
|
|
|
Default is off.<br>
|
|
<br>
|
|
When selected, key profile values will be added as an extension to the gcode file. For example:<br>
|
|
test.04hx06w_03fill_2cx2r_33EL.gcode<br>
|
|
<br>
|
|
would mean:<br>
|
|
<br>
|
|
* . (Carve section.)<br>
|
|
* 04h = 'Layer Height (mm):' 0.4<br>
|
|
* x<br>
|
|
* 06w = 0.6 width i.e. 0.4 times 'Edge Width over Height (ratio):' 1.5<br>
|
|
* _ (Fill section.)<br>
|
|
* 03fill = 'Infill Solidity (ratio):' 0.3<br>
|
|
* _ (Multiply section; if there is one column and one row then this section is not shown.)<br>
|
|
* 2c = 'Number of Columns (integer):' 2<br>
|
|
* x<br>
|
|
* 2r = 'Number of Rows (integer):' 2.<br>
|
|
* _ (Speed section.)<br>
|
|
* 33EL = 'Feed Rate (mm/s):' 33.0 and 'Flow Rate Setting (float):' 33.0. If either value has a positive value after the decimal place then this is also shown, but if it is zero it is hidden. Also, if the values differ (which they shouldn't with 5D volumetrics) then each should be displayed separately. For example, 35.2E30L = 'Feed Rate (mm/s):' 35.2 and 'Flow Rate Setting (float):' 30.0.<br>
|
|
<br>
|
|
<a name="Add Profile Extension" id="Add Profile Extension"></a><h3>Add Profile Extension</h3>
|
|
|
|
Default is off.<br>
|
|
<br>
|
|
When selected, the current profile will be added to the file extension. For example:<br>
|
|
test.my_profile_name.gcode<br>
|
|
<br>
|
|
<a name="Add Timestamp Extension" id="Add Timestamp Extension"></a><h3>Add Timestamp Extension</h3>
|
|
|
|
Default is off.<br>
|
|
<br>
|
|
When selected, the current date and time is added as an extension in format YYYYmmdd_HHMMSS (so it is sortable if one has many files). For example:<br>
|
|
test.my_profile_name.20110613_220113.gcode<br>
|
|
<br>
|
|
<a name="Also Send Output To" id="Also Send Output To"></a><h3>Also Send Output To</h3>
|
|
|
|
Default is empty.<br>
|
|
<br>
|
|
Defines the output name for sending to a file or pipe. A common choice is stdout to print the output in the shell screen. Another common choice is stderr. With the empty default, nothing will be done. If the value is anything else, the output will be written to that file name.<br>
|
|
<br>
|
|
<a name="Analyze Gcode" id="Analyze Gcode"></a><h3>Analyze Gcode</h3>
|
|
|
|
Default is on.<br>
|
|
<br>
|
|
When selected, the penultimate gcode will be sent to the analyze plugins to be analyzed and viewed.<br>
|
|
<br>
|
|
<a name="Comment Choice" id="Comment Choice"></a><h3>Comment Choice</h3>
|
|
|
|
Default is 'Delete All Comments'.<br>
|
|
<br>
|
|
<a name="Do Not Delete Comments" id="Do Not Delete Comments"></a><h4>Do Not Delete Comments</h4>
|
|
|
|
When selected, export will not delete comments. Crafting comments slow down the processing in many firmware types, which leads to pauses and therefore a lower quality print.<br>
|
|
<br>
|
|
<a name="Delete Crafting Comments" id="Delete Crafting Comments"></a><h4>Delete Crafting Comments</h4>
|
|
|
|
When selected, export will delete the time consuming crafting comments, but leave the initialization comments. Since the crafting comments are deleted, there are no pauses during extrusion. The remaining initialization comments provide some useful information for the analyze tools.<br>
|
|
<br>
|
|
<a name="Delete All Comments" id="Delete All Comments"></a><h4>Delete All Comments</h4>
|
|
|
|
When selected, export will delete all comments. The comments are not necessary to run a fabricator. Some printers do not support comments at all so the safest way is choose this option.<br>
|
|
<br>
|
|
<a name="Export Operations" id="Export Operations"></a><h3>Export Operations</h3>
|
|
|
|
Export presents the user with a choice of the export plugins in the export_plugins folder. The chosen plugin will then modify the gcode or translate it into another format. There is also the "Do Not Change Output" choice, which will not change the output. An export plugin is a script in the export_plugins folder which has the getOutput function, the globalIsReplaceable variable and if it's output is not replaceable, the writeOutput function.<br>
|
|
<br>
|
|
<a name="File Extension" id="File Extension"></a><h3>File Extension</h3>
|
|
|
|
Default is gcode.<br>
|
|
<br>
|
|
Defines the file extension added to the name of the output file. The output file will be named as originalname_export.extension so if you are processing XYZ.stl the output will by default be XYZ_export.gcode<br>
|
|
<br>
|
|
<a name="Name of Replace File" id="Name of Replace File"></a><h3>Name of Replace File</h3>
|
|
|
|
Default is replace.csv.<br>
|
|
<br>
|
|
When export is exporting the code, if there is a tab separated file with the name of the "Name of Replace File" setting, it will replace the string in the first column by its replacement in the second column. If there is nothing in the second column, the first column string will be deleted, if this leads to an empty line, the line will be deleted. If there are replacement columns after the second, they will be added as extra lines of text. There is an example file replace_example.csv to demonstrate the tab separated format, which can be edited in a text editor or a spreadsheet.<br>
|
|
<br>
|
|
Export looks for the alteration file in the alterations folder in the .skeinforge folder in the home directory. Export does not care if the text file names are capitalized, but some file systems do not handle file name cases properly, so to be on the safe side you should give them lower case names. If it doesn't find the file it then looks in the alterations folder in the skeinforge_plugins folder.<br>
|
|
<br>
|
|
<a name="Save Penultimate Gcode" id="Save Penultimate Gcode"></a><h3>Save Penultimate Gcode</h3>
|
|
|
|
Default is off.<br>
|
|
<br>
|
|
When selected, export will save the gcode file with the suffix '_penultimate.gcode' just before it is exported. This is useful because the code after it is exported could be in a form which the viewers can not display well.<br>
|
|
<br>
|
|
<a name="Examples" id="Examples"></a><h2>Examples</h2>
|
|
<hr>
|
|
|
|
The following examples export the file Screw Holder Bottom.stl. The examples are run in a terminal in the folder which contains Screw Holder Bottom.stl and export.py.<br>
|
|
<br>
|
|
> python export.py<br>
|
|
This brings up the export dialog.<br>
|
|
<br>
|
|
> python export.py Screw Holder Bottom.stl<br>
|
|
The export tool is parsing the file:<br>
|
|
Screw Holder Bottom.stl<br>
|
|
..<br>
|
|
The export tool has created the file:<br>
|
|
.. Screw Holder Bottom_export.gcode</tt>
|
|
<br />
|
|
<br />
|
|
<p>
|
|
<a href="skeinforge_application.skeinforge_plugins.craft_plugins.dwindle.html">Previous</a> / <a href="skeinforge_application.skeinforge_plugins.craft_plugins.export_plugins.binary_16_byte.html">Next</a> / <a href="contents.html">Contents</a>
|
|
</p>
|
|
<hr>
|
|
</p>
|
|
<p>
|
|
<table width="100%" cellspacing=0 cellpadding=2 border=0 summary="section">
|
|
<tr bgcolor="#aa55cc">
|
|
<td colspan=3 valign=bottom> <br>
|
|
<font color="#ffffff" face="helvetica, arial"><big><strong>Modules</strong></big></font></td></tr>
|
|
|
|
<tr><td bgcolor="#aa55cc"><tt> </tt></td><td> </td>
|
|
<td width="100%"><table width="100%" summary="list"><tr><td width="25%" valign=top><a href="__init__.html">__init__</a><br>
|
|
<a href="fabmetheus_utilities.archive.html">fabmetheus_utilities.archive</a><br>
|
|
<a href="cStringIO.html">cStringIO</a><br>
|
|
<a href="fabmetheus_utilities.euclidean.html">fabmetheus_utilities.euclidean</a><br>
|
|
</td><td width="25%" valign=top><a href="fabmetheus_utilities.fabmetheus_tools.fabmetheus_interpret.html">fabmetheus_utilities.fabmetheus_tools.fabmetheus_interpret</a><br>
|
|
<a href="fabmetheus_utilities.gcodec.html">fabmetheus_utilities.gcodec</a><br>
|
|
<a href="fabmetheus_utilities.intercircle.html">fabmetheus_utilities.intercircle</a><br>
|
|
<a href="os.html">os</a><br>
|
|
</td><td width="25%" valign=top><a href="fabmetheus_utilities.settings.html">fabmetheus_utilities.settings</a><br>
|
|
<a href="skeinforge_application.skeinforge_utilities.skeinforge_analyze.html">skeinforge_application.skeinforge_utilities.skeinforge_analyze</a><br>
|
|
<a href="skeinforge_application.skeinforge_utilities.skeinforge_craft.html">skeinforge_application.skeinforge_utilities.skeinforge_craft</a><br>
|
|
<a href="skeinforge_application.skeinforge_utilities.skeinforge_polyfile.html">skeinforge_application.skeinforge_utilities.skeinforge_polyfile</a><br>
|
|
</td><td width="25%" valign=top><a href="skeinforge_application.skeinforge_utilities.skeinforge_profile.html">skeinforge_application.skeinforge_utilities.skeinforge_profile</a><br>
|
|
<a href="sys.html">sys</a><br>
|
|
<a href="time.html">time</a><br>
|
|
</td></tr></table></td></tr></table><p>
|
|
<table width="100%" cellspacing=0 cellpadding=2 border=0 summary="section">
|
|
<tr bgcolor="#ee77aa">
|
|
<td colspan=3 valign=bottom> <br>
|
|
<font color="#ffffff" face="helvetica, arial"><big><strong>Classes</strong></big></font></td></tr>
|
|
|
|
<tr><td bgcolor="#ee77aa"><tt> </tt></td><td> </td>
|
|
<td width="100%"><dl>
|
|
<dt><font face="helvetica, arial"><a href="skeinforge_application.skeinforge_plugins.craft_plugins.export.html#ExportRepository">ExportRepository</a>
|
|
</font></dt><dt><font face="helvetica, arial"><a href="skeinforge_application.skeinforge_plugins.craft_plugins.export.html#ExportSkein">ExportSkein</a>
|
|
</font></dt></dl>
|
|
<p>
|
|
<table width="100%" cellspacing=0 cellpadding=2 border=0 summary="section">
|
|
<tr bgcolor="#ffc8d8">
|
|
<td colspan=3 valign=bottom> <br>
|
|
<font color="#000000" face="helvetica, arial"><a name="ExportRepository">class <strong>ExportRepository</strong></a></font></td></tr>
|
|
|
|
<tr bgcolor="#ffc8d8"><td rowspan=2><tt> </tt></td>
|
|
<td colspan=2><tt>A class to handle the export settings.<br> </tt></td></tr>
|
|
<tr><td> </td>
|
|
<td width="100%">Methods defined here:<br>
|
|
<dl><dt><a name="ExportRepository-__init__"><strong>__init__</strong></a>(self)</dt><dd><tt>Set the default settings, execute title & settings fileName.</tt></dd></dl>
|
|
|
|
<dl><dt><a name="ExportRepository-execute"><strong>execute</strong></a>(self)</dt><dd><tt>Export button has been clicked.</tt></dd></dl>
|
|
|
|
</td></tr></table> <p>
|
|
<table width="100%" cellspacing=0 cellpadding=2 border=0 summary="section">
|
|
<tr bgcolor="#ffc8d8">
|
|
<td colspan=3 valign=bottom> <br>
|
|
<font color="#000000" face="helvetica, arial"><a name="ExportSkein">class <strong>ExportSkein</strong></a></font></td></tr>
|
|
|
|
<tr bgcolor="#ffc8d8"><td rowspan=2><tt> </tt></td>
|
|
<td colspan=2><tt>A class to export a skein of extrusions.<br> </tt></td></tr>
|
|
<tr><td> </td>
|
|
<td width="100%">Methods defined here:<br>
|
|
<dl><dt><a name="ExportSkein-__init__"><strong>__init__</strong></a>(self)</dt></dl>
|
|
|
|
<dl><dt><a name="ExportSkein-addLine"><strong>addLine</strong></a>(self, line)</dt><dd><tt>Add a line of text and a newline to the output.</tt></dd></dl>
|
|
|
|
<dl><dt><a name="ExportSkein-getCraftedGcode"><strong>getCraftedGcode</strong></a>(self, repository, gcodeText)</dt><dd><tt>Parse gcode text and store the export gcode.</tt></dd></dl>
|
|
|
|
<dl><dt><a name="ExportSkein-getLineWithTruncatedNumber"><strong>getLineWithTruncatedNumber</strong></a>(self, character, line, splitLine)</dt><dd><tt>Get a line with the number after the character truncated.</tt></dd></dl>
|
|
|
|
<dl><dt><a name="ExportSkein-parseLine"><strong>parseLine</strong></a>(self, line)</dt><dd><tt>Parse a gcode line.</tt></dd></dl>
|
|
|
|
</td></tr></table></td></tr></table><p>
|
|
<table width="100%" cellspacing=0 cellpadding=2 border=0 summary="section">
|
|
<tr bgcolor="#eeaa77">
|
|
<td colspan=3 valign=bottom> <br>
|
|
<font color="#ffffff" face="helvetica, arial"><big><strong>Functions</strong></big></font></td></tr>
|
|
|
|
<tr><td bgcolor="#eeaa77"><tt> </tt></td><td> </td>
|
|
<td width="100%"><dl><dt><a name="-getCraftedTextFromText"><strong>getCraftedTextFromText</strong></a>(gcodeText, repository<font color="#909090">=None</font>)</dt><dd><tt>Export a gcode linear move text.</tt></dd></dl>
|
|
<dl><dt><a name="-getDescriptionCarve"><strong>getDescriptionCarve</strong></a>(lines)</dt><dd><tt>Get the description for carve.</tt></dd></dl>
|
|
<dl><dt><a name="-getDescriptionFill"><strong>getDescriptionFill</strong></a>(lines)</dt><dd><tt>Get the description for fill.</tt></dd></dl>
|
|
<dl><dt><a name="-getDescriptionMultiply"><strong>getDescriptionMultiply</strong></a>(lines)</dt><dd><tt>Get the description for multiply.</tt></dd></dl>
|
|
<dl><dt><a name="-getDescriptionSpeed"><strong>getDescriptionSpeed</strong></a>(lines)</dt><dd><tt>Get the description for speed.</tt></dd></dl>
|
|
<dl><dt><a name="-getDescriptiveExtension"><strong>getDescriptiveExtension</strong></a>(gcodeText)</dt><dd><tt>Get the descriptive extension.</tt></dd></dl>
|
|
<dl><dt><a name="-getDistanceGcode"><strong>getDistanceGcode</strong></a>(exportText)</dt><dd><tt>Get gcode lines with distance variable added, this is for if ever there is distance code.</tt></dd></dl>
|
|
<dl><dt><a name="-getFirstValue"><strong>getFirstValue</strong></a>(gcodeText, word)</dt><dd><tt>Get the value from the first line which starts with the given word.</tt></dd></dl>
|
|
<dl><dt><a name="-getNewRepository"><strong>getNewRepository</strong></a>()</dt><dd><tt>Get new repository.</tt></dd></dl>
|
|
<dl><dt><a name="-getReplaceableExportGcode"><strong>getReplaceableExportGcode</strong></a>(nameOfReplaceFile, replaceableExportGcode)</dt><dd><tt>Get text with strings replaced according to replace.csv file.</tt></dd></dl>
|
|
<dl><dt><a name="-getSelectedPluginModule"><strong>getSelectedPluginModule</strong></a>(plugins)</dt><dd><tt>Get the selected plugin module.</tt></dd></dl>
|
|
<dl><dt><a name="-getSettingString"><strong>getSettingString</strong></a>(lines, procedureName, settingNameStart)</dt><dd><tt>Get the setting value from the lines, return None if there is no setting starting with that name.</tt></dd></dl>
|
|
<dl><dt><a name="-main"><strong>main</strong></a>()</dt><dd><tt>Display the export dialog.</tt></dd></dl>
|
|
<dl><dt><a name="-sendOutputTo"><strong>sendOutputTo</strong></a>(outputTo, text)</dt><dd><tt>Send output to a file or a standard output.</tt></dd></dl>
|
|
<dl><dt><a name="-writeOutput"><strong>writeOutput</strong></a>(fileName, shouldAnalyze<font color="#909090">=True</font>)</dt><dd><tt>Export a gcode linear move file.</tt></dd></dl>
|
|
</td></tr></table><p>
|
|
<table width="100%" cellspacing=0 cellpadding=2 border=0 summary="section">
|
|
<tr bgcolor="#55aa55">
|
|
<td colspan=3 valign=bottom> <br>
|
|
<font color="#ffffff" face="helvetica, arial"><big><strong>Data</strong></big></font></td></tr>
|
|
|
|
<tr><td bgcolor="#55aa55"><tt> </tt></td><td> </td>
|
|
<td width="100%"><strong>__author__</strong> = 'Enrique Perez (perez_enrique@yahoo.com)'<br>
|
|
<strong>__credits__</strong> = 'Gary Hodgson <http://garyhodgson.com/reprap/2011/06/hacking-skeinforge-export-module/>'<br>
|
|
<strong>__date__</strong> = '$Date: 2008/21/04 $'<br>
|
|
<strong>__license__</strong> = 'GNU Affero General Public License http://www.gnu.org/licenses/agpl.html'<br>
|
|
<strong>absolute_import</strong> = _Feature((2, 5, 0, 'alpha', 1), (2, 7, 0, 'alpha', 0), 16384)</td></tr></table><p>
|
|
<table width="100%" cellspacing=0 cellpadding=2 border=0 summary="section">
|
|
<tr bgcolor="#7799ee">
|
|
<td colspan=3 valign=bottom> <br>
|
|
<font color="#ffffff" face="helvetica, arial"><big><strong>Author</strong></big></font></td></tr>
|
|
|
|
<tr><td bgcolor="#7799ee"><tt> </tt></td><td> </td>
|
|
<td width="100%">Enrique Perez (perez_enrique@yahoo.com)</td></tr></table><p>
|
|
<table width="100%" cellspacing=0 cellpadding=2 border=0 summary="section">
|
|
<tr bgcolor="#7799ee">
|
|
<td colspan=3 valign=bottom> <br>
|
|
<font color="#ffffff" face="helvetica, arial"><big><strong>Credits</strong></big></font></td></tr>
|
|
|
|
<tr><td bgcolor="#7799ee"><tt> </tt></td><td> </td>
|
|
<td width="100%">Gary Hodgson <<a href="http://garyhodgson.com/reprap/2011/06/hacking-skeinforge-export-module/">http://garyhodgson.com/reprap/2011/06/hacking-skeinforge-export-module/</a>></td></tr></table>
|
|
</body></html> |