/Program_Files/replicatorg-0025/skein_engines/skeinforge-0006/documentation/skeinforge_tools.clip.html
HTML | 178 lines | 156 code | 22 blank | 0 comment | 0 complexity | cfcaad6349fb182001075c3b5d7b883e MD5 | raw file
- <!doctype html PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
- <html><head><title>Python: module skeinforge_tools.clip</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_tools.html"><font color="#ffffff">skeinforge_tools</font></a>.clip</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/pyRepRap/skeinforge_tools/clip.py">/home/enrique/Desktop/backup/babbleold/script/reprap/pyRepRap/skeinforge_tools/clip.py</a></font></td></tr></table>
- <p><tt>Clip is a script to clip loop ends.<br>
- <br>
- The default 'Activate Clip' checkbox is on. When it is on, the functions described below will work, when it is off, the functions<br>
- will not be called.<br>
- <br>
- Clip clips the ends of loops to prevent bumps from forming. The "Clip Over Extrusion Width (ratio)" is the ratio of the amount<br>
- each end of the loop is clipped over the extrusion width. The total gap will therefore be twice the clip. If the ratio is too high<br>
- loops will have a gap, if the ratio is too low there will be a bulge at the loop ends. To run clip, in a shell type:<br>
- > python clip.py<br>
- <br>
- The following examples clip the files Screw Holder Bottom.gcode & Screw Holder Bottom.stl. The examples are run in a terminal in the<br>
- folder which contains Screw Holder Bottom.gcode, Screw Holder Bottom.stl and clip.py. The clip function will clip if 'Activate Clip' is true,<br>
- which can be set in the dialog or by changing the preferences file 'clip.csv' in the '.skeinforge' folder in your home directory<br>
- with a text editor or a spreadsheet program set to separate tabs. The functions writeOutput and getClipChainGcode check<br>
- to see if the text has been clipped, if not they call getCombChainGcode in comb.py to comb the text; once they have the<br>
- combed text, then they clip.<br>
- <br>
- <br>
- > python clip.py<br>
- This brings up the dialog, after clicking 'Clip', the following is printed:<br>
- File Screw Holder Bottom.stl is being chain clipped.<br>
- The clipped file is saved as Screw Holder Bottom_clip.gcode<br>
- <br>
- <br>
- > python clip.py Screw Holder Bottom.stl<br>
- File Screw Holder Bottom.stl is being chain clipped.<br>
- The clipped file is saved as Screw Holder Bottom_clip.gcode<br>
- <br>
- <br>
- > python<br>
- Python 2.5.1 (r251:54863, Sep 22 2007, 01:43:31)<br>
- [GCC 4.2.1 (SUSE Linux)] on linux2<br>
- Type "help", "copyright", "credits" or "license" for more information.<br>
- >>> import clip<br>
- >>> clip.<a href="#-main">main</a>()<br>
- This brings up the clip dialog.<br>
- <br>
- <br>
- >>> clip.<a href="#-writeOutput">writeOutput</a>()<br>
- Screw Holder Bottom.stl<br>
- File Screw Holder Bottom.stl is being chain clipped.<br>
- The clipped file is saved as Screw Holder Bottom_clip.gcode<br>
- <br>
- <br>
- >>> clip.<a href="#-getClipGcode">getClipGcode</a>("<br>
- ( GCode generated by May 8, 2008 carve.py )<br>
- ( Extruder Initialization )<br>
- ..<br>
- many lines of gcode<br>
- ..<br>
- ")<br>
- <br>
- <br>
- >>> clip.<a href="#-getClipChainGcode">getClipChainGcode</a>("<br>
- ( GCode generated by May 8, 2008 carve.py )<br>
- ( Extruder Initialization )<br>
- ..<br>
- many lines of gcode<br>
- ..<br>
- ")</tt></p>
- <p>
- <table width="100%" cellspacing=0 cellpadding=2 border=0 summary="section">
- <tr bgcolor="#aa55cc">
- <td colspan=3 valign=bottom> <br>
- <font color="#fffff" 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="skeinforge_tools.analyze.html">skeinforge_tools.analyze</a><br>
- <a href="cStringIO.html">cStringIO</a><br>
- <a href="skeinforge_tools.comb.html">skeinforge_tools.comb</a><br>
- </td><td width="25%" valign=top><a href="skeinforge_tools.skeinforge_utilities.euclidean.html">skeinforge_tools.skeinforge_utilities.euclidean</a><br>
- <a href="skeinforge_tools.skeinforge_utilities.gcodec.html">skeinforge_tools.skeinforge_utilities.gcodec</a><br>
- <a href="skeinforge_tools.skeinforge_utilities.intercircle.html">skeinforge_tools.skeinforge_utilities.intercircle</a><br>
- <a href="skeinforge_tools.skeinforge_utilities.interpret.html">skeinforge_tools.skeinforge_utilities.interpret</a><br>
- </td><td width="25%" valign=top><a href="math.html">math</a><br>
- <a href="skeinforge_tools.polyfile.html">skeinforge_tools.polyfile</a><br>
- <a href="skeinforge_tools.skeinforge_utilities.preferences.html">skeinforge_tools.skeinforge_utilities.preferences</a><br>
- <a href="sys.html">sys</a><br>
- </td><td width="25%" valign=top><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_tools.clip.html#ClipPreferences">ClipPreferences</a>
- </font></dt><dt><font face="helvetica, arial"><a href="skeinforge_tools.clip.html#ClipSkein">ClipSkein</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="ClipPreferences">class <strong>ClipPreferences</strong></a></font></td></tr>
-
- <tr bgcolor="#ffc8d8"><td rowspan=2><tt> </tt></td>
- <td colspan=2><tt>A class to handle the clip preferences.<br> </tt></td></tr>
- <tr><td> </td>
- <td width="100%">Methods defined here:<br>
- <dl><dt><a name="ClipPreferences-__init__"><strong>__init__</strong></a>(self)</dt><dd><tt>Set the default preferences, execute title & preferences fileName.</tt></dd></dl>
- <dl><dt><a name="ClipPreferences-execute"><strong>execute</strong></a>(self)</dt><dd><tt>Clip 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="ClipSkein">class <strong>ClipSkein</strong></a></font></td></tr>
-
- <tr bgcolor="#ffc8d8"><td rowspan=2><tt> </tt></td>
- <td colspan=2><tt>A class to clip a skein of extrusions.<br> </tt></td></tr>
- <tr><td> </td>
- <td width="100%">Methods defined here:<br>
- <dl><dt><a name="ClipSkein-__init__"><strong>__init__</strong></a>(self)</dt></dl>
- <dl><dt><a name="ClipSkein-addGcodeFromThreadZ"><strong>addGcodeFromThreadZ</strong></a>(self, thread, z)</dt><dd><tt>Add a gcode thread to the output.</tt></dd></dl>
- <dl><dt><a name="ClipSkein-addGcodeMovementZ"><strong>addGcodeMovementZ</strong></a>(self, point, z)</dt><dd><tt>Add a movement to the output.</tt></dd></dl>
- <dl><dt><a name="ClipSkein-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="ClipSkein-addTailoredLoopPath"><strong>addTailoredLoopPath</strong></a>(self)</dt><dd><tt>Add a clipped and jittered loop path.</tt></dd></dl>
- <dl><dt><a name="ClipSkein-getRounded"><strong>getRounded</strong></a>(self, number)</dt><dd><tt>Get number rounded to the number of carried decimal places as a string.</tt></dd></dl>
- <dl><dt><a name="ClipSkein-isNextExtruderOn"><strong>isNextExtruderOn</strong></a>(self)</dt><dd><tt>Determine if there is an extruder on command before a move command.</tt></dd></dl>
- <dl><dt><a name="ClipSkein-linearMove"><strong>linearMove</strong></a>(self, splitLine)</dt><dd><tt>Add to loop path if this is a loop or path.</tt></dd></dl>
- <dl><dt><a name="ClipSkein-parseGcode"><strong>parseGcode</strong></a>(self, gcodeText, loopTailorPreferences)</dt><dd><tt>Parse gcode text and store the clip gcode.</tt></dd></dl>
- <dl><dt><a name="ClipSkein-parseInitialization"><strong>parseInitialization</strong></a>(self, loopTailorPreferences)</dt><dd><tt>Parse gcode initialization and store the parameters.</tt></dd></dl>
- <dl><dt><a name="ClipSkein-parseLine"><strong>parseLine</strong></a>(self, line)</dt><dd><tt>Parse a gcode line and add it to the clip skein.</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="-getClipChainGcode"><strong>getClipChainGcode</strong></a>(fileName, gcodeText, loopTailorPreferences<font color="#909090">=None</font>)</dt><dd><tt>Clip a gcode linear move text. Chain clip the gcode if it is not already clipped.</tt></dd></dl>
- <dl><dt><a name="-getClipGcode"><strong>getClipGcode</strong></a>(gcodeText, loopTailorPreferences<font color="#909090">=None</font>)</dt><dd><tt>Clip a gcode linear move text.</tt></dd></dl>
- <dl><dt><a name="-main"><strong>main</strong></a>(hashtable<font color="#909090">=None</font>)</dt><dd><tt>Display the clip dialog.</tt></dd></dl>
- <dl><dt><a name="-writeOutput"><strong>writeOutput</strong></a>(fileName<font color="#909090">=''</font>)</dt><dd><tt>Clip a gcode linear move file. Chain clip the gcode if it is not already clipped. If no fileName is specified, clip the first unmodified gcode file in this folder.</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>__date__</strong> = '$Date: 2008/21/04 $'<br>
- <strong>__license__</strong> = 'GPL 3.0'<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>
- </body></html>