diff options
author | doomsay <doomsay@cb376a5e-1013-0410-a455-b6b1f9ac8223> | 2009-01-16 03:36:53 +0000 |
---|---|---|
committer | doomsay <doomsay@cb376a5e-1013-0410-a455-b6b1f9ac8223> | 2009-01-16 03:36:53 +0000 |
commit | 5fbba2854b6e242c44a136c51e4cd65c3ceefd47 (patch) | |
tree | 19751bb42ce6ba5ceab9445f03f5d8f4ba8650ca | |
parent | 6b8a5e2034df587b6d7cdacb6b727899e19c0cf6 (diff) | |
download | reprap-backup-5fbba2854b6e242c44a136c51e4cd65c3ceefd47.tar.gz reprap-backup-5fbba2854b6e242c44a136c51e4cd65c3ceefd47.zip |
carve, inset and wipe added
slice_shape and nozzle_wipe removed
git-svn-id: https://reprap.svn.sourceforge.net/svnroot/reprap@2402 cb376a5e-1013-0410-a455-b6b1f9ac8223
91 files changed, 4763 insertions, 3168 deletions
diff --git a/trunk/reprap/miscellaneous/python-beanshell-scripts/documentation/skeinforge.html b/trunk/reprap/miscellaneous/python-beanshell-scripts/documentation/skeinforge.html index 17dd72b4..e9aeedbb 100644 --- a/trunk/reprap/miscellaneous/python-beanshell-scripts/documentation/skeinforge.html +++ b/trunk/reprap/miscellaneous/python-beanshell-scripts/documentation/skeinforge.html @@ -11,11 +11,11 @@ ><font color="#ffffff" face="helvetica, arial"><a href=".">index</a><br><a href="file:/home/enrique/Desktop/backup/babbleold/script/reprap/pyRepRap/skeinforge.py">/home/enrique/Desktop/backup/babbleold/script/reprap/pyRepRap/skeinforge.py</a></font></td></tr></table> <p><tt>Introduction<br> <br> -Skeinforge is a tool chain to forge a gcode skein for a model.<br> +Skeinforge is a GPL tool chain to forge a gcode skein for a model.<br> <br> -The tool chain starts with slice_shape, which slices the model into layers, then the layers are modified by other tools in turn like<br> -fill, comb, tower, raft, stretch, hop, nozzle_wipe, oozebane, fillet & export. Each tool automatically gets the gcode from the<br> -previous tool. So if you want a sliced & filled gcode, call the fill tool and it will call slice_shape, then it will fill and output the<br> +The tool chain starts with carve, which carves the model into layers, then the layers are modified by other tools in turn like<br> +fill, comb, tower, raft, stretch, hop, wipe, oozebane, fillet & export. Each tool automatically gets the gcode from the<br> +previous tool. So if you want a carved & filled gcode, call the fill tool and it will call carve, then it will fill and output the<br> gcode. If you want to use all the tools, call export and it will call in turn all the other tools down the chain to produce the gcode file.<br> <br> The skeinforge module provides a single place to call up all the preference dialogs. When the 'Skeinforge' button is clicked,<br> @@ -35,10 +35,10 @@ There are also tools which handle preferences  The analyze tool calls plugins in the analyze_plugins folder, which will analyze the gcode in some way when it is generated if<br> their Activate checkbox is selected.<br> <br> -The import_translator tool accesses and displays the import plugins.<br> +The interpret tool accesses and displays the import plugins.<br> <br> The default preferences are similar to those on Nophead's machine. A preference which is often different is the<br> -'Extrusion Diameter' in slice_shape.<br> +'Extrusion Diameter' in carve.<br> <br> <br> <br> @@ -73,17 +73,17 @@ When the skeinforge dialog pops up, click 'Sk and the gcode file will be saved with the suffix '_export.gcode'.<br> <br> Or you can turn files into gcode by adding the file name, for example:<br> -> python skeinforge.py Hollow Square.stl<br> +> python skeinforge.py Screw Holder Bottom.stl<br> <br> <br> <br> End of the Beginning<br> <br> -When slice is generating the code, if there is a file start.txt, it will add that to the very beginning of the gcode. After it has<br> +When carve is generating the code, if there is a file start.txt, it will add that to the very beginning of the gcode. After it has<br> added some initialization code and just before it adds the extrusion gcode, it will add the file endofthebeginning.txt if it exists.<br> -At the very end, it will add the file end.txt if it exists. Slice does not care if the text file names are capitalized, but some file<br> +At the very end, it will add the file end.txt if it exists. Carve does not care if the text file names are capitalized, but some file<br> systems do not handle file name cases properly, so to be on the safe side you should give them lower case names. It will<br> -first look for the file in the same directory as slice, if it does not find it it will look in ~/.skeinforge/gcode_scripts.<br> +first look for the file in the same directory as carve, if it does not find it it will look in ~/.skeinforge/gcode_scripts.<br> <br> The computation intensive python modules will use psyco if it is available and run about twice as fast. Psyco is described at:<br> <a href="http://psyco.sourceforge.net/index.html">http://psyco.sourceforge.net/index.html</a><br> @@ -159,8 +159,8 @@ folder.<br> STL is an inferior triangle surface format, described at:<br> <a href="http://en.wikipedia.org/wiki/STL_(file_format">http://en.wikipedia.org/wiki/STL_(file_format</a>)<br> <br> -If you're using an STL file and you can't even slice it, try converting it to a GNU Triangulated Surface file in Art of Illusion. If<br> -it still doesn't slice, then follow the advice in the troubleshooting section.<br> +If you're using an STL file and you can't even carve it, try converting it to a GNU Triangulated Surface file in Art of Illusion. If<br> +it still doesn't carve, then follow the advice in the troubleshooting section.<br> <br> <br> <br> @@ -190,8 +190,8 @@ If there's a bug, try downloading the very&nb Then you can ask for skeinforge help by sending a private message through the forum software by going to my page at:<br> <a href="http://forums.reprap.org/profile.php?12,488">http://forums.reprap.org/profile.php?12,488</a><br> <br> -or posting in the "How to Print Gcode from Host" thread at:<br> -<a href="http://forums.reprap.org/read.php?12,10772">http://forums.reprap.org/read.php?12,10772</a><br> +or posting in the "Skeinforge Powwow" thread at:<br> +<a href="http://forums.reprap.org/read.php?12,20013">http://forums.reprap.org/read.php?12,20013</a><br> <br> When asking for help please include your object and your zipped skeinforge preferences. The skeinforge preferences are in<br> the .skeinforge folder in your home directory.<br> @@ -199,7 +199,7 @@ the .skeinforge folder in your home directory.<br> <br> Examples<br> <br> -The following examples slice and dice the STL file Screw Holder.stl. The examples are run in a terminal in the folder which<br> +The following examples carve and dice the STL file Screw Holder.stl. The examples are run in a terminal in the folder which<br> contains Screw Holder.gts and skeinforge.py.<br> <br> > python skeinforge.py<br> @@ -231,7 +231,7 @@ This brings up the skeinforge dialog.</tt></p> <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="cStringIO.html">cStringIO</a><br> <a href="skeinforge_tools.skeinforge_utilities.gcodec.html">skeinforge_tools.skeinforge_utilities.gcodec</a><br> -</td><td width="25%" valign=top><a href="skeinforge_tools.import_translator.html">skeinforge_tools.import_translator</a><br> +</td><td width="25%" valign=top><a href="skeinforge_tools.skeinforge_utilities.interpret.html">skeinforge_tools.skeinforge_utilities.interpret</a><br> <a href="skeinforge_tools.polyfile.html">skeinforge_tools.polyfile</a><br> </td><td width="25%" valign=top><a href="skeinforge_tools.skeinforge_utilities.preferences.html">skeinforge_tools.skeinforge_utilities.preferences</a><br> <a href="sys.html">sys</a><br> @@ -255,7 +255,7 @@ This brings up the skeinforge dialog.</tt></p> <td colspan=2><tt>A class to handle the skeinforge preferences.<br> </tt></td></tr> <tr><td> </td> <td width="100%">Methods defined here:<br> -<dl><dt><a name="SkeinforgePreferences-__init__"><strong>__init__</strong></a>(self)</dt><dd><tt>Set the default preferences, execute title & preferences filename.</tt></dd></dl> +<dl><dt><a name="SkeinforgePreferences-__init__"><strong>__init__</strong></a>(self)</dt><dd><tt>Set the default preferences, execute title & preferences fileName.</tt></dd></dl> <dl><dt><a name="SkeinforgePreferences-execute"><strong>execute</strong></a>(self)</dt><dd><tt>Skeinforge button has been clicked.</tt></dd></dl> @@ -266,9 +266,9 @@ This brings up the skeinforge dialog.</tt></p> <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="-getSkeinforgeToolFilenames"><strong>getSkeinforgeToolFilenames</strong></a>()</dt><dd><tt>Get skeinforge plugin filenames.</tt></dd></dl> +<td width="100%"><dl><dt><a name="-getSkeinforgeToolFilenames"><strong>getSkeinforgeToolFilenames</strong></a>()</dt><dd><tt>Get skeinforge plugin fileNames.</tt></dd></dl> <dl><dt><a name="-main"><strong>main</strong></a>()</dt><dd><tt>Display the skeinforge dialog.</tt></dd></dl> - <dl><dt><a name="-writeOutput"><strong>writeOutput</strong></a>(filename<font color="#909090">=''</font>)</dt><dd><tt>Skeinforge a gcode file. If no filename is specified, skeinforge the first gcode file in this folder that is not modified.</tt></dd></dl> + <dl><dt><a name="-writeOutput"><strong>writeOutput</strong></a>(fileName<font color="#909090">=''</font>)</dt><dd><tt>Skeinforge a gcode file. If no fileName is specified, skeinforge the first gcode file in this folder that is not modified.</tt></dd></dl> </td></tr></table><p> <table width="100%" cellspacing=0 cellpadding=2 border=0 summary="section"> <tr bgcolor="#55aa55"> @@ -299,11 +299,15 @@ Adrian Bowyer <<a href="http://forums.reprap.org/profile.php?12,13" Brendan Erwin <<a href="http://forums.reprap.org/profile.php?12,217">http://forums.reprap.org/profile.php?12,217</a>><br> Greenarrow <<a href="http://forums.reprap.org/profile.php?12,81">http://forums.reprap.org/profile.php?12,81</a>><br> Ian England <<a href="http://forums.reprap.org/profile.php?12,192">http://forums.reprap.org/profile.php?12,192</a>><br> +John Gilmore <<a href="http://forums.reprap.org/profile.php?12,364">http://forums.reprap.org/profile.php?12,364</a>><br> +Jonwise <<a href="http://forums.reprap.org/profile.php?12,716">http://forums.reprap.org/profile.php?12,716</a>><br> Kyle Corbitt <<a href="http://forums.reprap.org/profile.php?12,90">http://forums.reprap.org/profile.php?12,90</a>><br> Marius Kintel <<a href="http://reprap.soup.io/">http://reprap.soup.io/</a>><br> Nophead <<a href="http://www.blogger.com/profile/12801535866788103677">http://www.blogger.com/profile/12801535866788103677</a>><br> +PJR <<a href="http://forums.reprap.org/profile.php?12,757">http://forums.reprap.org/profile.php?12,757</a>><br> Reece.Arnott <<a href="http://forums.reprap.org/profile.php?12,152">http://forums.reprap.org/profile.php?12,152</a>><br> Wade <<a href="http://forums.reprap.org/profile.php?12,489">http://forums.reprap.org/profile.php?12,489</a>><br> +Zach Hoeken <<a href="http://blog.zachhoeken.com/">http://blog.zachhoeken.com/</a>><br> <br> Organizations:<br> Art of Illusion <<a href="http://www.artofillusion.org/">http://www.artofillusion.org/</a>></td></tr></table> diff --git a/trunk/reprap/miscellaneous/python-beanshell-scripts/documentation/skeinforge_tools.analyze.html b/trunk/reprap/miscellaneous/python-beanshell-scripts/documentation/skeinforge_tools.analyze.html index 1321bdc7..58dea8e2 100644 --- a/trunk/reprap/miscellaneous/python-beanshell-scripts/documentation/skeinforge_tools.analyze.html +++ b/trunk/reprap/miscellaneous/python-beanshell-scripts/documentation/skeinforge_tools.analyze.html @@ -50,7 +50,7 @@ A gode example is at:<br> <td colspan=2><tt>A class to handle the analyze preferences.<br> </tt></td></tr> <tr><td> </td> <td width="100%">Methods defined here:<br> -<dl><dt><a name="AnalyzePreferences-__init__"><strong>__init__</strong></a>(self)</dt><dd><tt>Set the default preferences, execute title & preferences filename.</tt></dd></dl> +<dl><dt><a name="AnalyzePreferences-__init__"><strong>__init__</strong></a>(self)</dt><dd><tt>Set the default preferences, execute title & preferences fileName.</tt></dd></dl> <dl><dt><a name="AnalyzePreferences-execute"><strong>execute</strong></a>(self)</dt><dd><tt>Analyze button has been clicked.</tt></dd></dl> @@ -61,9 +61,9 @@ A gode example is at:<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="-getAnalyzePluginFilenames"><strong>getAnalyzePluginFilenames</strong></a>()</dt><dd><tt>Get analyze plugin filenames.</tt></dd></dl> +<td width="100%"><dl><dt><a name="-getAnalyzePluginFilenames"><strong>getAnalyzePluginFilenames</strong></a>()</dt><dd><tt>Get analyze plugin fileNames.</tt></dd></dl> <dl><dt><a name="-main"><strong>main</strong></a>(hashtable<font color="#909090">=None</font>)</dt><dd><tt>Display the analyze dialog.</tt></dd></dl> - <dl><dt><a name="-writeOutput"><strong>writeOutput</strong></a>(filename<font color="#909090">=''</font>, gcodeText<font color="#909090">=''</font>)</dt><dd><tt>Analyze a gcode file. If no filename is specified, comment the first gcode file in this folder that is not modified.</tt></dd></dl> + <dl><dt><a name="-writeOutput"><strong>writeOutput</strong></a>(fileName<font color="#909090">=''</font>, gcodeText<font color="#909090">=''</font>)</dt><dd><tt>Analyze a gcode file. If no fileName is specified, comment the first gcode file in this folder that is not modified.</tt></dd></dl> </td></tr></table><p> <table width="100%" cellspacing=0 cellpadding=2 border=0 summary="section"> <tr bgcolor="#55aa55"> diff --git a/trunk/reprap/miscellaneous/python-beanshell-scripts/documentation/skeinforge_tools.analyze_plugins.analyze_utilities.enrique.html b/trunk/reprap/miscellaneous/python-beanshell-scripts/documentation/skeinforge_tools.analyze_plugins.analyze_utilities.enrique.html index a6034adf..c1aa835d 100644 --- a/trunk/reprap/miscellaneous/python-beanshell-scripts/documentation/skeinforge_tools.analyze_plugins.analyze_utilities.enrique.html +++ b/trunk/reprap/miscellaneous/python-beanshell-scripts/documentation/skeinforge_tools.analyze_plugins.analyze_utilities.enrique.html @@ -38,7 +38,7 @@ <tr><td bgcolor="#ffc8d8"><tt> </tt></td><td> </td> <td width="100%">Methods defined here:<br> -<dl><dt><a name="g2gif-__init__"><strong>__init__</strong></a>(self, filename, outfile)</dt></dl> +<dl><dt><a name="g2gif-__init__"><strong>__init__</strong></a>(self, fileName, outfile)</dt></dl> <dl><dt><a name="g2gif-linearMove"><strong>linearMove</strong></a>(self, splitLine)</dt></dl> @@ -61,8 +61,8 @@ # @param word string with value starting after the first letter<br> # @return double value of the word after the first letter</tt></dd></dl> <dl><dt><a name="-getDoubleForLetter"><strong>getDoubleForLetter</strong></a>(letter, splitLine)</dt><dd><tt># Get the double value of the word after the first occurence of the letter in the split line.</tt></dd></dl> - <dl><dt><a name="-getFileText"><strong>getFileText</strong></a>(filename)</dt><dd><tt># Get the entire text of a file.<br> -# @param filename name of the file<br> + <dl><dt><a name="-getFileText"><strong>getFileText</strong></a>(fileName)</dt><dd><tt># Get the entire text of a file.<br> +# @param fileName name of the file<br> # @return entire text of a file.</tt></dd></dl> <dl><dt><a name="-getTextLines"><strong>getTextLines</strong></a>(text)</dt><dd><tt># Get the all the lines of text of a text.<br> # @param text text<br> diff --git a/trunk/reprap/miscellaneous/python-beanshell-scripts/documentation/skeinforge_tools.analyze_plugins.analyze_utilities.gRead.html b/trunk/reprap/miscellaneous/python-beanshell-scripts/documentation/skeinforge_tools.analyze_plugins.analyze_utilities.gRead.html index 9dde822d..8d07d549 100644 --- a/trunk/reprap/miscellaneous/python-beanshell-scripts/documentation/skeinforge_tools.analyze_plugins.analyze_utilities.gRead.html +++ b/trunk/reprap/miscellaneous/python-beanshell-scripts/documentation/skeinforge_tools.analyze_plugins.analyze_utilities.gRead.html @@ -36,7 +36,7 @@ <tr><td bgcolor="#ffc8d8"><tt> </tt></td><td> </td> <td width="100%">Methods defined here:<br> -<dl><dt><a name="gRead-__init__"><strong>__init__</strong></a>(self, filename, layers, gcodeText<font color="#909090">=''</font>)</dt></dl> +<dl><dt><a name="gRead-__init__"><strong>__init__</strong></a>(self, fileName, layers, gcodeText<font color="#909090">=''</font>)</dt></dl> <dl><dt><a name="gRead-linearMove"><strong>linearMove</strong></a>(self, splitLine)</dt></dl> @@ -58,8 +58,8 @@ <td width="100%"><dl><dt><a name="-getDoubleAfterFirstLetter"><strong>getDoubleAfterFirstLetter</strong></a>(word)</dt><dd><tt># Get the double value of the word after the first letter.<br> # @param word string with value starting after the first letter<br> # @return double value of the word after the first letter</tt></dd></dl> - <dl><dt><a name="-getFileText"><strong>getFileText</strong></a>(filename)</dt><dd><tt># Get the entire text of a file.<br> -# @param filename name of the file<br> + <dl><dt><a name="-getFileText"><strong>getFileText</strong></a>(fileName)</dt><dd><tt># Get the entire text of a file.<br> +# @param fileName name of the file<br> # @return entire text of a file.</tt></dd></dl> <dl><dt><a name="-getTextLines"><strong>getTextLines</strong></a>(text)</dt><dd><tt># Get the all the lines of text of a text.<br> # @param text text<br> diff --git a/trunk/reprap/miscellaneous/python-beanshell-scripts/documentation/skeinforge_tools.analyze_plugins.analyze_utilities.preview.html b/trunk/reprap/miscellaneous/python-beanshell-scripts/documentation/skeinforge_tools.analyze_plugins.analyze_utilities.preview.html index 41ede809..c4af1c8d 100644 --- a/trunk/reprap/miscellaneous/python-beanshell-scripts/documentation/skeinforge_tools.analyze_plugins.analyze_utilities.preview.html +++ b/trunk/reprap/miscellaneous/python-beanshell-scripts/documentation/skeinforge_tools.analyze_plugins.analyze_utilities.preview.html @@ -55,7 +55,7 @@ <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="-viewGif"><strong>viewGif</strong></a>(filename, gcodeText<font color="#909090">=''</font>)</dt></dl> +<td width="100%"><dl><dt><a name="-viewGif"><strong>viewGif</strong></a>(fileName, gcodeText<font color="#909090">=''</font>)</dt></dl> </td></tr></table><p> <table width="100%" cellspacing=0 cellpadding=2 border=0 summary="section"> <tr bgcolor="#55aa55"> diff --git a/trunk/reprap/miscellaneous/python-beanshell-scripts/documentation/skeinforge_tools.analyze_plugins.comment.html b/trunk/reprap/miscellaneous/python-beanshell-scripts/documentation/skeinforge_tools.analyze_plugins.comment.html index b24c01ec..64c584da 100644 --- a/trunk/reprap/miscellaneous/python-beanshell-scripts/documentation/skeinforge_tools.analyze_plugins.comment.html +++ b/trunk/reprap/miscellaneous/python-beanshell-scripts/documentation/skeinforge_tools.analyze_plugins.comment.html @@ -76,7 +76,7 @@ The commented file is saved as Screw Holder_c <td colspan=2><tt>A class to handle the comment preferences.<br> </tt></td></tr> <tr><td> </td> <td width="100%">Methods defined here:<br> -<dl><dt><a name="CommentPreferences-__init__"><strong>__init__</strong></a>(self)</dt><dd><tt>Set the default preferences, execute title & preferences filename.</tt></dd></dl> +<dl><dt><a name="CommentPreferences-__init__"><strong>__init__</strong></a>(self)</dt><dd><tt>Set the default preferences, execute title & preferences fileName.</tt></dd></dl> <dl><dt><a name="CommentPreferences-execute"><strong>execute</strong></a>(self)</dt><dd><tt>Write button has been clicked.</tt></dd></dl> @@ -109,11 +109,11 @@ The commented file is saved as Screw Holder_c <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="-commentFile"><strong>commentFile</strong></a>(filename<font color="#909090">=''</font>)</dt><dd><tt>Comment a gcode file. If no filename is specified, comment the first gcode file in this folder that is not modified.</tt></dd></dl> +<td width="100%"><dl><dt><a name="-commentFile"><strong>commentFile</strong></a>(fileName<font color="#909090">=''</font>)</dt><dd><tt>Comment a gcode file. If no fileName is specified, comment the first gcode file in this folder that is not modified.</tt></dd></dl> <dl><dt><a name="-getCommentGcode"><strong>getCommentGcode</strong></a>(gcodeText)</dt><dd><tt>Get gcode text with added comments.</tt></dd></dl> <dl><dt><a name="-main"><strong>main</strong></a>()</dt><dd><tt>Display the comment dialog.</tt></dd></dl> - <dl><dt><a name="-writeCommentFileGivenText"><strong>writeCommentFileGivenText</strong></a>(filename, gcodeText)</dt><dd><tt>Write a commented gcode file for a gcode file.</tt></dd></dl> - <dl><dt><a name="-writeOutput"><strong>writeOutput</strong></a>(filename, gcodeText<font color="#909090">=''</font>)</dt><dd><tt>Write a commented gcode file for a skeinforge gcode file, if 'Write Commented File for Skeinforge Chain' is selected.</tt></dd></dl> + <dl><dt><a name="-writeCommentFileGivenText"><strong>writeCommentFileGivenText</strong></a>(fileName, gcodeText)</dt><dd><tt>Write a commented gcode file for a gcode file.</tt></dd></dl> + <dl><dt><a name="-writeOutput"><strong>writeOutput</strong></a>(fileName, gcodeText<font color="#909090">=''</font>)</dt><dd><tt>Write a commented gcode file for a skeinforge gcode file, if 'Write Commented File for Skeinforge Chain' is selected.</tt></dd></dl> </td></tr></table><p> <table width="100%" cellspacing=0 cellpadding=2 border=0 summary="section"> <tr bgcolor="#55aa55"> diff --git a/trunk/reprap/miscellaneous/python-beanshell-scripts/documentation/skeinforge_tools.analyze_plugins.gifscene.html b/trunk/reprap/miscellaneous/python-beanshell-scripts/documentation/skeinforge_tools.analyze_plugins.gifscene.html deleted file mode 100644 index 55d31e57..00000000 --- a/trunk/reprap/miscellaneous/python-beanshell-scripts/documentation/skeinforge_tools.analyze_plugins.gifscene.html +++ /dev/null @@ -1,121 +0,0 @@ - -<!doctype html PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN"> -<html><head><title>Python: module skeinforge_tools.analyze_plugins.gifscene</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>.<a href="skeinforge_tools.analyze_plugins.html"><font color="#ffffff">analyze_plugins</font></a>.gifscene</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/analyze_plugins/gifscene.py">/home/enrique/Desktop/backup/babbleold/script/reprap/pyRepRap/skeinforge_tools/analyze_plugins/gifscene.py</a></font></td></tr></table> - <p><tt>Gifscene is a script to display a gif for each layer of a gcode file.<br> - <br> -The default 'Activate Gifscene' checkbox is on. When it is on, the functions described below will work when called from the<br> -skeinforge toolchain, when it is off, the functions will not be called from the toolchain. The functions will still be called, whether<br> -or not the 'Activate Gifscene' checkbox is on, when gifscene is run directly.<br> - <br> -To run gifscene, in a shell in the folder which gifscene is in type:<br> -> python gifscene.py<br> - <br> -To run gifscene you need the Python Imaging Library, which can be downloaded from:<br> -www.pythonware.com/products/pil/<br> - <br> -I have not been able to install the Python Imaging Library, so I can only hope that I'm calling Nophead's code correctly. If you<br> -have the Python Imaging Library and gifscene still does not work for you, please post that in the 'How to Print Gcode from Host'<br> -thread at:<br> -<a href="http://forums.reprap.org/read.php?12,10772">http://forums.reprap.org/read.php?12,10772</a><br> - <br> -An explanation of the gcodes is at:<br> -<a href="http://reprap.org/bin/view/Main/Arduino_GCode_Interpreter">http://reprap.org/bin/view/Main/Arduino_GCode_Interpreter</a><br> - <br> -and at:<br> -<a href="http://reprap.org/bin/view/Main/MCodeReference">http://reprap.org/bin/view/Main/MCodeReference</a><br> - <br> -A gode example is at:<br> -<a href="http://forums.reprap.org/file.php?12,file=565">http://forums.reprap.org/file.php?12,file=565</a><br> - <br> -Gifscene may not work when called from the toolchain. If it does not, try running it directly.<br> - <br> -This example displays gifs for the gcode file Screw Holder.gcode. This example is run in a terminal in the folder which<br> -contains Screw Holder.gcode and gifscene.py.<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 gifscene<br> ->>> gifscene.<a href="#-main">main</a>()<br> -This brings up the gifscene dialog.<br> - <br> - <br> ->>> gifscene.<a href="#-gifsceneFile">gifsceneFile</a>()<br> -A gif for each layer of a gcode file is displayed.</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="cStringIO.html">cStringIO</a><br> -</td><td width="25%" valign=top><a href="skeinforge_tools.skeinforge_utilities.gcodec.html">skeinforge_tools.skeinforge_utilities.gcodec</a><br> -<a href="skeinforge_tools.polyfile.html">skeinforge_tools.polyfile</a><br> -</td><td width="25%" valign=top><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></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.analyze_plugins.gifscene.html#GifscenePreferences">GifscenePreferences</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="GifscenePreferences">class <strong>GifscenePreferences</strong></a></font></td></tr> - -<tr bgcolor="#ffc8d8"><td rowspan=2><tt> </tt></td> -<td colspan=2><tt>A class to handle the gifscene preferences.<br> </tt></td></tr> -<tr><td> </td> -<td width="100%">Methods defined here:<br> -<dl><dt><a name="GifscenePreferences-__init__"><strong>__init__</strong></a>(self)</dt><dd><tt>Set the default preferences, execute title & preferences filename.</tt></dd></dl> - -<dl><dt><a name="GifscenePreferences-execute"><strong>execute</strong></a>(self)</dt><dd><tt>Write button has been clicked.</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="-gifsceneFile"><strong>gifsceneFile</strong></a>(filename<font color="#909090">=''</font>)</dt><dd><tt>Gifscene a gcode file. If no filename is specified, gifscene the first gcode file in this folder that is not modified.</tt></dd></dl> - <dl><dt><a name="-main"><strong>main</strong></a>()</dt><dd><tt>Display the gifscene dialog.</tt></dd></dl> - <dl><dt><a name="-writeGifsceneFileGivenText"><strong>writeGifsceneFileGivenText</strong></a>(filename, gcodeText<font color="#909090">=''</font>)</dt><dd><tt>Write a gifsceneed gcode file for a gcode file.</tt></dd></dl> - <dl><dt><a name="-writeOutput"><strong>writeOutput</strong></a>(filename, gcodeText<font color="#909090">=''</font>)</dt><dd><tt>Write a gifsceneed gcode file for a skeinforge gcode file, if 'Activate Gifscene' is selected.</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>
\ No newline at end of file diff --git a/trunk/reprap/miscellaneous/python-beanshell-scripts/documentation/skeinforge_tools.analyze_plugins.skeinview.html b/trunk/reprap/miscellaneous/python-beanshell-scripts/documentation/skeinforge_tools.analyze_plugins.skeinview.html index 5adbd61b..61127a7b 100644 --- a/trunk/reprap/miscellaneous/python-beanshell-scripts/documentation/skeinforge_tools.analyze_plugins.skeinview.html +++ b/trunk/reprap/miscellaneous/python-beanshell-scripts/documentation/skeinforge_tools.analyze_plugins.skeinview.html @@ -134,7 +134,7 @@ This brings up a skein window to view ea <td colspan=2><tt>A class to handle the skeinview preferences.<br> </tt></td></tr> <tr><td> </td> <td width="100%">Methods defined here:<br> -<dl><dt><a name="SkeinviewPreferences-__init__"><strong>__init__</strong></a>(self)</dt><dd><tt>Set the default preferences, execute title & preferences filename.</tt></dd></dl> +<dl><dt><a name="SkeinviewPreferences-__init__"><strong>__init__</strong></a>(self)</dt><dd><tt>Set the default preferences, execute title & preferences fileName.</tt></dd></dl> <dl><dt><a name="SkeinviewPreferences-execute"><strong>execute</strong></a>(self)</dt><dd><tt>Write button has been clicked.</tt></dd></dl> @@ -175,8 +175,8 @@ This brings up a skein window to view ea <tr><td bgcolor="#eeaa77"><tt> </tt></td><td> </td> <td width="100%"><dl><dt><a name="-displaySkeinviewFileGivenText"><strong>displaySkeinviewFileGivenText</strong></a>(gcodeText, skeinviewPreferences<font color="#909090">=None</font>)</dt><dd><tt>Display a skeinviewed gcode file for a gcode file.</tt></dd></dl> <dl><dt><a name="-main"><strong>main</strong></a>()</dt><dd><tt>Display the skeinview dialog.</tt></dd></dl> - <dl><dt><a name="-skeinviewFile"><strong>skeinviewFile</strong></a>(filename<font color="#909090">=''</font>)</dt><dd><tt>Skeinview a gcode file. If no filename is specified, skeinview the first gcode file in this folder that is not modified.</tt></dd></dl> - <dl><dt><a name="-writeOutput"><strong>writeOutput</strong></a>(filename, gcodeText<font color="#909090">=''</font>)</dt><dd><tt>Write a skeinviewed gcode file for a skeinforge gcode file, if 'Activate Skeinview' is selected.</tt></dd></dl> + <dl><dt><a name="-skeinviewFile"><strong>skeinviewFile</strong></a>(fileName<font color="#909090">=''</font>)</dt><dd><tt>Skeinview a gcode file. If no fileName is specified, skeinview the first gcode file in this folder that is not modified.</tt></dd></dl> + <dl><dt><a name="-writeOutput"><strong>writeOutput</strong></a>(fileName, gcodeText<font color="#909090">=''</font>)</dt><dd><tt>Write a skeinviewed gcode file for a skeinforge gcode file, if 'Activate Skeinview' is selected.</tt></dd></dl> </td></tr></table><p> <table width="100%" cellspacing=0 cellpadding=2 border=0 summary="section"> <tr bgcolor="#55aa55"> diff --git a/trunk/reprap/miscellaneous/python-beanshell-scripts/documentation/skeinforge_tools.analyze_plugins.statistic.html b/trunk/reprap/miscellaneous/python-beanshell-scripts/documentation/skeinforge_tools.analyze_plugins.statistic.html index 8f8a16ee..9c029d41 100644 --- a/trunk/reprap/miscellaneous/python-beanshell-scripts/documentation/skeinforge_tools.analyze_plugins.statistic.html +++ b/trunk/reprap/miscellaneous/python-beanshell-scripts/documentation/skeinforge_tools.analyze_plugins.statistic.html @@ -15,6 +15,9 @@ The default 'Activate Statistic' checkbox is on.&n skeinforge toolchain, when it is off, the functions will not be called from the toolchain. The functions will still be called, whether<br> or not the 'Activate Statistic' checkbox is on, when statistic is run directly.<br> <br> +When the 'Print Statistics' checkbox is on, the statistics will be printed to the console, the default is on. When the 'Save<br> +Statistics' checkbox is on, the statistics will be save as a .txt file, the default is off.<br> + <br> To run statistic, in a shell in the folder which statistic is in type:<br> > python statistic.py<br> <br> @@ -78,7 +81,7 @@ The statistics file is saved as Screw Holder_ <td colspan=2><tt>A class to handle the statistics preferences.<br> </tt></td></tr> <tr><td> </td> <td width="100%">Methods defined here:<br> -<dl><dt><a name="StatisticPreferences-__init__"><strong>__init__</strong></a>(self)</dt><dd><tt>Set the default preferences, execute title & preferences filename.</tt></dd></dl> +<dl><dt><a name="StatisticPreferences-__init__"><strong>__init__</strong></a>(self)</dt><dd><tt>Set the default preferences, execute title & preferences fileName.</tt></dd></dl> <dl><dt><a name="StatisticPreferences-execute"><strong>execute</strong></a>(self)</dt><dd><tt>Write button has been clicked.</tt></dd></dl> @@ -119,9 +122,9 @@ The statistics file is saved as Screw Holder_ <tr><td bgcolor="#eeaa77"><tt> </tt></td><td> </td> <td width="100%"><dl><dt><a name="-getStatisticGcode"><strong>getStatisticGcode</strong></a>(gcodeText)</dt><dd><tt>Get statistics for a gcode text.</tt></dd></dl> <dl><dt><a name="-main"><strong>main</strong></a>()</dt><dd><tt>Display the statistics dialog.</tt></dd></dl> - <dl><dt><a name="-statisticFile"><strong>statisticFile</strong></a>(filename<font color="#909090">=''</font>)</dt><dd><tt>Write statistics for a gcode file. If no filename is specified, write statistics for the first gcode file in this folder that is not modified.</tt></dd></dl> - <dl><dt><a name="-writeOutput"><strong>writeOutput</strong></a>(filename, gcodeText<font color="#909090">=''</font>)</dt><dd><tt>Write statistics for a skeinforge gcode file, if 'Write Statistics File for Skeinforge Chain' is selected.</tt></dd></dl> - <dl><dt><a name="-writeStatisticFileGivenText"><strong>writeStatisticFileGivenText</strong></a>(filename, gcodeText, statisticPreferences)</dt><dd><tt>Write statistics for a gcode file.</tt></dd></dl> + <dl><dt><a name="-statisticFile"><strong>statisticFile</strong></a>(fileName<font color="#909090">=''</font>)</dt><dd><tt>Write statistics for a gcode file. If no fileName is specified, write statistics for the first gcode file in this folder that is not modified.</tt></dd></dl> + <dl><dt><a name="-writeOutput"><strong>writeOutput</strong></a>(fileName, gcodeText<font color="#909090">=''</font>)</dt><dd><tt>Write statistics for a skeinforge gcode file, if 'Write Statistics File for Skeinforge Chain' is selected.</tt></dd></dl> + <dl><dt><a name="-writeStatisticFileGivenText"><strong>writeStatisticFileGivenText</strong></a>(fileName, gcodeText, statisticPreferences)</dt><dd><tt>Write statistics for a gcode file.</tt></dd></dl> </td></tr></table><p> <table width="100%" cellspacing=0 cellpadding=2 border=0 summary="section"> <tr bgcolor="#55aa55"> diff --git a/trunk/reprap/miscellaneous/python-beanshell-scripts/documentation/skeinforge_tools.analyze_plugins.vectorwrite.html b/trunk/reprap/miscellaneous/python-beanshell-scripts/documentation/skeinforge_tools.analyze_plugins.vectorwrite.html index 7f64517a..8811abdc 100644 --- a/trunk/reprap/miscellaneous/python-beanshell-scripts/documentation/skeinforge_tools.analyze_plugins.vectorwrite.html +++ b/trunk/reprap/miscellaneous/python-beanshell-scripts/documentation/skeinforge_tools.analyze_plugins.vectorwrite.html @@ -108,7 +108,7 @@ The vector file is saved as Screw Holder.svg< <td colspan=2><tt>A class to handle the vectorwrite preferences.<br> </tt></td></tr> <tr><td> </td> <td width="100%">Methods defined here:<br> -<dl><dt><a name="VectorwritePreferences-__init__"><strong>__init__</strong></a>(self)</dt><dd><tt>Set the default preferences, execute title & preferences filename.</tt></dd></dl> +<dl><dt><a name="VectorwritePreferences-__init__"><strong>__init__</strong></a>(self)</dt><dd><tt>Set the default preferences, execute title & preferences fileName.</tt></dd></dl> </td></tr></table> <p> <table width="100%" cellspacing=0 cellpadding=2 border=0 summary="section"> @@ -128,13 +128,13 @@ The vector file is saved as Screw Holder.svg< <dl><dt><a name="VectorwriteSkein-execute"><strong>execute</strong></a>(self)</dt><dd><tt>Write button has been clicked.</tt></dd></dl> -<dl><dt><a name="VectorwriteSkein-getFilenameWriteFiles"><strong>getFilenameWriteFiles</strong></a>(self, filename)</dt><dd><tt>Write one or multiple files for the filename.</tt></dd></dl> +<dl><dt><a name="VectorwriteSkein-getFilenameWriteFiles"><strong>getFilenameWriteFiles</strong></a>(self, fileName)</dt><dd><tt>Write one or multiple files for the fileName.</tt></dd></dl> <dl><dt><a name="VectorwriteSkein-getHypertextLinkBasename"><strong>getHypertextLinkBasename</strong></a>(self, baseUnderscoredPrefix, vectorWindowIndex)</dt><dd><tt>Get hypertext link basename for a numbered vector window.</tt></dd></dl> <dl><dt><a name="VectorwriteSkein-getLinkBasename"><strong>getLinkBasename</strong></a>(self, baseUnderscoredPrefix, vectorWindowIndex)</dt><dd><tt>Get link basename for a numbered vector window.</tt></dd></dl> -<dl><dt><a name="VectorwriteSkein-getSuffixFilename"><strong>getSuffixFilename</strong></a>(self, baseUnderscoredPrefix, multipleDirectoryName, vectorWindowIndex)</dt><dd><tt>Get suffix filename for a numbered vector window.</tt></dd></dl> +<dl><dt><a name="VectorwriteSkein-getSuffixFilename"><strong>getSuffixFilename</strong></a>(self, baseUnderscoredPrefix, multipleDirectoryName, vectorWindowIndex)</dt><dd><tt>Get suffix fileName for a numbered vector window.</tt></dd></dl> <dl><dt><a name="VectorwriteSkein-initializeActiveLocation"><strong>initializeActiveLocation</strong></a>(self)</dt><dd><tt>Set variables to default.</tt></dd></dl> @@ -160,9 +160,9 @@ The vector file is saved as Screw Holder.svg< <tr><td bgcolor="#eeaa77"><tt> </tt></td><td> </td> <td width="100%"><dl><dt><a name="-main"><strong>main</strong></a>(hashtable<font color="#909090">=None</font>)</dt><dd><tt>Display the vectorwrite dialog.</tt></dd></dl> - <dl><dt><a name="-writeOutput"><strong>writeOutput</strong></a>(filename, gcodeText<font color="#909090">=''</font>)</dt><dd><tt>Write scalable vector graphics for a skeinforge gcode file, if 'Write Scalable Vector Graphics for Skeinforge Chain' is selected.</tt></dd></dl> - <dl><dt><a name="-writeVectorFile"><strong>writeVectorFile</strong></a>(filename<font color="#909090">=''</font>)</dt><dd><tt>Write scalable vector graphics for a gcode file. If no filename is specified, write scalable vector graphics for the first gcode file in this folder.</tt></dd></dl> - <dl><dt><a name="-writeVectorFileGivenText"><strong>writeVectorFileGivenText</strong></a>(filename, gcodeText, vectorwritePreferences)</dt><dd><tt>Write scalable vector graphics for a gcode file.</tt></dd></dl> + <dl><dt><a name="-writeOutput"><strong>writeOutput</strong></a>(fileName, gcodeText<font color="#909090">=''</font>)</dt><dd><tt>Write scalable vector graphics for a skeinforge gcode file, if 'Write Scalable Vector Graphics for Skeinforge Chain' is selected.</tt></dd></dl> + <dl><dt><a name="-writeVectorFile"><strong>writeVectorFile</strong></a>(fileName<font color="#909090">=''</font>)</dt><dd><tt>Write scalable vector graphics for a gcode file. If no fileName is specified, write scalable vector graphics for the first gcode file in this folder.</tt></dd></dl> + <dl><dt><a name="-writeVectorFileGivenText"><strong>writeVectorFileGivenText</strong></a>(fileName, gcodeText, vectorwritePreferences)</dt><dd><tt>Write scalable vector graphics for a gcode file.</tt></dd></dl> </td></tr></table><p> <table width="100%" cellspacing=0 cellpadding=2 border=0 summary="section"> <tr bgcolor="#55aa55"> diff --git a/trunk/reprap/miscellaneous/python-beanshell-scripts/documentation/skeinforge_tools.carve.html b/trunk/reprap/miscellaneous/python-beanshell-scripts/documentation/skeinforge_tools.carve.html new file mode 100644 index 00000000..9ea1ba98 --- /dev/null +++ b/trunk/reprap/miscellaneous/python-beanshell-scripts/documentation/skeinforge_tools.carve.html @@ -0,0 +1,192 @@ + +<!doctype html PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN"> +<html><head><title>Python: module skeinforge_tools.carve</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>.carve</strong></big></big> ($Date: 2008/02/05 $)</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/carve.py">/home/enrique/Desktop/backup/babbleold/script/reprap/pyRepRap/skeinforge_tools/carve.py</a></font></td></tr></table> + <p><tt>Carve shape is a script to carve a list of slice layers.<br> + <br> +Carve carves a list of slices into svg slice layers. The 'Layer Thickness' is the thickness the extrusion layer at default extruder speed,<br> +this is the most important carve preference. The 'Extrusion Diameter over Thickness is the ratio of the extrusion diameter over the<br> +layer thickness, the default is 1.25. The 'Extrusion Width over Thickness' is the ratio of the extrusion width over the layer thickness,<br> +the default is 1.5. A ratio of one means the extrusion is a circle, a typical ratio of 1.5 means the extrusion is a wide oval. These<br> +values should be measured from a test extrusion line.<br> + <br> +The extrusion fill density ratio that is printed to the console, ( it is derived quantity not a parameter ) is the area of the extrusion diameter<br> +over the extrusion width over the layer thickness. Assuming the extrusion diameter is correct, a high value means the filament will be<br> +packed tightly, and the object will be almost as dense as the filament. If the value is too high, there could be too little room for the<br> +filament, and the extruder will end up plowing through the extra filament. A low value means the filaments will be far away from each<br> +other, the object will be leaky and light. The value with the default extrusion preferences is around 0.82.<br> + <br> +Rarely changed preferences are 'Import Coarseness', 'Mesh Type', 'Infill Bridge Width Over Thickness', 'Infill in Direction of Bridges' &<br> +'Layer Thickness over Precision'. When a triangle mesh has holes in it, the triangle mesh slicer switches over to a slow algorithm that<br> +spans gaps in the mesh. The higher the import coarseness, the wider the gaps in the mesh it will span. An import coarseness of one<br> +means it will span gaps the width of the extrusion. When the Mesh Type preference is Correct Mesh, the mesh will be accurately<br> +carved, and if a hole is found, carve will switch over to the algorithm that spans gaps. If the Mesh Type preference is Unproven<br> +Mesh, carve will use the gap spanning algorithm from the start. The problem with the gap spanning algothm is that it will span gaps,<br> +even if there actually is a gap in the model. Infill bridge width over thickness ratio is the ratio of the extrusion width over the layer<br> +thickness on a bridge layer. If the infill in direction of bridges preference is chosen, the infill will be in the direction of bridges across<br> +gaps, so that the fill will be able to span a bridge easier. The 'Layer Thickness over Precision' is the ratio of the layer thickness over<br> +the smallest change in value. The higher the layer thickness over precision, the more significant figures the output numbers will have,<br> +the default is ten.<br> + <br> +To run carve, in a shell type:<br> +> python carve.py<br> + <br> +The following examples carve the GNU Triangulated Surface file Screw Holder Bottom.stl. The examples are run in a terminal in the<br> +folder which contains Screw Holder Bottom.stl and carve.py. The preferences can be set in the dialog or by changing the preferences file<br> +'carve.csv' with a text editor or a spreadsheet program set to separate tabs.<br> + <br> + <br> +> python carve.py<br> +This brings up the dialog, after clicking 'Carve', the following is printed:<br> +File Screw Holder Bottom.stl is being carved.<br> +The carved file is saved as Screw Holder Bottom_carve.svg<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 carve<br> +>>> carve.<a href="#-main">main</a>()<br> +File Screw Holder Bottom.stl is being carved.<br> +The carved file is saved as Screw Holder Bottom_carve.svg<br> +It took 3 seconds to carve the file.<br> + <br> + <br> +>>> carve.<a href="#-writeOutput">writeOutput</a>()<br> +File Screw Holder Bottom.gcode is being carved.<br> +The carved file is saved as Screw Holder Bottom_carve.svg<br> +It took 3 seconds to carve the file.<br> + <br> + <br> +>>> carve.<a href="#-getCarveGcode">getCarveGcode</a>("<br> +54 162 108 Number of Vertices,Number of Edges,Number of Faces<br> +-5.800000000000001 5.341893939393939 4.017841892579603 Vertex Coordinates XYZ<br> +5.800000000000001 5.341893939393939 4.017841892579603<br> +..<br> +many lines of GNU Triangulated Surface vertices, edges and faces<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.skeinforge_utilities.euclidean.html">skeinforge_tools.skeinforge_utilities.euclidean</a><br> +</td><td width="25%" valign=top><a href="skeinforge_tools.skeinforge_utilities.gcodec.html">skeinforge_tools.skeinforge_utilities.gcodec</a><br> +<a href="skeinforge_tools.skeinforge_utilities.interpret.html">skeinforge_tools.skeinforge_utilities.interpret</a><br> +<a href="math.html">math</a><br> +<a href="os.html">os</a><br> +</td><td width="25%" valign=top><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> +<a href="time.html">time</a><br> +</td><td width="25%" valign=top><a href="skeinforge_tools.skeinforge_utilities.triangle_mesh.html">skeinforge_tools.skeinforge_utilities.triangle_mesh</a><br> +<a href="webbrowser.html">webbrowser</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.carve.html#CarvePreferences">CarvePreferences</a> +</font></dt><dt><font face="helvetica, arial"><a href="skeinforge_tools.carve.html#CarveSkein">CarveSkein</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="CarvePreferences">class <strong>CarvePreferences</strong></a></font></td></tr> + +<tr bgcolor="#ffc8d8"><td rowspan=2><tt> </tt></td> +<td colspan=2><tt>A class to handle the carve preferences.<br> </tt></td></tr> +<tr><td> </td> +<td width="100%">Methods defined here:<br> +<dl><dt><a name="CarvePreferences-__init__"><strong>__init__</strong></a>(self)</dt><dd><tt>Set the default preferences, execute title & preferences fileName.</tt></dd></dl> + +<dl><dt><a name="CarvePreferences-execute"><strong>execute</strong></a>(self)</dt><dd><tt>Carve 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="CarveSkein">class <strong>CarveSkein</strong></a></font></td></tr> + +<tr bgcolor="#ffc8d8"><td rowspan=2><tt> </tt></td> +<td colspan=2><tt>A class to carve a GNU Triangulated Surface.<br> </tt></td></tr> +<tr><td> </td> +<td width="100%">Methods defined here:<br> +<dl><dt><a name="CarveSkein-__init__"><strong>__init__</strong></a>(self)</dt></dl> + +<dl><dt><a name="CarveSkein-addInitializationToOutputSVG"><strong>addInitializationToOutputSVG</strong></a>(self)</dt><dd><tt>Add initialization gcode to the output.</tt></dd></dl> + +<dl><dt><a name="CarveSkein-addLayerStart"><strong>addLayerStart</strong></a>(self, layerIndex, z)</dt><dd><tt>Add the start lines for the layer.</tt></dd></dl> + +<dl><dt><a name="CarveSkein-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="CarveSkein-addLines"><strong>addLines</strong></a>(self, lines)</dt><dd><tt>Add lines of text to the output.</tt></dd></dl> + +<dl><dt><a name="CarveSkein-addRotatedLoopLayerToOutput"><strong>addRotatedLoopLayerToOutput</strong></a>(self, layerIndex, rotatedBoundaryLayer)</dt><dd><tt>Add rotated boundary layer to the output.</tt></dd></dl> + +<dl><dt><a name="CarveSkein-addRotatedLoopLayersToOutput"><strong>addRotatedLoopLayersToOutput</strong></a>(self, rotatedBoundaryLayers)</dt><dd><tt>Add rotated boundary layers to the output.</tt></dd></dl> + +<dl><dt><a name="CarveSkein-addShutdownToOutput"><strong>addShutdownToOutput</strong></a>(self)</dt><dd><tt>Add shutdown svg to the output.</tt></dd></dl> + +<dl><dt><a name="CarveSkein-getReplacedSVGTemplateLines"><strong>getReplacedSVGTemplateLines</strong></a>(self, rotatedBoundaryLayers)</dt><dd><tt>Get the lines of text from the svg_template.txt file.</tt></dd></dl> + +<dl><dt><a name="CarveSkein-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="CarveSkein-getSVGLoopString"><strong>getSVGLoopString</strong></a>(self, loop)</dt><dd><tt>Get the svg loop string.</tt></dd></dl> + +<dl><dt><a name="CarveSkein-parseCarving"><strong>parseCarving</strong></a>(self, carvePreferences, carving)</dt><dd><tt>Parse gnu triangulated surface text and store the carved gcode.</tt></dd></dl> + +<dl><dt><a name="CarveSkein-setExtrusionDiameterWidth"><strong>setExtrusionDiameterWidth</strong></a>(self, carvePreferences)</dt><dd><tt>Set the extrusion diameter & width and the bridge thickness & width.</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="-getCarveGcode"><strong>getCarveGcode</strong></a>(fileName, carvePreferences<font color="#909090">=None</font>)</dt><dd><tt>Carve a shape file.</tt></dd></dl> + <dl><dt><a name="-getCarving"><strong>getCarving</strong></a>(fileName)</dt><dd><tt>Get a carving for the file using an import plugin.</tt></dd></dl> + <dl><dt><a name="-getParameterFromJavascript"><strong>getParameterFromJavascript</strong></a>(lines, parameterName, parameterValue)</dt><dd><tt>Get a paramater from lines of javascript.</tt></dd></dl> + <dl><dt><a name="-getReplacedInQuotes"><strong>getReplacedInQuotes</strong></a>(original, replacement, text)</dt><dd><tt>Replace what follows in quotes after the word.</tt></dd></dl> + <dl><dt><a name="-getReplacedTagString"><strong>getReplacedTagString</strong></a>(replacementTagString, tagID, text)</dt><dd><tt>Get text with the tag string replaced.</tt></dd></dl> + <dl><dt><a name="-getReplacedWordAndInQuotes"><strong>getReplacedWordAndInQuotes</strong></a>(original, replacement, text)</dt><dd><tt>Replace the word in the text and replace what follows in quotes after the word.</tt></dd></dl> + <dl><dt><a name="-main"><strong>main</strong></a>()</dt><dd><tt>Display the carve dialog.</tt></dd></dl> + <dl><dt><a name="-writeOutput"><strong>writeOutput</strong></a>(fileName<font color="#909090">=''</font>)</dt><dd><tt>Carve a GNU Triangulated Surface file. If no fileName is specified, carve the first GNU Triangulated Surface 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/02/05 $'<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>
\ No newline at end of file diff --git a/trunk/reprap/miscellaneous/python-beanshell-scripts/documentation/skeinforge_tools.clip.html b/trunk/reprap/miscellaneous/python-beanshell-scripts/documentation/skeinforge_tools.clip.html index 8016a963..b57d633f 100644 --- a/trunk/reprap/miscellaneous/python-beanshell-scripts/documentation/skeinforge_tools.clip.html +++ b/trunk/reprap/miscellaneous/python-beanshell-scripts/documentation/skeinforge_tools.clip.html @@ -19,8 +19,8 @@ each end of the loop is clipped over the 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 Hollow Square.gcode & Hollow Square.gts. The examples are run in a terminal in the<br> -folder which contains Hollow Square.gcode, Hollow Square.gts and clip.py. The clip function will clip if 'Activate Clip' is true,<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> @@ -29,13 +29,13 @@ combed text, then they clip.<br> <br> > python clip.py<br> This brings up the dialog, after clicking 'Clip', the following is printed:<br> -File Hollow Square.gts is being chain clipped.<br> -The clipped file is saved as Hollow Square_clip.gcode<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 Hollow Square.gts<br> -File Hollow Square.gts is being chain clipped.<br> -The clipped file is saved as Hollow Square_clip.gcode<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> @@ -48,13 +48,13 @@ This brings up the clip dialog.<br> <br> <br> >>> clip.<a href="#-writeOutput">writeOutput</a>()<br> -Hollow Square.gts<br> -File Hollow Square.gts is being chain clipped.<br> -The clipped file is saved as Hollow Square_clip.gcode<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 slice.py )<br> +( GCode generated by May 8, 2008 carve.py )<br> ( Extruder Initialization )<br> ..<br> many lines of gcode<br> @@ -63,7 +63,7 @@ many lines of gcode<br> <br> <br> >>> clip.<a href="#-getClipChainGcode">getClipChainGcode</a>("<br> -( GCode generated by May 8, 2008 slice.py )<br> +( GCode generated by May 8, 2008 carve.py )<br> ( Extruder Initialization )<br> ..<br> many lines of gcode<br> @@ -82,8 +82,8 @@ many lines of gcode<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.import_translator.html">skeinforge_tools.import_translator</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> @@ -110,7 +110,7 @@ many lines of gcode<br> <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-__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> @@ -126,9 +126,9 @@ many lines of gcode<br> <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-addGcodeFromThread"><strong>addGcodeFromThread</strong></a>(self, thread)</dt><dd><tt>Add a gcode thread to the output.</tt></dd></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-addGcodeMovement"><strong>addGcodeMovement</strong></a>(self, point)</dt><dd><tt>Add a movement 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> @@ -153,10 +153,10 @@ many lines of gcode<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> +<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> + <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"> diff --git a/trunk/reprap/miscellaneous/python-beanshell-scripts/documentation/skeinforge_tools.comb.html b/trunk/reprap/miscellaneous/python-beanshell-scripts/documentation/skeinforge_tools.comb.html index a0620b35..b25e4199 100644 --- a/trunk/reprap/miscellaneous/python-beanshell-scripts/documentation/skeinforge_tools.comb.html +++ b/trunk/reprap/miscellaneous/python-beanshell-scripts/documentation/skeinforge_tools.comb.html @@ -14,7 +14,7 @@ The default 'Activate Comb' 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> -Comb bends the extruder travel paths around holes in the slice, to avoid stringers. It moves the extruder to the inside of outer<br> +Comb bends the extruder travel paths around holes in the carve, to avoid stringers. It moves the extruder to the inside of outer<br> perimeters before turning the extruder on so any start up ooze will be inside the shape. It jitters the loop end position to a<br> different place on each layer to prevent the a ridge from forming. The 'Arrival Inset Follow Distance over Extrusion Width' is the<br> ratio of the amount before the start of the outer perimeter the extruder will be moved to. A high value means the extruder will<br> @@ -27,8 +27,8 @@ finish within the perimeter, a low value mean perimeter. To run comb, in a shell type:<br> > python comb.py<br> <br> -The following examples comb the files Hollow Square.gcode & Hollow Square.gts. The examples are run in a terminal in the folder<br> -which contains Hollow Square.gcode, Hollow Square.gts and comb.py. The comb function will comb if 'Activate Comb' is true, which<br> +The following examples comb the files Screw Holder Bottom.gcode & Screw Holder Bottom.stl. The examples are run in a terminal in the folder<br> +which contains Screw Holder Bottom.gcode, Screw Holder Bottom.stl and comb.py. The comb function will comb if 'Activate Comb' is true, which<br> can be set in the dialog or by changing the preferences file 'comb.csv' in the '.skeinforge' folder in your home directory with a text<br> editor or a spreadsheet program set to separate tabs. The functions writeOutput and getCombChainGcode check to see if the<br> text has been combed, if not they call getTowerChainGcode in tower.py to tower the text; once they have the towered text, then<br> @@ -38,8 +38,8 @@ they comb. Pictures of combing in action&nbs <br> > python comb.py<br> This brings up the dialog, after clicking 'Comb', the following is printed:<br> -File Hollow Square.gts is being chain combed.<br> -The combed file is saved as Hollow Square_comb.gcode<br> +File Screw Holder Bottom.stl is being chain combed.<br> +The combed file is saved as Screw Holder Bottom_comb.gcode<br> <br> <br> >python<br> @@ -52,13 +52,13 @@ This brings up the comb dialog.<br> <br> <br> >>> comb.<a href="#-writeOutput">writeOutput</a>()<br> -Hollow Square.gts<br> -File Hollow Square.gts is being chain combed.<br> -The combed file is saved as Hollow Square_comb.gcode<br> +Screw Holder Bottom.stl<br> +File Screw Holder Bottom.stl is being chain combed.<br> +The combed file is saved as Screw Holder Bottom_comb.gcode<br> <br> <br> >>> comb.<a href="#-getCombGcode">getCombGcode</a>("<br> -( GCode generated by May 8, 2008 slice.py )<br> +( GCode generated by May 8, 2008 carve.py )<br> ( Extruder Initialization )<br> ..<br> many lines of gcode<br> @@ -67,7 +67,7 @@ many lines of gcode<br> <br> <br> >>> comb.<a href="#-getCombChainGcode">getCombChainGcode</a>("<br> -( GCode generated by May 8, 2008 slice.py )<br> +( GCode generated by May 8, 2008 carve.py )<br> ( Extruder Initialization )<br> ..<br> many lines of gcode<br> @@ -85,8 +85,8 @@ many lines of gcode<br> <a href="cStringIO.html">cStringIO</a><br> <a href="skeinforge_tools.skeinforge_utilities.euclidean.html">skeinforge_tools.skeinforge_utilities.euclidean</a><br> </td><td width="25%" valign=top><a href="skeinforge_tools.skeinforge_utilities.gcodec.html">skeinforge_tools.skeinforge_utilities.gcodec</a><br> -<a href="skeinforge_tools.import_translator.html">skeinforge_tools.import_translator</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> <a href="math.html">math</a><br> </td><td width="25%" valign=top><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> @@ -114,7 +114,7 @@ many lines of gcode<br> <td colspan=2><tt>A class to handle the comb preferences.<br> </tt></td></tr> <tr><td> </td> <td width="100%">Methods defined here:<br> -<dl><dt><a name="CombPreferences-__init__"><strong>__init__</strong></a>(self)</dt><dd><tt>Set the default preferences, execute title & preferences filename.</tt></dd></dl> +<dl><dt><a name="CombPreferences-__init__"><strong>__init__</strong></a>(self)</dt><dd><tt>Set the default preferences, execute title & preferences fileName.</tt></dd></dl> <dl><dt><a name="CombPreferences-execute"><strong>execute</strong></a>(self)</dt><dd><tt>Comb button has been clicked.</tt></dd></dl> @@ -130,26 +130,26 @@ many lines of gcode<br> <td width="100%">Methods defined here:<br> <dl><dt><a name="CombSkein-__init__"><strong>__init__</strong></a>(self)</dt></dl> -<dl><dt><a name="CombSkein-addGcodeFromThread"><strong>addGcodeFromThread</strong></a>(self, thread)</dt><dd><tt>Add a gcode thread to the output.</tt></dd></dl> +<dl><dt><a name="CombSkein-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="CombSkein-addGcodeMovement"><strong>addGcodeMovement</strong></a>(self, point)</dt><dd><tt>Add a movement to the output.</tt></dd></dl> +<dl><dt><a name="CombSkein-addGcodeMovementZ"><strong>addGcodeMovementZ</strong></a>(self, point, z)</dt><dd><tt>Add a movement to the output.</tt></dd></dl> -<dl><dt><a name="CombSkein-addGcodePath"><strong>addGcodePath</strong></a>(self, path)</dt><dd><tt>Add a gcode path, without modifying the extruder, to the output.</tt></dd></dl> +<dl><dt><a name="CombSkein-addGcodePathZ"><strong>addGcodePathZ</strong></a>(self, path, z)</dt><dd><tt>Add a gcode path, without modifying the extruder, to the output.</tt></dd></dl> -<dl><dt><a name="CombSkein-addIfTravel"><strong>addIfTravel</strong></a>(self, splitLine)</dt><dd><tt>Add travel move around loops if this the extruder is off.</tt></dd></dl> +<dl><dt><a name="CombSkein-addIfTravel"><strong>addIfTravel</strong></a>(self, splitLine)</dt><dd><tt>Add travel move around loops if the extruder is off.</tt></dd></dl> <dl><dt><a name="CombSkein-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="CombSkein-addLoopsBeforeLeavingPerimeter"><strong>addLoopsBeforeLeavingPerimeter</strong></a>(self, aroundBetweenPath, insetPerimeter, perimeterCrossing)</dt><dd><tt>Add loops before leaving the first outer perimeter, in order to leave most of the ooze in the infill.</tt></dd></dl> - <dl><dt><a name="CombSkein-addPathBeforeEnd"><strong>addPathBeforeEnd</strong></a>(self, aroundBetweenPath, location, loop)</dt><dd><tt>Add the path before the end of the loop.</tt></dd></dl> -<dl><dt><a name="CombSkein-addPathBetween"><strong>addPathBetween</strong></a>(self, aroundBetweenPath, betweenFirst, betweenSecond, loopFirst)</dt><dd><tt>Add a path between the perimeter and the fill.</tt></dd></dl> +<dl><dt><a name="CombSkein-addPathBetween"><strong>addPathBetween</strong></a>(self, aroundBetweenPath, betweenFirst, betweenSecond, isLeavingPerimeter, loopFirst)</dt><dd><tt>Add a path between the perimeter and the fill.</tt></dd></dl> <dl><dt><a name="CombSkein-addTailoredLoopPath"><strong>addTailoredLoopPath</strong></a>(self)</dt><dd><tt>Add a clipped and jittered loop path.</tt></dd></dl> <dl><dt><a name="CombSkein-addToLoop"><strong>addToLoop</strong></a>(self, location)</dt><dd><tt>Add a location to loop.</tt></dd></dl> +<dl><dt><a name="CombSkein-getAroundBetweenPath"><strong>getAroundBetweenPath</strong></a>(self, location)</dt><dd><tt>Insert paths around and between the perimeter and the fill.</tt></dd></dl> + <dl><dt><a name="CombSkein-getBetweens"><strong>getBetweens</strong></a>(self)</dt><dd><tt>Set betweens for the layer.</tt></dd></dl> <dl><dt><a name="CombSkein-getJitteredLoop"><strong>getJitteredLoop</strong></a>(self, jitterDistance, jitterLoop)</dt><dd><tt>Get a jittered loop path.</tt></dd></dl> @@ -158,9 +158,9 @@ many lines of gcode<br> <dl><dt><a name="CombSkein-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="CombSkein-initializeMoreParameters"><strong>initializeMoreParameters</strong></a>(self)</dt><dd><tt>Add a movement to the output.</tt></dd></dl> +<dl><dt><a name="CombSkein-getStartIndex"><strong>getStartIndex</strong></a>(self, xIntersections)</dt><dd><tt>Get the start index of the intersections.</tt></dd></dl> -<dl><dt><a name="CombSkein-insertPathsAroundBetween"><strong>insertPathsAroundBetween</strong></a>(self, aroundBetweenPath, location)</dt><dd><tt>Insert paths around and between the perimeter and the fill.</tt></dd></dl> +<dl><dt><a name="CombSkein-initializeMoreParameters"><strong>initializeMoreParameters</strong></a>(self)</dt><dd><tt>Add a movement to the output.</tt></dd></dl> <dl><dt><a name="CombSkein-insertPathsBetween"><strong>insertPathsBetween</strong></a>(self, aroundBetweenPath, nextBeginning, pathEnd)</dt><dd><tt>Insert paths between the perimeter and the fill.</tt></dd></dl> @@ -185,11 +185,11 @@ many lines of gcode<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="-getCombChainGcode"><strong>getCombChainGcode</strong></a>(filename, gcodeText, combPreferences<font color="#909090">=None</font>)</dt><dd><tt>Comb a gcode linear move text. Chain comb the gcode if it is not already combed.</tt></dd></dl> +<td width="100%"><dl><dt><a name="-getCombChainGcode"><strong>getCombChainGcode</strong></a>(fileName, gcodeText, combPreferences<font color="#909090">=None</font>)</dt><dd><tt>Comb a gcode linear move text. Chain comb the gcode if it is not already combed.</tt></dd></dl> <dl><dt><a name="-getCombGcode"><strong>getCombGcode</strong></a>(gcodeText, combPreferences<font color="#909090">=None</font>)</dt><dd><tt>Comb a gcode linear move text.</tt></dd></dl> <dl><dt><a name="-isLoopNumberEqual"><strong>isLoopNumberEqual</strong></a>(betweenX, betweenXIndex, loopNumber)</dt><dd><tt>Determine if the loop number is equal.</tt></dd></dl> <dl><dt><a name="-main"><strong>main</strong></a>(hashtable<font color="#909090">=None</font>)</dt><dd><tt>Display the comb dialog.</tt></dd></dl> - <dl><dt><a name="-writeOutput"><strong>writeOutput</strong></a>(filename<font color="#909090">=''</font>)</dt><dd><tt>Comb a gcode linear move file. Chain comb the gcode if it is not already combed. If no filename is specified, comb the first unmodified gcode file in this folder.</tt></dd></dl> + <dl><dt><a name="-writeOutput"><strong>writeOutput</strong></a>(fileName<font color="#909090">=''</font>)</dt><dd><tt>Comb a gcode linear move file. Chain comb the gcode if it is not already combed. If no fileName is specified, comb 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"> diff --git a/trunk/reprap/miscellaneous/python-beanshell-scripts/documentation/skeinforge_tools.cool.html b/trunk/reprap/miscellaneous/python-beanshell-scripts/documentation/skeinforge_tools.cool.html index d8af8135..65c8efe7 100644 --- a/trunk/reprap/miscellaneous/python-beanshell-scripts/documentation/skeinforge_tools.cool.html +++ b/trunk/reprap/miscellaneous/python-beanshell-scripts/documentation/skeinforge_tools.cool.html @@ -24,25 +24,25 @@ If the 'Turn Fan On at Beginning' preference& To run cool, in a shell which cool is in type:<br> > python cool.py<br> <br> -The following examples cool the files Hollow Square.gcode & Hollow Square.gts. The examples are run in a terminal in the<br> -folder which contains Hollow Square.gcode, Hollow Square.gts and cool.py. The cool function will cool if the 'Activate Cool'<br> +The following examples cool 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 cool.py. The cool function will cool if the 'Activate Cool'<br> checkbox is on. The functions writeOutput and getCoolChainGcode check to see if the text has been cooled, if not they<br> call the getClipChainGcode in clip.py to clip the text; once they have the clipped text, then they cool.<br> <br> <br> > python cool.py<br> This brings up the dialog, after clicking 'Cool', the following is printed:<br> -File Hollow Square.gts is being chain cooled.<br> +File Screw Holder Bottom.stl is being chain cooled.<br> The extrusion fill density ratio is 0.853<br> -The cooled file is saved as Hollow Square.gcode<br> +The cooled file is saved as Screw Holder Bottom.gcode<br> The scalable vector graphics file is saved as Hollow_Square_cool.svg<br> It took 34 seconds to cool the file.<br> <br> <br> -> python cool.py Hollow Square.gts<br> -File Hollow Square.gts is being chain cooled.<br> +> python cool.py Screw Holder Bottom.stl<br> +File Screw Holder Bottom.stl is being chain cooled.<br> The extrusion fill density ratio is 0.853<br> -The cooled file is saved as Hollow Square.gcode<br> +The cooled file is saved as Screw Holder Bottom.gcode<br> The scalable vector graphics file is saved as Hollow_Square_cool.svg<br> It took 34 seconds to cool the file.<br> <br> @@ -57,15 +57,15 @@ This brings up the cool dialog.<br> <br> <br> >>> cool.<a href="#-writeOutput">writeOutput</a>()<br> -File Hollow Square.gts is being chain cooled.<br> +File Screw Holder Bottom.stl is being chain cooled.<br> The extrusion fill density ratio is 0.853<br> -The cooled file is saved as Hollow Square.gcode<br> +The cooled file is saved as Screw Holder Bottom.gcode<br> The scalable vector graphics file is saved as Hollow_Square_cool.svg<br> It took 34 seconds to cool the file.<br> <br> <br> >>> cool.<a href="#-getCoolGcode">getCoolGcode</a>("<br> -( GCode generated by May 8, 2008 slice.py )<br> +( GCode generated by May 8, 2008 carve.py )<br> ( Extruder Initialization )<br> ..<br> many lines of gcode<br> @@ -74,7 +74,7 @@ many lines of gcode<br> <br> <br> >>> cool.<a href="#-getCoolChainGcode">getCoolChainGcode</a>("<br> -( GCode generated by May 8, 2008 slice.py )<br> +( GCode generated by May 8, 2008 carve.py )<br> ( Extruder Initialization )<br> ..<br> many lines of gcode<br> @@ -93,8 +93,8 @@ many lines of gcode<br> <a href="skeinforge_tools.clip.html">skeinforge_tools.clip</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.import_translator.html">skeinforge_tools.import_translator</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> @@ -121,7 +121,7 @@ many lines of gcode<br> <td colspan=2><tt>A class to handle the cool preferences.<br> </tt></td></tr> <tr><td> </td> <td width="100%">Methods defined here:<br> -<dl><dt><a name="CoolPreferences-__init__"><strong>__init__</strong></a>(self)</dt><dd><tt>Set the default preferences, execute title & preferences filename.</tt></dd></dl> +<dl><dt><a name="CoolPreferences-__init__"><strong>__init__</strong></a>(self)</dt><dd><tt>Set the default preferences, execute title & preferences fileName.</tt></dd></dl> <dl><dt><a name="CoolPreferences-execute"><strong>execute</strong></a>(self)</dt><dd><tt>Cool button has been clicked.</tt></dd></dl> @@ -137,7 +137,7 @@ many lines of gcode<br> <td width="100%">Methods defined here:<br> <dl><dt><a name="CoolSkein-__init__"><strong>__init__</strong></a>(self)</dt></dl> -<dl><dt><a name="CoolSkein-addGcodeFromFeedrateMovement"><strong>addGcodeFromFeedrateMovement</strong></a>(self, feedrateMinute, point)</dt><dd><tt>Add a movement to the output.</tt></dd></dl> +<dl><dt><a name="CoolSkein-addGcodeFromFeedrateMovementZ"><strong>addGcodeFromFeedrateMovementZ</strong></a>(self, feedrateMinute, point, z)</dt><dd><tt>Add a movement to the output.</tt></dd></dl> <dl><dt><a name="CoolSkein-addLine"><strong>addLine</strong></a>(self, line)</dt><dd><tt>Add a line of text and a newline to the output.</tt></dd></dl> @@ -158,10 +158,10 @@ many lines of gcode<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="-getCoolChainGcode"><strong>getCoolChainGcode</strong></a>(filename, gcodeText, coolPreferences<font color="#909090">=None</font>)</dt><dd><tt>Cool a gcode linear move text. Chain cool the gcode if it is not already cooled.</tt></dd></dl> +<td width="100%"><dl><dt><a name="-getCoolChainGcode"><strong>getCoolChainGcode</strong></a>(fileName, gcodeText, coolPreferences<font color="#909090">=None</font>)</dt><dd><tt>Cool a gcode linear move text. Chain cool the gcode if it is not already cooled.</tt></dd></dl> <dl><dt><a name="-getCoolGcode"><strong>getCoolGcode</strong></a>(gcodeText, coolPreferences<font color="#909090">=None</font>)</dt><dd><tt>Cool 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 cool dialog.</tt></dd></dl> - <dl><dt><a name="-writeOutput"><strong>writeOutput</strong></a>(filename<font color="#909090">=''</font>)</dt><dd><tt>Cool a gcode linear move file. Chain cool the gcode if it is not already cooled. If no filename is specified, cool the first unmodified gcode file in this folder.</tt></dd></dl> + <dl><dt><a name="-writeOutput"><strong>writeOutput</strong></a>(fileName<font color="#909090">=''</font>)</dt><dd><tt>Cool a gcode linear move file. Chain cool the gcode if it is not already cooled. If no fileName is specified, cool 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"> diff --git a/trunk/reprap/miscellaneous/python-beanshell-scripts/documentation/skeinforge_tools.export.html b/trunk/reprap/miscellaneous/python-beanshell-scripts/documentation/skeinforge_tools.export.html index 7da4536e..bf6d027b 100644 --- a/trunk/reprap/miscellaneous/python-beanshell-scripts/documentation/skeinforge_tools.export.html +++ b/trunk/reprap/miscellaneous/python-beanshell-scripts/documentation/skeinforge_tools.export.html @@ -30,15 +30,15 @@ An export plugin is a script in the expo To run export, in a shell type:<br> > python export.py<br> <br> -The following examples export the files Hollow Square.gts. The examples are run in a terminal in the folder which contains<br> -Hollow Square.gts & export.py. The function writeOutput checks to see if the text has been exported, if not they call<br> +The following examples export the files Screw Holder Bottom.stl. The examples are run in a terminal in the folder which contains<br> +Screw Holder Bottom.stl & export.py. The function writeOutput checks to see if the text has been exported, if not they call<br> getUnpauseChainGcode in unpause.py to unpause the text; once they have the unpaused text, then it exports.<br> <br> <br> > python export.py<br> This brings up the dialog, after clicking 'Export', the following is printed:<br> -File Hollow Square.gts is being chain exported.<br> -The exported file is saved as Hollow Square_export.gcode<br> +File Screw Holder Bottom.stl is being chain exported.<br> +The exported file is saved as Screw Holder Bottom_export.gcode<br> <br> <br> >python<br> @@ -51,9 +51,9 @@ This brings up the export dialog.<br> <br> <br> >>> export.<a href="#-writeOutput">writeOutput</a>()<br> -Hollow Square.gts<br> -File Hollow Square.gts is being chain exported.<br> -The exported file is saved as Hollow Square_export.gcode</tt></p> +Screw Holder Bottom.stl<br> +File Screw Holder Bottom.stl is being chain exported.<br> +The exported file is saved as Screw Holder Bottom_export.gcode</tt></p> <p> <table width="100%" cellspacing=0 cellpadding=2 border=0 summary="section"> <tr bgcolor="#aa55cc"> @@ -66,8 +66,8 @@ The exported file is saved as Hollow Square_e <a href="cStringIO.html">cStringIO</a><br> <a href="skeinforge_tools.skeinforge_utilities.euclidean.html">skeinforge_tools.skeinforge_utilities.euclidean</a><br> </td><td width="25%" valign=top><a href="skeinforge_tools.skeinforge_utilities.gcodec.html">skeinforge_tools.skeinforge_utilities.gcodec</a><br> -<a href="skeinforge_tools.import_translator.html">skeinforge_tools.import_translator</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> <a href="os.html">os</a><br> </td><td width="25%" valign=top><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> @@ -95,7 +95,7 @@ The exported file is saved as Hollow Square_e <td colspan=2><tt>A class to handle the export preferences.<br> </tt></td></tr> <tr><td> </td> <td width="100%">Methods defined here:<br> -<dl><dt><a name="ExportPreferences-__init__"><strong>__init__</strong></a>(self)</dt><dd><tt>Set the default preferences, execute title & preferences filename.</tt></dd></dl> +<dl><dt><a name="ExportPreferences-__init__"><strong>__init__</strong></a>(self)</dt><dd><tt>Set the default preferences, execute title & preferences fileName.</tt></dd></dl> <dl><dt><a name="ExportPreferences-execute"><strong>execute</strong></a>(self)</dt><dd><tt>Export button has been clicked.</tt></dd></dl> @@ -129,8 +129,8 @@ The exported file is saved as Hollow Square_e <td width="100%"><dl><dt><a name="-getExportGcode"><strong>getExportGcode</strong></a>(gcodeText, exportPreferences<font color="#909090">=None</font>)</dt><dd><tt>Export a gcode linear move text.</tt></dd></dl> <dl><dt><a name="-getSelectedPlugin"><strong>getSelectedPlugin</strong></a>(exportPreferences)</dt><dd><tt>Get the selected plugin.</tt></dd></dl> <dl><dt><a name="-main"><strong>main</strong></a>(hashtable<font color="#909090">=None</font>)</dt><dd><tt>Display the export dialog.</tt></dd></dl> - <dl><dt><a name="-writeOutput"><strong>writeOutput</strong></a>(filename<font color="#909090">=''</font>)</dt><dd><tt>Export a gcode linear move file. Chain export the gcode if it is not already exported.<br> -If no filename is specified, export the first unmodified gcode file in this folder.</tt></dd></dl> + <dl><dt><a name="-writeOutput"><strong>writeOutput</strong></a>(fileName<font color="#909090">=''</font>)</dt><dd><tt>Export a gcode linear move file. Chain export the gcode if it is not already exported.<br> +If no fileName is specified, export 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"> diff --git a/trunk/reprap/miscellaneous/python-beanshell-scripts/documentation/skeinforge_tools.export_plugins.binary_16_byte.html b/trunk/reprap/miscellaneous/python-beanshell-scripts/documentation/skeinforge_tools.export_plugins.binary_16_byte.html index b491e2ab..22402a9d 100644 --- a/trunk/reprap/miscellaneous/python-beanshell-scripts/documentation/skeinforge_tools.export_plugins.binary_16_byte.html +++ b/trunk/reprap/miscellaneous/python-beanshell-scripts/documentation/skeinforge_tools.export_plugins.binary_16_byte.html @@ -75,7 +75,7 @@ the move takes place.</tt></p> <td width="100%"><table width="100%" summary="list"><tr><td width="25%" valign=top><a href="__init__.html">__init__</a><br> <a href="cStringIO.html">cStringIO</a><br> </td><td width="25%" valign=top><a href="skeinforge_tools.skeinforge_utilities.gcodec.html">skeinforge_tools.skeinforge_utilities.gcodec</a><br> -<a href="skeinforge_tools.import_translator.html">skeinforge_tools.import_translator</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="os.html">os</a><br> <a href="skeinforge_tools.polyfile.html">skeinforge_tools.polyfile</a><br> </td><td width="25%" valign=top><a href="skeinforge_tools.skeinforge_utilities.preferences.html">skeinforge_tools.skeinforge_utilities.preferences</a><br> @@ -101,7 +101,7 @@ the move takes place.</tt></p> <td colspan=2><tt>A class to handle the export preferences.<br> </tt></td></tr> <tr><td> </td> <td width="100%">Methods defined here:<br> -<dl><dt><a name="Binary16BytePreferences-__init__"><strong>__init__</strong></a>(self)</dt><dd><tt>Set the default preferences, execute title & preferences filename.</tt></dd></dl> +<dl><dt><a name="Binary16BytePreferences-__init__"><strong>__init__</strong></a>(self)</dt><dd><tt>Set the default preferences, execute title & preferences fileName.</tt></dd></dl> <dl><dt><a name="Binary16BytePreferences-execute"><strong>execute</strong></a>(self)</dt><dd><tt>Convert to binary 16 byte button has been clicked.</tt></dd></dl> @@ -133,13 +133,13 @@ the move takes place.</tt></p> <dl><dt><a name="-getOutput"><strong>getOutput</strong></a>(gcodeText, binary16BytePreferences<font color="#909090">=None</font>)</dt><dd><tt>Get the exported version of a gcode file. This function, isArchivable and writeOutput are the only necessary functions in a skeinforge export plugin.<br> If this plugin writes an output than should not be printed, an empty string should be returned.</tt></dd></dl> <dl><dt><a name="-getStringFromCharacterSplitLine"><strong>getStringFromCharacterSplitLine</strong></a>(character, splitLine)</dt><dd><tt>Get the string after the first occurence of the character in the split line.</tt></dd></dl> - <dl><dt><a name="-getSummarizedFilename"><strong>getSummarizedFilename</strong></a>(filename)</dt><dd><tt>Get the filename basename if the file is in the current working directory, otherwise return the original full name.</tt></dd></dl> + <dl><dt><a name="-getSummarizedFilename"><strong>getSummarizedFilename</strong></a>(fileName)</dt><dd><tt>Get the fileName basename if the file is in the current working directory, otherwise return the original full name.</tt></dd></dl> <dl><dt><a name="-getTextLines"><strong>getTextLines</strong></a>(text)</dt><dd><tt>Get the all the lines of text of a text.</tt></dd></dl> <dl><dt><a name="-indexOfStartingWithSecond"><strong>indexOfStartingWithSecond</strong></a>(letter, splitLine)</dt><dd><tt>Get index of the first occurence of the given letter in the split line, starting with the second word. Return - 1 if letter is not found</tt></dd></dl> <dl><dt><a name="-isArchivable"><strong>isArchivable</strong></a>()</dt><dd><tt>Return whether or not this plugin is archivable.</tt></dd></dl> <dl><dt><a name="-main"><strong>main</strong></a>(hashtable<font color="#909090">=None</font>)</dt><dd><tt>Display the export dialog.</tt></dd></dl> - <dl><dt><a name="-writeFileText"><strong>writeFileText</strong></a>(filename, fileText)</dt><dd><tt>Write a text to a file.</tt></dd></dl> - <dl><dt><a name="-writeOutput"><strong>writeOutput</strong></a>(filename<font color="#909090">=''</font>, gcodeText<font color="#909090">=''</font>)</dt><dd><tt>Write the exported version of a gcode file. This function, getOutput and isArchivable are the only necessary functions in a skeinforge export plugin.</tt></dd></dl> + <dl><dt><a name="-writeFileText"><strong>writeFileText</strong></a>(fileName, fileText)</dt><dd><tt>Write a text to a file.</tt></dd></dl> + <dl><dt><a name="-writeOutput"><strong>writeOutput</strong></a>(fileName<font color="#909090">=''</font>, gcodeText<font color="#909090">=''</font>)</dt><dd><tt>Write the exported version of a gcode file. This function, getOutput and isArchivable are the only necessary functions in a skeinforge export plugin.</tt></dd></dl> </td></tr></table><p> <table width="100%" cellspacing=0 cellpadding=2 border=0 summary="section"> <tr bgcolor="#55aa55"> diff --git a/trunk/reprap/miscellaneous/python-beanshell-scripts/documentation/skeinforge_tools.export_plugins.gcode_small.html b/trunk/reprap/miscellaneous/python-beanshell-scripts/documentation/skeinforge_tools.export_plugins.gcode_small.html index f0233eaf..995a9038 100644 --- a/trunk/reprap/miscellaneous/python-beanshell-scripts/documentation/skeinforge_tools.export_plugins.gcode_small.html +++ b/trunk/reprap/miscellaneous/python-beanshell-scripts/documentation/skeinforge_tools.export_plugins.gcode_small.html @@ -66,12 +66,12 @@ developers making new plugins do not have to& <td width="100%"><dl><dt><a name="-getOutput"><strong>getOutput</strong></a>(gcodeText)</dt><dd><tt>Get the exported version of a gcode file. This function, isArchivable and writeOutput are the only necessary functions in a skeinforge export plugin.<br> If this plugin writes an output than should not be printed, an empty string should be returned.</tt></dd></dl> <dl><dt><a name="-getStringFromCharacterSplitLine"><strong>getStringFromCharacterSplitLine</strong></a>(character, splitLine)</dt><dd><tt>Get the string after the first occurence of the character in the split line.</tt></dd></dl> - <dl><dt><a name="-getSummarizedFilename"><strong>getSummarizedFilename</strong></a>(filename)</dt><dd><tt>Get the filename basename if the file is in the current working directory, otherwise return the original full name.</tt></dd></dl> + <dl><dt><a name="-getSummarizedFilename"><strong>getSummarizedFilename</strong></a>(fileName)</dt><dd><tt>Get the fileName basename if the file is in the current working directory, otherwise return the original full name.</tt></dd></dl> <dl><dt><a name="-getTextLines"><strong>getTextLines</strong></a>(text)</dt><dd><tt>Get the all the lines of text of a text.</tt></dd></dl> <dl><dt><a name="-indexOfStartingWithSecond"><strong>indexOfStartingWithSecond</strong></a>(letter, splitLine)</dt><dd><tt>Get index of the first occurence of the given letter in the split line, starting with the second word. Return - 1 if letter is not found</tt></dd></dl> <dl><dt><a name="-isArchivable"><strong>isArchivable</strong></a>()</dt><dd><tt>Return whether or not this plugin is archivable.</tt></dd></dl> - <dl><dt><a name="-writeFileText"><strong>writeFileText</strong></a>(filename, fileText)</dt><dd><tt>Write a text to a file.</tt></dd></dl> - <dl><dt><a name="-writeOutput"><strong>writeOutput</strong></a>(filename, gcodeText)</dt><dd><tt>Write the exported version of a gcode file. This function, getOutput and isArchivable are the only necessary functions in a skeinforge export plugin.</tt></dd></dl> + <dl><dt><a name="-writeFileText"><strong>writeFileText</strong></a>(fileName, fileText)</dt><dd><tt>Write a text to a file.</tt></dd></dl> + <dl><dt><a name="-writeOutput"><strong>writeOutput</strong></a>(fileName, gcodeText)</dt><dd><tt>Write the exported version of a gcode file. This function, getOutput and isArchivable are the only necessary functions in a skeinforge export plugin.</tt></dd></dl> </td></tr></table><p> <table width="100%" cellspacing=0 cellpadding=2 border=0 summary="section"> <tr bgcolor="#55aa55"> diff --git a/trunk/reprap/miscellaneous/python-beanshell-scripts/documentation/skeinforge_tools.export_plugins.gcode_step.html b/trunk/reprap/miscellaneous/python-beanshell-scripts/documentation/skeinforge_tools.export_plugins.gcode_step.html index 258dbf2a..178ee4d7 100644 --- a/trunk/reprap/miscellaneous/python-beanshell-scripts/documentation/skeinforge_tools.export_plugins.gcode_step.html +++ b/trunk/reprap/miscellaneous/python-beanshell-scripts/documentation/skeinforge_tools.export_plugins.gcode_step.html @@ -39,7 +39,7 @@ The writeOutput function of this script takes  <td width="100%"><table width="100%" summary="list"><tr><td width="25%" valign=top><a href="__init__.html">__init__</a><br> <a href="cStringIO.html">cStringIO</a><br> </td><td width="25%" valign=top><a href="skeinforge_tools.skeinforge_utilities.gcodec.html">skeinforge_tools.skeinforge_utilities.gcodec</a><br> -<a href="skeinforge_tools.import_translator.html">skeinforge_tools.import_translator</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="os.html">os</a><br> <a href="skeinforge_tools.polyfile.html">skeinforge_tools.polyfile</a><br> </td><td width="25%" valign=top><a href="skeinforge_tools.skeinforge_utilities.preferences.html">skeinforge_tools.skeinforge_utilities.preferences</a><br> @@ -65,7 +65,7 @@ The writeOutput function of this script takes  <td colspan=2><tt>A class to handle the export preferences.<br> </tt></td></tr> <tr><td> </td> <td width="100%">Methods defined here:<br> -<dl><dt><a name="GcodeStepPreferences-__init__"><strong>__init__</strong></a>(self)</dt><dd><tt>Set the default preferences, execute title & preferences filename.</tt></dd></dl> +<dl><dt><a name="GcodeStepPreferences-__init__"><strong>__init__</strong></a>(self)</dt><dd><tt>Set the default preferences, execute title & preferences fileName.</tt></dd></dl> <dl><dt><a name="GcodeStepPreferences-execute"><strong>execute</strong></a>(self)</dt><dd><tt>Convert to gcode step button has been clicked.</tt></dd></dl> @@ -103,13 +103,13 @@ The writeOutput function of this script takes  <dl><dt><a name="-getOutput"><strong>getOutput</strong></a>(gcodeText, gcodeStepPreferences<font color="#909090">=None</font>)</dt><dd><tt>Get the exported version of a gcode file. This function, isArchivable and writeOutput are the only necessary functions in a skeinforge export plugin.<br> If this plugin writes an output than should not be printed, an empty string should be returned.</tt></dd></dl> <dl><dt><a name="-getStringFromCharacterSplitLine"><strong>getStringFromCharacterSplitLine</strong></a>(character, splitLine)</dt><dd><tt>Get the string after the first occurence of the character in the split line.</tt></dd></dl> - <dl><dt><a name="-getSummarizedFilename"><strong>getSummarizedFilename</strong></a>(filename)</dt><dd><tt>Get the filename basename if the file is in the current working directory, otherwise return the original full name.</tt></dd></dl> + <dl><dt><a name="-getSummarizedFilename"><strong>getSummarizedFilename</strong></a>(fileName)</dt><dd><tt>Get the fileName basename if the file is in the current working directory, otherwise return the original full name.</tt></dd></dl> <dl><dt><a name="-getTextLines"><strong>getTextLines</strong></a>(text)</dt><dd><tt>Get the all the lines of text of a text.</tt></dd></dl> <dl><dt><a name="-indexOfStartingWithSecond"><strong>indexOfStartingWithSecond</strong></a>(letter, splitLine)</dt><dd><tt>Get index of the first occurence of the given letter in the split line, starting with the second word. Return - 1 if letter is not found</tt></dd></dl> <dl><dt><a name="-isArchivable"><strong>isArchivable</strong></a>()</dt><dd><tt>Return whether or not this plugin is archivable.</tt></dd></dl> <dl><dt><a name="-main"><strong>main</strong></a>(hashtable<font color="#909090">=None</font>)</dt><dd><tt>Display the export dialog.</tt></dd></dl> - <dl><dt><a name="-writeFileText"><strong>writeFileText</strong></a>(filename, fileText)</dt><dd><tt>Write a text to a file.</tt></dd></dl> - <dl><dt><a name="-writeOutput"><strong>writeOutput</strong></a>(filename<font color="#909090">=''</font>, gcodeText<font color="#909090">=''</font>)</dt><dd><tt>Write the exported version of a gcode file. This function, getOutput and isArchivable are the only necessary functions in a skeinforge export plugin.</tt></dd></dl> + <dl><dt><a name="-writeFileText"><strong>writeFileText</strong></a>(fileName, fileText)</dt><dd><tt>Write a text to a file.</tt></dd></dl> + <dl><dt><a name="-writeOutput"><strong>writeOutput</strong></a>(fileName<font color="#909090">=''</font>, gcodeText<font color="#909090">=''</font>)</dt><dd><tt>Write the exported version of a gcode file. This function, getOutput and isArchivable are the only necessary functions in a skeinforge export plugin.</tt></dd></dl> </td></tr></table><p> <table width="100%" cellspacing=0 cellpadding=2 border=0 summary="section"> <tr bgcolor="#55aa55"> diff --git a/trunk/reprap/miscellaneous/python-beanshell-scripts/documentation/skeinforge_tools.fill.html b/trunk/reprap/miscellaneous/python-beanshell-scripts/documentation/skeinforge_tools.fill.html index f9987e48..4c38da7d 100644 --- a/trunk/reprap/miscellaneous/python-beanshell-scripts/documentation/skeinforge_tools.fill.html +++ b/trunk/reprap/miscellaneous/python-beanshell-scripts/documentation/skeinforge_tools.fill.html @@ -9,7 +9,7 @@ <font color="#ffffff" face="helvetica, arial"> <br><big><big><strong><a href="skeinforge_tools.html"><font color="#ffffff">skeinforge_tools</font></a>.fill</strong></big></big> ($Date: 2008/28/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/fill.py">/home/enrique/Desktop/backup/babbleold/script/reprap/pyRepRap/skeinforge_tools/fill.py</a></font></td></tr></table> - <p><tt>Fill is a script to fill the slices of a gcode file.<br> + <p><tt>Fill is a script to fill the carves of a gcode file.<br> <br> The diaphragm is a solid group of layers, at regular intervals. It can be used with a sparse infill to give the object watertight, horizontal<br> compartments and/or a higher shear strength. The "Diaphragm Period" is the number of layers between diaphrams. The "Diaphragm<br> @@ -54,14 +54,14 @@ zero, the entire object will be composed of&n through the surface and with a value of three, the object could be watertight. The higher the solid surface thickness, the stronger and<br> heavier the object will be. The default is three.<br> <br> -The following examples fill the files Hollow Square.gcode & Hollow Square.gts. The examples are run in a terminal in the folder which<br> -contains Hollow Square.gcode, Hollow Square.gts and fill.py.<br> +The following examples fill the files Screw Holder Bottom.gcode & Screw Holder Bottom.stl. The examples are run in a terminal in the folder which<br> +contains Screw Holder Bottom.gcode, Screw Holder Bottom.stl and fill.py.<br> <br> <br> > python fill.py<br> This brings up the dialog, after clicking 'Fill', the following is printed:<br> -File Hollow Square.gts is being chain filled.<br> -The filled file is saved as Hollow Square_fill.gcode<br> +File Screw Holder Bottom.stl is being chain filled.<br> +The filled file is saved as Screw Holder Bottom_fill.gcode<br> <br> <br> >python<br> @@ -70,14 +70,14 @@ Python 2.5.1 (r251:54863, Sep 22 2007, 01:43:31)<b Type "help", "copyright", "credits" or "license" for more information.<br> >>> import fill<br> >>> fill.<a href="#-main">main</a>()<br> -File Hollow Square.gts is being filled.<br> -The filled file is saved as Hollow Square_fill.gcode<br> +File Screw Holder Bottom.stl is being filled.<br> +The filled file is saved as Screw Holder Bottom_fill.gcode<br> It took 3 seconds to fill the file.<br> <br> <br> >>> fill.<a href="#-writeOutput">writeOutput</a>()<br> -File Hollow Square.gts is being filled.<br> -The filled file is saved as Hollow Square_fill.gcode<br> +File Screw Holder Bottom.stl is being filled.<br> +The filled file is saved as Screw Holder Bottom_fill.gcode<br> It took 3 seconds to fill the file.</tt></p> <p> <table width="100%" cellspacing=0 cellpadding=2 border=0 summary="section"> @@ -91,12 +91,12 @@ It took 3 seconds to fill the file.</tt></p> <a href="cStringIO.html">cStringIO</a><br> <a href="skeinforge_tools.skeinforge_utilities.euclidean.html">skeinforge_tools.skeinforge_utilities.euclidean</a><br> </td><td width="25%" valign=top><a href="skeinforge_tools.skeinforge_utilities.gcodec.html">skeinforge_tools.skeinforge_utilities.gcodec</a><br> -<a href="skeinforge_tools.import_translator.html">skeinforge_tools.import_translator</a><br> +<a href="skeinforge_tools.inset.html">skeinforge_tools.inset</a><br> <a href="skeinforge_tools.skeinforge_utilities.intercircle.html">skeinforge_tools.skeinforge_utilities.intercircle</a><br> -<a href="math.html">math</a><br> -</td><td width="25%" valign=top><a href="skeinforge_tools.polyfile.html">skeinforge_tools.polyfile</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="skeinforge_tools.slice_shape.html">skeinforge_tools.slice_shape</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> @@ -122,7 +122,7 @@ It took 3 seconds to fill the file.</tt></p> <td colspan=2><tt>A class to handle the fill preferences.<br> </tt></td></tr> <tr><td> </td> <td width="100%">Methods defined here:<br> -<dl><dt><a name="FillPreferences-__init__"><strong>__init__</strong></a>(self)</dt><dd><tt>Set the default preferences, execute title & preferences filename.</tt></dd></dl> +<dl><dt><a name="FillPreferences-__init__"><strong>__init__</strong></a>(self)</dt><dd><tt>Set the default preferences, execute title & preferences fileName.</tt></dd></dl> <dl><dt><a name="FillPreferences-execute"><strong>execute</strong></a>(self)</dt><dd><tt>Fill button has been clicked.</tt></dd></dl> @@ -138,41 +138,39 @@ It took 3 seconds to fill the file.</tt></p> <td width="100%">Methods defined here:<br> <dl><dt><a name="FillSkein-__init__"><strong>__init__</strong></a>(self)</dt></dl> -<dl><dt><a name="FillSkein-addFill"><strong>addFill</strong></a>(self, layerIndex)</dt><dd><tt>Add fill to the slice layer.</tt></dd></dl> +<dl><dt><a name="FillSkein-addFill"><strong>addFill</strong></a>(self, layerIndex)</dt><dd><tt>Add fill to the carve layer.</tt></dd></dl> -<dl><dt><a name="FillSkein-addGcodeFromThread"><strong>addGcodeFromThread</strong></a>(self, thread)</dt><dd><tt>Add a gcode thread to the output.</tt></dd></dl> +<dl><dt><a name="FillSkein-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="FillSkein-addGcodeMovement"><strong>addGcodeMovement</strong></a>(self, point)</dt><dd><tt>Add a movement to the output.</tt></dd></dl> +<dl><dt><a name="FillSkein-addGcodeMovementZ"><strong>addGcodeMovementZ</strong></a>(self, point, z)</dt><dd><tt>Add a movement to the output.</tt></dd></dl> -<dl><dt><a name="FillSkein-addGrid"><strong>addGrid</strong></a>(self, alreadyFilledArounds, arounds, fillLoops, gridPointInsetX, paths, pixelTable, width, reverseRotationAroundZAngle, rotatedExtruderLoops, surroundingSlices, z)</dt></dl> +<dl><dt><a name="FillSkein-addGrid"><strong>addGrid</strong></a>(self, alreadyFilledArounds, arounds, fillLoops, gridPointInsetX, paths, pixelTable, width, reverseRotationAroundZAngle, rotatedExtruderLoops, surroundingCarves)</dt></dl> -<dl><dt><a name="FillSkein-addGridLinePoints"><strong>addGridLinePoints</strong></a>(self, alreadyFilledArounds, begin, end, gridPoints, gridRotationAngle, offset, rotatedExtruderLoops, surroundingSlices, y, z)</dt><dd><tt>Add the segments of one line of a grid to the infill.</tt></dd></dl> +<dl><dt><a name="FillSkein-addGridLinePoints"><strong>addGridLinePoints</strong></a>(self, alreadyFilledArounds, begin, end, gridPoints, gridRotationAngle, offset, rotatedExtruderLoops, surroundingCarves, y)</dt><dd><tt>Add the segments of one line of a grid to the infill.</tt></dd></dl> <dl><dt><a name="FillSkein-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="FillSkein-addRemainingGridPoints"><strong>addRemainingGridPoints</strong></a>(self, arounds, gridPointInsetX, gridPointInsetY, gridPoints, isBothOrNone, paths, pixelTable, width)</dt></dl> +<dl><dt><a name="FillSkein-addRemainingGridPoints"><strong>addRemainingGridPoints</strong></a>(self, arounds, gridPointInsetX, gridPointInsetY, gridPoints, isBothOrNone, paths, pixelTable, width)</dt><dd><tt>Add the remaining grid points to the grid point list.</tt></dd></dl> -<dl><dt><a name="FillSkein-addRotatedSlice"><strong>addRotatedSlice</strong></a>(self, layerIndex, reverseRotationAroundZAngle, surroundingSlices)</dt><dd><tt>Add a rotated slice to the surrounding slices.</tt></dd></dl> +<dl><dt><a name="FillSkein-addRotatedCarve"><strong>addRotatedCarve</strong></a>(self, layerIndex, reverseRotationAroundZAngle, surroundingCarves)</dt><dd><tt>Add a rotated carve to the surrounding carves.</tt></dd></dl> <dl><dt><a name="FillSkein-addShutdownToOutput"><strong>addShutdownToOutput</strong></a>(self)</dt><dd><tt>Add shutdown gcode to the output.</tt></dd></dl> <dl><dt><a name="FillSkein-addToThread"><strong>addToThread</strong></a>(self, location)</dt><dd><tt>Add a location to thread.</tt></dd></dl> -<dl><dt><a name="FillSkein-getAreaChange"><strong>getAreaChange</strong></a>(self, area, layerIndex)</dt><dd><tt>Get the difference between the area of the slice at the layer index and the given area.</tt></dd></dl> +<dl><dt><a name="FillSkein-getAreaChange"><strong>getAreaChange</strong></a>(self, area, layerIndex)</dt><dd><tt>Get the difference between the area of the carve at the layer index and the given area.</tt></dd></dl> -<dl><dt><a name="FillSkein-getGridPoints"><strong>getGridPoints</strong></a>(self, alreadyFilledArounds, fillLoops, reverseRotationAroundZAngle, rotatedExtruderLoops, surroundingSlices, z)</dt><dd><tt>Add a grid to the infill.</tt></dd></dl> +<dl><dt><a name="FillSkein-getCarveArea"><strong>getCarveArea</strong></a>(self, layerIndex)</dt><dd><tt>Get the area of the carve.</tt></dd></dl> + +<dl><dt><a name="FillSkein-getGridPoints"><strong>getGridPoints</strong></a>(self, alreadyFilledArounds, fillLoops, reverseRotationAroundZAngle, rotatedExtruderLoops, surroundingCarves)</dt><dd><tt>Add a grid to the infill.</tt></dd></dl> <dl><dt><a name="FillSkein-getLayerRoundZ"><strong>getLayerRoundZ</strong></a>(self, layerIndex)</dt><dd><tt>Get the plane angle around z that the layer is rotated by.</tt></dd></dl> <dl><dt><a name="FillSkein-getNextGripXStep"><strong>getNextGripXStep</strong></a>(self, gridXStep)</dt><dd><tt>Get the next grid x step, increment by an extra one every three if hexagonal grid is chosen.</tt></dd></dl> -<dl><dt><a name="FillSkein-getRotatedLayer"><strong>getRotatedLayer</strong></a>(self)</dt><dd><tt>Get the rotated layer, making a new one if necessary.</tt></dd></dl> - <dl><dt><a name="FillSkein-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="FillSkein-getSliceArea"><strong>getSliceArea</strong></a>(self, layerIndex)</dt><dd><tt>Get the area of the slice.</tt></dd></dl> - -<dl><dt><a name="FillSkein-isPointInsideLineSegments"><strong>isPointInsideLineSegments</strong></a>(self, alreadyFilledArounds, gridPoint, rotatedExtruderLoops, surroundingSlices)</dt><dd><tt>Is the point inside the line segments of the loops.</tt></dd></dl> +<dl><dt><a name="FillSkein-isPointInsideLineSegments"><strong>isPointInsideLineSegments</strong></a>(self, alreadyFilledArounds, gridPoint, rotatedExtruderLoops, surroundingCarves)</dt><dd><tt>Is the point inside the line segments of the loops.</tt></dd></dl> <dl><dt><a name="FillSkein-linearMove"><strong>linearMove</strong></a>(self, splitLine)</dt><dd><tt>Add a linear move to the thread.</tt></dd></dl> @@ -194,7 +192,7 @@ It took 3 seconds to fill the file.</tt></p> <td colspan=2><tt>A rotated layer.<br> </tt></td></tr> <tr><td> </td> <td width="100%">Methods defined here:<br> -<dl><dt><a name="RotatedLayer-__init__"><strong>__init__</strong></a>(self)</dt></dl> +<dl><dt><a name="RotatedLayer-__init__"><strong>__init__</strong></a>(self, z)</dt></dl> <dl><dt><a name="RotatedLayer-__repr__"><strong>__repr__</strong></a>(self)</dt><dd><tt>Get the string representation of this <a href="#RotatedLayer">RotatedLayer</a>.</tt></dd></dl> @@ -229,25 +227,26 @@ It took 3 seconds to fill the file.</tt></p> <dl><dt><a name="-addShortenedLineSegment"><strong>addShortenedLineSegment</strong></a>(lineSegment, shortenDistance, shortenedSegments)</dt><dd><tt>Add shortened line segment.</tt></dd></dl> <dl><dt><a name="-addSparseEndpoints"><strong>addSparseEndpoints</strong></a>(doubleExtrusionWidth, endpoints, fillLine, horizontalSegments, infillSolidity, removedEndpoints, solidSurfaceThickness, surroundingXIntersections)</dt><dd><tt>Add sparse endpoints.</tt></dd></dl> <dl><dt><a name="-addSparseEndpointsFromSegment"><strong>addSparseEndpointsFromSegment</strong></a>(doubleExtrusionWidth, endpoints, fillLine, horizontalSegments, infillSolidity, removedEndpoints, segment, solidSurfaceThickness, surroundingXIntersections)</dt><dd><tt>Add sparse endpoints from a segment.</tt></dd></dl> - <dl><dt><a name="-addSurroundingXIntersectionIndexes"><strong>addSurroundingXIntersectionIndexes</strong></a>(surroundingSlices, xIntersectionIndexList, y)</dt><dd><tt>Add x intersection indexes from surrounding layers.</tt></dd></dl> + <dl><dt><a name="-addSurroundingXIntersectionIndexes"><strong>addSurroundingXIntersectionIndexes</strong></a>(surroundingCarves, xIntersectionIndexList, y)</dt><dd><tt>Add x intersection indexes from surrounding layers.</tt></dd></dl> <dl><dt><a name="-addYIntersectionPathToList"><strong>addYIntersectionPathToList</strong></a>(pathIndex, pointIndex, y, yIntersection, yIntersectionPaths)</dt><dd><tt>Add the y intersection path to the y intersection paths.</tt></dd></dl> <dl><dt><a name="-compareDistanceFromCenter"><strong>compareDistanceFromCenter</strong></a>(self, other)</dt><dd><tt>Get comparison in order to sort y intersections in ascending order of distance from the center.</tt></dd></dl> <dl><dt><a name="-comparePointIndexDescending"><strong>comparePointIndexDescending</strong></a>(self, other)</dt><dd><tt>Get comparison in order to sort y intersections in descending order of point index.</tt></dd></dl> <dl><dt><a name="-createExtraFillLoops"><strong>createExtraFillLoops</strong></a>(radius, surroundingLoop)</dt><dd><tt>Create extra fill loops.</tt></dd></dl> <dl><dt><a name="-createFillForSurroundings"><strong>createFillForSurroundings</strong></a>(radius, surroundingLoops)</dt><dd><tt>Create extra fill loops for surrounding loops.</tt></dd></dl> + <dl><dt><a name="-getAdditionalLength"><strong>getAdditionalLength</strong></a>(path, point, pointIndex)</dt><dd><tt>Get the additional length added by inserting a point into a path.</tt></dd></dl> <dl><dt><a name="-getClosestOppositeIntersectionPaths"><strong>getClosestOppositeIntersectionPaths</strong></a>(yIntersectionPaths)</dt><dd><tt>Get the close to center paths, starting with the first and an additional opposite if it exists.</tt></dd></dl> <dl><dt><a name="-getExtraFillLoops"><strong>getExtraFillLoops</strong></a>(insideLoops, outsideLoop, radius)</dt><dd><tt>Get extra loops between inside and outside loops.</tt></dd></dl> - <dl><dt><a name="-getFillChainGcode"><strong>getFillChainGcode</strong></a>(filename, gcodeText, fillPreferences<font color="#909090">=None</font>)</dt><dd><tt>Fill the slices of a gcode text. Chain fill the gcode if it is not already sliced.</tt></dd></dl> - <dl><dt><a name="-getFillGcode"><strong>getFillGcode</strong></a>(gcodeText, fillPreferences<font color="#909090">=None</font>)</dt><dd><tt>Fill the slices of a gcode text.</tt></dd></dl> + <dl><dt><a name="-getFillChainGcode"><strong>getFillChainGcode</strong></a>(fileName, gcodeText, fillPreferences<font color="#909090">=None</font>)</dt><dd><tt>Fill the carves of a gcode text. Chain fill the gcode if it is not already carved.</tt></dd></dl> + <dl><dt><a name="-getFillGcode"><strong>getFillGcode</strong></a>(gcodeText, fillPreferences<font color="#909090">=None</font>)</dt><dd><tt>Fill the carves of a gcode text.</tt></dd></dl> <dl><dt><a name="-getHorizontalSegmentsFromLoopLists"><strong>getHorizontalSegmentsFromLoopLists</strong></a>(fillLoops, alreadyFilledArounds, y)</dt><dd><tt>Get horizontal segments inside loops.</tt></dd></dl> <dl><dt><a name="-getIntersectionOfXIntersectionIndexes"><strong>getIntersectionOfXIntersectionIndexes</strong></a>(totalSolidSurfaceThickness, xIntersectionIndexList)</dt><dd><tt>Get x intersections from surrounding layers.</tt></dd></dl> <dl><dt><a name="-getNonIntersectingGridPointLine"><strong>getNonIntersectingGridPointLine</strong></a>(arounds, gridPointInsetX, isJunctionWide, paths, pixelTable, yIntersectionPath, width)</dt><dd><tt>Get the points around the grid point that is junction wide that do not intersect.</tt></dd></dl> <dl><dt><a name="-getPlusMinusSign"><strong>getPlusMinusSign</strong></a>(number)</dt><dd><tt>Get one if the number is zero or positive else negative one.</tt></dd></dl> - <dl><dt><a name="-getSurroundingXIntersections"><strong>getSurroundingXIntersections</strong></a>(doubleSolidSurfaceThickness, surroundingSlices, y)</dt><dd><tt>Get x intersections from surrounding layers.</tt></dd></dl> + <dl><dt><a name="-getSurroundingXIntersections"><strong>getSurroundingXIntersections</strong></a>(doubleSolidSurfaceThickness, surroundingCarves, y)</dt><dd><tt>Get x intersections from surrounding layers.</tt></dd></dl> <dl><dt><a name="-getWithLeastLength"><strong>getWithLeastLength</strong></a>(path, point)</dt><dd><tt>Insert a point into a path, at the index at which the path would be shortest.</tt></dd></dl> <dl><dt><a name="-getYIntersection"><strong>getYIntersection</strong></a>(firstPoint, secondPoint, x)</dt><dd><tt>Get where the line crosses x.</tt></dd></dl> - <dl><dt><a name="-getYIntersectionIfExists"><strong>getYIntersectionIfExists</strong></a>(vector3First, vector3Second, x)</dt><dd><tt>Get the y intersection if it exists.</tt></dd></dl> - <dl><dt><a name="-getYIntersectionInsideYSegment"><strong>getYIntersectionInsideYSegment</strong></a>(segmentFirstY, segmentSecondY, vector3First, vector3Second, x)</dt><dd><tt>Get the y intersection inside the y segment if it does, else none.</tt></dd></dl> + <dl><dt><a name="-getYIntersectionIfExists"><strong>getYIntersectionIfExists</strong></a>(complexFirst, complexSecond, x)</dt><dd><tt>Get the y intersection if it exists.</tt></dd></dl> + <dl><dt><a name="-getYIntersectionInsideYSegment"><strong>getYIntersectionInsideYSegment</strong></a>(segmentFirstY, segmentSecondY, complexFirst, complexSecond, x)</dt><dd><tt>Get the y intersection inside the y segment if it does, else none.</tt></dd></dl> <dl><dt><a name="-insertGridPointPair"><strong>insertGridPointPair</strong></a>(arounds, gridPoint, gridPointInsetX, gridPoints, isJunctionWide, paths, pixelTable, yIntersectionPath, width)</dt><dd><tt>Insert a pair of points around the grid point is is junction wide, otherwise inset one point.</tt></dd></dl> <dl><dt><a name="-insertGridPointPairWithLinePath"><strong>insertGridPointPairWithLinePath</strong></a>(arounds, gridPoint, gridPointInsetX, gridPoints, isJunctionWide, linePath, paths, pixelTable, yIntersectionPath, width)</dt><dd><tt>Insert a pair of points around the grid point is is junction wide, otherwise inset one point.</tt></dd></dl> <dl><dt><a name="-insertGridPointPairs"><strong>insertGridPointPairs</strong></a>(arounds, gridPoint, gridPointInsetX, gridPoints, intersectionPathFirst, intersectionPathSecond, isBothOrNone, isJunctionWide, paths, pixelTable, width)</dt><dd><tt>Insert a pair of points around a pair of grid points.</tt></dd></dl> @@ -265,7 +264,7 @@ It took 3 seconds to fill the file.</tt></p> <dl><dt><a name="-main"><strong>main</strong></a>(hashtable<font color="#909090">=None</font>)</dt><dd><tt>Display the fill dialog.</tt></dd></dl> <dl><dt><a name="-removeEndpoints"><strong>removeEndpoints</strong></a>(aroundPixelTable, layerExtrusionWidth, paths, removedEndpoints, aroundWidth)</dt><dd><tt>Remove endpoints which are added to the path.</tt></dd></dl> <dl><dt><a name="-setIsOutside"><strong>setIsOutside</strong></a>(yCloseToCenterPath, yIntersectionPaths)</dt><dd><tt>Determine if the yCloseToCenterPath is outside.</tt></dd></dl> - <dl><dt><a name="-writeOutput"><strong>writeOutput</strong></a>(filename<font color="#909090">=''</font>)</dt><dd><tt>Fill the slices of a gcode file. Chain slice the file if it is a GNU TriangulatedSurface file. If no filename is specified, fill the first unmodified gcode file in this folder.</tt></dd></dl> + <dl><dt><a name="-writeOutput"><strong>writeOutput</strong></a>(fileName<font color="#909090">=''</font>)</dt><dd><tt>Fill the carves of a gcode file. Chain carve the file if it is a GNU TriangulatedSurface file. If no fileName is specified, fill 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"> diff --git a/trunk/reprap/miscellaneous/python-beanshell-scripts/documentation/skeinforge_tools.fillet.html b/trunk/reprap/miscellaneous/python-beanshell-scripts/documentation/skeinforge_tools.fillet.html index 462f78ca..a36ad789 100644 --- a/trunk/reprap/miscellaneous/python-beanshell-scripts/documentation/skeinforge_tools.fillet.html +++ b/trunk/reprap/miscellaneous/python-beanshell-scripts/documentation/skeinforge_tools.fillet.html @@ -30,8 +30,8 @@ jerk at the end of the path. The d the new feedrate, the default is true. To run fillet, in a shell in the folder which fillet is in type:<br> > python fillet.py<br> <br> -The following examples fillet the files Hollow Square.gcode & Hollow Square.gts. The examples are run in a terminal in the folder<br> -which contains Hollow Square.gcode, Hollow Square.gts and fillet.py. The fillet function executes the preferred fillet type, which<br> +The following examples fillet the files Screw Holder Bottom.gcode & Screw Holder Bottom.stl. The examples are run in a terminal in the folder<br> +which contains Screw Holder Bottom.gcode, Screw Holder Bottom.stl and fillet.py. The fillet function executes the preferred fillet type, which<br> can be set in the dialog or by changing the preferences file 'fillet.csv' with a text editor or a spreadsheet program set to separate<br> tabs. The functions writeOutput and getFilletChainGcode check to see if the text has been combed, if not they call the<br> getOozebaneChainGcode in oozebane.py to fill the text; once they have the oozebaned text, then they fillet.<br> @@ -39,8 +39,8 @@ getOozebaneChainGcode in oozebane.py to fill the t <br> > python fillet.py<br> This brings up the dialog, after clicking 'Fillet', the following is printed:<br> -File Hollow Square.gts is being chain filleted.<br> -The filleted file is saved as Hollow Square_fillet.gcode<br> +File Screw Holder Bottom.stl is being chain filleted.<br> +The filleted file is saved as Screw Holder Bottom_fillet.gcode<br> <br> <br> > python<br> @@ -53,27 +53,27 @@ This brings up the fillet dialog.<br> <br> <br> >>> fillet.<a href="#-arcPointFile">arcPointFile</a>()<br> -File Hollow Square.gcode is being filleted into arc points.<br> -The arc point file is saved as Hollow Square_fillet.gcode<br> +File Screw Holder Bottom.gcode is being filleted into arc points.<br> +The arc point file is saved as Screw Holder Bottom_fillet.gcode<br> <br> <br> >>> fillet.<a href="#-arcRadiusFile">arcRadiusFile</a>()<br> -File Hollow Square.gcode is being filleted into arc radiuses.<br> -The arc radius file is saved as Hollow Square_fillet.gcode<br> +File Screw Holder Bottom.gcode is being filleted into arc radiuses.<br> +The arc radius file is saved as Screw Holder Bottom_fillet.gcode<br> <br> <br> >>> fillet.<a href="#-arcSegmentFile">arcSegmentFile</a>()<br> -File Hollow Square.gcode is being arc segmented.<br> -The arc segment file is saved as Hollow Square_fillet.gcode<br> +File Screw Holder Bottom.gcode is being arc segmented.<br> +The arc segment file is saved as Screw Holder Bottom_fillet.gcode<br> <br> <br> >>> fillet.<a href="#-bevelFile">bevelFile</a>()<br> -File Hollow Square.gcode is being beveled.<br> -The beveled file is saved as Hollow Square_fillet.gcode<br> +File Screw Holder Bottom.gcode is being beveled.<br> +The beveled file is saved as Screw Holder Bottom_fillet.gcode<br> <br> <br> >>> fillet.<a href="#-getArcPointGcode">getArcPointGcode</a>("<br> -( GCode generated by May 8, 2008 slice.py )<br> +( GCode generated by May 8, 2008 carve.py )<br> ( Extruder Initialization )<br> ..<br> many lines of gcode<br> @@ -82,7 +82,7 @@ many lines of gcode<br> <br> <br> >>> fillet.<a href="#-getArcRadiusGcode">getArcRadiusGcode</a>("<br> -( GCode generated by May 8, 2008 slice.py )<br> +( GCode generated by May 8, 2008 carve.py )<br> ( Extruder Initialization )<br> ..<br> many lines of gcode<br> @@ -91,7 +91,7 @@ many lines of gcode<br> <br> <br> >>> fillet.<a href="#-getArcSegmentGcode">getArcSegmentGcode</a>("<br> -( GCode generated by May 8, 2008 slice.py )<br> +( GCode generated by May 8, 2008 carve.py )<br> ( Extruder Initialization )<br> ..<br> many lines of gcode<br> @@ -100,7 +100,7 @@ many lines of gcode<br> <br> <br> >>> fillet.<a href="#-getBevelGcode">getBevelGcode</a>("<br> -( GCode generated by May 8, 2008 slice.py )<br> +( GCode generated by May 8, 2008 carve.py )<br> ( Extruder Initialization )<br> ..<br> many lines of gcode<br> @@ -109,7 +109,7 @@ many lines of gcode<br> <br> <br> >>> fillet.<a href="#-getFilletGcode">getFilletGcode</a>("<br> -( GCode generated by May 8, 2008 slice.py )<br> +( GCode generated by May 8, 2008 carve.py )<br> ( Extruder Initialization )<br> ..<br> many lines of gcode<br> @@ -118,7 +118,7 @@ many lines of gcode<br> <br> <br> >>> fillet.<a href="#-getFilletChainGcode">getFilletChainGcode</a>("<br> -( GCode generated by May 8, 2008 slice.py )<br> +( GCode generated by May 8, 2008 carve.py )<br> ( Extruder Initialization )<br> ..<br> many lines of gcode<br> @@ -127,9 +127,9 @@ many lines of gcode<br> <br> <br> >>> fillet.<a href="#-writeOutput">writeOutput</a>()<br> -Hollow Square.gts<br> -File Hollow Square.gcode is being chain filleted.<br> -The filleted file is saved as Hollow Square_fillet.gcode</tt></p> +Screw Holder Bottom.stl<br> +File Screw Holder Bottom.gcode is being chain filleted.<br> +The filleted file is saved as Screw Holder Bottom_fillet.gcode</tt></p> <p> <table width="100%" cellspacing=0 cellpadding=2 border=0 summary="section"> <tr bgcolor="#aa55cc"> @@ -142,7 +142,7 @@ The filleted file is saved as Hollow Square_f <a href="cStringIO.html">cStringIO</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.import_translator.html">skeinforge_tools.import_translator</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.oozebane.html">skeinforge_tools.oozebane</a><br> <a href="skeinforge_tools.polyfile.html">skeinforge_tools.polyfile</a><br> @@ -372,7 +372,7 @@ Methods inherited from <a href="skeinforge_tools.fillet.html#BevelSkein">BevelSk <td colspan=2><tt>A class to handle the fillet preferences.<br> </tt></td></tr> <tr><td> </td> <td width="100%">Methods defined here:<br> -<dl><dt><a name="FilletPreferences-__init__"><strong>__init__</strong></a>(self)</dt><dd><tt>Set the default preferences, execute title & preferences filename.</tt></dd></dl> +<dl><dt><a name="FilletPreferences-__init__"><strong>__init__</strong></a>(self)</dt><dd><tt>Set the default preferences, execute title & preferences fileName.</tt></dd></dl> <dl><dt><a name="FilletPreferences-execute"><strong>execute</strong></a>(self)</dt><dd><tt>Fillet button has been clicked.</tt></dd></dl> @@ -383,20 +383,20 @@ Methods inherited from <a href="skeinforge_tools.fillet.html#BevelSkein">BevelSk <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="-arcPointFile"><strong>arcPointFile</strong></a>(filename<font color="#909090">=''</font>)</dt><dd><tt>Fillet a gcode linear move file into a helical point move file. If no filename is specified, arc point the first unmodified gcode file in this folder.</tt></dd></dl> - <dl><dt><a name="-arcRadiusFile"><strong>arcRadiusFile</strong></a>(filename<font color="#909090">=''</font>)</dt><dd><tt>Fillet a gcode linear move file into a helical radius move file. If no filename is specified, arc radius the first unmodified gcode file in this folder.</tt></dd></dl> - <dl><dt><a name="-arcSegmentFile"><strong>arcSegmentFile</strong></a>(filename<font color="#909090">=''</font>)</dt><dd><tt>Fillet a gcode linear move file into an arc segment linear move file. If no filename is specified, arc segment the first unmodified gcode file in this folder.</tt></dd></dl> - <dl><dt><a name="-bevelFile"><strong>bevelFile</strong></a>(filename<font color="#909090">=''</font>)</dt><dd><tt>Bevel a gcode linear move file. If no filename is specified, bevel the first unmodified gcode file in this folder.</tt></dd></dl> +<td width="100%"><dl><dt><a name="-arcPointFile"><strong>arcPointFile</strong></a>(fileName<font color="#909090">=''</font>)</dt><dd><tt>Fillet a gcode linear move file into a helical point move file. If no fileName is specified, arc point the first unmodified gcode file in this folder.</tt></dd></dl> + <dl><dt><a name="-arcRadiusFile"><strong>arcRadiusFile</strong></a>(fileName<font color="#909090">=''</font>)</dt><dd><tt>Fillet a gcode linear move file into a helical radius move file. If no fileName is specified, arc radius the first unmodified gcode file in this folder.</tt></dd></dl> + <dl><dt><a name="-arcSegmentFile"><strong>arcSegmentFile</strong></a>(fileName<font color="#909090">=''</font>)</dt><dd><tt>Fillet a gcode linear move file into an arc segment linear move file. If no fileName is specified, arc segment the first unmodified gcode file in this folder.</tt></dd></dl> + <dl><dt><a name="-bevelFile"><strong>bevelFile</strong></a>(fileName<font color="#909090">=''</font>)</dt><dd><tt>Bevel a gcode linear move file. If no fileName is specified, bevel the first unmodified gcode file in this folder.</tt></dd></dl> <dl><dt><a name="-getArcPointGcode"><strong>getArcPointGcode</strong></a>(filletPreferences, gcodeText)</dt><dd><tt>Arc point a gcode linear move text into a helical point move gcode text.</tt></dd></dl> <dl><dt><a name="-getArcRadiusGcode"><strong>getArcRadiusGcode</strong></a>(filletPreferences, gcodeText)</dt><dd><tt>Arc radius a gcode linear move text into a helical radius move gcode text.</tt></dd></dl> <dl><dt><a name="-getArcSegmentGcode"><strong>getArcSegmentGcode</strong></a>(filletPreferences, gcodeText)</dt><dd><tt>Arc segment a gcode linear move text into an arc segment linear move gcode text.</tt></dd></dl> <dl><dt><a name="-getBevelGcode"><strong>getBevelGcode</strong></a>(filletPreferences, gcodeText)</dt><dd><tt>Bevel a gcode linear move text.</tt></dd></dl> - <dl><dt><a name="-getFilletChainGcode"><strong>getFilletChainGcode</strong></a>(filename, gcodeText, filletPreferences<font color="#909090">=None</font>)</dt><dd><tt>Fillet a gcode linear move text. Chain oozebane the gcode if it is not already oozebaned.</tt></dd></dl> + <dl><dt><a name="-getFilletChainGcode"><strong>getFilletChainGcode</strong></a>(fileName, gcodeText, filletPreferences<font color="#909090">=None</font>)</dt><dd><tt>Fillet a gcode linear move text. Chain oozebane the gcode if it is not already oozebaned.</tt></dd></dl> <dl><dt><a name="-getFilletGcode"><strong>getFilletGcode</strong></a>(gcodeText, filletPreferences<font color="#909090">=None</font>)</dt><dd><tt>Fillet a gcode linear move text.</tt></dd></dl> <dl><dt><a name="-main"><strong>main</strong></a>()</dt><dd><tt>Display the fillet dialog.</tt></dd></dl> - <dl><dt><a name="-writeOutput"><strong>writeOutput</strong></a>(filename<font color="#909090">=''</font>)</dt><dd><tt>Fillet a gcode linear move file. Chain fill the gcode if it is not already filled.<br> + <dl><dt><a name="-writeOutput"><strong>writeOutput</strong></a>(fileName<font color="#909090">=''</font>)</dt><dd><tt>Fillet a gcode linear move file. Chain fill the gcode if it is not already filled.<br> Depending on the preferences, either arcPoint, arcRadius, arcSegment, bevel or do nothing.<br> -If no filename is specified, fillet the first unmodified gcode file in this folder.</tt></dd></dl> +If no fileName is specified, fillet 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"> diff --git a/trunk/reprap/miscellaneous/python-beanshell-scripts/documentation/skeinforge_tools.hop.html b/trunk/reprap/miscellaneous/python-beanshell-scripts/documentation/skeinforge_tools.hop.html index edc6b134..79901957 100644 --- a/trunk/reprap/miscellaneous/python-beanshell-scripts/documentation/skeinforge_tools.hop.html +++ b/trunk/reprap/miscellaneous/python-beanshell-scripts/documentation/skeinforge_tools.hop.html @@ -14,24 +14,24 @@ The default 'Activate Hop' checkbox is off. It is off because Vik and Nophead found better results without hopping. When it<br> is on, the functions described below will work, when it is off, the functions will not be called.<br> <br> -The important value for the hop preferences is "Hop Over Extrusion Height (ratio)" which is the ratio of the hop height over the<br> -extrusion height, the default is 1.0. The 'Minimum Hop Angle (degrees)' is the minimum angle that the path of the extruder<br> +The important value for the hop preferences is "Hop Over Layer Thickness (ratio)" which is the ratio of the hop height over the<br> +layer thickness, the default is 1.0. The 'Minimum Hop Angle (degrees)' is the minimum angle that the path of the extruder<br> will be raised. An angle of ninety means that the extruder will go straight up as soon as it is not extruding and a low angle<br> means the extruder path will gradually rise to the hop height, the default is 20 degrees.<br> <br> To run hop, in a shell which hop is in type:<br> > python hop.py<br> <br> -The following examples hop the files Hollow Square.gcode & Hollow Square.gts. The examples are run in a terminal in the<br> -folder which contains Hollow Square.gcode, Hollow Square.gts and hop.py. The hop function will hop if the 'Activate Hop'<br> +The following examples hop 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 hop.py. The hop function will hop if the 'Activate Hop'<br> checkbox is on. The functions writeOutput and getHopChainGcode check to see if the text has been hopped, if not they<br> call the getStretchChainGcode in stretch.py to stretch the text; once they have the stretched text, then they hop.<br> <br> <br> > python hop.py<br> This brings up the dialog, after clicking 'Hop', the following is printed:<br> -File Hollow Square.gts is being chain hopped.<br> -The hopped file is saved as Hollow Square_hop.gcode<br> +File Screw Holder Bottom.stl is being chain hopped.<br> +The hopped file is saved as Screw Holder Bottom_hop.gcode<br> <br> <br> > python<br> @@ -44,13 +44,13 @@ This brings up the hop dialog.<br> <br> <br> >>> hop.<a href="#-writeOutput">writeOutput</a>()<br> -Hollow Square.gts<br> -File Hollow Square.gts is being chain hopped.<br> -The hopped file is saved as Hollow Square_hop.gcode<br> +Screw Holder Bottom.stl<br> +File Screw Holder Bottom.stl is being chain hopped.<br> +The hopped file is saved as Screw Holder Bottom_hop.gcode<br> <br> <br> >>> hop.<a href="#-getHopGcode">getHopGcode</a>("<br> -( GCode generated by May 8, 2008 slice.py )<br> +( GCode generated by May 8, 2008 carve.py )<br> ( Extruder Initialization )<br> ..<br> many lines of gcode<br> @@ -59,7 +59,7 @@ many lines of gcode<br> <br> <br> >>> hop.<a href="#-getHopChainGcode">getHopChainGcode</a>("<br> -( GCode generated by May 8, 2008 slice.py )<br> +( GCode generated by May 8, 2008 carve.py )<br> ( Extruder Initialization )<br> ..<br> many lines of gcode<br> @@ -77,7 +77,7 @@ many lines of gcode<br> <a href="cStringIO.html">cStringIO</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.import_translator.html">skeinforge_tools.import_translator</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> @@ -105,7 +105,7 @@ many lines of gcode<br> <td colspan=2><tt>A class to handle the hop preferences.<br> </tt></td></tr> <tr><td> </td> <td width="100%">Methods defined here:<br> -<dl><dt><a name="HopPreferences-__init__"><strong>__init__</strong></a>(self)</dt><dd><tt>Set the default preferences, execute title & preferences filename.</tt></dd></dl> +<dl><dt><a name="HopPreferences-__init__"><strong>__init__</strong></a>(self)</dt><dd><tt>Set the default preferences, execute title & preferences fileName.</tt></dd></dl> <dl><dt><a name="HopPreferences-execute"><strong>execute</strong></a>(self)</dt><dd><tt>Hop button has been clicked.</tt></dd></dl> @@ -125,7 +125,7 @@ many lines of gcode<br> <dl><dt><a name="HopSkein-getHopLine"><strong>getHopLine</strong></a>(self, line)</dt><dd><tt>Get hopped gcode line.</tt></dd></dl> -<dl><dt><a name="HopSkein-getMovementLineWithHop"><strong>getMovementLineWithHop</strong></a>(self, location)</dt><dd><tt>Get linear movement line for a location.</tt></dd></dl> +<dl><dt><a name="HopSkein-getMovementLineWithHop"><strong>getMovementLineWithHop</strong></a>(self, location, z)</dt><dd><tt>Get linear movement line for a location.</tt></dd></dl> <dl><dt><a name="HopSkein-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> @@ -144,10 +144,10 @@ many lines of gcode<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="-getHopChainGcode"><strong>getHopChainGcode</strong></a>(filename, gcodeText, hopPreferences<font color="#909090">=None</font>)</dt><dd><tt>Hop a gcode linear move text. Chain hop the gcode if it is not already hopped.</tt></dd></dl> +<td width="100%"><dl><dt><a name="-getHopChainGcode"><strong>getHopChainGcode</strong></a>(fileName, gcodeText, hopPreferences<font color="#909090">=None</font>)</dt><dd><tt>Hop a gcode linear move text. Chain hop the gcode if it is not already hopped.</tt></dd></dl> <dl><dt><a name="-getHopGcode"><strong>getHopGcode</strong></a>(gcodeText, hopPreferences<font color="#909090">=None</font>)</dt><dd><tt>Hop 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 hop dialog.</tt></dd></dl> - <dl><dt><a name="-writeOutput"><strong>writeOutput</strong></a>(filename<font color="#909090">=''</font>)</dt><dd><tt>Hop a gcode linear move file. Chain hop the gcode if it is not already hopped. If no filename is specified, hop the first unmodified gcode file in this folder.</tt></dd></dl> + <dl><dt><a name="-writeOutput"><strong>writeOutput</strong></a>(fileName<font color="#909090">=''</font>)</dt><dd><tt>Hop a gcode linear move file. Chain hop the gcode if it is not already hopped. If no fileName is specified, hop 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"> diff --git a/trunk/reprap/miscellaneous/python-beanshell-scripts/documentation/skeinforge_tools.html b/trunk/reprap/miscellaneous/python-beanshell-scripts/documentation/skeinforge_tools.html index c46ae5bc..6394a739 100644 --- a/trunk/reprap/miscellaneous/python-beanshell-scripts/documentation/skeinforge_tools.html +++ b/trunk/reprap/miscellaneous/python-beanshell-scripts/documentation/skeinforge_tools.html @@ -19,28 +19,28 @@ <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="skeinforge_tools.analyze.html">analyze</a><br> <a href="skeinforge_tools.analyze_plugins.html"><strong>analyze_plugins</strong> (package)</a><br> +<a href="skeinforge_tools.carve.html">carve</a><br> <a href="skeinforge_tools.clip.html">clip</a><br> <a href="skeinforge_tools.comb.html">comb</a><br> <a href="skeinforge_tools.cool.html">cool</a><br> -<a href="skeinforge_tools.export.html">export</a><br> -</td><td width="25%" valign=top><a href="skeinforge_tools.export_plugins.html"><strong>export_plugins</strong> (package)</a><br> +</td><td width="25%" valign=top><a href="skeinforge_tools.export.html">export</a><br> +<a href="skeinforge_tools.export_plugins.html"><strong>export_plugins</strong> (package)</a><br> <a href="skeinforge_tools.fill.html">fill</a><br> <a href="skeinforge_tools.fillet.html">fillet</a><br> <a href="skeinforge_tools.hop.html">hop</a><br> <a href="skeinforge_tools.import_plugins.html"><strong>import_plugins</strong> (package)</a><br> -<a href="skeinforge_tools.import_translator.html">import_translator</a><br> -</td><td width="25%" valign=top><a href="skeinforge_tools.material.html">material</a><br> +</td><td width="25%" valign=top><a href="skeinforge_tools.inset.html">inset</a><br> +<a href="skeinforge_tools.material.html">material</a><br> <a href="skeinforge_tools.multiply.html">multiply</a><br> -<a href="skeinforge_tools.nozzle_wipe.html">nozzle_wipe</a><br> <a href="skeinforge_tools.oozebane.html">oozebane</a><br> <a href="skeinforge_tools.polyfile.html">polyfile</a><br> <a href="skeinforge_tools.raft.html">raft</a><br> </td><td width="25%" valign=top><a href="skeinforge_tools.skeinforge_utilities.html"><strong>skeinforge_utilities</strong> (package)</a><br> -<a href="skeinforge_tools.slice_shape.html">slice_shape</a><br> <a href="skeinforge_tools.speed.html">speed</a><br> <a href="skeinforge_tools.stretch.html">stretch</a><br> <a href="skeinforge_tools.tower.html">tower</a><br> <a href="skeinforge_tools.unpause.html">unpause</a><br> +<a href="skeinforge_tools.wipe.html">wipe</a><br> </td></tr></table></td></tr></table><p> <table width="100%" cellspacing=0 cellpadding=2 border=0 summary="section"> <tr bgcolor="#55aa55"> diff --git a/trunk/reprap/miscellaneous/python-beanshell-scripts/documentation/skeinforge_tools.import_plugins.gts.html b/trunk/reprap/miscellaneous/python-beanshell-scripts/documentation/skeinforge_tools.import_plugins.gts.html new file mode 100644 index 00000000..44966073 --- /dev/null +++ b/trunk/reprap/miscellaneous/python-beanshell-scripts/documentation/skeinforge_tools.import_plugins.gts.html @@ -0,0 +1,83 @@ + +<!doctype html PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN"> +<html><head><title>Python: module skeinforge_tools.import_plugins.gts</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>.<a href="skeinforge_tools.import_plugins.html"><font color="#ffffff">import_plugins</font></a>.gts</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/import_plugins/gts.py">/home/enrique/Desktop/backup/babbleold/script/reprap/pyRepRap/skeinforge_tools/import_plugins/gts.py</a></font></td></tr></table> + <p><tt>The gts.py script is an import translator plugin to get a carving from an gts file.<br> + <br> +An import plugin is a script in the import_plugins folder which has the function getCarving. It is meant to be run from the<br> +interpret tool. To ensure that the plugin works on platforms which do not handle file capitalization properly, give the plugin<br> +a lower case name.<br> + <br> +The getCarving function takes the file name of an gts file and returns the carving.<br> + <br> +The GNU Triangulated Surface (.gts) format is described at:<br> +<a href="http://gts.sourceforge.net/reference/gts-surfaces.html#GTS-SURFACE-WRITE">http://gts.sourceforge.net/reference/gts-surfaces.html#GTS-SURFACE-WRITE</a><br> + <br> +This example gets a carving for the gts file Screw Holder Bottom.gts. This example is run in a terminal in the folder which<br> +contains Screw Holder Bottom.gts and gts.py.<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 gts<br> +>>> gts.<a href="#-getCarving">getCarving</a>()<br> +[11.6000003815, 10.6837882996, 7.80209827423<br> +..<br> +many more lines of the carving<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> +</td><td width="25%" valign=top><a href="skeinforge_tools.skeinforge_utilities.gcodec.html">skeinforge_tools.skeinforge_utilities.gcodec</a><br> +</td><td width="25%" valign=top><a href="skeinforge_tools.skeinforge_utilities.triangle_mesh.html">skeinforge_tools.skeinforge_utilities.triangle_mesh</a><br> +</td><td width="25%" valign=top></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="-getCarving"><strong>getCarving</strong></a>(fileName<font color="#909090">=''</font>)</dt><dd><tt>Get the triangle mesh for the gts file.</tt></dd></dl> + <dl><dt><a name="-getFromGNUTriangulatedSurfaceText"><strong>getFromGNUTriangulatedSurfaceText</strong></a>(gnuTriangulatedSurfaceText, triangleMesh)</dt><dd><tt>Initialize from a GNU Triangulated Surface Text.</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> = 'Nophead <http://hydraraptor.blogspot.com/><font color="#c040c0">\n</font>Art of Illusion <http://www.artofillusion.org/>'<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><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%">Nophead <<a href="http://hydraraptor.blogspot.com/">http://hydraraptor.blogspot.com/</a>><br> +Art of Illusion <<a href="http://www.artofillusion.org/">http://www.artofillusion.org/</a>></td></tr></table> +</body></html>
\ No newline at end of file diff --git a/trunk/reprap/miscellaneous/python-beanshell-scripts/documentation/skeinforge_tools.import_plugins.html b/trunk/reprap/miscellaneous/python-beanshell-scripts/documentation/skeinforge_tools.import_plugins.html index 171e995b..2af903d6 100644 --- a/trunk/reprap/miscellaneous/python-beanshell-scripts/documentation/skeinforge_tools.import_plugins.html +++ b/trunk/reprap/miscellaneous/python-beanshell-scripts/documentation/skeinforge_tools.import_plugins.html @@ -17,8 +17,11 @@ <font color="#ffffff" face="helvetica, arial"><big><strong>Package Contents</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="skeinforge_tools.import_plugins.stl.html">stl</a><br> -</td><td width="25%" valign=top></td><td width="25%" valign=top></td><td width="25%" valign=top></td></tr></table></td></tr></table><p> +<td width="100%"><table width="100%" summary="list"><tr><td width="25%" valign=top><a href="skeinforge_tools.import_plugins.gts.html">gts</a><br> +</td><td width="25%" valign=top><a href="skeinforge_tools.import_plugins.slc.html">slc</a><br> +</td><td width="25%" valign=top><a href="skeinforge_tools.import_plugins.stl.html">stl</a><br> +</td><td width="25%" valign=top><a href="skeinforge_tools.import_plugins.svg.html">svg</a><br> +</td></tr></table></td></tr></table><p> <table width="100%" cellspacing=0 cellpadding=2 border=0 summary="section"> <tr bgcolor="#55aa55"> <td colspan=3 valign=bottom> <br> diff --git a/trunk/reprap/miscellaneous/python-beanshell-scripts/documentation/skeinforge_tools.import_plugins.slc.html b/trunk/reprap/miscellaneous/python-beanshell-scripts/documentation/skeinforge_tools.import_plugins.slc.html new file mode 100644 index 00000000..0fd6ac68 --- /dev/null +++ b/trunk/reprap/miscellaneous/python-beanshell-scripts/documentation/skeinforge_tools.import_plugins.slc.html @@ -0,0 +1,152 @@ + +<!doctype html PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN"> +<html><head><title>Python: module skeinforge_tools.import_plugins.slc</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>.<a href="skeinforge_tools.import_plugins.html"><font color="#ffffff">import_plugins</font></a>.slc</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/import_plugins/slc.py">/home/enrique/Desktop/backup/babbleold/script/reprap/pyRepRap/skeinforge_tools/import_plugins/slc.py</a></font></td></tr></table> + <p><tt>The slc.py script is an import translator plugin to get a carving from an slc file.<br> + <br> +An import plugin is a script in the import_plugins folder which has the function getCarving. It is meant to be run from the<br> +interpret tool. To ensure that the plugin works on platforms which do not handle file capitalization properly, give the plugin<br> +a lower case name.<br> + <br> +The getCarving function takes the file name of an slc file and returns the carving.<br> + <br> +This example gets a triangle mesh for the slc file rotor.slc. This example is run in a terminal in the folder which contains<br> +rotor.slc and slc.py.<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 slc<br> +>>> slc.<a href="#-getCarving">getCarving</a>()<br> +0.20000000298, 999999999.0, -999999999.0, [8.72782748851e-17, None<br> +..<br> +many more lines of the carving<br> +..<br> + <br> + <br> +An explanation of the SLC format can be found at:<br> +<a href="http://rapid.lpt.fi/archives/rp-ml-1999/0713.html">http://rapid.lpt.fi/archives/rp-ml-1999/0713.html</a></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> +</td><td width="25%" valign=top><a href="skeinforge_tools.skeinforge_utilities.euclidean.html">skeinforge_tools.skeinforge_utilities.euclidean</a><br> +</td><td width="25%" valign=top><a href="skeinforge_tools.skeinforge_utilities.gcodec.html">skeinforge_tools.skeinforge_utilities.gcodec</a><br> +</td><td width="25%" valign=top><a href="sys.html">sys</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.import_plugins.slc.html#SLCCarving">SLCCarving</a> +</font></dt><dt><font face="helvetica, arial"><a href="skeinforge_tools.import_plugins.slc.html#SampleTableEntry">SampleTableEntry</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="SLCCarving">class <strong>SLCCarving</strong></a></font></td></tr> + +<tr bgcolor="#ffc8d8"><td rowspan=2><tt> </tt></td> +<td colspan=2><tt>An slc carving.<br> </tt></td></tr> +<tr><td> </td> +<td width="100%">Methods defined here:<br> +<dl><dt><a name="SLCCarving-__init__"><strong>__init__</strong></a>(self)</dt><dd><tt>Add empty lists.</tt></dd></dl> + +<dl><dt><a name="SLCCarving-__repr__"><strong>__repr__</strong></a>(self)</dt><dd><tt>Get the string representation of this carving.</tt></dd></dl> + +<dl><dt><a name="SLCCarving-getCarveCornerMaximum"><strong>getCarveCornerMaximum</strong></a>(self)</dt><dd><tt>Get the corner maximum of the vertices.</tt></dd></dl> + +<dl><dt><a name="SLCCarving-getCarveCornerMinimum"><strong>getCarveCornerMinimum</strong></a>(self)</dt><dd><tt>Get the corner minimum of the vertices.</tt></dd></dl> + +<dl><dt><a name="SLCCarving-getCarveLayerThickness"><strong>getCarveLayerThickness</strong></a>(self)</dt><dd><tt>Get the layer thickness.</tt></dd></dl> + +<dl><dt><a name="SLCCarving-getCarveRotatedBoundaryLayers"><strong>getCarveRotatedBoundaryLayers</strong></a>(self)</dt><dd><tt>Get the rotated boundary layers.</tt></dd></dl> + +<dl><dt><a name="SLCCarving-processContourLayers"><strong>processContourLayers</strong></a>(self, file)</dt><dd><tt>Process a contour layer at a time until the top of the part.</tt></dd></dl> + +<dl><dt><a name="SLCCarving-readFile"><strong>readFile</strong></a>(self, fileName)</dt><dd><tt>Read SLC and store the layers.</tt></dd></dl> + +<dl><dt><a name="SLCCarving-readTableEntry"><strong>readTableEntry</strong></a>(self, file)</dt><dd><tt>Read in the sampling table section. It contains a table length (byte) and the table entries.</tt></dd></dl> + +<dl><dt><a name="SLCCarving-setCarveBridgeLayerThickness"><strong>setCarveBridgeLayerThickness</strong></a>(self, bridgeLayerThickness)</dt><dd><tt>Set the bridge layer thickness. If the infill is not in the direction of the bridge, the bridge layer thickness should be given as None or not set at all.</tt></dd></dl> + +<dl><dt><a name="SLCCarving-setCarveExtrusionWidth"><strong>setCarveExtrusionWidth</strong></a>(self, extrusionWidth)</dt><dd><tt>Set the extrusion width.</tt></dd></dl> + +<dl><dt><a name="SLCCarving-setCarveImportCoarseness"><strong>setCarveImportCoarseness</strong></a>(self, importCoarseness)</dt><dd><tt>Set the import coarseness.</tt></dd></dl> + +<dl><dt><a name="SLCCarving-setCarveIsCorrectMesh"><strong>setCarveIsCorrectMesh</strong></a>(self, isCorrectMesh)</dt><dd><tt>Set the is correct mesh flag.</tt></dd></dl> + +<dl><dt><a name="SLCCarving-setCarveLayerThickness"><strong>setCarveLayerThickness</strong></a>(self, layerThickness)</dt><dd><tt>Set the layer thickness.</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="SampleTableEntry">class <strong>SampleTableEntry</strong></a></font></td></tr> + +<tr bgcolor="#ffc8d8"><td rowspan=2><tt> </tt></td> +<td colspan=2><tt>Sample table entry.<br> </tt></td></tr> +<tr><td> </td> +<td width="100%">Methods defined here:<br> +<dl><dt><a name="SampleTableEntry-__init__"><strong>__init__</strong></a>(self, file)</dt><dd><tt>Read in the sampling table section. It contains a table length (byte) and the table entries.</tt></dd></dl> + +<dl><dt><a name="SampleTableEntry-__repr__"><strong>__repr__</strong></a>(self)</dt><dd><tt>Get the string representation of this sample table entry.</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="-getCarving"><strong>getCarving</strong></a>(fileName<font color="#909090">=''</font>)</dt><dd><tt>Get the triangle mesh for the slc file.</tt></dd></dl> + <dl><dt><a name="-getLittleEndianFloatGivenFile"><strong>getLittleEndianFloatGivenFile</strong></a>(file)</dt><dd><tt>Get little endian float given a file.</tt></dd></dl> + <dl><dt><a name="-getLittleEndianUnsignedLongGivenFile"><strong>getLittleEndianUnsignedLongGivenFile</strong></a>(file)</dt><dd><tt>Get little endian float given a file.</tt></dd></dl> + <dl><dt><a name="-getPointsFromFile"><strong>getPointsFromFile</strong></a>(numPoints, file)</dt><dd><tt>Process the vertice points for a given boundary.</tt></dd></dl> + <dl><dt><a name="-main"><strong>main</strong></a>(hashtable<font color="#909090">=None</font>)</dt><dd><tt>Display the inset dialog.</tt></dd></dl> + <dl><dt><a name="-readHeader"><strong>readHeader</strong></a>(file)</dt><dd><tt>Read the slc header.</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> = 'Nophead <http://hydraraptor.blogspot.com/><font color="#c040c0">\n</font>Art of Illusion <http://www.artofillusion.org/>'<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><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%">Nophead <<a href="http://hydraraptor.blogspot.com/">http://hydraraptor.blogspot.com/</a>><br> +Art of Illusion <<a href="http://www.artofillusion.org/">http://www.artofillusion.org/</a>></td></tr></table> +</body></html>
\ No newline at end of file diff --git a/trunk/reprap/miscellaneous/python-beanshell-scripts/documentation/skeinforge_tools.import_plugins.stl.html b/trunk/reprap/miscellaneous/python-beanshell-scripts/documentation/skeinforge_tools.import_plugins.stl.html index 884bf413..832a26dc 100644 --- a/trunk/reprap/miscellaneous/python-beanshell-scripts/documentation/skeinforge_tools.import_plugins.stl.html +++ b/trunk/reprap/miscellaneous/python-beanshell-scripts/documentation/skeinforge_tools.import_plugins.stl.html @@ -9,13 +9,13 @@ <font color="#ffffff" face="helvetica, arial"> <br><big><big><strong><a href="skeinforge_tools.html"><font color="#ffffff">skeinforge_tools</font></a>.<a href="skeinforge_tools.import_plugins.html"><font color="#ffffff">import_plugins</font></a>.stl</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/import_plugins/stl.py">/home/enrique/Desktop/backup/babbleold/script/reprap/pyRepRap/skeinforge_tools/import_plugins/stl.py</a></font></td></tr></table> - <p><tt>The stl.py script is an import translator plugin to get a triangle mesh from an stl file.<br> + <p><tt>The stl.py script is an import translator plugin to get a carving from an stl file.<br> <br> -An import plugin is a script in the import_plugins folder which has the function getTriangleMesh. It is meant to be run from the<br> -import_translator tool. To ensure that the plugin works on platforms which do not handle file capitalization properly, give the plugin<br> +An import plugin is a script in the import_plugins folder which has the function getCarving. It is meant to be run from the<br> +interpret tool. To ensure that the plugin works on platforms which do not handle file capitalization properly, give the plugin<br> a lower case name.<br> <br> -The getTriangleMesh function takes the filename of an stl file and returns the triangle mesh.<br> +The getCarving function takes the file name of an stl file and returns the carving.<br> <br> STL is an inferior triangle surface format, described at:<br> <a href="http://en.wikipedia.org/wiki/STL_(file_format">http://en.wikipedia.org/wiki/STL_(file_format</a>)<br> @@ -23,8 +23,8 @@ STL is an inferior triangle surface format, d A good triangle surface format is the GNU Triangulated Surface format which is described at:<br> <a href="http://gts.sourceforge.net/reference/gts-surfaces.html#GTS-SURFACE-WRITE">http://gts.sourceforge.net/reference/gts-surfaces.html#GTS-SURFACE-WRITE</a><br> <br> -This example gets a triangle mesh for the stl file Hollow Square.stl. This example is run in a terminal in the folder which contains<br> -Hollow Square.stl and stl.py.<br> +This example gets a carving for the stl file Screw Holder Bottom.stl. This example is run in a terminal in the folder which<br> +contains Screw Holder Bottom.stl and stl.py.<br> <br> <br> > python<br> @@ -32,10 +32,10 @@ Python 2.5.1 (r251:54863, Sep 22 2007, 01:43:31)<b [GCC 4.2.1 (SUSE Linux)] on linux2<br> Type "help", "copyright", "credits" or "license" for more information.<br> >>> import stl<br> ->>> stl.<a href="#-getTriangleMesh">getTriangleMesh</a>()<br> +>>> stl.<a href="#-getCarving">getCarving</a>()<br> [11.6000003815, 10.6837882996, 7.80209827423<br> ..<br> -many more lines of the triangle mesh<br> +many more lines of the carving<br> ..</tt></p> <p> <table width="100%" cellspacing=0 cellpadding=2 border=0 summary="section"> @@ -57,9 +57,9 @@ many more lines of the triangle mesh<br> <td width="100%"><dl><dt><a name="-addFacesGivenBinary"><strong>addFacesGivenBinary</strong></a>(stlData, triangleMesh, vertexIndexTable)</dt><dd><tt>Add faces given stl binary.</tt></dd></dl> <dl><dt><a name="-addFacesGivenText"><strong>addFacesGivenText</strong></a>(stlText, triangleMesh, vertexIndexTable)</dt><dd><tt>Add faces given stl text.</tt></dd></dl> <dl><dt><a name="-addFacesGivenVertices"><strong>addFacesGivenVertices</strong></a>(triangleMesh, vertexIndexTable, vertices)</dt><dd><tt>Add faces given stl text.</tt></dd></dl> + <dl><dt><a name="-getCarving"><strong>getCarving</strong></a>(fileName<font color="#909090">=''</font>)</dt><dd><tt>Get the triangle mesh for the stl file.</tt></dd></dl> <dl><dt><a name="-getFaceGivenLines"><strong>getFaceGivenLines</strong></a>(triangleMesh, vertexStartIndex, vertexIndexTable, vertices)</dt><dd><tt>Add face given line index and lines.</tt></dd></dl> <dl><dt><a name="-getFloatGivenBinary"><strong>getFloatGivenBinary</strong></a>(byteIndex, stlData)</dt><dd><tt>Get vertex given stl vertex line.</tt></dd></dl> - <dl><dt><a name="-getTriangleMesh"><strong>getTriangleMesh</strong></a>(filename<font color="#909090">=''</font>)</dt><dd><tt>Get the triangle mesh for the stl file.</tt></dd></dl> <dl><dt><a name="-getVertexGivenBinary"><strong>getVertexGivenBinary</strong></a>(byteIndex, stlData)</dt><dd><tt>Get vertex given stl vertex line.</tt></dd></dl> <dl><dt><a name="-getVertexGivenLine"><strong>getVertexGivenLine</strong></a>(line)</dt><dd><tt>Get vertex given stl vertex line.</tt></dd></dl> </td></tr></table><p> diff --git a/trunk/reprap/miscellaneous/python-beanshell-scripts/documentation/skeinforge_tools.import_plugins.svg.html b/trunk/reprap/miscellaneous/python-beanshell-scripts/documentation/skeinforge_tools.import_plugins.svg.html new file mode 100644 index 00000000..0cd8ddf5 --- /dev/null +++ b/trunk/reprap/miscellaneous/python-beanshell-scripts/documentation/skeinforge_tools.import_plugins.svg.html @@ -0,0 +1,130 @@ + +<!doctype html PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN"> +<html><head><title>Python: module skeinforge_tools.import_plugins.svg</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>.<a href="skeinforge_tools.import_plugins.html"><font color="#ffffff">import_plugins</font></a>.svg</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/import_plugins/svg.py">/home/enrique/Desktop/backup/babbleold/script/reprap/pyRepRap/skeinforge_tools/import_plugins/svg.py</a></font></td></tr></table> + <p><tt>The svg.py script is an import translator plugin to get a carving from an svg file.<br> + <br> +An import plugin is a script in the import_plugins folder which has the function getCarving. It is meant to be run from the<br> +interpret tool. To ensure that the plugin works on platforms which do not handle file capitalization properly, give the plugin<br> +a lower case name.<br> + <br> +The getCarving function takes the file name of an svg file and returns the carving.<br> + <br> +This example gets a carving for the svg file Screw Holder Bottom.svg. This example is run in a terminal in the folder which<br> +contains Screw Holder Bottom.svg and svg.py.<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 svg<br> +>>> svg.<a href="#-getCarving">getCarving</a>()<br> +0.20000000298, 999999999.0, -999999999.0, [8.72782748851e-17, None<br> +..<br> +many more lines of the carving<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> +</td><td width="25%" valign=top><a href="skeinforge_tools.skeinforge_utilities.euclidean.html">skeinforge_tools.skeinforge_utilities.euclidean</a><br> +</td><td width="25%" valign=top><a href="skeinforge_tools.skeinforge_utilities.gcodec.html">skeinforge_tools.skeinforge_utilities.gcodec</a><br> +</td><td width="25%" valign=top></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.import_plugins.svg.html#SVGCarving">SVGCarving</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="SVGCarving">class <strong>SVGCarving</strong></a></font></td></tr> + +<tr bgcolor="#ffc8d8"><td rowspan=2><tt> </tt></td> +<td colspan=2><tt>An svg carving.<br> </tt></td></tr> +<tr><td> </td> +<td width="100%">Methods defined here:<br> +<dl><dt><a name="SVGCarving-__init__"><strong>__init__</strong></a>(self)</dt><dd><tt>Add empty lists.</tt></dd></dl> + +<dl><dt><a name="SVGCarving-__repr__"><strong>__repr__</strong></a>(self)</dt><dd><tt>Get the string representation of this carving.</tt></dd></dl> + +<dl><dt><a name="SVGCarving-getCarveCornerMaximum"><strong>getCarveCornerMaximum</strong></a>(self)</dt><dd><tt>Get the corner maximum of the vertices.</tt></dd></dl> + +<dl><dt><a name="SVGCarving-getCarveCornerMinimum"><strong>getCarveCornerMinimum</strong></a>(self)</dt><dd><tt>Get the corner minimum of the vertices.</tt></dd></dl> + +<dl><dt><a name="SVGCarving-getCarveLayerThickness"><strong>getCarveLayerThickness</strong></a>(self)</dt><dd><tt>Get the layer thickness.</tt></dd></dl> + +<dl><dt><a name="SVGCarving-getCarveRotatedBoundaryLayers"><strong>getCarveRotatedBoundaryLayers</strong></a>(self)</dt><dd><tt>Get the rotated boundary layers.</tt></dd></dl> + +<dl><dt><a name="SVGCarving-parseInitialization"><strong>parseInitialization</strong></a>(self)</dt><dd><tt>Parse gcode initialization and store the parameters.</tt></dd></dl> + +<dl><dt><a name="SVGCarving-parseLine"><strong>parseLine</strong></a>(self, lineIndex)</dt><dd><tt>Parse a gcode line and add it to the inset skein.</tt></dd></dl> + +<dl><dt><a name="SVGCarving-parseSVG"><strong>parseSVG</strong></a>(self, svgText)</dt><dd><tt>Parse SVG text and store the layers.</tt></dd></dl> + +<dl><dt><a name="SVGCarving-setCarveBridgeLayerThickness"><strong>setCarveBridgeLayerThickness</strong></a>(self, bridgeLayerThickness)</dt><dd><tt>Set the bridge layer thickness. If the infill is not in the direction of the bridge, the bridge layer thickness should be given as None or not set at all.</tt></dd></dl> + +<dl><dt><a name="SVGCarving-setCarveExtrusionWidth"><strong>setCarveExtrusionWidth</strong></a>(self, extrusionWidth)</dt><dd><tt>Set the extrusion width.</tt></dd></dl> + +<dl><dt><a name="SVGCarving-setCarveImportCoarseness"><strong>setCarveImportCoarseness</strong></a>(self, importCoarseness)</dt><dd><tt>Set the import coarseness.</tt></dd></dl> + +<dl><dt><a name="SVGCarving-setCarveIsCorrectMesh"><strong>setCarveIsCorrectMesh</strong></a>(self, isCorrectMesh)</dt><dd><tt>Set the is correct mesh flag.</tt></dd></dl> + +<dl><dt><a name="SVGCarving-setCarveLayerThickness"><strong>setCarveLayerThickness</strong></a>(self, layerThickness)</dt><dd><tt>Set the layer thickness.</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="-addPathData"><strong>addPathData</strong></a>(line, loops)</dt><dd><tt>Add the data from the path line.</tt></dd></dl> + <dl><dt><a name="-addTextData"><strong>addTextData</strong></a>(line, rotatedBoundaryLayers)</dt><dd><tt>Add the data from the text line.</tt></dd></dl> + <dl><dt><a name="-getCarving"><strong>getCarving</strong></a>(fileName<font color="#909090">=''</font>)</dt><dd><tt>Get the triangle mesh for the gts file.</tt></dd></dl> + <dl><dt><a name="-getValueInQuotes"><strong>getValueInQuotes</strong></a>(name, text, value)</dt><dd><tt>Get value in quotes after the name.</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> = 'Nophead <http://hydraraptor.blogspot.com/><font color="#c040c0">\n</font>Art of Illusion <http://www.artofillusion.org/>'<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><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%">Nophead <<a href="http://hydraraptor.blogspot.com/">http://hydraraptor.blogspot.com/</a>><br> +Art of Illusion <<a href="http://www.artofillusion.org/">http://www.artofillusion.org/</a>></td></tr></table> +</body></html>
\ No newline at end of file diff --git a/trunk/reprap/miscellaneous/python-beanshell-scripts/documentation/skeinforge_tools.import_translator.html b/trunk/reprap/miscellaneous/python-beanshell-scripts/documentation/skeinforge_tools.import_translator.html deleted file mode 100644 index f2b16c88..00000000 --- a/trunk/reprap/miscellaneous/python-beanshell-scripts/documentation/skeinforge_tools.import_translator.html +++ /dev/null @@ -1,120 +0,0 @@ - -<!doctype html PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN"> -<html><head><title>Python: module skeinforge_tools.import_translator</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>.import_translator</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/import_translator.py">/home/enrique/Desktop/backup/babbleold/script/reprap/pyRepRap/skeinforge_tools/import_translator.py</a></font></td></tr></table> - <p><tt>Import translator is a script to access and display the import plugins.<br> - <br> -Import shows the client which import plugins are in the import_plugins folder. If "Translate" is clicked, the chosen file will be<br> -translated and saved as a GNU Triangulated Surface format file.<br> - <br> -An import plugin is a script in the import_plugins folder which has the function getTriangleMesh.<br> - <br> -The following examples import the files Hollow Square.stl. The examples are run in a terminal in the folder which contains<br> -Hollow Square.stl & import_translator.py.<br> - <br> - <br> -> python import_translator.py<br> -This brings up the dialog, after clicking 'Translate', the following is printed:<br> -File Hollow Square.stl is being translated to the GNU Triangulated Surface format.'<br> -The translated file is saved as Hollow Square.gts<br> -It took 0 seconds to translate the file.<br> - <br> - <br> -> python import_translator.py Hollow Square.stl<br> -File Hollow Square.stl is being translated to the GNU Triangulated Surface format.<br> -The translated file is saved as Hollow Square.gts<br> -It took 0 seconds to translate the file.<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 import<br> ->>> import.<a href="#-writeOutput">writeOutput</a>()<br> -File Hollow Square.stl is being translated to the GNU Triangulated Surface format.<br> -The translated file is saved as Hollow Square.gts<br> -It took 0 seconds to translate the file.<br> - <br> - <br> ->>> import.<a href="#-main">main</a>()<br> -This brings up the import dialog.</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.skeinforge_utilities.gcodec.html">skeinforge_tools.skeinforge_utilities.gcodec</a><br> -</td><td width="25%" valign=top><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> -</td><td width="25%" valign=top><a href="sys.html">sys</a><br> -<a href="time.html">time</a><br> -</td><td width="25%" valign=top></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.import_translator.html#ImportPreferences">ImportPreferences</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="ImportPreferences">class <strong>ImportPreferences</strong></a></font></td></tr> - -<tr bgcolor="#ffc8d8"><td rowspan=2><tt> </tt></td> -<td colspan=2><tt>A class to handle the import preferences.<br> </tt></td></tr> -<tr><td> </td> -<td width="100%">Methods defined here:<br> -<dl><dt><a name="ImportPreferences-__init__"><strong>__init__</strong></a>(self)</dt><dd><tt>Set the default preferences, execute title & preferences filename.</tt></dd></dl> - -<dl><dt><a name="ImportPreferences-execute"><strong>execute</strong></a>(self)</dt><dd><tt>Import button has been clicked.</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="-getGNUTranslatorFileTypeTuples"><strong>getGNUTranslatorFileTypeTuples</strong></a>()</dt><dd><tt>Get the file type tuples from the translators in the import plugins folder.</tt></dd></dl> - <dl><dt><a name="-getGNUTranslatorFileTypes"><strong>getGNUTranslatorFileTypes</strong></a>()</dt><dd><tt>Get the file types from the translators in the import plugins folder.</tt></dd></dl> - <dl><dt><a name="-getGNUTranslatorFilesUnmodified"><strong>getGNUTranslatorFilesUnmodified</strong></a>()</dt><dd><tt>Get the file types from the translators in the import plugins folder.</tt></dd></dl> - <dl><dt><a name="-getGNUTranslatorGcodeFileTypeTuples"><strong>getGNUTranslatorGcodeFileTypeTuples</strong></a>()</dt><dd><tt>Get the file type tuples from the translators in the import plugins folder.</tt></dd></dl> - <dl><dt><a name="-getImportPluginFilenames"><strong>getImportPluginFilenames</strong></a>()</dt><dd><tt>Get analyze plugin filenames.</tt></dd></dl> - <dl><dt><a name="-getTranslatorFileTypeTuples"><strong>getTranslatorFileTypeTuples</strong></a>()</dt><dd><tt>Get the file types from the translators in the import plugins folder.</tt></dd></dl> - <dl><dt><a name="-getTriangleMesh"><strong>getTriangleMesh</strong></a>(filename)</dt><dd><tt>Get a triangle mesh for the file using an import plugin.</tt></dd></dl> - <dl><dt><a name="-main"><strong>main</strong></a>(hashtable<font color="#909090">=None</font>)</dt><dd><tt>Display the import dialog.</tt></dd></dl> - <dl><dt><a name="-writeOutput"><strong>writeOutput</strong></a>(filename<font color="#909090">=''</font>)</dt><dd><tt>Translate a file to the GNU Triangulated Surface format. If no filename is specified, translate the first file for which there is an import plugin.</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>
\ No newline at end of file diff --git a/trunk/reprap/miscellaneous/python-beanshell-scripts/documentation/skeinforge_tools.inset.html b/trunk/reprap/miscellaneous/python-beanshell-scripts/documentation/skeinforge_tools.inset.html new file mode 100644 index 00000000..27b9b182 --- /dev/null +++ b/trunk/reprap/miscellaneous/python-beanshell-scripts/documentation/skeinforge_tools.inset.html @@ -0,0 +1,188 @@ + +<!doctype html PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN"> +<html><head><title>Python: module skeinforge_tools.inset</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>.inset</strong></big></big> ($Date: 2008/28/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/inset.py">/home/enrique/Desktop/backup/babbleold/script/reprap/pyRepRap/skeinforge_tools/inset.py</a></font></td></tr></table> + <p><tt>Inset is a script to inset the carves of a gcode file.<br> + <br> +Inset insets the svg slices into gcode extrusion layers. The 'Extrusion Perimeter Width over Thickness' ratio is the ratio of the<br> +extrusion perimeter width over the layer thickness. The higher the value the more the perimeter will be inset, the default is 1.8.<br> + <br> +The 'Infill Perimeter Overlap' ratio is the amount the infill overlaps the perimeter over the extrusion width. The higher the value the<br> +more the infill will overlap the perimeter, and the thicker join between the infill and the perimeter. If the value is too high, the join will<br> +be so thick that the nozzle will run plow through the join below making a mess, the default is 0.05. There are two choices for the<br> +infill perimeter overlap method of calculation. If the 'Calculate Overlap from Perimeter and Infill' option is chosen, the overlap will be<br> +calculated from the average of the perimeter width and the infill width, this is the default choice. If the 'Calculate Overlap from<br> +Perimeter Only' option is chosen, the overlap will be calculated from the perimeter width only.<br> + <br> +If the "Start at Home" preference is selected, the G28 gcode will be added at the beginning of the file.<br> + <br> +When inset is generating the code, if there is a file start.txt, it will add that to the very beginning of the gcode. After it has added some<br> +initialization code and just before it adds the extrusion gcode, it will add the file endofthebeginning.txt if it exists. At the very end, it will<br> +add the file end.txt if it exists. Carve does not care if the text file names are capitalized, but some file systems do not handle file name<br> +cases properly, so to be on the safe side you should give them lower case names. It will first look for the file in the same directory as<br> +inset, if it does not find it it will look in ~/.skeinforge/gcode_scripts.<br> + <br> +The following examples inset the files Screw Holder Bottom.gcode & Screw Holder Bottom.stl. The examples are run in a terminal in<br> +the folder which contains Screw Holder Bottom.stl and inset.py.<br> + <br> + <br> +> python inset.py<br> +This brings up the dialog, after clicking 'Inset', the following is printed:<br> +File Screw Holder Bottom.stl is being chain insetted.<br> +The insetted file is saved as Screw Holder Bottom_inset.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 inset<br> +>>> inset.<a href="#-main">main</a>()<br> +File Screw Holder Bottom.stl is being insetted.<br> +The insetted file is saved as Screw Holder Bottom_inset.gcode<br> +It took 3 seconds to inset the file.<br> + <br> + <br> +>>> inset.<a href="#-writeOutput">writeOutput</a>()<br> +File Screw Holder Bottom.stl is being insetted.<br> +The insetted file is saved as Screw Holder Bottom_inset.gcode<br> +It took 3 seconds to inset the file.</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.carve.html">skeinforge_tools.carve</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="os.html">os</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> +</td><td width="25%" valign=top><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_tools.inset.html#InsetPreferences">InsetPreferences</a> +</font></dt><dt><font face="helvetica, arial"><a href="skeinforge_tools.inset.html#InsetSkein">InsetSkein</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="InsetPreferences">class <strong>InsetPreferences</strong></a></font></td></tr> + +<tr bgcolor="#ffc8d8"><td rowspan=2><tt> </tt></td> +<td colspan=2><tt>A class to handle the inset preferences.<br> </tt></td></tr> +<tr><td> </td> +<td width="100%">Methods defined here:<br> +<dl><dt><a name="InsetPreferences-__init__"><strong>__init__</strong></a>(self)</dt><dd><tt>Set the default preferences, execute title & preferences fileName.</tt></dd></dl> + +<dl><dt><a name="InsetPreferences-execute"><strong>execute</strong></a>(self)</dt><dd><tt>Inset 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="InsetSkein">class <strong>InsetSkein</strong></a></font></td></tr> + +<tr bgcolor="#ffc8d8"><td rowspan=2><tt> </tt></td> +<td colspan=2><tt>A class to inset a skein of extrusions.<br> </tt></td></tr> +<tr><td> </td> +<td width="100%">Methods defined here:<br> +<dl><dt><a name="InsetSkein-__init__"><strong>__init__</strong></a>(self)</dt></dl> + +<dl><dt><a name="InsetSkein-addFromFile"><strong>addFromFile</strong></a>(self, fileName)</dt><dd><tt>Add lines of text from the fileName.</tt></dd></dl> + +<dl><dt><a name="InsetSkein-addFromUpperLowerFile"><strong>addFromUpperLowerFile</strong></a>(self, fileName)</dt><dd><tt>Add lines of text from the fileName or the lowercase fileName, if there is no file by the original fileName in the directory.</tt></dd></dl> + +<dl><dt><a name="InsetSkein-addGcodeFromPerimeterPaths"><strong>addGcodeFromPerimeterPaths</strong></a>(self, isIntersectingSelf, loop, loopLists, radius, z)</dt><dd><tt>Add the perimeter paths to the output.</tt></dd></dl> + +<dl><dt><a name="InsetSkein-addGcodeFromRemainingLoop"><strong>addGcodeFromRemainingLoop</strong></a>(self, loop, loopLists, radius, z)</dt><dd><tt>Add the remainder of the loop which does not overlap the alreadyFilledArounds loops.</tt></dd></dl> + +<dl><dt><a name="InsetSkein-addGcodeFromThreadZ"><strong>addGcodeFromThreadZ</strong></a>(self, thread, z)</dt><dd><tt>Add a thread to the output.</tt></dd></dl> + +<dl><dt><a name="InsetSkein-addGcodeMovementZ"><strong>addGcodeMovementZ</strong></a>(self, point, z)</dt><dd><tt>Add a movement to the output.</tt></dd></dl> + +<dl><dt><a name="InsetSkein-addInitializationToOutput"><strong>addInitializationToOutput</strong></a>(self)</dt><dd><tt>Add initialization gcode to the output.</tt></dd></dl> + +<dl><dt><a name="InsetSkein-addInset"><strong>addInset</strong></a>(self, layerIndex)</dt><dd><tt>Add fill to the carve layer.</tt></dd></dl> + +<dl><dt><a name="InsetSkein-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="InsetSkein-addPathData"><strong>addPathData</strong></a>(self, line)</dt><dd><tt>Add the data from the path line.</tt></dd></dl> + +<dl><dt><a name="InsetSkein-addRotatedLoopLayer"><strong>addRotatedLoopLayer</strong></a>(self, z)</dt><dd><tt>Add rotated loop layer.</tt></dd></dl> + +<dl><dt><a name="InsetSkein-addShutdownToOutput"><strong>addShutdownToOutput</strong></a>(self)</dt><dd><tt>Add shutdown gcode to the output.</tt></dd></dl> + +<dl><dt><a name="InsetSkein-addTextData"><strong>addTextData</strong></a>(self, line)</dt><dd><tt>Add the data from the text line.</tt></dd></dl> + +<dl><dt><a name="InsetSkein-getExtrudateLoops"><strong>getExtrudateLoops</strong></a>(self, halfWidth, loop)</dt><dd><tt>Get the inset extrudate loops from the loop.</tt></dd></dl> + +<dl><dt><a name="InsetSkein-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="InsetSkein-parseGcode"><strong>parseGcode</strong></a>(self, insetPreferences, gcodeText)</dt><dd><tt>Parse gcode text and store the bevel gcode.</tt></dd></dl> + +<dl><dt><a name="InsetSkein-parseInitialization"><strong>parseInitialization</strong></a>(self)</dt><dd><tt>Parse gcode initialization and store the parameters.</tt></dd></dl> + +<dl><dt><a name="InsetSkein-parseLine"><strong>parseLine</strong></a>(self, lineIndex)</dt><dd><tt>Parse a gcode line and add it to the inset 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="-addAlreadyFilledArounds"><strong>addAlreadyFilledArounds</strong></a>(alreadyFilledArounds, loop, radius)</dt><dd><tt>Add already filled loops around loop to alreadyFilledArounds.</tt></dd></dl> + <dl><dt><a name="-addSegmentOutline"><strong>addSegmentOutline</strong></a>(isThick, outlines, pointBegin, pointEnd, width)</dt><dd><tt>Add a diamond or hexagonal outline for a line segment.</tt></dd></dl> + <dl><dt><a name="-getInsetChainGcode"><strong>getInsetChainGcode</strong></a>(fileName, gcodeText, insetPreferences<font color="#909090">=None</font>)</dt><dd><tt>Inset the carves of a gcode text. Chain inset the gcode if it is not already carved.</tt></dd></dl> + <dl><dt><a name="-getInsetGcode"><strong>getInsetGcode</strong></a>(gcodeText, insetPreferences<font color="#909090">=None</font>)</dt><dd><tt>Inset the carves of a gcode text.</tt></dd></dl> + <dl><dt><a name="-getSegmentsFromPoints"><strong>getSegmentsFromPoints</strong></a>(aroundLists, loopLists, pointBegin, pointEnd)</dt><dd><tt>Get endpoint segments from the beginning and end of a line segment.</tt></dd></dl> + <dl><dt><a name="-isCloseToLast"><strong>isCloseToLast</strong></a>(paths, point, radius)</dt><dd><tt>Determine if the point is close to the last point of the last path.</tt></dd></dl> + <dl><dt><a name="-isIntersectingItself"><strong>isIntersectingItself</strong></a>(loop, width)</dt><dd><tt>Determine if the loop is intersecting itself.</tt></dd></dl> + <dl><dt><a name="-isIntersectingWithinList"><strong>isIntersectingWithinList</strong></a>(loop, loopList)</dt><dd><tt>Determine if the loop is intersecting or is within the loop list.</tt></dd></dl> + <dl><dt><a name="-isIntersectingWithinLists"><strong>isIntersectingWithinLists</strong></a>(loop, loopLists)</dt><dd><tt>Determine if the loop is intersecting or is within the loop lists.</tt></dd></dl> + <dl><dt><a name="-isSegmentInsideAround"><strong>isSegmentInsideAround</strong></a>(aroundLists, segment)</dt><dd><tt>Determine if the segment is inside an around.</tt></dd></dl> + <dl><dt><a name="-main"><strong>main</strong></a>(hashtable<font color="#909090">=None</font>)</dt><dd><tt>Display the inset dialog.</tt></dd></dl> + <dl><dt><a name="-writeOutput"><strong>writeOutput</strong></a>(fileName<font color="#909090">=''</font>)</dt><dd><tt>Inset the carves of a gcode file. Chain carve the file if it is a GNU TriangulatedSurface file. If no fileName is specified, inset 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/28/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>
\ No newline at end of file diff --git a/trunk/reprap/miscellaneous/python-beanshell-scripts/documentation/skeinforge_tools.material.html b/trunk/reprap/miscellaneous/python-beanshell-scripts/documentation/skeinforge_tools.material.html index 959c24b7..3751fae5 100644 --- a/trunk/reprap/miscellaneous/python-beanshell-scripts/documentation/skeinforge_tools.material.html +++ b/trunk/reprap/miscellaneous/python-beanshell-scripts/documentation/skeinforge_tools.material.html @@ -58,7 +58,7 @@ ABS</tt></p> <td colspan=2><tt>A class to handle the material preferences.<br> </tt></td></tr> <tr><td> </td> <td width="100%">Methods defined here:<br> -<dl><dt><a name="MaterialPreferences-__init__"><strong>__init__</strong></a>(self)</dt><dd><tt>Set the default preferences, execute title & preferences filename.</tt></dd></dl> +<dl><dt><a name="MaterialPreferences-__init__"><strong>__init__</strong></a>(self)</dt><dd><tt>Set the default preferences, execute title & preferences fileName.</tt></dd></dl> </td></tr></table></td></tr></table><p> <table width="100%" cellspacing=0 cellpadding=2 border=0 summary="section"> diff --git a/trunk/reprap/miscellaneous/python-beanshell-scripts/documentation/skeinforge_tools.multiply.html b/trunk/reprap/miscellaneous/python-beanshell-scripts/documentation/skeinforge_tools.multiply.html index 87d05bdc..35263498 100644 --- a/trunk/reprap/miscellaneous/python-beanshell-scripts/documentation/skeinforge_tools.multiply.html +++ b/trunk/reprap/miscellaneous/python-beanshell-scripts/documentation/skeinforge_tools.multiply.html @@ -20,8 +20,8 @@ The center of the shape will be moved to The "Number of Columns" preference is the number of columns in the array table. The "Number of Rows" is the number of rows<br> in the table. The "Separation over Extrusion Width" is the ratio of separation between the shape copies over the extrusion width.<br> <br> -The following examples multiply the files Hollow Square.gcode & Hollow Square.gts. The examples are run in a terminal in the<br> -folder which contains Hollow Square.gcode, Hollow Square.gts and multiply.py. The multiply function will multiply if "Activate<br> +The following examples multiply 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 multiply.py. The multiply function will multiply if "Activate<br> Multiply" is true, which can be set in the dialog or by changing the preferences file 'multiply.csv' with a text editor or a<br> spreadsheet program set to separate tabs. The functions writeOutput and getMultiplyChainGcode check to see if the text has<br> been multiplied, if not they call getFillChainGcode in fill.py to get filled gcode; once they have the filled text, then they multiply.<br> @@ -29,8 +29,8 @@ been multiplied, if not they call getFillChainGcod <br> > python multiply.py<br> This brings up the dialog, after clicking 'Multiply', the following is printed:<br> -File Hollow Square.gts is being chain multiplied.<br> -The multiplied file is saved as Hollow Square_multiply.gcode<br> +File Screw Holder Bottom.stl is being chain multiplied.<br> +The multiplied file is saved as Screw Holder Bottom_multiply.gcode<br> <br> <br> >python<br> @@ -43,13 +43,13 @@ This brings up the multiply dialog.<br> <br> <br> >>> multiply.<a href="#-writeOutput">writeOutput</a>()<br> -Hollow Square.gts<br> -File Hollow Square.gts is being chain multiplied.<br> -The multiplied file is saved as Hollow Square_multiply.gcode<br> +Screw Holder Bottom.stl<br> +File Screw Holder Bottom.stl is being chain multiplied.<br> +The multiplied file is saved as Screw Holder Bottom_multiply.gcode<br> <br> <br> >>> multiply.<a href="#-getMultiplyGcode">getMultiplyGcode</a>("<br> -( GCode generated by May 8, 2008 slice.py )<br> +( GCode generated by May 8, 2008 carve.py )<br> ( Extruder Initialization )<br> ..<br> many lines of gcode<br> @@ -58,7 +58,7 @@ many lines of gcode<br> <br> <br> >>> multiply.<a href="#-getMultiplyChainGcode">getMultiplyChainGcode</a>("<br> -( GCode generated by May 8, 2008 slice.py )<br> +( GCode generated by May 8, 2008 carve.py )<br> ( Extruder Initialization )<br> ..<br> many lines of gcode<br> @@ -77,8 +77,8 @@ many lines of gcode<br> <a href="skeinforge_tools.skeinforge_utilities.euclidean.html">skeinforge_tools.skeinforge_utilities.euclidean</a><br> </td><td width="25%" valign=top><a href="skeinforge_tools.fill.html">skeinforge_tools.fill</a><br> <a href="skeinforge_tools.skeinforge_utilities.gcodec.html">skeinforge_tools.skeinforge_utilities.gcodec</a><br> -<a href="skeinforge_tools.import_translator.html">skeinforge_tools.import_translator</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="skeinforge_tools.material.html">skeinforge_tools.material</a><br> <a href="math.html">math</a><br> <a href="skeinforge_tools.polyfile.html">skeinforge_tools.polyfile</a><br> @@ -106,7 +106,7 @@ many lines of gcode<br> <td colspan=2><tt>A class to handle the multiply preferences.<br> </tt></td></tr> <tr><td> </td> <td width="100%">Methods defined here:<br> -<dl><dt><a name="MultiplyPreferences-__init__"><strong>__init__</strong></a>(self)</dt><dd><tt>Set the default preferences, execute title & preferences filename.</tt></dd></dl> +<dl><dt><a name="MultiplyPreferences-__init__"><strong>__init__</strong></a>(self)</dt><dd><tt>Set the default preferences, execute title & preferences fileName.</tt></dd></dl> <dl><dt><a name="MultiplyPreferences-execute"><strong>execute</strong></a>(self)</dt><dd><tt>Multiply button has been clicked.</tt></dd></dl> @@ -128,9 +128,9 @@ many lines of gcode<br> <dl><dt><a name="MultiplySkein-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="MultiplySkein-getGcodeFromMovement"><strong>getGcodeFromMovement</strong></a>(self, point)</dt><dd><tt>Get a gcode movement.</tt></dd></dl> +<dl><dt><a name="MultiplySkein-getGcodeFromMovementZ"><strong>getGcodeFromMovementZ</strong></a>(self, point, z)</dt><dd><tt>Get a gcode movement.</tt></dd></dl> -<dl><dt><a name="MultiplySkein-getMultipliedLine"><strong>getMultipliedLine</strong></a>(self, splitLine)</dt><dd><tt>Get elevated gcode line with operating feedrate.</tt></dd></dl> +<dl><dt><a name="MultiplySkein-getMovedLocationSetOldLocation"><strong>getMovedLocationSetOldLocation</strong></a>(self, offset, splitLine)</dt><dd><tt>Get the moved location and set the old location.</tt></dd></dl> <dl><dt><a name="MultiplySkein-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> @@ -149,11 +149,11 @@ many lines of gcode<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="-getMultiplyChainGcode"><strong>getMultiplyChainGcode</strong></a>(filename, gcodeText, multiplyPreferences<font color="#909090">=None</font>)</dt><dd><tt>Multiply a gcode linear move text. Chain multiply the gcode if it is not already multiplied.</tt></dd></dl> +<td width="100%"><dl><dt><a name="-getMultiplyChainGcode"><strong>getMultiplyChainGcode</strong></a>(fileName, gcodeText, multiplyPreferences<font color="#909090">=None</font>)</dt><dd><tt>Multiply a gcode linear move text. Chain multiply the gcode if it is not already multiplied.</tt></dd></dl> <dl><dt><a name="-getMultiplyGcode"><strong>getMultiplyGcode</strong></a>(gcodeText, multiplyPreferences<font color="#909090">=None</font>)</dt><dd><tt>Multiply a gcode linear move text.</tt></dd></dl> <dl><dt><a name="-main"><strong>main</strong></a>()</dt><dd><tt>Display the multiply dialog.</tt></dd></dl> - <dl><dt><a name="-writeOutput"><strong>writeOutput</strong></a>(filename<font color="#909090">=''</font>)</dt><dd><tt>Multiply a gcode linear move file. Chain multiply the gcode if it is not already multiplied.<br> -If no filename is specified, multiply the first unmodified gcode file in this folder.</tt></dd></dl> + <dl><dt><a name="-writeOutput"><strong>writeOutput</strong></a>(fileName<font color="#909090">=''</font>)</dt><dd><tt>Multiply a gcode linear move file. Chain multiply the gcode if it is not already multiplied.<br> +If no fileName is specified, multiply 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"> diff --git a/trunk/reprap/miscellaneous/python-beanshell-scripts/documentation/skeinforge_tools.nozzle_wipe.html b/trunk/reprap/miscellaneous/python-beanshell-scripts/documentation/skeinforge_tools.nozzle_wipe.html deleted file mode 100644 index 0e1a2894..00000000 --- a/trunk/reprap/miscellaneous/python-beanshell-scripts/documentation/skeinforge_tools.nozzle_wipe.html +++ /dev/null @@ -1,180 +0,0 @@ - -<!doctype html PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN"> -<html><head><title>Python: module skeinforge_tools.nozzle_wipe</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>.nozzle_wipe</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/nozzle_wipe.py">/home/enrique/Desktop/backup/babbleold/script/reprap/pyRepRap/skeinforge_tools/nozzle_wipe.py</a></font></td></tr></table> - <p><tt>Nozzle wipe is a script to wipe the nozzle.<br> - <br> -At the beginning of a layer, depending on the preferences nozzle, wipe will move the nozzle with the extruder off to the arrival point,<br> -then to the wipe point, then to the departure point, then back to the layer.<br> - <br> -The default 'Activate Nozzle Wipe' 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> -The "Location Arrival X" preference, is the x coordinate of the arrival location. The "Location Arrival Y" and "Location Arrival Z"<br> -preferences are the y & z coordinates of the location. The equivalent "Location Wipe.." and "Location Departure.." preferences are for<br> -the wipe and departure locations.<br> - <br> -The "Nozzle Wipe Period (layers)" preference is the number of layers between nozzle wipes. Nozzle wipe will always wipe just before<br> -the first layer, afterwards it will wipe every "Nozzle Wipe Period" layers. With the default of three, nozzle wipe will wipe just before<br> -the zeroth layer, the third layer, sixth layer and so on.<br> - <br> -To run nozzle wipe, in a shell which nozzle wipe is in type:<br> -> python nozzle_wipe.py<br> - <br> -The following examples nozzle wipes the files Hollow Square.gcode & Hollow Square.gts. The examples are run in a terminal in the<br> -folder which contains Hollow Square.gcode, Hollow Square.gts and nozzle_wipe.py. The nozzle wipe function will nozzle wipe if the<br> -'Activate Nozzle Wipe' checkbox is on. The functions writeOutput and getNozzleWipeChainGcode check to see if the text has been<br> -nozzle wiped, if not they call the getHopChainGcode in hop.py to hop the text; once they have the hopped text, then they nozzle wipe.<br> - <br> - <br> -> python nozzle_wipe.py<br> -This brings up the dialog, after clicking 'Nozzle Wipe', the following is printed:<br> -File Hollow Square.gts is being chain nozzle wiped.<br> -The nozzle wiped file is saved as Hollow Square_nozzle_wipe.gcode<br> - <br> - <br> -> python nozzle_wipe.py Hollow Square.gts<br> -File Hollow Square.gts is being chain nozzle wiped.<br> -The nozzle wiped file is saved as Hollow Square_nozzle_wipe.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 nozzle_wipe<br> ->>> nozzle_wipe.<a href="#-main">main</a>()<br> -This brings up the nozzle wipe dialog.<br> - <br> - <br> ->>> nozzle_wipe.<a href="#-writeOutput">writeOutput</a>()<br> -File Hollow Square.gts is being chain nozzle wiped.<br> -The nozzle wiped file is saved as Hollow Square_nozzle_wipe.gcode<br> - <br> - <br> ->>> nozzle_wipe.<a href="#-getNozzleWipeGcode">getNozzleWipeGcode</a>("<br> -( GCode generated by May 8, 2008 slice.py )<br> -( Extruder Initialization )<br> -..<br> -many lines of gcode<br> -..<br> -")<br> -Many line of nozzle wiped gcode.<br> - <br> ->>> nozzle_wipe.<a href="#-getNozzleWipeChainGcode">getNozzleWipeChainGcode</a>("<br> -( GCode generated by May 8, 2008 slice.py )<br> -( Extruder Initialization )<br> -..<br> -many lines of gcode<br> -..<br> -")<br> -Many line of nozzle wiped gcode.</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> -</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.hop.html">skeinforge_tools.hop</a><br> -</td><td width="25%" valign=top><a href="skeinforge_tools.import_translator.html">skeinforge_tools.import_translator</a><br> -<a href="math.html">math</a><br> -<a href="skeinforge_tools.polyfile.html">skeinforge_tools.polyfile</a><br> -</td><td width="25%" valign=top><a href="skeinforge_tools.skeinforge_utilities.preferences.html">skeinforge_tools.skeinforge_utilities.preferences</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_tools.nozzle_wipe.html#NozzleWipePreferences">NozzleWipePreferences</a> -</font></dt><dt><font face="helvetica, arial"><a href="skeinforge_tools.nozzle_wipe.html#NozzleWipeSkein">NozzleWipeSkein</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="NozzleWipePreferences">class <strong>NozzleWipePreferences</strong></a></font></td></tr> - -<tr bgcolor="#ffc8d8"><td rowspan=2><tt> </tt></td> -<td colspan=2><tt>A class to handle the nozzle wipe preferences.<br> </tt></td></tr> -<tr><td> </td> -<td width="100%">Methods defined here:<br> -<dl><dt><a name="NozzleWipePreferences-__init__"><strong>__init__</strong></a>(self)</dt><dd><tt>Set the default preferences, execute title & preferences filename.</tt></dd></dl> - -<dl><dt><a name="NozzleWipePreferences-execute"><strong>execute</strong></a>(self)</dt><dd><tt>Nozzle wipe 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="NozzleWipeSkein">class <strong>NozzleWipeSkein</strong></a></font></td></tr> - -<tr bgcolor="#ffc8d8"><td rowspan=2><tt> </tt></td> -<td colspan=2><tt>A class to nozzle wipe a skein of extrusions.<br> </tt></td></tr> -<tr><td> </td> -<td width="100%">Methods defined here:<br> -<dl><dt><a name="NozzleWipeSkein-__init__"><strong>__init__</strong></a>(self)</dt></dl> - -<dl><dt><a name="NozzleWipeSkein-addHop"><strong>addHop</strong></a>(self, begin, end)</dt><dd><tt>Add hop to highest point.</tt></dd></dl> - -<dl><dt><a name="NozzleWipeSkein-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="NozzleWipeSkein-addWipeTravel"><strong>addWipeTravel</strong></a>(self, splitLine)</dt><dd><tt>Add the wipe travel gcode.</tt></dd></dl> - -<dl><dt><a name="NozzleWipeSkein-getLinearMoveWithFeedrate"><strong>getLinearMoveWithFeedrate</strong></a>(self, feedrate, location)</dt><dd><tt>Get a linear move line with the feedrate.</tt></dd></dl> - -<dl><dt><a name="NozzleWipeSkein-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="NozzleWipeSkein-parseGcode"><strong>parseGcode</strong></a>(self, gcodeText, nozzleWipePreferences)</dt><dd><tt>Parse gcode text and store the nozzle wipe gcode.</tt></dd></dl> - -<dl><dt><a name="NozzleWipeSkein-parseInitialization"><strong>parseInitialization</strong></a>(self, nozzleWipePreferences)</dt><dd><tt>Parse gcode initialization and store the parameters.</tt></dd></dl> - -<dl><dt><a name="NozzleWipeSkein-parseLine"><strong>parseLine</strong></a>(self, line)</dt><dd><tt>Parse a gcode line and add it to the bevel gcode.</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="-getNozzleWipeChainGcode"><strong>getNozzleWipeChainGcode</strong></a>(filename, gcodeText, nozzleWipePreferences<font color="#909090">=None</font>)</dt><dd><tt>Nozzle wipe a gcode linear move text. Chain nozzle wipe the gcode if it is not already nozzle wiped.</tt></dd></dl> - <dl><dt><a name="-getNozzleWipeGcode"><strong>getNozzleWipeGcode</strong></a>(gcodeText, nozzleWipePreferences<font color="#909090">=None</font>)</dt><dd><tt>Nozzle wipe 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 nozzle wipe dialog.</tt></dd></dl> - <dl><dt><a name="-writeOutput"><strong>writeOutput</strong></a>(filename<font color="#909090">=''</font>)</dt><dd><tt>Nozzle wipe a gcode linear move file. Chain nozzle wipe the gcode if it is not already nozzle wiped. If no filename is specified, nozzle wipe 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>
\ No newline at end of file diff --git a/trunk/reprap/miscellaneous/python-beanshell-scripts/documentation/skeinforge_tools.oozebane.html b/trunk/reprap/miscellaneous/python-beanshell-scripts/documentation/skeinforge_tools.oozebane.html index 0a5a6353..bb55aff0 100644 --- a/trunk/reprap/miscellaneous/python-beanshell-scripts/documentation/skeinforge_tools.oozebane.html +++ b/trunk/reprap/miscellaneous/python-beanshell-scripts/documentation/skeinforge_tools.oozebane.html @@ -24,8 +24,11 @@ the feedrate will be decreased and the larger <br> Oozebane also turns the extruder on just before the start of a thread. The "Early Startup Maximum Distance Over Extrusion Width"<br> preference is the ratio of the maximum distance before the thread starts that the extruder will be turned off over the extrusion width,<br> -the default is 2.0. The longer the extruder has been off, the sooner the extruder will turn back on, the ratio is one minus one over e<br> -to the power of the distance the extruder has been off over the "Early Startup Distance Constant Over Extrusion Width".<br> +the default is 2.0. The longer the extruder has been off, the earlier the extruder will turn back on, the ratio is one minus one over e<br> +to the power of the distance the extruder has been off over the "Early Startup Distance Constant Over Extrusion Width". The 'First<br> +Early Startup Distance over Extrusion Width' preference is the ratio of the distance before the first thread starts that the extruder<br> +will be turned off over the extrusion width. This value should be high because, according to Marius, the extruder takes a second or<br> +two to extrude when starting for the first time, the default is forty.<br> <br> The "Minimum Distance for Early Startup over Extrusion Width" ratio is the minimum distance that the extruder has to be off before<br> the thread begins over the extrusion width for the early start up feature to activate. The "Minimum Distance for Early Shutdown<br> @@ -38,22 +41,22 @@ the thread will remain at roughly the same&nb To run oozebane, in a shell which oozebane is in type:<br> > python oozebane.py<br> <br> -The following examples oozebane the files Hollow Square.gcode & Hollow Square.gts. The examples are run in a terminal in the<br> -folder which contains Hollow Square.gcode, Hollow Square.gts and oozebane.py. The oozebane function will oozebane if the<br> +The following examples oozebane 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 oozebane.py. The oozebane function will oozebane if the<br> 'Activate Oozebane' checkbox is on. The functions writeOutput and getOozebaneChainGcode check to see if the text has been<br> -oozebaned, if not they call the getNozzleWipeChainGcode in nozzle_wipe.py to nozzle wipe the text; once they have the nozzle<br> +oozebaned, if not they call the getWipeChainGcode in wipe.py to nozzle wipe the text; once they have the nozzle<br> wiped text, then they oozebane.<br> <br> <br> > python oozebane.py<br> This brings up the dialog, after clicking 'Oozebane', the following is printed:<br> -File Hollow Square.gts is being chain oozebaned.<br> -The oozebaned file is saved as Hollow Square_oozebane.gcode<br> +File Screw Holder Bottom.stl is being chain oozebaned.<br> +The oozebaned file is saved as Screw Holder Bottom_oozebane.gcode<br> <br> <br> -> python oozebane.py Hollow Square.gts<br> -File Hollow Square.gts is being chain oozebaned.<br> -The oozebaned file is saved as Hollow Square_oozebane.gcode<br> +> python oozebane.py Screw Holder Bottom.stl<br> +File Screw Holder Bottom.stl is being chain oozebaned.<br> +The oozebaned file is saved as Screw Holder Bottom_oozebane.gcode<br> <br> <br> > python<br> @@ -66,12 +69,12 @@ This brings up the oozebane dialog.<br> <br> <br> >>> oozebane.<a href="#-writeOutput">writeOutput</a>()<br> -File Hollow Square.gts is being chain oozebaned.<br> -The oozebaned file is saved as Hollow Square_oozebane.gcode<br> +File Screw Holder Bottom.stl is being chain oozebaned.<br> +The oozebaned file is saved as Screw Holder Bottom_oozebane.gcode<br> <br> <br> >>> oozebane.<a href="#-getOozebaneGcode">getOozebaneGcode</a>("<br> -( GCode generated by May 8, 2008 slice.py )<br> +( GCode generated by May 8, 2008 carve.py )<br> ( Extruder Initialization )<br> ..<br> many lines of gcode<br> @@ -80,7 +83,7 @@ many lines of gcode<br> <br> <br> >>> oozebane.<a href="#-getOozebaneChainGcode">getOozebaneChainGcode</a>("<br> -( GCode generated by May 8, 2008 slice.py )<br> +( GCode generated by May 8, 2008 carve.py )<br> ( Extruder Initialization )<br> ..<br> many lines of gcode<br> @@ -98,13 +101,13 @@ many lines of gcode<br> <a href="cStringIO.html">cStringIO</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.import_translator.html">skeinforge_tools.import_translator</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.nozzle_wipe.html">skeinforge_tools.nozzle_wipe</a><br> <a href="skeinforge_tools.polyfile.html">skeinforge_tools.polyfile</a><br> -</td><td width="25%" valign=top><a href="skeinforge_tools.skeinforge_utilities.preferences.html">skeinforge_tools.skeinforge_utilities.preferences</a><br> -<a href="sys.html">sys</a><br> +<a href="skeinforge_tools.skeinforge_utilities.preferences.html">skeinforge_tools.skeinforge_utilities.preferences</a><br> +</td><td width="25%" valign=top><a href="sys.html">sys</a><br> <a href="time.html">time</a><br> +<a href="skeinforge_tools.wipe.html">skeinforge_tools.wipe</a><br> </td></tr></table></td></tr></table><p> <table width="100%" cellspacing=0 cellpadding=2 border=0 summary="section"> <tr bgcolor="#ee77aa"> @@ -126,7 +129,7 @@ many lines of gcode<br> <td colspan=2><tt>A class to handle the oozebane preferences.<br> </tt></td></tr> <tr><td> </td> <td width="100%">Methods defined here:<br> -<dl><dt><a name="OozebanePreferences-__init__"><strong>__init__</strong></a>(self)</dt><dd><tt>Set the default preferences, execute title & preferences filename.</tt></dd></dl> +<dl><dt><a name="OozebanePreferences-__init__"><strong>__init__</strong></a>(self)</dt><dd><tt>Set the default preferences, execute title & preferences fileName.</tt></dd></dl> <dl><dt><a name="OozebanePreferences-execute"><strong>execute</strong></a>(self)</dt><dd><tt>Oozebane button has been clicked.</tt></dd></dl> @@ -148,6 +151,8 @@ many lines of gcode<br> <dl><dt><a name="OozebaneSkein-addLineSetShutdowns"><strong>addLineSetShutdowns</strong></a>(self, line)</dt><dd><tt>Add a line and set the shutdown variables.</tt></dd></dl> +<dl><dt><a name="OozebaneSkein-getActiveFeedrateRatio"><strong>getActiveFeedrateRatio</strong></a>(self)</dt><dd><tt>Get the feedrate of the first active move over the operating feedrate.</tt></dd></dl> + <dl><dt><a name="OozebaneSkein-getAddAfterStartupLines"><strong>getAddAfterStartupLines</strong></a>(self, line)</dt><dd><tt>Get and / or add after the startup lines.</tt></dd></dl> <dl><dt><a name="OozebaneSkein-getAddBeforeStartupLines"><strong>getAddBeforeStartupLines</strong></a>(self, line)</dt><dd><tt>Get and / or add before the startup lines.</tt></dd></dl> @@ -207,10 +212,10 @@ many lines of gcode<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="-getOozebaneChainGcode"><strong>getOozebaneChainGcode</strong></a>(filename, gcodeText, oozebanePreferences<font color="#909090">=None</font>)</dt><dd><tt>Oozebane a gcode linear move text. Chain oozebane the gcode if it is not already oozebaned.</tt></dd></dl> +<td width="100%"><dl><dt><a name="-getOozebaneChainGcode"><strong>getOozebaneChainGcode</strong></a>(fileName, gcodeText, oozebanePreferences<font color="#909090">=None</font>)</dt><dd><tt>Oozebane a gcode linear move text. Chain oozebane the gcode if it is not already oozebaned.</tt></dd></dl> <dl><dt><a name="-getOozebaneGcode"><strong>getOozebaneGcode</strong></a>(gcodeText, oozebanePreferences<font color="#909090">=None</font>)</dt><dd><tt>Oozebane 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 oozebane dialog.</tt></dd></dl> - <dl><dt><a name="-writeOutput"><strong>writeOutput</strong></a>(filename<font color="#909090">=''</font>)</dt><dd><tt>Oozebane a gcode linear move file. Chain oozebane the gcode if it is not already oozebaned. If no filename is specified, oozebane the first unmodified gcode file in this folder.</tt></dd></dl> + <dl><dt><a name="-writeOutput"><strong>writeOutput</strong></a>(fileName<font color="#909090">=''</font>)</dt><dd><tt>Oozebane a gcode linear move file. Chain oozebane the gcode if it is not already oozebaned. If no fileName is specified, oozebane 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"> diff --git a/trunk/reprap/miscellaneous/python-beanshell-scripts/documentation/skeinforge_tools.polyfile.html b/trunk/reprap/miscellaneous/python-beanshell-scripts/documentation/skeinforge_tools.polyfile.html index a839e3eb..cd4facae 100644 --- a/trunk/reprap/miscellaneous/python-beanshell-scripts/documentation/skeinforge_tools.polyfile.html +++ b/trunk/reprap/miscellaneous/python-beanshell-scripts/documentation/skeinforge_tools.polyfile.html @@ -62,7 +62,7 @@ This returns true if 'Execute All Unmodified <td colspan=2><tt>A class to handle the polyfile preferences.<br> </tt></td></tr> <tr><td> </td> <td width="100%">Methods defined here:<br> -<dl><dt><a name="PolyfilePreferences-__init__"><strong>__init__</strong></a>(self)</dt><dd><tt>Set the default preferences, execute title & preferences filename.</tt></dd></dl> +<dl><dt><a name="PolyfilePreferences-__init__"><strong>__init__</strong></a>(self)</dt><dd><tt>Set the default preferences, execute title & preferences fileName.</tt></dd></dl> </td></tr></table></td></tr></table><p> <table width="100%" cellspacing=0 cellpadding=2 border=0 summary="section"> @@ -71,11 +71,11 @@ This returns true if 'Execute All Unmodified <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="-getFileOrDirectoryTypes"><strong>getFileOrDirectoryTypes</strong></a>(filename, fileTypes, wasCancelled)</dt><dd><tt>Get the gcode files in the directory the file is in if directory preference is true. Otherwise, return the file in a list.</tt></dd></dl> - <dl><dt><a name="-getFileOrDirectoryTypesUnmodifiedGcode"><strong>getFileOrDirectoryTypesUnmodifiedGcode</strong></a>(filename, fileTypes, wasCancelled)</dt><dd><tt>Get the gcode files in the directory the file is in if directory preference is true. Otherwise, return the file in a list.</tt></dd></dl> - <dl><dt><a name="-getFileOrGcodeDirectory"><strong>getFileOrGcodeDirectory</strong></a>(filename, wasCancelled, words<font color="#909090">=[]</font>)</dt><dd><tt>Get the gcode files in the directory the file is in if directory preference is true. Otherwise, return the file in a list.</tt></dd></dl> +<td width="100%"><dl><dt><a name="-getFileOrDirectoryTypes"><strong>getFileOrDirectoryTypes</strong></a>(fileName, fileTypes, wasCancelled)</dt><dd><tt>Get the gcode files in the directory the file is in if directory preference is true. Otherwise, return the file in a list.</tt></dd></dl> + <dl><dt><a name="-getFileOrDirectoryTypesUnmodifiedGcode"><strong>getFileOrDirectoryTypesUnmodifiedGcode</strong></a>(fileName, fileTypes, wasCancelled)</dt><dd><tt>Get the gcode files in the directory the file is in if directory preference is true. Otherwise, return the file in a list.</tt></dd></dl> + <dl><dt><a name="-getFileOrGcodeDirectory"><strong>getFileOrGcodeDirectory</strong></a>(fileName, wasCancelled, words<font color="#909090">=[]</font>)</dt><dd><tt>Get the gcode files in the directory the file is in if directory preference is true. Otherwise, return the file in a list.</tt></dd></dl> <dl><dt><a name="-isDirectoryPreference"><strong>isDirectoryPreference</strong></a>()</dt><dd><tt>Determine if the directory preference is true.</tt></dd></dl> - <dl><dt><a name="-isEmptyOrCancelled"><strong>isEmptyOrCancelled</strong></a>(filename, wasCancelled)</dt><dd><tt>Determine if the filename is empty or the dialog was cancelled.</tt></dd></dl> + <dl><dt><a name="-isEmptyOrCancelled"><strong>isEmptyOrCancelled</strong></a>(fileName, wasCancelled)</dt><dd><tt>Determine if the fileName is empty or the dialog was cancelled.</tt></dd></dl> <dl><dt><a name="-main"><strong>main</strong></a>(hashtable<font color="#909090">=None</font>)</dt><dd><tt>Display the file or directory dialog.</tt></dd></dl> </td></tr></table><p> <table width="100%" cellspacing=0 cellpadding=2 border=0 summary="section"> diff --git a/trunk/reprap/miscellaneous/python-beanshell-scripts/documentation/skeinforge_tools.raft.html b/trunk/reprap/miscellaneous/python-beanshell-scripts/documentation/skeinforge_tools.raft.html index 657d1b87..46e2ac10 100644 --- a/trunk/reprap/miscellaneous/python-beanshell-scripts/documentation/skeinforge_tools.raft.html +++ b/trunk/reprap/miscellaneous/python-beanshell-scripts/documentation/skeinforge_tools.raft.html @@ -33,14 +33,14 @@ those will be in the raft dialog. If&nb will have to set new preferences for the new material.<br> <br> The "Base Infill Density" preference is the infill density ratio of the base of the raft, the default ratio is half. The "Base Layer<br> -Height over Extrusion Height" preference is the ratio of the height & width of the base layer compared to the height and width<br> +Height over Layer Thickness" preference is the ratio of the height & width of the base layer compared to the height and width<br> of the shape infill, the default is two. The feedrate will be slower for raft layers which have thicker extrusions than the shape<br> infill. The "Base Layers" preference is the number of base layers, the default is one. The "Base Nozzle Lift over Half Base<br> -Extrusion Height" is the amount the nozzle is above the center of the extrusion divided by half the base extrusion height.<br> +Layer Thickness" is the amount the nozzle is above the center of the extrusion divided by half the base layer thickness.<br> <br> -The interface of the raft has equivalent preferences called "Interface Infill Density", "Interface Layer Height over Extrusion<br> -Height", "Interface Layers" and "Interface Nozzle Lift over Half Base Extrusion Height". The shape has the equivalent<br> -preference of called "Operating Nozzle Lift over Half Extrusion Height".<br> +The interface of the raft has equivalent preferences called "Interface Infill Density", "Interface Layer Thickness over Extrusion<br> +Height", "Interface Layers" and "Interface Nozzle Lift over Half Base Layer Thickness". The shape has the equivalent<br> +preference of called "Operating Nozzle Lift over Half Layer Thickness".<br> <br> The altitude that the bottom of the raft will be set to the "Bottom Altitude" preference.<br> <br> @@ -73,12 +73,8 @@ preference sets the temperature of the next l temperature of the support layer. The "Temperature of Supported Layers" preference sets the temperature of the layer of the<br> shape above the support layer.<br> <br> -If the "Turn Extruder On Early" checkbox is checked, the extruder will be turned on before the first layer is extruded. Now that<br> -oozebane turns on the extruder just before a thread begins, the "Turn Extruder On Early" option is probably not necesary so the<br> -default is now off.<br> - <br> -The following examples raft the files Hollow Square.gcode & Hollow Square.gts. The examples are run in a terminal in the folder<br> -which contains Hollow Square.gcode, Hollow Square.gts and raft.py. The raft function will raft if "Activate Raft, Elevate Nozzle,<br> +The following examples raft the files Screw Holder Bottom.gcode & Screw Holder Bottom.stl. The examples are run in a terminal in the folder<br> +which contains Screw Holder Bottom.gcode, Screw Holder Bottom.stl and raft.py. The raft function will raft if "Activate Raft, Elevate Nozzle,<br> Orbit and Set Altitude" is true, which can be set in the dialog or by changing the preferences file 'raft.csv' with a text editor or a<br> spreadsheet program set to separate tabs. The functions writeOutput and getRaftChainGcode check to see if the text has<br> been rafted, if not they call getSpeedChainGcode in speed.py to get speeded gcode; once they have the speeded text, then<br> @@ -88,8 +84,8 @@ they raft. Pictures of rafting in action&nbs <br> > python raft.py<br> This brings up the dialog, after clicking 'Raft', the following is printed:<br> -File Hollow Square.gts is being chain rafted.<br> -The rafted file is saved as Hollow Square_raft.gcode<br> +File Screw Holder Bottom.stl is being chain rafted.<br> +The rafted file is saved as Screw Holder Bottom_raft.gcode<br> <br> <br> >python<br> @@ -102,13 +98,13 @@ This brings up the raft dialog.<br> <br> <br> >>> raft.<a href="#-writeOutput">writeOutput</a>()<br> -Hollow Square.gts<br> -File Hollow Square.gts is being chain rafted.<br> -The rafted file is saved as Hollow Square_raft.gcode<br> +Screw Holder Bottom.stl<br> +File Screw Holder Bottom.stl is being chain rafted.<br> +The rafted file is saved as Screw Holder Bottom_raft.gcode<br> <br> <br> >>> raft.<a href="#-getRaftGcode">getRaftGcode</a>("<br> -( GCode generated by May 8, 2008 slice.py )<br> +( GCode generated by May 8, 2008 carve.py )<br> ( Extruder Initialization )<br> ..<br> many lines of gcode<br> @@ -117,7 +113,7 @@ many lines of gcode<br> <br> <br> >>> raft.<a href="#-getRaftChainGcode">getRaftChainGcode</a>("<br> -( GCode generated by May 8, 2008 slice.py )<br> +( GCode generated by May 8, 2008 carve.py )<br> ( Extruder Initialization )<br> ..<br> many lines of gcode<br> @@ -135,8 +131,8 @@ many lines of gcode<br> <a href="cStringIO.html">cStringIO</a><br> <a href="skeinforge_tools.skeinforge_utilities.euclidean.html">skeinforge_tools.skeinforge_utilities.euclidean</a><br> </td><td width="25%" valign=top><a href="skeinforge_tools.skeinforge_utilities.gcodec.html">skeinforge_tools.skeinforge_utilities.gcodec</a><br> -<a href="skeinforge_tools.import_translator.html">skeinforge_tools.import_translator</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> <a href="skeinforge_tools.material.html">skeinforge_tools.material</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> @@ -165,7 +161,7 @@ many lines of gcode<br> <td colspan=2><tt>A class to handle the raft preferences.<br> </tt></td></tr> <tr><td> </td> <td width="100%">Methods defined here:<br> -<dl><dt><a name="RaftPreferences-__init__"><strong>__init__</strong></a>(self)</dt><dd><tt>Set the default preferences, execute title & preferences filename.</tt></dd></dl> +<dl><dt><a name="RaftPreferences-__init__"><strong>__init__</strong></a>(self)</dt><dd><tt>Set the default preferences, execute title & preferences fileName.</tt></dd></dl> <dl><dt><a name="RaftPreferences-execute"><strong>execute</strong></a>(self)</dt><dd><tt>Raft button has been clicked.</tt></dd></dl> @@ -183,33 +179,33 @@ many lines of gcode<br> <dl><dt><a name="RaftSkein-addBaseLayer"><strong>addBaseLayer</strong></a>(self, baseExtrusionWidth, baseStep, stepBegin, stepEnd)</dt><dd><tt>Add a base layer.</tt></dd></dl> -<dl><dt><a name="RaftSkein-addGcodeFromFeedrateMovement"><strong>addGcodeFromFeedrateMovement</strong></a>(self, feedrateMinute, point)</dt><dd><tt>Add a movement to the output.</tt></dd></dl> +<dl><dt><a name="RaftSkein-addGcodeFromFeedrateMovementZ"><strong>addGcodeFromFeedrateMovementZ</strong></a>(self, feedrateMinute, point, z)</dt><dd><tt>Add a movement to the output.</tt></dd></dl> -<dl><dt><a name="RaftSkein-addGcodeFromFeedrateThread"><strong>addGcodeFromFeedrateThread</strong></a>(self, feedrateMinute, thread)</dt><dd><tt>Add a thread to the output.</tt></dd></dl> +<dl><dt><a name="RaftSkein-addGcodeFromFeedrateThreadZ"><strong>addGcodeFromFeedrateThreadZ</strong></a>(self, feedrateMinute, thread, z)</dt><dd><tt>Add a thread to the output.</tt></dd></dl> <dl><dt><a name="RaftSkein-addInterfaceLayer"><strong>addInterfaceLayer</strong></a>(self)</dt><dd><tt>Add an interface layer.</tt></dd></dl> -<dl><dt><a name="RaftSkein-addLayerFromSegments"><strong>addLayerFromSegments</strong></a>(self, feedrateMinute, layerExtrusionHeight, segments, zCenter)</dt><dd><tt>Add a layer from segments and raise the extrusion top.</tt></dd></dl> +<dl><dt><a name="RaftSkein-addLayerFromSegments"><strong>addLayerFromSegments</strong></a>(self, feedrateMinute, layerLayerThickness, segments, zCenter, z)</dt><dd><tt>Add a layer from segments and raise the extrusion top.</tt></dd></dl> <dl><dt><a name="RaftSkein-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="RaftSkein-addRaft"><strong>addRaft</strong></a>(self)</dt></dl> -<dl><dt><a name="RaftSkein-addSupportLayerTable"><strong>addSupportLayerTable</strong></a>(self, layerIndex)</dt><dd><tt>Add support segments from the boundary layers.</tt></dd></dl> +<dl><dt><a name="RaftSkein-addSupportLayerTemperature"><strong>addSupportLayerTemperature</strong></a>(self, supportSegments, z)</dt><dd><tt>Add support layer and temperature before the object layer.</tt></dd></dl> -<dl><dt><a name="RaftSkein-addSupportLayerTemperature"><strong>addSupportLayerTemperature</strong></a>(self, segments)</dt><dd><tt>Add support layer and temperature before the object layer.</tt></dd></dl> +<dl><dt><a name="RaftSkein-addSupportSegmentTable"><strong>addSupportSegmentTable</strong></a>(self, layerIndex)</dt><dd><tt>Add support segments from the boundary layers.</tt></dd></dl> <dl><dt><a name="RaftSkein-addTemperature"><strong>addTemperature</strong></a>(self, temperature)</dt><dd><tt>Add a line of temperature.</tt></dd></dl> -<dl><dt><a name="RaftSkein-addTemperatureOrbits"><strong>addTemperatureOrbits</strong></a>(self, segments, temperaturePreference, temperatureTimeChangePreference)</dt><dd><tt>Add the temperature and orbits around the support layer.</tt></dd></dl> +<dl><dt><a name="RaftSkein-addTemperatureOrbits"><strong>addTemperatureOrbits</strong></a>(self, segments, temperaturePreference, temperatureTimeChangePreference, z)</dt><dd><tt>Add the temperature and orbits around the support layer.</tt></dd></dl> <dl><dt><a name="RaftSkein-addToFillXIntersectionIndexTables"><strong>addToFillXIntersectionIndexTables</strong></a>(self, fillXIntersectionIndexTables, layerIndex)</dt><dd><tt>Add fill segments from the boundary layers.</tt></dd></dl> -<dl><dt><a name="RaftSkein-extendSegments"><strong>extendSegments</strong></a>(self, supportLayerTable)</dt><dd><tt>Extend the support segments.</tt></dd></dl> +<dl><dt><a name="RaftSkein-extendSegments"><strong>extendSegments</strong></a>(self, supportSegmentTable)</dt><dd><tt>Extend the support segments.</tt></dd></dl> <dl><dt><a name="RaftSkein-getBoundaryLine"><strong>getBoundaryLine</strong></a>(self, splitLine)</dt><dd><tt>Get elevated boundary gcode line.</tt></dd></dl> -<dl><dt><a name="RaftSkein-getGcodeFromFeedrateMovement"><strong>getGcodeFromFeedrateMovement</strong></a>(self, feedrateMinute, point)</dt><dd><tt>Get a gcode movement.</tt></dd></dl> +<dl><dt><a name="RaftSkein-getGcodeFromFeedrateMovementZ"><strong>getGcodeFromFeedrateMovementZ</strong></a>(self, feedrateMinute, point, z)</dt><dd><tt>Get a gcode movement.</tt></dd></dl> <dl><dt><a name="RaftSkein-getRaftedLine"><strong>getRaftedLine</strong></a>(self, splitLine)</dt><dd><tt>Get elevated gcode line with operating feedrate.</tt></dd></dl> @@ -217,9 +213,9 @@ many lines of gcode<br> <dl><dt><a name="RaftSkein-getStepsUntilEnd"><strong>getStepsUntilEnd</strong></a>(self, begin, end, stepSize)</dt><dd><tt>Get steps from the beginning until the end.</tt></dd></dl> -<dl><dt><a name="RaftSkein-getSupportLayerSegments"><strong>getSupportLayerSegments</strong></a>(self)</dt><dd><tt>Get the support layer segments.</tt></dd></dl> +<dl><dt><a name="RaftSkein-getSupportSegments"><strong>getSupportSegments</strong></a>(self)</dt><dd><tt>Get the support layer segments.</tt></dd></dl> -<dl><dt><a name="RaftSkein-joinSegments"><strong>joinSegments</strong></a>(self, supportLayerTableIndex)</dt><dd><tt>Join the support segments of this layer with those of the layer above.</tt></dd></dl> +<dl><dt><a name="RaftSkein-joinSegments"><strong>joinSegments</strong></a>(self, supportSegmentTableIndex)</dt><dd><tt>Join the support segments of this layer with those of the layer above.</tt></dd></dl> <dl><dt><a name="RaftSkein-parseGcode"><strong>parseGcode</strong></a>(self, gcodeText, raftPreferences)</dt><dd><tt>Parse gcode text and store the raft gcode.</tt></dd></dl> @@ -233,9 +229,9 @@ many lines of gcode<br> <dl><dt><a name="RaftSkein-setInterfaceVariables"><strong>setInterfaceVariables</strong></a>(self, interfaceExtrusionWidth, stepBegin, stepEnd)</dt><dd><tt>Set the interface variables.</tt></dd></dl> -<dl><dt><a name="RaftSkein-subtractJoinedFill"><strong>subtractJoinedFill</strong></a>(self, fillXIntersectionIndexTables, supportLayerTableIndex)</dt><dd><tt>Join the fill then subtract it from the support layer table.</tt></dd></dl> +<dl><dt><a name="RaftSkein-subtractJoinedFill"><strong>subtractJoinedFill</strong></a>(self, fillXIntersectionIndexTables, supportSegmentTableIndex)</dt><dd><tt>Join the fill then subtract it from the support layer table.</tt></dd></dl> -<dl><dt><a name="RaftSkein-truncateSupportLayerTables"><strong>truncateSupportLayerTables</strong></a>(self)</dt><dd><tt>Truncate the support segments after the last support segment which contains elements.</tt></dd></dl> +<dl><dt><a name="RaftSkein-truncateSupportSegmentTables"><strong>truncateSupportSegmentTables</strong></a>(self)</dt><dd><tt>Truncate the support segments after the last support segment which contains elements.</tt></dd></dl> </td></tr></table></td></tr></table><p> <table width="100%" cellspacing=0 cellpadding=2 border=0 summary="section"> @@ -249,16 +245,16 @@ many lines of gcode<br> <dl><dt><a name="-getEndpointsFromSegments"><strong>getEndpointsFromSegments</strong></a>(segments)</dt><dd><tt>Get the endpoints from the segments.</tt></dd></dl> <dl><dt><a name="-getExtendedLineSegment"><strong>getExtendedLineSegment</strong></a>(extensionDistance, lineSegment)</dt><dd><tt>Add shortened line segment.</tt></dd></dl> <dl><dt><a name="-getFillXIntersectionIndexes"><strong>getFillXIntersectionIndexes</strong></a>(fillLoops, y)</dt><dd><tt>Get fill x intersection indexes inside loops.</tt></dd></dl> - <dl><dt><a name="-getHorizontalSegments"><strong>getHorizontalSegments</strong></a>(fillLoops, alreadyFilledArounds, y, z)</dt><dd><tt>Get horizontal segments inside loops.</tt></dd></dl> + <dl><dt><a name="-getHorizontalSegments"><strong>getHorizontalSegments</strong></a>(fillLoops, alreadyFilledArounds, y)</dt><dd><tt>Get horizontal segments inside loops.</tt></dd></dl> <dl><dt><a name="-getJoinOfXIntersectionIndexes"><strong>getJoinOfXIntersectionIndexes</strong></a>(xIntersectionIndexList)</dt><dd><tt>Get x intersections from surrounding layers.</tt></dd></dl> - <dl><dt><a name="-getRaftChainGcode"><strong>getRaftChainGcode</strong></a>(filename, gcodeText, raftPreferences<font color="#909090">=None</font>)</dt><dd><tt>Raft a gcode linear move text. Chain raft the gcode if it is not already rafted.</tt></dd></dl> + <dl><dt><a name="-getRaftChainGcode"><strong>getRaftChainGcode</strong></a>(fileName, gcodeText, raftPreferences<font color="#909090">=None</font>)</dt><dd><tt>Raft a gcode linear move text. Chain raft the gcode if it is not already rafted.</tt></dd></dl> <dl><dt><a name="-getRaftGcode"><strong>getRaftGcode</strong></a>(gcodeText, raftPreferences<font color="#909090">=None</font>)</dt><dd><tt>Raft a gcode linear move text.</tt></dd></dl> - <dl><dt><a name="-getSquareLoop"><strong>getSquareLoop</strong></a>(beginComplex, endComplex, z)</dt><dd><tt>Get a square loop from the beginning to the end and back.</tt></dd></dl> - <dl><dt><a name="-joinSegmentTables"><strong>joinSegmentTables</strong></a>(fromTable, intoTable, z)</dt><dd><tt>Join both segment tables and put the join into the intoTable.</tt></dd></dl> + <dl><dt><a name="-getSquareLoop"><strong>getSquareLoop</strong></a>(beginComplex, endComplex)</dt><dd><tt>Get a square loop from the beginning to the end and back.</tt></dd></dl> + <dl><dt><a name="-joinSegmentTables"><strong>joinSegmentTables</strong></a>(fromTable, intoTable)</dt><dd><tt>Join both segment tables and put the join into the intoTable.</tt></dd></dl> <dl><dt><a name="-main"><strong>main</strong></a>()</dt><dd><tt>Display the raft dialog.</tt></dd></dl> - <dl><dt><a name="-subtractFill"><strong>subtractFill</strong></a>(fillXIntersectionIndexTable, supportLayerTable)</dt><dd><tt>Subtract fill from the support layer table.</tt></dd></dl> - <dl><dt><a name="-writeOutput"><strong>writeOutput</strong></a>(filename<font color="#909090">=''</font>)</dt><dd><tt>Raft a gcode linear move file. Chain raft the gcode if it is not already rafted.<br> -If no filename is specified, raft the first unmodified gcode file in this folder.</tt></dd></dl> + <dl><dt><a name="-subtractFill"><strong>subtractFill</strong></a>(fillXIntersectionIndexTable, supportSegmentLayerTable)</dt><dd><tt>Subtract fill from the support layer table.</tt></dd></dl> + <dl><dt><a name="-writeOutput"><strong>writeOutput</strong></a>(fileName<font color="#909090">=''</font>)</dt><dd><tt>Raft a gcode linear move file. Chain raft the gcode if it is not already rafted.<br> +If no fileName is specified, raft 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"> diff --git a/trunk/reprap/miscellaneous/python-beanshell-scripts/documentation/skeinforge_tools.skeinforge_utilities.euclidean.html b/trunk/reprap/miscellaneous/python-beanshell-scripts/documentation/skeinforge_tools.skeinforge_utilities.euclidean.html index fdba82f6..09034db4 100644 --- a/trunk/reprap/miscellaneous/python-beanshell-scripts/documentation/skeinforge_tools.skeinforge_utilities.euclidean.html +++ b/trunk/reprap/miscellaneous/python-beanshell-scripts/documentation/skeinforge_tools.skeinforge_utilities.euclidean.html @@ -9,25 +9,22 @@ <font color="#ffffff" face="helvetica, arial"> <br><big><big><strong><a href="skeinforge_tools.html"><font color="#ffffff">skeinforge_tools</font></a>.<a href="skeinforge_tools.skeinforge_utilities.html"><font color="#ffffff">skeinforge_utilities</font></a>.euclidean</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/skeinforge_utilities/euclidean.py">/home/enrique/Desktop/backup/babbleold/script/reprap/pyRepRap/skeinforge_tools/skeinforge_utilities/euclidean.py</a></font></td></tr></table> - <p><tt>Euclidean is a collection of python utilities for complex numbers, paths, polygons & Vec3s.<br> + <p><tt>Euclidean is a collection of python utilities for complex numbers, paths, polygons & Vector3s.<br> <br> To use euclidean, install python 2.x on your machine, which is avaliable from <a href="http://www.python.org/download/">http://www.python.org/download/</a><br> <br> Then in the folder which euclidean is in, type 'python' in a shell to run the python interpreter. Finally type<br> -'import euclidean' to import these utilities and 'from vec3 import Vec3' to import the Vec3 class.<br> +'import euclidean' to import these utilities and 'from vector3 import Vector3' to import the Vector3 class.<br> <br> <br> Below are examples of euclidean use.<br> <br> >>> from euclidean import *<br> ->>> from vec3 import Vec3<br> ->>> origin=Vec3()<br> ->>> right=Vec3(1.0,0.0,0.0)<br> ->>> back=Vec3(0.0,1.0,0.0)<br> ->>> <a href="#-getAngleAroundZAxisDifference">getAngleAroundZAxisDifference</a>(back, right)<br> -1.5707963267948966<br> ->>> <a href="#-getPointMaximum">getPointMaximum</a>(right,back)<br> -1.0, 1.0, 0.0<br> +>>> origin=complex()<br> +>>> right=complex(1.0,0.0)<br> +>>> back=complex(0.0,1.0)<br> +>>> <a href="#-getMaximum">getMaximum</a>(right,back)<br> +1.0, 1.0<br> >>> polygon=[origin, right, back]<br> >>> <a href="#-getPolygonLength">getPolygonLength</a>(polygon)<br> 3.4142135623730949<br> @@ -50,9 +47,11 @@ Below are examples of euclidean use.<br> <tr><td bgcolor="#ee77aa"><tt> </tt></td><td> </td> <td width="100%"><dl> -<dt><font face="helvetica, arial"><a href="skeinforge_tools.skeinforge_utilities.euclidean.html#Endpoint">Endpoint</a> -</font></dt><dt><font face="helvetica, arial"><a href="skeinforge_tools.skeinforge_utilities.euclidean.html#EndpointComplex">EndpointComplex</a> +<dt><font face="helvetica, arial"><a href="skeinforge_tools.skeinforge_utilities.euclidean.html#DistanceIndex">DistanceIndex</a> +</font></dt><dt><font face="helvetica, arial"><a href="skeinforge_tools.skeinforge_utilities.euclidean.html#Endpoint">Endpoint</a> +</font></dt><dt><font face="helvetica, arial"><a href="skeinforge_tools.skeinforge_utilities.euclidean.html#LoopLayer">LoopLayer</a> </font></dt><dt><font face="helvetica, arial"><a href="skeinforge_tools.skeinforge_utilities.euclidean.html#PathZ">PathZ</a> +</font></dt><dt><font face="helvetica, arial"><a href="skeinforge_tools.skeinforge_utilities.euclidean.html#RotatedLoopLayer">RotatedLoopLayer</a> </font></dt><dt><font face="helvetica, arial"><a href="skeinforge_tools.skeinforge_utilities.euclidean.html#SurroundingLoop">SurroundingLoop</a> </font></dt><dt><font face="helvetica, arial"><a href="skeinforge_tools.skeinforge_utilities.euclidean.html#XIntersectionIndex">XIntersectionIndex</a> </font></dt></dl> @@ -60,6 +59,20 @@ Below are examples of euclidean use.<br> <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="DistanceIndex">class <strong>DistanceIndex</strong></a></font></td></tr> + +<tr bgcolor="#ffc8d8"><td rowspan=2><tt> </tt></td> +<td colspan=2><tt>A class to hold the distance and the index of the loop.<br> </tt></td></tr> +<tr><td> </td> +<td width="100%">Methods defined here:<br> +<dl><dt><a name="DistanceIndex-__init__"><strong>__init__</strong></a>(self, distance, index)</dt></dl> + +<dl><dt><a name="DistanceIndex-__repr__"><strong>__repr__</strong></a>(self)</dt><dd><tt>Get the string representation of this distance index.</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="Endpoint">class <strong>Endpoint</strong></a></font></td></tr> <tr bgcolor="#ffc8d8"><td rowspan=2><tt> </tt></td> @@ -80,21 +93,15 @@ Below are examples of euclidean use.<br> <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="EndpointComplex">class <strong>EndpointComplex</strong></a></font></td></tr> +<font color="#000000" face="helvetica, arial"><a name="LoopLayer">class <strong>LoopLayer</strong></a></font></td></tr> <tr bgcolor="#ffc8d8"><td rowspan=2><tt> </tt></td> -<td colspan=2><tt>The endpoint of a segment.<br> </tt></td></tr> +<td colspan=2><tt>Loops with a z.<br> </tt></td></tr> <tr><td> </td> <td width="100%">Methods defined here:<br> -<dl><dt><a name="EndpointComplex-__repr__"><strong>__repr__</strong></a>(self)</dt><dd><tt>Get the string representation of this <a href="#Endpoint">Endpoint</a>.</tt></dd></dl> - -<dl><dt><a name="EndpointComplex-getFromOtherPoint"><strong>getFromOtherPoint</strong></a>(self, otherEndpoint, point)</dt><dd><tt>Initialize from other endpoint.</tt></dd></dl> - -<dl><dt><a name="EndpointComplex-getHop"><strong>getHop</strong></a>(self, fillInset, path)</dt><dd><tt>Get a hop away from the endpoint if the other endpoint is doubling back.</tt></dd></dl> - -<dl><dt><a name="EndpointComplex-getNearestEndpoint"><strong>getNearestEndpoint</strong></a>(self, endpoints)</dt><dd><tt>Get nearest endpoint.</tt></dd></dl> +<dl><dt><a name="LoopLayer-__init__"><strong>__init__</strong></a>(self, z)</dt></dl> -<dl><dt><a name="EndpointComplex-getNearestMiss"><strong>getNearestMiss</strong></a>(self, endpoints, path, pixelTable, width)</dt><dd><tt>Get the nearest endpoint which the segment to that endpoint misses the other extrusions.</tt></dd></dl> +<dl><dt><a name="LoopLayer-__repr__"><strong>__repr__</strong></a>(self)</dt><dd><tt>Get the string representation of this loop layer.</tt></dd></dl> </td></tr></table> <p> <table width="100%" cellspacing=0 cellpadding=2 border=0 summary="section"> @@ -106,11 +113,23 @@ Below are examples of euclidean use.<br> <td colspan=2><tt>Complex path with a z.<br> </tt></td></tr> <tr><td> </td> <td width="100%">Methods defined here:<br> -<dl><dt><a name="PathZ-__init__"><strong>__init__</strong></a>(self, path, z)</dt></dl> +<dl><dt><a name="PathZ-__init__"><strong>__init__</strong></a>(self, z)</dt></dl> -<dl><dt><a name="PathZ-__repr__"><strong>__repr__</strong></a>(self)</dt><dd><tt>Get the string representation of this flat path.</tt></dd></dl> +<dl><dt><a name="PathZ-__repr__"><strong>__repr__</strong></a>(self)</dt><dd><tt>Get the string representation of this path z.</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="RotatedLoopLayer">class <strong>RotatedLoopLayer</strong></a></font></td></tr> + +<tr bgcolor="#ffc8d8"><td rowspan=2><tt> </tt></td> +<td colspan=2><tt>A rotated layer.<br> </tt></td></tr> +<tr><td> </td> +<td width="100%">Methods defined here:<br> +<dl><dt><a name="RotatedLoopLayer-__init__"><strong>__init__</strong></a>(self, z)</dt></dl> -<dl><dt><a name="PathZ-getPath"><strong>getPath</strong></a>(self)</dt><dd><tt>Get the Vec3 path.</tt></dd></dl> +<dl><dt><a name="RotatedLoopLayer-__repr__"><strong>__repr__</strong></a>(self)</dt><dd><tt>Get the string representation of this rotated loop layer.</tt></dd></dl> </td></tr></table> <p> <table width="100%" cellspacing=0 cellpadding=2 border=0 summary="section"> @@ -126,6 +145,10 @@ Below are examples of euclidean use.<br> <dl><dt><a name="SurroundingLoop-__repr__"><strong>__repr__</strong></a>(self)</dt><dd><tt>Get the string representation of this surrounding loop.</tt></dd></dl> +<dl><dt><a name="SurroundingLoop-addToBoundary"><strong>addToBoundary</strong></a>(self, vector3)</dt><dd><tt>Add vector3 to boundary.</tt></dd></dl> + +<dl><dt><a name="SurroundingLoop-addToLoop"><strong>addToLoop</strong></a>(self, vector3)</dt><dd><tt>Add vector3 to loop.</tt></dd></dl> + <dl><dt><a name="SurroundingLoop-addToThreads"><strong>addToThreads</strong></a>(self, oldOrderedLocation, skein)</dt><dd><tt>Add to paths from the last location.</tt></dd></dl> <dl><dt><a name="SurroundingLoop-getFillLoops"><strong>getFillLoops</strong></a>(self)</dt><dd><tt>Get last fill loops from the outside loop and the loops inside the inside loops.</tt></dd></dl> @@ -167,157 +190,101 @@ Below are examples of euclidean use.<br> <dl><dt><a name="-addPixelToPixelTableWithSteepness"><strong>addPixelToPixelTableWithSteepness</strong></a>(isSteep, pixelTable, x, y)</dt><dd><tt>Add pixels to the pixel table with steepness.</tt></dd></dl> <dl><dt><a name="-addPointToPath"><strong>addPointToPath</strong></a>(path, pixelTable, point, width)</dt><dd><tt>Add a point to a path and the pixel table.</tt></dd></dl> <dl><dt><a name="-addSegmentToPixelTable"><strong>addSegmentToPixelTable</strong></a>(beginComplex, endComplex, pixelTable, shortenDistanceBegin, shortenDistanceEnd, width)</dt><dd><tt>Add line segment to the pixel table.</tt></dd></dl> - <dl><dt><a name="-addSurroundingLoopBeginning"><strong>addSurroundingLoopBeginning</strong></a>(loop, skein)</dt><dd><tt>Add surrounding loop beginning to gcode output.</tt></dd></dl> - <dl><dt><a name="-addSurroundingLoopComplexBeginning"><strong>addSurroundingLoopComplexBeginning</strong></a>(loop, skein, z)</dt><dd><tt>Add surrounding loop beginning to gcode output.</tt></dd></dl> - <dl><dt><a name="-addToThreadsFromLoop"><strong>addToThreadsFromLoop</strong></a>(extrusionHalfWidthSquared, gcodeType, loop, oldOrderedLocation, skein)</dt><dd><tt>Add to threads from the last location from loop.</tt></dd></dl> + <dl><dt><a name="-addSurroundingLoopBeginning"><strong>addSurroundingLoopBeginning</strong></a>(loop, skein, z)</dt><dd><tt>Add surrounding loop beginning to gcode output.</tt></dd></dl> + <dl><dt><a name="-addToThreadsFromLoop"><strong>addToThreadsFromLoop</strong></a>(extrusionHalfWidth, gcodeType, loop, oldOrderedLocation, skein)</dt><dd><tt>Add to threads from the last location from loop.</tt></dd></dl> <dl><dt><a name="-addToThreadsRemoveFromSurroundings"><strong>addToThreadsRemoveFromSurroundings</strong></a>(oldOrderedLocation, surroundingLoops, skein)</dt><dd><tt>Add to threads from the last location from surrounding loops.</tt></dd></dl> <dl><dt><a name="-addXIntersectionIndexes"><strong>addXIntersectionIndexes</strong></a>(loop, solidIndex, xIntersectionIndexList, y)</dt><dd><tt>Add the x intersections for a loop.</tt></dd></dl> - <dl><dt><a name="-addXIntersectionIndexesFromComplexes"><strong>addXIntersectionIndexesFromComplexes</strong></a>(loop, solidIndex, xIntersectionIndexList, y)</dt><dd><tt>Add the x intersections for a loop.</tt></dd></dl> - <dl><dt><a name="-addXIntersectionIndexesFromLoopListComplexes"><strong>addXIntersectionIndexesFromLoopListComplexes</strong></a>(loopLists, xIntersectionIndexList, y)</dt><dd><tt>Add the x intersections for the loop lists.</tt></dd></dl> <dl><dt><a name="-addXIntersectionIndexesFromLoopLists"><strong>addXIntersectionIndexesFromLoopLists</strong></a>(loopLists, xIntersectionIndexList, y)</dt><dd><tt>Add the x intersections for the loop lists.</tt></dd></dl> <dl><dt><a name="-addXIntersectionIndexesFromLoops"><strong>addXIntersectionIndexesFromLoops</strong></a>(loops, solidIndex, xIntersectionIndexList, y)</dt><dd><tt>Add the x intersections for the loops.</tt></dd></dl> - <dl><dt><a name="-getAngleAroundZAxisDifference"><strong>getAngleAroundZAxisDifference</strong></a>(subtractFromVec3, subtractVec3)</dt><dd><tt>Get the angle around the Z axis difference between a pair of Vec3s.<br> + <dl><dt><a name="-compareSegmentLength"><strong>compareSegmentLength</strong></a>(endpoint, otherEndpoint)</dt><dd><tt>Get comparison in order to sort endpoints in ascending order of segment length.</tt></dd></dl> + <dl><dt><a name="-getAngleAroundZAxisDifference"><strong>getAngleAroundZAxisDifference</strong></a>(subtractFromVec3, subtractVec3)</dt><dd><tt>Get the angle around the Z axis difference between a pair of Vector3s.<br> <br> Keyword arguments:<br> -subtractFromVec3 -- Vec3 whose angle will be subtracted from<br> -subtractVec3 -- Vec3 whose angle will be subtracted</tt></dd></dl> +subtractFromVec3 -- Vector3 whose angle will be subtracted from<br> +subtractVec3 -- Vector3 whose angle will be subtracted</tt></dd></dl> <dl><dt><a name="-getAroundLoop"><strong>getAroundLoop</strong></a>(begin, end, loop)</dt><dd><tt>Get an arc around a loop.</tt></dd></dl> - <dl><dt><a name="-getAwayPath"><strong>getAwayPath</strong></a>(path, radius)</dt><dd><tt>Get a loop with only the points that are far enough away from each other.</tt></dd></dl> - <dl><dt><a name="-getAwayPointComplexes"><strong>getAwayPointComplexes</strong></a>(pointComplexes, radius)</dt><dd><tt>Get a path with only the points that are far enough away from each other.</tt></dd></dl> + <dl><dt><a name="-getAwayPoints"><strong>getAwayPoints</strong></a>(pointComplexes, radius)</dt><dd><tt>Get a path with only the points that are far enough away from each other.</tt></dd></dl> <dl><dt><a name="-getBackOfLoops"><strong>getBackOfLoops</strong></a>(loops)</dt><dd><tt>Get the back of the loops.</tt></dd></dl> <dl><dt><a name="-getClippedAtEndLoopPath"><strong>getClippedAtEndLoopPath</strong></a>(clip, loopPath)</dt><dd><tt>Get a clipped loop path.</tt></dd></dl> <dl><dt><a name="-getClippedLoopPath"><strong>getClippedLoopPath</strong></a>(clip, loopPath)</dt><dd><tt>Get a clipped loop path.</tt></dd></dl> - <dl><dt><a name="-getComplexCrossProduct"><strong>getComplexCrossProduct</strong></a>(firstComplex, secondComplex)</dt><dd><tt>Get z component cross product of a pair of complexes.</tt></dd></dl> - <dl><dt><a name="-getComplexDot"><strong>getComplexDot</strong></a>(firstComplex, secondComplex)</dt><dd><tt>Get the dot product of a pair of complexes.</tt></dd></dl> - <dl><dt><a name="-getComplexDotPlusOne"><strong>getComplexDotPlusOne</strong></a>(firstComplex, secondComplex)</dt><dd><tt>Get the dot product plus one of the x and y components of a pair of Vec3s.</tt></dd></dl> - <dl><dt><a name="-getComplexMaximum"><strong>getComplexMaximum</strong></a>(firstComplex, secondComplex)</dt><dd><tt>Get a complex with each component the maximum of the respective components of a pair of complexes.</tt></dd></dl> - <dl><dt><a name="-getComplexMaximumFromPointComplexes"><strong>getComplexMaximumFromPointComplexes</strong></a>(pointComplexes)</dt><dd><tt>Get a complex with each component the maximum of the respective components of a list of complex points.</tt></dd></dl> - <dl><dt><a name="-getComplexMaximumFromVec3List"><strong>getComplexMaximumFromVec3List</strong></a>(vec3List)</dt><dd><tt>Get a complex with each component the maximum of the respective components of a list of Vec3s.</tt></dd></dl> - <dl><dt><a name="-getComplexMinimum"><strong>getComplexMinimum</strong></a>(firstComplex, secondComplex)</dt><dd><tt>Get a complex with each component the minimum of the respective components of a pair of complexes.</tt></dd></dl> - <dl><dt><a name="-getComplexMinimumFromPointComplexes"><strong>getComplexMinimumFromPointComplexes</strong></a>(pointComplexes)</dt><dd><tt>Get a complex with each component the minimum of the respective components of a list of complex points.</tt></dd></dl> - <dl><dt><a name="-getComplexMinimumFromVec3List"><strong>getComplexMinimumFromVec3List</strong></a>(vec3List)</dt><dd><tt>Get a complex with each component the minimum of the respective components of a list of Vec3s.</tt></dd></dl> - <dl><dt><a name="-getDistanceSquaredToPlaneSegment"><strong>getDistanceSquaredToPlaneSegment</strong></a>(segmentBegin, segmentEnd, point)</dt><dd><tt>Get the distance squared from a point to the x & y components of a segment.</tt></dd></dl> + <dl><dt><a name="-getCrossProduct"><strong>getCrossProduct</strong></a>(firstComplex, secondComplex)</dt><dd><tt>Get z component cross product of a pair of complexes.</tt></dd></dl> + <dl><dt><a name="-getDistanceToPlaneSegment"><strong>getDistanceToPlaneSegment</strong></a>(segmentBegin, segmentEnd, point)</dt><dd><tt>Get the distance squared from a point to the x & y components of a segment.</tt></dd></dl> + <dl><dt><a name="-getDotProduct"><strong>getDotProduct</strong></a>(firstComplex, secondComplex)</dt><dd><tt>Get the dot product of a pair of complexes.</tt></dd></dl> + <dl><dt><a name="-getDotProductPlusOne"><strong>getDotProductPlusOne</strong></a>(firstComplex, secondComplex)</dt><dd><tt>Get the dot product plus one of the x and y components of a pair of Vector3s.</tt></dd></dl> <dl><dt><a name="-getFillOfSurroundings"><strong>getFillOfSurroundings</strong></a>(surroundingLoops)</dt><dd><tt>Get extra fill loops of surrounding loops.</tt></dd></dl> <dl><dt><a name="-getFloatPart"><strong>getFloatPart</strong></a>(number)</dt><dd><tt>Get the float part of the number.</tt></dd></dl> <dl><dt><a name="-getFrontOfLoops"><strong>getFrontOfLoops</strong></a>(loops)</dt><dd><tt>Get the front of the loops.</tt></dd></dl> - <dl><dt><a name="-getHalfSimplifiedLoop"><strong>getHalfSimplifiedLoop</strong></a>(loop, radius, remainder)</dt><dd><tt>Get the loop with half of the points inside the channel removed.</tt></dd></dl> - <dl><dt><a name="-getHalfSimplifiedLoopComplex"><strong>getHalfSimplifiedLoopComplex</strong></a>(loopComplex, radius, remainder)</dt><dd><tt>Get the loop with half of the points inside the channel removed.</tt></dd></dl> + <dl><dt><a name="-getHalfSimplifiedLoop"><strong>getHalfSimplifiedLoop</strong></a>(loopComplex, radius, remainder)</dt><dd><tt>Get the loop with half of the points inside the channel removed.</tt></dd></dl> <dl><dt><a name="-getHalfSimplifiedPath"><strong>getHalfSimplifiedPath</strong></a>(path, radius, remainder)</dt><dd><tt>Get the path with half of the points inside the channel removed.</tt></dd></dl> <dl><dt><a name="-getInsidesAddToOutsides"><strong>getInsidesAddToOutsides</strong></a>(loops, outsides)</dt><dd><tt>Add loops to either the insides or outsides.</tt></dd></dl> <dl><dt><a name="-getIntermediateLocation"><strong>getIntermediateLocation</strong></a>(alongWay, begin, end)</dt><dd><tt>Get the intermediate location between begin and end.</tt></dd></dl> - <dl><dt><a name="-getIntermediateLocationComplex"><strong>getIntermediateLocationComplex</strong></a>(alongWay, begin, end)</dt><dd><tt>Get the intermediate location between begin and end.</tt></dd></dl> <dl><dt><a name="-getLargestLoop"><strong>getLargestLoop</strong></a>(loops)</dt><dd><tt>Get largest loop from loops.</tt></dd></dl> - <dl><dt><a name="-getLeftPoint"><strong>getLeftPoint</strong></a>(path)</dt><dd><tt>Get the leftmost point in the path.</tt></dd></dl> - <dl><dt><a name="-getLeftPointComplex"><strong>getLeftPointComplex</strong></a>(pointComplexes)</dt><dd><tt>Get the leftmost complex point in the points.</tt></dd></dl> - <dl><dt><a name="-getLoopComplexMaximumSpan"><strong>getLoopComplexMaximumSpan</strong></a>(loop)</dt><dd><tt>Get the maximum span of the loop.</tt></dd></dl> - <dl><dt><a name="-getLoopStartingNearest"><strong>getLoopStartingNearest</strong></a>(extrusionHalfWidthSquared, location, loop)</dt><dd><tt>Add to threads from the last location from loop.</tt></dd></dl> - <dl><dt><a name="-getMaximumSpan"><strong>getMaximumSpan</strong></a>(loop)</dt><dd><tt>Get the maximum span in the xy plane.</tt></dd></dl> - <dl><dt><a name="-getNearestDistanceSquaredIndex"><strong>getNearestDistanceSquaredIndex</strong></a>(point, loop)</dt><dd><tt>Get the distance squared to the nearest segment of the loop and index of that segment.</tt></dd></dl> - <dl><dt><a name="-getNearestPathDistanceSquaredIndex"><strong>getNearestPathDistanceSquaredIndex</strong></a>(point, path)</dt><dd><tt>Get the distance squared to the nearest segment of the path and index of that segment.</tt></dd></dl> + <dl><dt><a name="-getLeftPoint"><strong>getLeftPoint</strong></a>(pointComplexes)</dt><dd><tt>Get the leftmost complex point in the points.</tt></dd></dl> + <dl><dt><a name="-getLoopStartingNearest"><strong>getLoopStartingNearest</strong></a>(extrusionHalfWidth, location, loop)</dt><dd><tt>Add to threads from the last location from loop.</tt></dd></dl> + <dl><dt><a name="-getMaximum"><strong>getMaximum</strong></a>(firstComplex, secondComplex)</dt><dd><tt>Get a complex with each component the maximum of the respective components of a pair of complexes.</tt></dd></dl> + <dl><dt><a name="-getMaximumFromPoints"><strong>getMaximumFromPoints</strong></a>(pointComplexes)</dt><dd><tt>Get a complex with each component the maximum of the respective components of a list of complex points.</tt></dd></dl> + <dl><dt><a name="-getMaximumSpan"><strong>getMaximumSpan</strong></a>(loop)</dt><dd><tt>Get the maximum span of the loop.</tt></dd></dl> + <dl><dt><a name="-getMinimum"><strong>getMinimum</strong></a>(firstComplex, secondComplex)</dt><dd><tt>Get a complex with each component the minimum of the respective components of a pair of complexes.</tt></dd></dl> + <dl><dt><a name="-getMinimumFromPoints"><strong>getMinimumFromPoints</strong></a>(pointComplexes)</dt><dd><tt>Get a complex with each component the minimum of the respective components of a list of complex points.</tt></dd></dl> + <dl><dt><a name="-getMinimumFromVec3List"><strong>getMinimumFromVec3List</strong></a>(vec3List)</dt><dd><tt>Get a complex with each component the minimum of the respective components of a list of Vector3s.</tt></dd></dl> + <dl><dt><a name="-getNearestDistanceIndex"><strong>getNearestDistanceIndex</strong></a>(point, loop)</dt><dd><tt>Get the distance squared to the nearest segment of the loop and index of that segment.</tt></dd></dl> <dl><dt><a name="-getNearestPointOnSegment"><strong>getNearestPointOnSegment</strong></a>(segmentBegin, segmentEnd, point)</dt><dd><tt>Get the nearest point on the segment.</tt></dd></dl> <dl><dt><a name="-getNormalized"><strong>getNormalized</strong></a>(complexNumber)</dt><dd><tt>Get the normalized complex.</tt></dd></dl> - <dl><dt><a name="-getNumberOfIntersectionsToLeft"><strong>getNumberOfIntersectionsToLeft</strong></a>(leftPoint, loop)</dt><dd><tt>Get the number of intersections through the loop for the line starting from the left point and going left.</tt></dd></dl> - <dl><dt><a name="-getNumberOfIntersectionsToLeftComplex"><strong>getNumberOfIntersectionsToLeftComplex</strong></a>(leftPointComplex, loopComplex)</dt><dd><tt>Get the number of intersections through the loop for the line starting from the left point and going left.</tt></dd></dl> + <dl><dt><a name="-getNumberOfIntersectionsToLeft"><strong>getNumberOfIntersectionsToLeft</strong></a>(leftPointComplex, loopComplex)</dt><dd><tt>Get the number of intersections through the loop for the line starting from the left point and going left.</tt></dd></dl> <dl><dt><a name="-getOrderedSurroundingLoops"><strong>getOrderedSurroundingLoops</strong></a>(extrusionWidth, surroundingLoops)</dt><dd><tt>Get ordered surrounding loops from surrounding loops.</tt></dd></dl> <dl><dt><a name="-getPathLength"><strong>getPathLength</strong></a>(path)</dt><dd><tt>Get the length of a path ( an open polyline ).</tt></dd></dl> - <dl><dt><a name="-getPathRoundZAxisByPlaneAngle"><strong>getPathRoundZAxisByPlaneAngle</strong></a>(planeAngle, path)</dt><dd><tt>Get Vec3 array rotated by a plane angle.<br> - <br> -Keyword arguments:<br> -planeAngle - plane angle of the rotation<br> -path - Vec3 array whose rotation will be returned</tt></dd></dl> <dl><dt><a name="-getPathsFromEndpoints"><strong>getPathsFromEndpoints</strong></a>(endpoints, fillInset, pixelTable, width)</dt><dd><tt>Get paths from endpoints.</tt></dd></dl> - <dl><dt><a name="-getPlaneDot"><strong>getPlaneDot</strong></a>(vec3First, vec3Second)</dt><dd><tt>Get the dot product of the x and y components of a pair of Vec3s.</tt></dd></dl> - <dl><dt><a name="-getPlaneDotPlusOne"><strong>getPlaneDotPlusOne</strong></a>(vec3First, vec3Second)</dt><dd><tt>Get the dot product plus one of the x and y components of a pair of Vec3s.</tt></dd></dl> - <dl><dt><a name="-getPointComplexesFromPoints"><strong>getPointComplexesFromPoints</strong></a>(points)</dt><dd><tt>Get complex path from a Vec3 path.</tt></dd></dl> - <dl><dt><a name="-getPointComplexesRoundZAxisByComplex"><strong>getPointComplexesRoundZAxisByComplex</strong></a>(planeAngle, points)</dt><dd><tt>Get points rotated by the plane angle</tt></dd></dl> - <dl><dt><a name="-getPointMaximum"><strong>getPointMaximum</strong></a>(firstPoint, secondPoint)</dt><dd><tt>Get a point with each component the maximum of the respective components of a pair of Vec3s.</tt></dd></dl> - <dl><dt><a name="-getPointMinimum"><strong>getPointMinimum</strong></a>(firstPoint, secondPoint)</dt><dd><tt>Get a point with each component the minimum of the respective components of a pair of Vec3s.</tt></dd></dl> + <dl><dt><a name="-getPlaneDot"><strong>getPlaneDot</strong></a>(vec3First, vec3Second)</dt><dd><tt>Get the dot product of the x and y components of a pair of Vector3s.</tt></dd></dl> + <dl><dt><a name="-getPointMaximum"><strong>getPointMaximum</strong></a>(firstPoint, secondPoint)</dt><dd><tt>Get a point with each component the maximum of the respective components of a pair of Vector3s.</tt></dd></dl> + <dl><dt><a name="-getPointMinimum"><strong>getPointMinimum</strong></a>(firstPoint, secondPoint)</dt><dd><tt>Get a point with each component the minimum of the respective components of a pair of Vector3s.</tt></dd></dl> <dl><dt><a name="-getPointPlusSegmentWithLength"><strong>getPointPlusSegmentWithLength</strong></a>(length, point, segment)</dt><dd><tt>Get point plus a segment scaled to a given length.</tt></dd></dl> - <dl><dt><a name="-getPointsFromPointComplexesZ"><strong>getPointsFromPointComplexesZ</strong></a>(pointComplexes, z)</dt><dd><tt>Get Vec3 points from a complex points and z.</tt></dd></dl> - <dl><dt><a name="-getPointsListFromPointComplexesListZ"><strong>getPointsListFromPointComplexesListZ</strong></a>(pointComplexesList, z)</dt><dd><tt>Get Vec3 points list from a complex points list and z.</tt></dd></dl> - <dl><dt><a name="-getPolar"><strong>getPolar</strong></a>(angle, radius)</dt><dd><tt>Get polar complex from counterclockwise angle from 1, 0 and radius.<br> - <br> -Keyword arguments:<br> -angle -- counterclockwise angle from 1, 0<br> -radius -- radius of complex</tt></dd></dl> - <dl><dt><a name="-getPolygonArea"><strong>getPolygonArea</strong></a>(polygon)</dt><dd><tt>Get the xy plane area of a polygon.</tt></dd></dl> - <dl><dt><a name="-getPolygonComplexArea"><strong>getPolygonComplexArea</strong></a>(polygonComplex)</dt><dd><tt>Get the area of a complex polygon.</tt></dd></dl> + <dl><dt><a name="-getPointsRoundZAxis"><strong>getPointsRoundZAxis</strong></a>(planeAngle, points)</dt><dd><tt>Get points rotated by the plane angle</tt></dd></dl> + <dl><dt><a name="-getPolar"><strong>getPolar</strong></a>(angle, radius)</dt><dd><tt>Get polar complex from counterclockwise angle from 1, 0 and radius.</tt></dd></dl> + <dl><dt><a name="-getPolygonArea"><strong>getPolygonArea</strong></a>(polygonComplex)</dt><dd><tt>Get the area of a complex polygon.</tt></dd></dl> <dl><dt><a name="-getPolygonLength"><strong>getPolygonLength</strong></a>(polygon)</dt><dd><tt>Get the length of a polygon perimeter.</tt></dd></dl> <dl><dt><a name="-getReverseFloatPart"><strong>getReverseFloatPart</strong></a>(number)</dt><dd><tt>Get the reverse float part of the number.</tt></dd></dl> - <dl><dt><a name="-getRotatedClockwiseQuarterAroundZAxis"><strong>getRotatedClockwiseQuarterAroundZAxis</strong></a>(vector3)</dt><dd><tt>Get vector3 rotated a quarter clockwise turn around Z axis.</tt></dd></dl> - <dl><dt><a name="-getRotatedWiddershinsQuarterAroundZAxis"><strong>getRotatedWiddershinsQuarterAroundZAxis</strong></a>(vector3)</dt><dd><tt>Get Vec3 rotated a quarter widdershins turn around Z axis.</tt></dd></dl> - <dl><dt><a name="-getRoundXAxis"><strong>getRoundXAxis</strong></a>(angle, vector3)</dt><dd><tt>Get Vec3 rotated around X axis from widdershins angle and Vec3.<br> - <br> -Keyword arguments:<br> -angle - widdershins angle from 1, 0<br> -vector3 - Vec3 whose rotation will be returned</tt></dd></dl> - <dl><dt><a name="-getRoundYAxis"><strong>getRoundYAxis</strong></a>(angle, vector3)</dt><dd><tt>Get Vec3 rotated around Y axis from widdershins angle and Vec3.<br> - <br> -Keyword arguments:<br> -angle - widdershins angle from 1, 0<br> -vector3 - Vec3 whose rotation will be returned</tt></dd></dl> - <dl><dt><a name="-getRoundZAxis"><strong>getRoundZAxis</strong></a>(angle, vector3)</dt><dd><tt>Get Vec3 rotated around Z axis from widdershins angle and Vec3.<br> - <br> -Keyword arguments:<br> -angle - widdershins angle from 1, 0<br> -vector3 - Vec3 whose rotation will be returned</tt></dd></dl> - <dl><dt><a name="-getRoundZAxisByPlaneAngle"><strong>getRoundZAxisByPlaneAngle</strong></a>(planeAngle, vector3)</dt><dd><tt>Get Vec3 rotated by a plane angle.<br> + <dl><dt><a name="-getRotatedWiddershinsQuarterAroundZAxis"><strong>getRotatedWiddershinsQuarterAroundZAxis</strong></a>(vector3)</dt><dd><tt>Get Vector3 rotated a quarter widdershins turn around Z axis.</tt></dd></dl> + <dl><dt><a name="-getRoundZAxisByPlaneAngle"><strong>getRoundZAxisByPlaneAngle</strong></a>(planeAngle, vector3)</dt><dd><tt>Get Vector3 rotated by a plane angle.<br> <br> Keyword arguments:<br> planeAngle - plane angle of the rotation<br> -vector3 - Vec3 whose rotation will be returned</tt></dd></dl> +vector3 - Vector3 whose rotation will be returned</tt></dd></dl> <dl><dt><a name="-getRoundedPoint"><strong>getRoundedPoint</strong></a>(point)</dt><dd><tt>Get point with each component rounded.</tt></dd></dl> <dl><dt><a name="-getRoundedToDecimalPlaces"><strong>getRoundedToDecimalPlaces</strong></a>(decimalPlaces, number)</dt><dd><tt>Get number rounded to a number of decimal places as a string.</tt></dd></dl> <dl><dt><a name="-getRoundedToThreePlaces"><strong>getRoundedToThreePlaces</strong></a>(number)</dt><dd><tt>Get number rounded to three places as a string.</tt></dd></dl> - <dl><dt><a name="-getSegmentComplexFromPoints"><strong>getSegmentComplexFromPoints</strong></a>(begin, end)</dt><dd><tt>Get endpoint segment from a pair of points.</tt></dd></dl> - <dl><dt><a name="-getSegmentComplexesFromXIntersectionIndexes"><strong>getSegmentComplexesFromXIntersectionIndexes</strong></a>(xIntersectionIndexList, y)</dt><dd><tt>Get endpoint segments from the x intersection indexes.</tt></dd></dl> - <dl><dt><a name="-getSegmentComplexesFromXIntersections"><strong>getSegmentComplexesFromXIntersections</strong></a>(xIntersections, y)</dt><dd><tt>Get endpoint segments from the x intersections.</tt></dd></dl> <dl><dt><a name="-getSegmentFromPoints"><strong>getSegmentFromPoints</strong></a>(begin, end)</dt><dd><tt>Get endpoint segment from a pair of points.</tt></dd></dl> - <dl><dt><a name="-getSegmentsFromXIntersectionIndexes"><strong>getSegmentsFromXIntersectionIndexes</strong></a>(xIntersectionIndexList, y, z)</dt><dd><tt>Get endpoint segments from the x intersection indexes.</tt></dd></dl> - <dl><dt><a name="-getSegmentsFromXIntersections"><strong>getSegmentsFromXIntersections</strong></a>(xIntersections, y, z)</dt><dd><tt>Get endpoint segments from the x intersections.</tt></dd></dl> - <dl><dt><a name="-getSimplifiedLoop"><strong>getSimplifiedLoop</strong></a>(loop, radius)</dt><dd><tt>Get loop with points inside the channel removed.</tt></dd></dl> - <dl><dt><a name="-getSimplifiedLoopAtFirstZ"><strong>getSimplifiedLoopAtFirstZ</strong></a>(loop, radius)</dt><dd><tt>Get loop at the first z with points inside the channel removed.</tt></dd></dl> - <dl><dt><a name="-getSimplifiedLoopComplex"><strong>getSimplifiedLoopComplex</strong></a>(loopComplex, radius)</dt><dd><tt>Get loop with points inside the channel removed.</tt></dd></dl> + <dl><dt><a name="-getSegmentsFromXIntersectionIndexes"><strong>getSegmentsFromXIntersectionIndexes</strong></a>(xIntersectionIndexList, y)</dt><dd><tt>Get endpoint segments from the x intersection indexes.</tt></dd></dl> + <dl><dt><a name="-getSegmentsFromXIntersections"><strong>getSegmentsFromXIntersections</strong></a>(xIntersections, y)</dt><dd><tt>Get endpoint segments from the x intersections.</tt></dd></dl> + <dl><dt><a name="-getSimplifiedLoop"><strong>getSimplifiedLoop</strong></a>(loopComplex, radius)</dt><dd><tt>Get loop with points inside the channel removed.</tt></dd></dl> <dl><dt><a name="-getSimplifiedPath"><strong>getSimplifiedPath</strong></a>(path, radius)</dt><dd><tt>Get path with points inside the channel removed.</tt></dd></dl> <dl><dt><a name="-getSquareValues"><strong>getSquareValues</strong></a>(pixelTable, x, y)</dt><dd><tt>Get a list of the values in a square around the x and y pixel coordinates.</tt></dd></dl> <dl><dt><a name="-getStepKey"><strong>getStepKey</strong></a>(x, y)</dt><dd><tt>Get step key for x and y.</tt></dd></dl> <dl><dt><a name="-getTransferClosestSurroundingLoop"><strong>getTransferClosestSurroundingLoop</strong></a>(oldOrderedLocation, remainingSurroundingLoops, skein)</dt><dd><tt>Get and transfer the closest remaining surrounding loop.</tt></dd></dl> <dl><dt><a name="-getTransferredPaths"><strong>getTransferredPaths</strong></a>(insides, loop)</dt><dd><tt>Get transferred paths from inside paths.</tt></dd></dl> <dl><dt><a name="-getTransferredSurroundingLoops"><strong>getTransferredSurroundingLoops</strong></a>(insides, loop)</dt><dd><tt>Get transferred paths from inside surrounding loops.</tt></dd></dl> - <dl><dt><a name="-getWiddershinsDot"><strong>getWiddershinsDot</strong></a>(vec3First, vec3Second)</dt><dd><tt>Get the magintude of the positive dot product plus one of the x and y components of a pair of Vec3s, with the reversed sign of the cross product.</tt></dd></dl> - <dl><dt><a name="-getWiddershinsDotGivenComplex"><strong>getWiddershinsDotGivenComplex</strong></a>(complexFirst, complexSecond)</dt><dd><tt>Get the magintude of the positive dot product plus one of the x and y components of a pair of complexes, with the reversed sign of the cross product.</tt></dd></dl> - <dl><dt><a name="-getXIntersection"><strong>getXIntersection</strong></a>(firstPoint, secondPoint, y)</dt><dd><tt>Get where the line crosses y.</tt></dd></dl> - <dl><dt><a name="-getXIntersectionFromComplex"><strong>getXIntersectionFromComplex</strong></a>(firstComplex, secondComplex, y)</dt><dd><tt>Get where the line crosses y.</tt></dd></dl> + <dl><dt><a name="-getWiddershinsDotGiven"><strong>getWiddershinsDotGiven</strong></a>(complexFirst, complexSecond)</dt><dd><tt>Get the magintude of the positive dot product plus one of the x and y components of a pair of complexes, with the reversed sign of the cross product.</tt></dd></dl> + <dl><dt><a name="-getXIntersection"><strong>getXIntersection</strong></a>(firstComplex, secondComplex, y)</dt><dd><tt>Get where the line crosses y.</tt></dd></dl> <dl><dt><a name="-getXIntersectionsFromIntersections"><strong>getXIntersectionsFromIntersections</strong></a>(xIntersectionIndexList)</dt><dd><tt>Get x intersections from the x intersection index list, in other words subtract non negative intersections from negatives.</tt></dd></dl> - <dl><dt><a name="-getZComponentCrossProduct"><strong>getZComponentCrossProduct</strong></a>(vec3First, vec3Second)</dt><dd><tt>Get z component cross product of a pair of Vec3s.</tt></dd></dl> - <dl><dt><a name="-isCloseXYPlane"><strong>isCloseXYPlane</strong></a>(overlapDistanceSquared, pixelTable, point, x, y)</dt><dd><tt>Determine if the point is close to another point on the loop in the xy plane.</tt></dd></dl> - <dl><dt><a name="-isCloseXYPlaneComplex"><strong>isCloseXYPlaneComplex</strong></a>(overlapDistance, pixelTable, pointComplex, x, y)</dt><dd><tt>Determine if the point is close to another point on the loop.</tt></dd></dl> + <dl><dt><a name="-getZComponentCrossProduct"><strong>getZComponentCrossProduct</strong></a>(vec3First, vec3Second)</dt><dd><tt>Get z component cross product of a pair of Vector3s.</tt></dd></dl> + <dl><dt><a name="-isCloseXYPlane"><strong>isCloseXYPlane</strong></a>(overlapDistance, pixelTable, pointComplex, x, y)</dt><dd><tt>Determine if the point is close to another point on the loop.</tt></dd></dl> <dl><dt><a name="-isInsideOtherLoops"><strong>isInsideOtherLoops</strong></a>(loopIndex, loops)</dt><dd><tt>Determine if a loop in a list is inside another loop in that list.</tt></dd></dl> <dl><dt><a name="-isLargeSameDirection"><strong>isLargeSameDirection</strong></a>(inset, loop, requiredSize)</dt><dd><tt>Determine if the inset is in the same direction as the loop and if the inset is as large as the required size.</tt></dd></dl> - <dl><dt><a name="-isLineComplexIntersectingInsideXSegment"><strong>isLineComplexIntersectingInsideXSegment</strong></a>(segmentFirstX, segmentSecondX, vector3First, vector3Second, y)</dt><dd><tt>Determine if the line is crossing inside the x segment.</tt></dd></dl> <dl><dt><a name="-isLineIntersectingInsideXSegment"><strong>isLineIntersectingInsideXSegment</strong></a>(segmentFirstX, segmentSecondX, vector3First, vector3Second, y)</dt><dd><tt>Determine if the line is crossing inside the x segment.</tt></dd></dl> - <dl><dt><a name="-isLineIntersectingLoopComplexes"><strong>isLineIntersectingLoopComplexes</strong></a>(loops, pointBegin, pointEnd)</dt><dd><tt>Determine if the line is intersecting loops.</tt></dd></dl> <dl><dt><a name="-isLineIntersectingLoops"><strong>isLineIntersectingLoops</strong></a>(loops, pointBegin, pointEnd)</dt><dd><tt>Determine if the line is intersecting loops.</tt></dd></dl> - <dl><dt><a name="-isLoopComplexIntersectingInsideXSegment"><strong>isLoopComplexIntersectingInsideXSegment</strong></a>(loop, segmentFirstX, segmentSecondX, segmentYMirror, y)</dt><dd><tt>Determine if the loop is intersecting inside the x segment.</tt></dd></dl> - <dl><dt><a name="-isLoopComplexLargeSameDirection"><strong>isLoopComplexLargeSameDirection</strong></a>(inset, loop, requiredSize)</dt><dd><tt>Determine if the inset is in the same direction as the loop and if the inset is as large as the required size.</tt></dd></dl> <dl><dt><a name="-isLoopIntersectingInsideXSegment"><strong>isLoopIntersectingInsideXSegment</strong></a>(loop, segmentFirstX, segmentSecondX, segmentYMirror, y)</dt><dd><tt>Determine if the loop is intersecting inside the x segment.</tt></dd></dl> - <dl><dt><a name="-isLoopIntersectingLoopComplexes"><strong>isLoopIntersectingLoopComplexes</strong></a>(loop, otherLoops)</dt><dd><tt>Determine if the loop is intersecting other loops.</tt></dd></dl> <dl><dt><a name="-isLoopIntersectingLoops"><strong>isLoopIntersectingLoops</strong></a>(loop, otherLoops)</dt><dd><tt>Determine if the loop is intersecting other loops.</tt></dd></dl> - <dl><dt><a name="-isLoopListComplexIntersectingInsideXSegment"><strong>isLoopListComplexIntersectingInsideXSegment</strong></a>(loopList, segmentFirstX, segmentSecondX, segmentYMirror, y)</dt><dd><tt>Determine if the loop list is crossing inside the x segment.</tt></dd></dl> <dl><dt><a name="-isLoopListIntersectingInsideXSegment"><strong>isLoopListIntersectingInsideXSegment</strong></a>(loopList, segmentFirstX, segmentSecondX, segmentYMirror, y)</dt><dd><tt>Determine if the loop list is crossing inside the x segment.</tt></dd></dl> <dl><dt><a name="-isPathInsideLoop"><strong>isPathInsideLoop</strong></a>(loop, path)</dt><dd><tt>Determine if a path is inside another loop.</tt></dd></dl> - <dl><dt><a name="-isPathInsideLoopComplex"><strong>isPathInsideLoopComplex</strong></a>(loop, path)</dt><dd><tt>Determine if a path is inside another loop.</tt></dd></dl> <dl><dt><a name="-isPathInsideLoops"><strong>isPathInsideLoops</strong></a>(loops, path)</dt><dd><tt>Determine if a path is inside another loop in a list.</tt></dd></dl> <dl><dt><a name="-isPixelTableIntersecting"><strong>isPixelTableIntersecting</strong></a>(bigTable, littleTable, maskTable<font color="#909090">={}</font>)</dt><dd><tt>Add path to the pixel table.</tt></dd></dl> - <dl><dt><a name="-isPolygonComplexWiddershins"><strong>isPolygonComplexWiddershins</strong></a>(polygonComplex)</dt><dd><tt>Determine if the complex polygon goes round in the widdershins direction.</tt></dd></dl> + <dl><dt><a name="-isPointInsideLoop"><strong>isPointInsideLoop</strong></a>(loop, point)</dt><dd><tt>Determine if a point is inside another loop.</tt></dd></dl> <dl><dt><a name="-isSegmentCompletelyInX"><strong>isSegmentCompletelyInX</strong></a>(segment, xFirst, xSecond)</dt><dd><tt>Determine if the segment overlaps within x.</tt></dd></dl> - <dl><dt><a name="-isWiddershins"><strong>isWiddershins</strong></a>(polygon)</dt><dd><tt>Determine if the polygon goes round in the widdershins direction.</tt></dd></dl> - <dl><dt><a name="-isWithinChannel"><strong>isWithinChannel</strong></a>(channelRadius, pointIndex, loop)</dt><dd><tt>Determine if the the point is within the channel between two adjacent points.</tt></dd></dl> - <dl><dt><a name="-isWithinChannelComplex"><strong>isWithinChannelComplex</strong></a>(channelRadius, pointIndex, loopComplex)</dt><dd><tt>Determine if the the point is within the channel between two adjacent points.</tt></dd></dl> + <dl><dt><a name="-isWiddershins"><strong>isWiddershins</strong></a>(polygonComplex)</dt><dd><tt>Determine if the complex polygon goes round in the widdershins direction.</tt></dd></dl> + <dl><dt><a name="-isWithinChannel"><strong>isWithinChannel</strong></a>(channelRadius, pointIndex, loopComplex)</dt><dd><tt>Determine if the the point is within the channel between two adjacent points.</tt></dd></dl> <dl><dt><a name="-isXSegmentIntersectingPaths"><strong>isXSegmentIntersectingPaths</strong></a>(paths, segmentFirstX, segmentSecondX, segmentYMirror, y)</dt><dd><tt>Determine if a path list is crossing inside the x segment.</tt></dd></dl> <dl><dt><a name="-removePixelTableFromPixelTable"><strong>removePixelTableFromPixelTable</strong></a>(pixelTableToBeRemoved, pixelTableToBeRemovedFrom)</dt><dd><tt>Remove pixel from the pixel table.</tt></dd></dl> <dl><dt><a name="-toggleHashtable"><strong>toggleHashtable</strong></a>(hashtable, key, value)</dt><dd><tt>Toggle a hashtable between having and not having a key.</tt></dd></dl> - <dl><dt><a name="-transferClosestFillLoop"><strong>transferClosestFillLoop</strong></a>(extrusionHalfWidthSquared, oldOrderedLocation, remainingFillLoops, skein)</dt><dd><tt>Transfer the closest remaining fill loop.</tt></dd></dl> + <dl><dt><a name="-transferClosestFillLoop"><strong>transferClosestFillLoop</strong></a>(extrusionHalfWidth, oldOrderedLocation, remainingFillLoops, skein)</dt><dd><tt>Transfer the closest remaining fill loop.</tt></dd></dl> <dl><dt><a name="-transferClosestPath"><strong>transferClosestPath</strong></a>(oldOrderedLocation, remainingPaths, skein)</dt><dd><tt>Transfer the closest remaining path.</tt></dd></dl> <dl><dt><a name="-transferClosestPaths"><strong>transferClosestPaths</strong></a>(oldOrderedLocation, remainingPaths, skein)</dt><dd><tt>Transfer the closest remaining paths.</tt></dd></dl> <dl><dt><a name="-transferPathsToSurroundingLoops"><strong>transferPathsToSurroundingLoops</strong></a>(paths, surroundingLoops)</dt><dd><tt>Transfer paths to surrounding loops.</tt></dd></dl> diff --git a/trunk/reprap/miscellaneous/python-beanshell-scripts/documentation/skeinforge_tools.skeinforge_utilities.gcodec.html b/trunk/reprap/miscellaneous/python-beanshell-scripts/documentation/skeinforge_tools.skeinforge_utilities.gcodec.html index cfc14024..7f4bfe3d 100644 --- a/trunk/reprap/miscellaneous/python-beanshell-scripts/documentation/skeinforge_tools.skeinforge_utilities.gcodec.html +++ b/trunk/reprap/miscellaneous/python-beanshell-scripts/documentation/skeinforge_tools.skeinforge_utilities.gcodec.html @@ -15,10 +15,10 @@ To run gcodec, install python 2.x on your&nbs <br> Then in the folder which gcodec is in, type 'python' in a shell to run the python interpreter. Finally type 'from gcodec import *' to import this program.<br> <br> -Below is an example of gcodec use. This example is run in a terminal in the folder which contains Hollow Square.gcode and gcodec.py.<br> +Below is an example of gcodec use. This example is run in a terminal in the folder which contains Screw Holder Bottom.gcode and gcodec.py.<br> <br> >>> from gcodec import *<br> ->>> <a href="#-getFileText">getFileText</a>('Hollow Square.gcode')<br> +>>> <a href="#-getFileText">getFileText</a>('Screw Holder Bottom.gcode')<br> '( GCode generated by April 17,2007 Skeinforge )<br> ( Extruder Initialization )<br> M100 P210<br> @@ -31,7 +31,7 @@ G21<br> G90<br> G28<br> ( Extruder Movement )<br> -( Extruder paths for layer 0 of Hollow Square )<br> +( Extruder paths for layer 0 of Screw Holder Bottom )<br> (<extrusionStart><br> G1 X2.727 Y-2.505 Z0.33 F600.0<br> <br> @@ -56,7 +56,7 @@ many lines of text<br> <tr><td bgcolor="#eeaa77"><tt> </tt></td><td> </td> <td width="100%"><dl><dt><a name="-createInitFile"><strong>createInitFile</strong></a>()</dt><dd><tt>Create the __init__.py file.</tt></dd></dl> - <dl><dt><a name="-findWords"><strong>findWords</strong></a>(filenames, search)</dt><dd><tt>Find in files the search.</tt></dd></dl> + <dl><dt><a name="-findWords"><strong>findWords</strong></a>(fileNames, search)</dt><dd><tt>Find in files the search.</tt></dd></dl> <dl><dt><a name="-getDoubleAfterFirstLetter"><strong>getDoubleAfterFirstLetter</strong></a>(word)</dt><dd><tt>Get the double value of the word after the first letter.<br> <br> Keyword arguments:<br> @@ -64,7 +64,8 @@ word -- string with value starting after the& <dl><dt><a name="-getDoubleForLetter"><strong>getDoubleForLetter</strong></a>(letter, splitLine)</dt><dd><tt>Get the double value of the word after the first occurence of the letter in the split line.</tt></dd></dl> <dl><dt><a name="-getDoubleFromCharacterSplitLineValue"><strong>getDoubleFromCharacterSplitLineValue</strong></a>(character, splitLine, value)</dt><dd><tt>Get the double value of the string after the first occurence of the character in the split line.</tt></dd></dl> <dl><dt><a name="-getFeedrateMinute"><strong>getFeedrateMinute</strong></a>(feedrateMinute, splitLine)</dt><dd><tt>Get the feedrate per minute if the split line has a feedrate.</tt></dd></dl> - <dl><dt><a name="-getFileText"><strong>getFileText</strong></a>(filename, readMode<font color="#909090">='r'</font>)</dt><dd><tt>Get the entire text of a file.</tt></dd></dl> + <dl><dt><a name="-getFileText"><strong>getFileText</strong></a>(fileName, readMode<font color="#909090">='r'</font>)</dt><dd><tt>Get the entire text of a file.</tt></dd></dl> + <dl><dt><a name="-getFileTextInFileDirectory"><strong>getFileTextInFileDirectory</strong></a>(fileInDirectory, fileName, readMode<font color="#909090">='r'</font>)</dt><dd><tt>Get the entire text of a file in the directory of the file in directory.</tt></dd></dl> <dl><dt><a name="-getFilesWithFileTypeWithoutWords"><strong>getFilesWithFileTypeWithoutWords</strong></a>(fileType, words<font color="#909090">=[]</font>, fileInDirectory<font color="#909090">=''</font>)</dt><dd><tt>Get files which have a given file type, but with do not contain a word in a list.<br> <br> Keyword arguments:<br> @@ -76,29 +77,30 @@ Keyword arguments:<br> fileType -- file types required<br> words -- list of words which the file must not have</tt></dd></dl> <dl><dt><a name="-getFirstWord"><strong>getFirstWord</strong></a>(splitLine)</dt><dd><tt>Get the first word of a split line.</tt></dd></dl> - <dl><dt><a name="-getGcodeFileText"><strong>getGcodeFileText</strong></a>(filename, gcodeText)</dt><dd><tt>Get the gcode text from a file if it the gcode text is empty and if the file is a gcode file.</tt></dd></dl> + <dl><dt><a name="-getGcodeFileText"><strong>getGcodeFileText</strong></a>(fileName, gcodeText)</dt><dd><tt>Get the gcode text from a file if it the gcode text is empty and if the file is a gcode file.</tt></dd></dl> <dl><dt><a name="-getLocationFromSplitLine"><strong>getLocationFromSplitLine</strong></a>(oldLocation, splitLine)</dt><dd><tt>Get the location from the split line.</tt></dd></dl> - <dl><dt><a name="-getModule"><strong>getModule</strong></a>(filename, folderName, moduleFilename)</dt><dd><tt>Get the module from the filename and folder name.</tt></dd></dl> - <dl><dt><a name="-getPluginFilenames"><strong>getPluginFilenames</strong></a>(folderName, moduleFilename)</dt><dd><tt>Get the filenames of the python plugins in the export_plugins folder.</tt></dd></dl> + <dl><dt><a name="-getModule"><strong>getModule</strong></a>(fileName, folderName, moduleFilename)</dt><dd><tt>Get the module from the fileName and folder name.</tt></dd></dl> + <dl><dt><a name="-getPluginFilenames"><strong>getPluginFilenames</strong></a>(folderName, moduleFilename)</dt><dd><tt>Get the fileNames of the python plugins in the export_plugins folder.</tt></dd></dl> <dl><dt><a name="-getPythonDirectoryNames"><strong>getPythonDirectoryNames</strong></a>(directoryName)</dt><dd><tt>Get the python directories.</tt></dd></dl> <dl><dt><a name="-getPythonDirectoryNamesRecursively"><strong>getPythonDirectoryNamesRecursively</strong></a>(directoryName<font color="#909090">=''</font>)</dt><dd><tt>Get the python directories recursively.</tt></dd></dl> - <dl><dt><a name="-getPythonFilenamesExceptInit"><strong>getPythonFilenamesExceptInit</strong></a>(fileInDirectory<font color="#909090">=''</font>)</dt><dd><tt>Get the python filenames of the directory which the fileInDirectory is in, except for the __init__.py file.</tt></dd></dl> - <dl><dt><a name="-getPythonFilenamesExceptInitRecursively"><strong>getPythonFilenamesExceptInitRecursively</strong></a>(directoryName<font color="#909090">=''</font>)</dt><dd><tt>Get the python filenames of the directory recursively, except for the __init__.py files.</tt></dd></dl> - <dl><dt><a name="-getSummarizedFilename"><strong>getSummarizedFilename</strong></a>(filename)</dt><dd><tt>Get the filename basename if the file is in the current working directory, otherwise return the original full name.</tt></dd></dl> + <dl><dt><a name="-getPythonFilenamesExceptInit"><strong>getPythonFilenamesExceptInit</strong></a>(fileInDirectory<font color="#909090">=''</font>)</dt><dd><tt>Get the python fileNames of the directory which the fileInDirectory is in, except for the __init__.py file.</tt></dd></dl> + <dl><dt><a name="-getPythonFilenamesExceptInitRecursively"><strong>getPythonFilenamesExceptInitRecursively</strong></a>(directoryName<font color="#909090">=''</font>)</dt><dd><tt>Get the python fileNames of the directory recursively, except for the __init__.py files.</tt></dd></dl> + <dl><dt><a name="-getSummarizedFilename"><strong>getSummarizedFilename</strong></a>(fileName)</dt><dd><tt>Get the fileName basename if the file is in the current working directory, otherwise return the original full name.</tt></dd></dl> <dl><dt><a name="-getTextLines"><strong>getTextLines</strong></a>(text)</dt><dd><tt>Get the all the lines of text of a text.</tt></dd></dl> <dl><dt><a name="-getUnmodifiedGCodeFiles"><strong>getUnmodifiedGCodeFiles</strong></a>(fileInDirectory<font color="#909090">=''</font>)</dt><dd><tt>Get gcode files which are not modified.</tt></dd></dl> + <dl><dt><a name="-getWithoutBracketsEqualTab"><strong>getWithoutBracketsEqualTab</strong></a>(line)</dt><dd><tt>Get a string without the greater than sign, the bracket and less than sign, the equal sign or the tab.</tt></dd></dl> <dl><dt><a name="-indexOfStartingWithSecond"><strong>indexOfStartingWithSecond</strong></a>(letter, splitLine)</dt><dd><tt>Get index of the first occurence of the given letter in the split line, starting with the second word. Return - 1 if letter is not found</tt></dd></dl> - <dl><dt><a name="-isFileWithFileTypeWithoutWords"><strong>isFileWithFileTypeWithoutWords</strong></a>(fileType, filename, words)</dt><dd><tt>Determine if file has a given file type, but with does not contain a word in a list.<br> + <dl><dt><a name="-isFileWithFileTypeWithoutWords"><strong>isFileWithFileTypeWithoutWords</strong></a>(fileType, fileName, words)</dt><dd><tt>Determine if file has a given file type, but with does not contain a word in a list.<br> <br> Keyword arguments:<br> fileType -- file type required<br> -filename -- name of the file<br> -words -- list of words which the filename must not have</tt></dd></dl> +fileName -- name of the file<br> +words -- list of words which the fileName must not have</tt></dd></dl> <dl><dt><a name="-isProcedureDone"><strong>isProcedureDone</strong></a>(gcodeText, procedure)</dt><dd><tt>Determine if the procedure has been done on the gcode text.</tt></dd></dl> <dl><dt><a name="-isThereAFirstWord"><strong>isThereAFirstWord</strong></a>(firstWord, lines, startIndex)</dt><dd><tt>Parse gcode until the first word if there is one.</tt></dd></dl> - <dl><dt><a name="-replaceWords"><strong>replaceWords</strong></a>(filenames, original, replacement)</dt><dd><tt>Replace in files the original with the replacement.</tt></dd></dl> - <dl><dt><a name="-writeFileMessageEnd"><strong>writeFileMessageEnd</strong></a>(end, filename, fileText, message)</dt><dd><tt>Write to a filename with a suffix and print a message.</tt></dd></dl> - <dl><dt><a name="-writeFileText"><strong>writeFileText</strong></a>(filename, fileText, writeMode<font color="#909090">='w+'</font>)</dt><dd><tt>Write a text to a file.</tt></dd></dl> + <dl><dt><a name="-replaceWords"><strong>replaceWords</strong></a>(fileNames, original, replacement)</dt><dd><tt>Replace in files the original with the replacement.</tt></dd></dl> + <dl><dt><a name="-writeFileMessageEnd"><strong>writeFileMessageEnd</strong></a>(end, fileName, fileText, message)</dt><dd><tt>Write to a fileName with a suffix and print a message.</tt></dd></dl> + <dl><dt><a name="-writeFileText"><strong>writeFileText</strong></a>(fileName, fileText, writeMode<font color="#909090">='w+'</font>)</dt><dd><tt>Write a text to a file.</tt></dd></dl> </td></tr></table><p> <table width="100%" cellspacing=0 cellpadding=2 border=0 summary="section"> <tr bgcolor="#55aa55"> diff --git a/trunk/reprap/miscellaneous/python-beanshell-scripts/documentation/skeinforge_tools.skeinforge_utilities.html b/trunk/reprap/miscellaneous/python-beanshell-scripts/documentation/skeinforge_tools.skeinforge_utilities.html index ed7968ca..2aa01fc1 100644 --- a/trunk/reprap/miscellaneous/python-beanshell-scripts/documentation/skeinforge_tools.skeinforge_utilities.html +++ b/trunk/reprap/miscellaneous/python-beanshell-scripts/documentation/skeinforge_tools.skeinforge_utilities.html @@ -20,10 +20,12 @@ <td width="100%"><table width="100%" summary="list"><tr><td width="25%" valign=top><a href="skeinforge_tools.skeinforge_utilities.euclidean.html">euclidean</a><br> <a href="skeinforge_tools.skeinforge_utilities.gcodec.html">gcodec</a><br> </td><td width="25%" valign=top><a href="skeinforge_tools.skeinforge_utilities.intercircle.html">intercircle</a><br> -<a href="skeinforge_tools.skeinforge_utilities.preferences.html">preferences</a><br> -</td><td width="25%" valign=top><a href="skeinforge_tools.skeinforge_utilities.triangle_mesh.html">triangle_mesh</a><br> -<a href="skeinforge_tools.skeinforge_utilities.vec3.html">vec3</a><br> -</td><td width="25%" valign=top></td></tr></table></td></tr></table><p> +<a href="skeinforge_tools.skeinforge_utilities.interpret.html">interpret</a><br> +</td><td width="25%" valign=top><a href="skeinforge_tools.skeinforge_utilities.preferences.html">preferences</a><br> +<a href="skeinforge_tools.skeinforge_utilities.triangle_mesh.html">triangle_mesh</a><br> +</td><td width="25%" valign=top><a href="skeinforge_tools.skeinforge_utilities.vec3.html">vec3</a><br> +<a href="skeinforge_tools.skeinforge_utilities.vector3.html">vector3</a><br> +</td></tr></table></td></tr></table><p> <table width="100%" cellspacing=0 cellpadding=2 border=0 summary="section"> <tr bgcolor="#55aa55"> <td colspan=3 valign=bottom> <br> diff --git a/trunk/reprap/miscellaneous/python-beanshell-scripts/documentation/skeinforge_tools.skeinforge_utilities.intercircle.html b/trunk/reprap/miscellaneous/python-beanshell-scripts/documentation/skeinforge_tools.skeinforge_utilities.intercircle.html index bb60a606..4805fe49 100644 --- a/trunk/reprap/miscellaneous/python-beanshell-scripts/documentation/skeinforge_tools.skeinforge_utilities.intercircle.html +++ b/trunk/reprap/miscellaneous/python-beanshell-scripts/documentation/skeinforge_tools.skeinforge_utilities.intercircle.html @@ -30,9 +30,7 @@ <td width="100%"><dl> <dt><font face="helvetica, arial"><a href="skeinforge_tools.skeinforge_utilities.intercircle.html#BoundingLoop">BoundingLoop</a> </font></dt><dt><font face="helvetica, arial"><a href="skeinforge_tools.skeinforge_utilities.intercircle.html#CircleIntersection">CircleIntersection</a> -</font></dt><dt><font face="helvetica, arial"><a href="skeinforge_tools.skeinforge_utilities.intercircle.html#CircleIntersectionComplex">CircleIntersectionComplex</a> </font></dt><dt><font face="helvetica, arial"><a href="skeinforge_tools.skeinforge_utilities.intercircle.html#CircleNode">CircleNode</a> -</font></dt><dt><font face="helvetica, arial"><a href="skeinforge_tools.skeinforge_utilities.intercircle.html#CircleNodeComplex">CircleNodeComplex</a> </font></dt></dl> <p> <table width="100%" cellspacing=0 cellpadding=2 border=0 summary="section"> @@ -65,10 +63,10 @@ <font color="#000000" face="helvetica, arial"><a name="CircleIntersection">class <strong>CircleIntersection</strong></a></font></td></tr> <tr bgcolor="#ffc8d8"><td rowspan=2><tt> </tt></td> -<td colspan=2><tt>An intersection of two circles.<br> </tt></td></tr> +<td colspan=2><tt>An intersection of two complex circles.<br> </tt></td></tr> <tr><td> </td> <td width="100%">Methods defined here:<br> -<dl><dt><a name="CircleIntersection-__init__"><strong>__init__</strong></a>(self)</dt></dl> +<dl><dt><a name="CircleIntersection-__init__"><strong>__init__</strong></a>(self, circleNodeAhead, index, circleNodeBehind)</dt></dl> <dl><dt><a name="CircleIntersection-__repr__"><strong>__repr__</strong></a>(self)</dt><dd><tt>Get the string representation of this <a href="#CircleIntersection">CircleIntersection</a>.</tt></dd></dl> @@ -78,8 +76,6 @@ <dl><dt><a name="CircleIntersection-getCircleIntersectionAhead"><strong>getCircleIntersectionAhead</strong></a>(self)</dt></dl> -<dl><dt><a name="CircleIntersection-getFromCircleNodes"><strong>getFromCircleNodes</strong></a>(self, circleNodeAhead, index, circleNodeBehind)</dt></dl> - <dl><dt><a name="CircleIntersection-getPositionRelativeToBehind"><strong>getPositionRelativeToBehind</strong></a>(self)</dt></dl> <dl><dt><a name="CircleIntersection-isWithinCircles"><strong>isWithinCircles</strong></a>(self, pixelTable, width)</dt></dl> @@ -88,60 +84,18 @@ <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="CircleIntersectionComplex">class <strong>CircleIntersectionComplex</strong></a></font></td></tr> - -<tr bgcolor="#ffc8d8"><td rowspan=2><tt> </tt></td> -<td colspan=2><tt>An intersection of two complex circles.<br> </tt></td></tr> -<tr><td> </td> -<td width="100%">Methods defined here:<br> -<dl><dt><a name="CircleIntersectionComplex-__init__"><strong>__init__</strong></a>(self, circleNodeComplexAhead, index, circleNodeComplexBehind)</dt></dl> - -<dl><dt><a name="CircleIntersectionComplex-__repr__"><strong>__repr__</strong></a>(self)</dt><dd><tt>Get the string representation of this <a href="#CircleIntersection">CircleIntersection</a>.</tt></dd></dl> - -<dl><dt><a name="CircleIntersectionComplex-addToList"><strong>addToList</strong></a>(self, circleIntersectionPath)</dt></dl> - -<dl><dt><a name="CircleIntersectionComplex-getAbsolutePosition"><strong>getAbsolutePosition</strong></a>(self)</dt></dl> - -<dl><dt><a name="CircleIntersectionComplex-getCircleIntersectionAhead"><strong>getCircleIntersectionAhead</strong></a>(self)</dt></dl> - -<dl><dt><a name="CircleIntersectionComplex-getPositionRelativeToBehind"><strong>getPositionRelativeToBehind</strong></a>(self)</dt></dl> - -<dl><dt><a name="CircleIntersectionComplex-isWithinCircles"><strong>isWithinCircles</strong></a>(self, pixelTable, width)</dt></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="CircleNode">class <strong>CircleNode</strong></a></font></td></tr> <tr bgcolor="#ffc8d8"><td rowspan=2><tt> </tt></td> -<td colspan=2><tt>A node of circle intersections.<br> </tt></td></tr> +<td colspan=2><tt>A complex node of complex circle intersections.<br> </tt></td></tr> <tr><td> </td> <td width="100%">Methods defined here:<br> -<dl><dt><a name="CircleNode-__init__"><strong>__init__</strong></a>(self)</dt></dl> +<dl><dt><a name="CircleNode-__init__"><strong>__init__</strong></a>(self, circle, index, radius)</dt></dl> <dl><dt><a name="CircleNode-__repr__"><strong>__repr__</strong></a>(self)</dt><dd><tt>Get the string representation of this <a href="#CircleNode">CircleNode</a>.</tt></dd></dl> -<dl><dt><a name="CircleNode-getFromCircleRadius"><strong>getFromCircleRadius</strong></a>(self, circle, index, radius)</dt></dl> - <dl><dt><a name="CircleNode-getWithinNodes"><strong>getWithinNodes</strong></a>(self, pixelTable, width)</dt></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="CircleNodeComplex">class <strong>CircleNodeComplex</strong></a></font></td></tr> - -<tr bgcolor="#ffc8d8"><td rowspan=2><tt> </tt></td> -<td colspan=2><tt>A complex node of complex circle intersections.<br> </tt></td></tr> -<tr><td> </td> -<td width="100%">Methods defined here:<br> -<dl><dt><a name="CircleNodeComplex-__init__"><strong>__init__</strong></a>(self, circleComplex, index, radius)</dt></dl> - -<dl><dt><a name="CircleNodeComplex-__repr__"><strong>__repr__</strong></a>(self)</dt><dd><tt>Get the string representation of this <a href="#CircleNodeComplex">CircleNodeComplex</a>.</tt></dd></dl> - -<dl><dt><a name="CircleNodeComplex-getWithinNodes"><strong>getWithinNodes</strong></a>(self, pixelTable, width)</dt></dl> - </td></tr></table></td></tr></table><p> <table width="100%" cellspacing=0 cellpadding=2 border=0 summary="section"> <tr bgcolor="#eeaa77"> @@ -149,46 +103,27 @@ <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="-addCircleIntersectionLoop"><strong>addCircleIntersectionLoop</strong></a>(circleIntersectionPath, circleIntersections)</dt><dd><tt>Add a circle intersection loop.</tt></dd></dl> - <dl><dt><a name="-addCircleIntersectionLoopComplex"><strong>addCircleIntersectionLoopComplex</strong></a>(circleIntersectionPathComplexes, circleIntersectionComplexes)</dt><dd><tt>Add a circle intersection loop.</tt></dd></dl> - <dl><dt><a name="-addOperatingOrbits"><strong>addOperatingOrbits</strong></a>(boundaryLoops, operatingJump, skein, temperatureChangeTime)</dt><dd><tt>Add the orbits before the operating layers.</tt></dd></dl> - <dl><dt><a name="-addOrbits"><strong>addOrbits</strong></a>(loop, skein, temperatureChangeTime)</dt><dd><tt>Add orbits with the extruder off.</tt></dd></dl> - <dl><dt><a name="-addPointComplexesFromSegment"><strong>addPointComplexesFromSegment</strong></a>(pointComplexes, radius, pointBeginComplex, pointEndComplex)</dt><dd><tt>Add point complexes between the endpoints of a segment.</tt></dd></dl> - <dl><dt><a name="-addPointsFromSegment"><strong>addPointsFromSegment</strong></a>(points, radius, pointBegin, pointEnd)</dt><dd><tt>Add points between the endpoints of a segment.</tt></dd></dl> - <dl><dt><a name="-getCenterComplexesFromCircleNodeComplexes"><strong>getCenterComplexesFromCircleNodeComplexes</strong></a>(circleNodeComplexes)</dt><dd><tt>Get the complex centers of the circle intersection loops from circle nodes.</tt></dd></dl> - <dl><dt><a name="-getCenterComplexesFromIntersectionLoopComplex"><strong>getCenterComplexesFromIntersectionLoopComplex</strong></a>(circleIntersectionLoopComplex)</dt><dd><tt>Get the centers from the intersection loop.</tt></dd></dl> - <dl><dt><a name="-getCenterComplexesFromIntersectionLoopComplexes"><strong>getCenterComplexesFromIntersectionLoopComplexes</strong></a>(circleIntersectionLoopComplexes)</dt><dd><tt>Get the centers from the intersection loops.</tt></dd></dl> - <dl><dt><a name="-getCentersFromCircleNodes"><strong>getCentersFromCircleNodes</strong></a>(circleNodes)</dt><dd><tt>Get the centers of the circle intersection loops from circle nodes.</tt></dd></dl> - <dl><dt><a name="-getCentersFromIntersectionLoop"><strong>getCentersFromIntersectionLoop</strong></a>(circleIntersectionLoop)</dt><dd><tt>Get the centers from the intersection loop.</tt></dd></dl> - <dl><dt><a name="-getCentersFromIntersectionLoops"><strong>getCentersFromIntersectionLoops</strong></a>(circleIntersectionLoops)</dt><dd><tt>Get the centers from the intersection loops.</tt></dd></dl> - <dl><dt><a name="-getCentersFromLoopComplexDirection"><strong>getCentersFromLoopComplexDirection</strong></a>(isWiddershins, loop, radius)</dt><dd><tt>Get the centers of the circle intersection loops which go around in the given direction.</tt></dd></dl> +<td width="100%"><dl><dt><a name="-addCircleIntersectionLoop"><strong>addCircleIntersectionLoop</strong></a>(circleIntersectionPathComplexes, circleIntersections)</dt><dd><tt>Add a circle intersection loop.</tt></dd></dl> + <dl><dt><a name="-addOperatingOrbits"><strong>addOperatingOrbits</strong></a>(boundaryLoops, skein, temperatureChangeTime, z)</dt><dd><tt>Add the orbits before the operating layers.</tt></dd></dl> + <dl><dt><a name="-addOrbits"><strong>addOrbits</strong></a>(loop, skein, temperatureChangeTime, z)</dt><dd><tt>Add orbits with the extruder off.</tt></dd></dl> + <dl><dt><a name="-addPointsFromSegment"><strong>addPointsFromSegment</strong></a>(pointComplexes, radius, pointBeginComplex, pointEndComplex, thresholdRatio<font color="#909090">=0.90000000000000002</font>)</dt><dd><tt>Add point complexes between the endpoints of a segment.</tt></dd></dl> + <dl><dt><a name="-getCentersFromCircleNodes"><strong>getCentersFromCircleNodes</strong></a>(circleNodesComplex)</dt><dd><tt>Get the complex centers of the circle intersection loops from circle nodes.</tt></dd></dl> + <dl><dt><a name="-getCentersFromIntersectionLoop"><strong>getCentersFromIntersectionLoop</strong></a>(circleIntersectionLoopComplex)</dt><dd><tt>Get the centers from the intersection loop.</tt></dd></dl> + <dl><dt><a name="-getCentersFromIntersectionLoops"><strong>getCentersFromIntersectionLoops</strong></a>(circleIntersectionLoopComplexes)</dt><dd><tt>Get the centers from the intersection loops.</tt></dd></dl> <dl><dt><a name="-getCentersFromLoopDirection"><strong>getCentersFromLoopDirection</strong></a>(isWiddershins, loop, radius)</dt><dd><tt>Get the centers of the circle intersection loops which go around in the given direction.</tt></dd></dl> - <dl><dt><a name="-getCentersFromOutside"><strong>getCentersFromOutside</strong></a>(isOutside, loop, radius)</dt><dd><tt>Get the centers of the circle intersection loops which are outside if isOutside is true, otherwise get the ones inside.</tt></dd></dl> - <dl><dt><a name="-getCircleIntersectionComplexesFromCircleNodeComplexes"><strong>getCircleIntersectionComplexesFromCircleNodeComplexes</strong></a>(circleNodeComplexes)</dt><dd><tt>Get all the circle intersections which exist between all the circle nodes.</tt></dd></dl> - <dl><dt><a name="-getCircleIntersectionLoopComplexes"><strong>getCircleIntersectionLoopComplexes</strong></a>(circleIntersectionComplexes)</dt><dd><tt>Get all the loops going through the circle intersections.</tt></dd></dl> <dl><dt><a name="-getCircleIntersectionLoops"><strong>getCircleIntersectionLoops</strong></a>(circleIntersections)</dt><dd><tt>Get all the loops going through the circle intersections.</tt></dd></dl> - <dl><dt><a name="-getCircleIntersectionsFromCircleNodes"><strong>getCircleIntersectionsFromCircleNodes</strong></a>(circleNodes)</dt><dd><tt>Get all the circle intersections which exist between all the circle nodes.</tt></dd></dl> - <dl><dt><a name="-getCircleNodeComplexesFromLoopComplex"><strong>getCircleNodeComplexesFromLoopComplex</strong></a>(loop, radius)</dt><dd><tt>Get the circle nodes from every point on a loop and between points.</tt></dd></dl> - <dl><dt><a name="-getCircleNodeComplexesFromPointComplexes"><strong>getCircleNodeComplexesFromPointComplexes</strong></a>(pointComplexes, radius)</dt><dd><tt>Get the circle nodes from a path.</tt></dd></dl> + <dl><dt><a name="-getCircleIntersectionsFromCircleNodes"><strong>getCircleIntersectionsFromCircleNodes</strong></a>(circleNodesComplex)</dt><dd><tt>Get all the circle intersections which exist between all the circle nodes.</tt></dd></dl> <dl><dt><a name="-getCircleNodesFromLoop"><strong>getCircleNodesFromLoop</strong></a>(loop, radius)</dt><dd><tt>Get the circle nodes from every point on a loop and between points.</tt></dd></dl> - <dl><dt><a name="-getCircleNodesFromPath"><strong>getCircleNodesFromPath</strong></a>(path, radius)</dt><dd><tt>Get the circle nodes from a path.</tt></dd></dl> - <dl><dt><a name="-getInsetComplexFromClockwiseTriple"><strong>getInsetComplexFromClockwiseTriple</strong></a>(aheadAbsoluteComplex, behindAbsoluteComplex, centerComplex, radius)</dt><dd><tt>Get loop inset from clockwise triple, out from widdershins loop.</tt></dd></dl> + <dl><dt><a name="-getCircleNodesFromPoints"><strong>getCircleNodesFromPoints</strong></a>(pointComplexes, radius)</dt><dd><tt>Get the circle nodes from a path.</tt></dd></dl> <dl><dt><a name="-getInsetFromClockwiseLoop"><strong>getInsetFromClockwiseLoop</strong></a>(loop, radius)</dt><dd><tt>Get loop inset from clockwise loop, out from widdershins loop.</tt></dd></dl> - <dl><dt><a name="-getInsetFromClockwiseLoopComplex"><strong>getInsetFromClockwiseLoopComplex</strong></a>(loopComplex, radius)</dt><dd><tt>Get loop inset from clockwise loop, out from widdershins loop.</tt></dd></dl> - <dl><dt><a name="-getInsetFromClockwiseTriple"><strong>getInsetFromClockwiseTriple</strong></a>(aheadAbsolute, behindAbsolute, center, radius)</dt><dd><tt>Get loop inset from clockwise triple, out from widdershins loop.</tt></dd></dl> + <dl><dt><a name="-getInsetFromClockwiseTriple"><strong>getInsetFromClockwiseTriple</strong></a>(aheadAbsoluteComplex, behindAbsoluteComplex, centerComplex, radius)</dt><dd><tt>Get loop inset from clockwise triple, out from widdershins loop.</tt></dd></dl> <dl><dt><a name="-getInsetLoops"><strong>getInsetLoops</strong></a>(inset, loops)</dt><dd><tt>Get the inset loops.</tt></dd></dl> - <dl><dt><a name="-getIntersectionAtInset"><strong>getIntersectionAtInset</strong></a>(ahead, behind, inset)</dt><dd><tt>Get circle intersection loop at inset from segment.</tt></dd></dl> - <dl><dt><a name="-getIntersectionComplexAtInset"><strong>getIntersectionComplexAtInset</strong></a>(aheadComplex, behindComplex, inset)</dt><dd><tt>Get circle intersection loop at inset from segment.</tt></dd></dl> - <dl><dt><a name="-getLoopComplexesFromLoopComplexesDirection"><strong>getLoopComplexesFromLoopComplexesDirection</strong></a>(isWiddershins, loopComplexes)</dt><dd><tt>Get the loops going round in a given direction.</tt></dd></dl> + <dl><dt><a name="-getIntersectionAtInset"><strong>getIntersectionAtInset</strong></a>(aheadComplex, behindComplex, inset)</dt><dd><tt>Get circle intersection loop at inset from segment.</tt></dd></dl> <dl><dt><a name="-getLoopsFromLoopsDirection"><strong>getLoopsFromLoopsDirection</strong></a>(isWiddershins, loops)</dt><dd><tt>Get the loops going round in a given direction.</tt></dd></dl> <dl><dt><a name="-getSimplifiedInsetFromClockwiseLoop"><strong>getSimplifiedInsetFromClockwiseLoop</strong></a>(loop, radius)</dt><dd><tt>Get loop inset from clockwise loop, out from widdershins loop.</tt></dd></dl> - <dl><dt><a name="-getSimplifiedInsetFromClockwiseLoopComplex"><strong>getSimplifiedInsetFromClockwiseLoopComplex</strong></a>(loopComplex, radius)</dt><dd><tt>Get loop inset from clockwise loop, out from widdershins loop.</tt></dd></dl> - <dl><dt><a name="-getWithoutIntersectionComplexes"><strong>getWithoutIntersectionComplexes</strong></a>(loopComplex)</dt><dd><tt>Get loop without intersections.</tt></dd></dl> <dl><dt><a name="-getWithoutIntersections"><strong>getWithoutIntersections</strong></a>(loop)</dt><dd><tt>Get loop without intersections.</tt></dd></dl> <dl><dt><a name="-isLoopIntersectingLoop"><strong>isLoopIntersectingLoop</strong></a>(anotherLoop, loop)</dt><dd><tt>Determine if the a loop is intersecting another loop.</tt></dd></dl> <dl><dt><a name="-removeIntersection"><strong>removeIntersection</strong></a>(loop)</dt><dd><tt>Get loop without the first intersection.</tt></dd></dl> - <dl><dt><a name="-removeIntersectionComplex"><strong>removeIntersectionComplex</strong></a>(loopComplex)</dt><dd><tt>Get loop without the first intersection.</tt></dd></dl> - <dl><dt><a name="-setZAccordingToOperatingJump"><strong>setZAccordingToOperatingJump</strong></a>(loop, operatingJump)</dt><dd><tt>Set of the loop to the first point, increasing by the operating jump if it exists.</tt></dd></dl> </td></tr></table><p> <table width="100%" cellspacing=0 cellpadding=2 border=0 summary="section"> <tr bgcolor="#55aa55"> diff --git a/trunk/reprap/miscellaneous/python-beanshell-scripts/documentation/skeinforge_tools.skeinforge_utilities.interpret.html b/trunk/reprap/miscellaneous/python-beanshell-scripts/documentation/skeinforge_tools.skeinforge_utilities.interpret.html new file mode 100644 index 00000000..7ae12379 --- /dev/null +++ b/trunk/reprap/miscellaneous/python-beanshell-scripts/documentation/skeinforge_tools.skeinforge_utilities.interpret.html @@ -0,0 +1,68 @@ + +<!doctype html PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN"> +<html><head><title>Python: module skeinforge_tools.skeinforge_utilities.interpret</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>.<a href="skeinforge_tools.skeinforge_utilities.html"><font color="#ffffff">skeinforge_utilities</font></a>.interpret</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/skeinforge_utilities/interpret.py">/home/enrique/Desktop/backup/babbleold/script/reprap/pyRepRap/skeinforge_tools/skeinforge_utilities/interpret.py</a></font></td></tr></table> + <p><tt>Interpret is a collection of utilities to list the import plugins.<br> + <br> +An import plugin is a script in the import_plugins folder which has the function getTriangleMesh.<br> + <br> +The following examples shows functions of interpret. The examples are run in a terminal in the folder which contains interpret.py.<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 interpret<br> +>>> interpret.<a href="#-getGNUTranslatorGcodeFileTypeTuples">getGNUTranslatorGcodeFileTypeTuples</a>()<br> +[('GTS files', '*.gts'), ('Gcode text files', '*.gcode'), ('STL files', '*.stl'), ('SVG files', '*.svg')]<br> + <br> +>>> interpret.<a href="#-getImportPluginFilenames">getImportPluginFilenames</a>()<br> +['gts', 'stl', 'svg']</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> +</td><td width="25%" valign=top><a href="skeinforge_tools.skeinforge_utilities.gcodec.html">skeinforge_tools.skeinforge_utilities.gcodec</a><br> +</td><td width="25%" valign=top><a href="os.html">os</a><br> +</td><td width="25%" valign=top></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="-getGNUTranslatorFilesUnmodified"><strong>getGNUTranslatorFilesUnmodified</strong></a>()</dt><dd><tt>Get the file types from the translators in the import plugins folder.</tt></dd></dl> + <dl><dt><a name="-getGNUTranslatorGcodeFileTypeTuples"><strong>getGNUTranslatorGcodeFileTypeTuples</strong></a>()</dt><dd><tt>Get the file type tuples from the translators in the import plugins folder plus gcode.</tt></dd></dl> + <dl><dt><a name="-getImportPluginFilenames"><strong>getImportPluginFilenames</strong></a>()</dt><dd><tt>Get analyze plugin fileNames.</tt></dd></dl> + <dl><dt><a name="-getTranslatorFileTypeTuples"><strong>getTranslatorFileTypeTuples</strong></a>()</dt><dd><tt>Get the file types from the translators in the import plugins 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>
\ No newline at end of file diff --git a/trunk/reprap/miscellaneous/python-beanshell-scripts/documentation/skeinforge_tools.skeinforge_utilities.preferences.html b/trunk/reprap/miscellaneous/python-beanshell-scripts/documentation/skeinforge_tools.skeinforge_utilities.preferences.html index d7f40b41..e682e5c4 100644 --- a/trunk/reprap/miscellaneous/python-beanshell-scripts/documentation/skeinforge_tools.skeinforge_utilities.preferences.html +++ b/trunk/reprap/miscellaneous/python-beanshell-scripts/documentation/skeinforge_tools.skeinforge_utilities.preferences.html @@ -209,13 +209,13 @@ Methods inherited from <a href="skeinforge_tools.skeinforge_utilities.preference <dl><dt><a name="Filename-execute"><strong>execute</strong></a>(self)</dt></dl> -<dl><dt><a name="Filename-getFilenameFirstTypes"><strong>getFilenameFirstTypes</strong></a>(self)</dt><dd><tt>Get the file types with the file type of the filename moved to the front of the list.</tt></dd></dl> +<dl><dt><a name="Filename-getFilenameFirstTypes"><strong>getFilenameFirstTypes</strong></a>(self)</dt><dd><tt>Get the file types with the file type of the fileName moved to the front of the list.</tt></dd></dl> <dl><dt><a name="Filename-getFromFilename"><strong>getFromFilename</strong></a>(self, fileTypes, name, value)</dt><dd><tt>Initialize.</tt></dd></dl> <dl><dt><a name="Filename-setToDisplay"><strong>setToDisplay</strong></a>(self)</dt><dd><tt>Pass.</tt></dd></dl> -<dl><dt><a name="Filename-setValueToString"><strong>setValueToString</strong></a>(self, valueString)</dt><dd><tt>Set the filename to the string.</tt></dd></dl> +<dl><dt><a name="Filename-setValueToString"><strong>setValueToString</strong></a>(self, valueString)</dt><dd><tt>Set the fileName to the string.</tt></dd></dl> <hr> Methods inherited from <a href="skeinforge_tools.skeinforge_utilities.preferences.html#BooleanPreference">BooleanPreference</a>:<br> @@ -525,7 +525,7 @@ Methods inherited from <a href="skeinforge_tools.skeinforge_utilities.preference <td width="100%"><dl><dt><a name="-displayDialog"><strong>displayDialog</strong></a>(displayPreferences)</dt><dd><tt>Display the preferences dialog.</tt></dd></dl> <dl><dt><a name="-getArchiveText"><strong>getArchiveText</strong></a>(preferences)</dt><dd><tt>Get the text representation of the archive.</tt></dd></dl> <dl><dt><a name="-getPreferencesDirectoryPath"><strong>getPreferencesDirectoryPath</strong></a>()</dt><dd><tt>Get the preferences directory path, which is the home directory joined with .skeinforge.</tt></dd></dl> - <dl><dt><a name="-getPreferencesFilePath"><strong>getPreferencesFilePath</strong></a>(filename)</dt><dd><tt>Get the preferences file path, which is the home directory joined with .skeinforge and filename.</tt></dd></dl> + <dl><dt><a name="-getPreferencesFilePath"><strong>getPreferencesFilePath</strong></a>(fileName)</dt><dd><tt>Get the preferences file path, which is the home directory joined with .skeinforge and fileName.</tt></dd></dl> <dl><dt><a name="-readPreferences"><strong>readPreferences</strong></a>(preferences)</dt><dd><tt>Set an archive to the preferences read from a file.</tt></dd></dl> <dl><dt><a name="-readPreferencesFromText"><strong>readPreferencesFromText</strong></a>(preferences, text)</dt><dd><tt>Set an archive to the preferences read from a text.</tt></dd></dl> <dl><dt><a name="-setArchiveToLine"><strong>setArchiveToLine</strong></a>(lineIndex, lines, preferenceTable)</dt><dd><tt>Set an archive to a preference line.</tt></dd></dl> diff --git a/trunk/reprap/miscellaneous/python-beanshell-scripts/documentation/skeinforge_tools.skeinforge_utilities.triangle_mesh.html b/trunk/reprap/miscellaneous/python-beanshell-scripts/documentation/skeinforge_tools.skeinforge_utilities.triangle_mesh.html index 0b277099..f756710d 100644 --- a/trunk/reprap/miscellaneous/python-beanshell-scripts/documentation/skeinforge_tools.skeinforge_utilities.triangle_mesh.html +++ b/trunk/reprap/miscellaneous/python-beanshell-scripts/documentation/skeinforge_tools.skeinforge_utilities.triangle_mesh.html @@ -13,28 +13,28 @@ <br> It can read from and write to a GNU Triangulated Surface (.gts) file.<br> <br> -The following examples slice the GNU Triangulated Surface file Hollow Square.gts. The examples are run in a terminal in the folder which<br> -contains Hollow Square.gts and triangle_mesh.py.<br> +The following examples carve the GNU Triangulated Surface file Screw Holder Bottom.stl. The examples are run in a terminal in the folder which<br> +contains Screw Holder Bottom.stl and triangle_mesh.py.<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 slice<br> ->>> slice.main()<br> -File Hollow Square.gts is being sliced.<br> -The sliced file is saved as Hollow Square_slice.gcode<br> -It took 3 seconds to slice the file.<br> +>>> import carve<br> +>>> carve.main()<br> +File Screw Holder Bottom.stl is being carved.<br> +The carved file is saved as Screw Holder Bottom_carve.gcode<br> +It took 3 seconds to carve the file.<br> <br> <br> ->>> slice.writeOutput()<br> -File Hollow Square.gcode is being sliced.<br> -The sliced file is saved as Hollow Square_slice.gcode<br> -It took 3 seconds to slice the file.<br> +>>> carve.writeOutput()<br> +File Screw Holder Bottom.gcode is being carved.<br> +The carved file is saved as Screw Holder Bottom_carve.gcode<br> +It took 3 seconds to carve the file.<br> <br> <br> ->>> slice.getSliceGcode("<br> +>>> carve.getCarveGcode("<br> 54 162 108 Number of Vertices,Number of Edges,Number of Faces<br> -5.800000000000001 5.341893939393939 4.017841892579603 Vertex Coordinates XYZ<br> 5.800000000000001 5.341893939393939 4.017841892579603<br> @@ -50,9 +50,13 @@ many lines of GNU Triangulated Surface vertices,&n <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> -</td><td width="25%" valign=top><a href="cStringIO.html">cStringIO</a><br> +<a href="cStringIO.html">cStringIO</a><br> +</td><td width="25%" valign=top><a href="cmath.html">cmath</a><br> +<a href="skeinforge_tools.skeinforge_utilities.euclidean.html">skeinforge_tools.skeinforge_utilities.euclidean</a><br> </td><td width="25%" valign=top><a href="skeinforge_tools.skeinforge_utilities.gcodec.html">skeinforge_tools.skeinforge_utilities.gcodec</a><br> -</td><td width="25%" valign=top></td></tr></table></td></tr></table><p> +<a href="skeinforge_tools.skeinforge_utilities.intercircle.html">skeinforge_tools.skeinforge_utilities.intercircle</a><br> +</td><td width="25%" valign=top><a href="math.html">math</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> @@ -63,6 +67,7 @@ many lines of GNU Triangulated Surface vertices,&n <dt><font face="helvetica, arial"><a href="skeinforge_tools.skeinforge_utilities.triangle_mesh.html#Edge">Edge</a> </font></dt><dt><font face="helvetica, arial"><a href="skeinforge_tools.skeinforge_utilities.triangle_mesh.html#EdgePair">EdgePair</a> </font></dt><dt><font face="helvetica, arial"><a href="skeinforge_tools.skeinforge_utilities.triangle_mesh.html#Face">Face</a> +</font></dt><dt><font face="helvetica, arial"><a href="skeinforge_tools.skeinforge_utilities.triangle_mesh.html#LoopArea">LoopArea</a> </font></dt><dt><font face="helvetica, arial"><a href="skeinforge_tools.skeinforge_utilities.triangle_mesh.html#TriangleMesh">TriangleMesh</a> </font></dt></dl> <p> @@ -123,6 +128,20 @@ many lines of GNU Triangulated Surface vertices,&n <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="LoopArea">class <strong>LoopArea</strong></a></font></td></tr> + +<tr bgcolor="#ffc8d8"><td rowspan=2><tt> </tt></td> +<td colspan=2><tt>Complex loop with an area.<br> </tt></td></tr> +<tr><td> </td> +<td width="100%">Methods defined here:<br> +<dl><dt><a name="LoopArea-__init__"><strong>__init__</strong></a>(self, loop)</dt></dl> + +<dl><dt><a name="LoopArea-__repr__"><strong>__repr__</strong></a>(self)</dt><dd><tt>Get the string representation of this flat path.</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="TriangleMesh">class <strong>TriangleMesh</strong></a></font></td></tr> <tr bgcolor="#ffc8d8"><td rowspan=2><tt> </tt></td> @@ -133,10 +152,36 @@ many lines of GNU Triangulated Surface vertices,&n <dl><dt><a name="TriangleMesh-__repr__"><strong>__repr__</strong></a>(self)</dt><dd><tt>Get the string representation of this <a href="#TriangleMesh">TriangleMesh</a>.</tt></dd></dl> -<dl><dt><a name="TriangleMesh-getFromGNUTriangulatedSurfaceText"><strong>getFromGNUTriangulatedSurfaceText</strong></a>(self, gnuTriangulatedSurfaceText)</dt><dd><tt>Initialize from a GNU Triangulated Surface Text.</tt></dd></dl> +<dl><dt><a name="TriangleMesh-addToZoneArray"><strong>addToZoneArray</strong></a>(self, point, zoneArray, z)</dt><dd><tt>Add a height to the zone array.</tt></dd></dl> + +<dl><dt><a name="TriangleMesh-getBridgeDirection"><strong>getBridgeDirection</strong></a>(self, layerLoops)</dt><dd><tt>Get span direction for the majority of the overhanging extrusion perimeter, if any.</tt></dd></dl> + +<dl><dt><a name="TriangleMesh-getBridgeLoops"><strong>getBridgeLoops</strong></a>(self, loop)</dt><dd><tt>Get the inset bridge loops from the loop.</tt></dd></dl> + +<dl><dt><a name="TriangleMesh-getCarveCornerMaximum"><strong>getCarveCornerMaximum</strong></a>(self)</dt><dd><tt>Get the corner maximum of the vertices.</tt></dd></dl> + +<dl><dt><a name="TriangleMesh-getCarveCornerMinimum"><strong>getCarveCornerMinimum</strong></a>(self)</dt><dd><tt>Get the corner minimum of the vertices.</tt></dd></dl> + +<dl><dt><a name="TriangleMesh-getCarveLayerThickness"><strong>getCarveLayerThickness</strong></a>(self)</dt><dd><tt>Get the layer thickness.</tt></dd></dl> + +<dl><dt><a name="TriangleMesh-getCarveRotatedBoundaryLayers"><strong>getCarveRotatedBoundaryLayers</strong></a>(self)</dt><dd><tt>Get the rotated boundary layers.</tt></dd></dl> <dl><dt><a name="TriangleMesh-getGNUTriangulatedSurfaceText"><strong>getGNUTriangulatedSurfaceText</strong></a>(self)</dt><dd><tt>Get this mesh in the GNU Triangulated Surface (.gts) format.</tt></dd></dl> +<dl><dt><a name="TriangleMesh-getLoopsFromMesh"><strong>getLoopsFromMesh</strong></a>(self, z)</dt><dd><tt>Get loops from a carve of a mesh.</tt></dd></dl> + +<dl><dt><a name="TriangleMesh-getZAddExtruderPaths"><strong>getZAddExtruderPaths</strong></a>(self, z)</dt><dd><tt>Get next z and add extruder loops.</tt></dd></dl> + +<dl><dt><a name="TriangleMesh-setCarveBridgeLayerThickness"><strong>setCarveBridgeLayerThickness</strong></a>(self, bridgeLayerThickness)</dt><dd><tt>Set the bridge layer thickness. If the infill is not in the direction of the bridge, the bridge layer thickness should be given as None or not set at all.</tt></dd></dl> + +<dl><dt><a name="TriangleMesh-setCarveExtrusionWidth"><strong>setCarveExtrusionWidth</strong></a>(self, extrusionWidth)</dt><dd><tt>Set the extrusion width.</tt></dd></dl> + +<dl><dt><a name="TriangleMesh-setCarveImportCoarseness"><strong>setCarveImportCoarseness</strong></a>(self, importCoarseness)</dt><dd><tt>Set the import coarseness.</tt></dd></dl> + +<dl><dt><a name="TriangleMesh-setCarveIsCorrectMesh"><strong>setCarveIsCorrectMesh</strong></a>(self, isCorrectMesh)</dt><dd><tt>Set the is correct mesh flag.</tt></dd></dl> + +<dl><dt><a name="TriangleMesh-setCarveLayerThickness"><strong>setCarveLayerThickness</strong></a>(self, layerThickness)</dt><dd><tt>Set the layer thickness.</tt></dd></dl> + <dl><dt><a name="TriangleMesh-setEdgesForAllFaces"><strong>setEdgesForAllFaces</strong></a>(self)</dt><dd><tt>Set the face edges of all the faces.</tt></dd></dl> </td></tr></table></td></tr></table><p> @@ -146,8 +191,29 @@ many lines of GNU Triangulated Surface vertices,&n <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="-getCommonVertexIndex"><strong>getCommonVertexIndex</strong></a>(edgeFirst, edgeSecond)</dt><dd><tt>Get the vertex index that both edges have in common.</tt></dd></dl> - <dl><dt><a name="-getTriangleMesh"><strong>getTriangleMesh</strong></a>(filename<font color="#909090">=''</font>)</dt><dd><tt>Slice a GNU Triangulated Surface file. If no filename is specified, slice the first GNU Triangulated Surface file in this folder.</tt></dd></dl> +<td width="100%"><dl><dt><a name="-addEdgePair"><strong>addEdgePair</strong></a>(edgePairTable, edges, faceEdgeIndex, remainingEdgeIndex, remainingEdgeTable)</dt><dd><tt>Add edge pair to the edge pair table.</tt></dd></dl> + <dl><dt><a name="-addLoopToPointTable"><strong>addLoopToPointTable</strong></a>(loop, pointTable)</dt><dd><tt>Add the points in the loop to the point table.</tt></dd></dl> + <dl><dt><a name="-addPointsAtZ"><strong>addPointsAtZ</strong></a>(edgePair, points, radius, vertices, z)</dt><dd><tt>Add point complexes on the segment between the edge intersections with z.</tt></dd></dl> + <dl><dt><a name="-addWithLeastLength"><strong>addWithLeastLength</strong></a>(loops, point, shortestAdditionalLength)</dt><dd><tt>Insert a point into a loop, at the index at which the loop would be shortest.</tt></dd></dl> + <dl><dt><a name="-compareArea"><strong>compareArea</strong></a>(loopArea, otherLoopArea)</dt><dd><tt>Get comparison in order to sort loop areas in descending order of area.</tt></dd></dl> + <dl><dt><a name="-getAdditionalLoopLength"><strong>getAdditionalLoopLength</strong></a>(loop, point, pointIndex)</dt><dd><tt>Get the additional length added by inserting a point into a loop.</tt></dd></dl> + <dl><dt><a name="-getCarveIntersectionFromEdge"><strong>getCarveIntersectionFromEdge</strong></a>(edge, vertices, z)</dt><dd><tt>Get the complex where the carve intersects the edge.</tt></dd></dl> + <dl><dt><a name="-getCommonVertexIndex"><strong>getCommonVertexIndex</strong></a>(edgeFirst, edgeSecond)</dt><dd><tt>Get the vertex index that both edges have in common.</tt></dd></dl> + <dl><dt><a name="-getDoubledRoundZ"><strong>getDoubledRoundZ</strong></a>(overhangingSegment, segmentRoundZ)</dt><dd><tt>Get doubled plane angle around z of the overhanging segment.</tt></dd></dl> + <dl><dt><a name="-getLoopsFromCorrectMesh"><strong>getLoopsFromCorrectMesh</strong></a>(edges, faces, vertices, z)</dt><dd><tt>Get loops from a carve of a correct mesh.</tt></dd></dl> + <dl><dt><a name="-getLoopsFromUnprovenMesh"><strong>getLoopsFromUnprovenMesh</strong></a>(edges, extrusionWidth, faces, importCoarseness, vertices, z)</dt><dd><tt>Get loops from a carve of an unproven mesh.</tt></dd></dl> + <dl><dt><a name="-getLoopsInDescendingOrderOfArea"><strong>getLoopsInDescendingOrderOfArea</strong></a>(loops)</dt><dd><tt>Get the lowest zone index.</tt></dd></dl> + <dl><dt><a name="-getLowestZoneIndex"><strong>getLowestZoneIndex</strong></a>(zoneArray, z)</dt><dd><tt>Get the lowest zone index.</tt></dd></dl> + <dl><dt><a name="-getNextEdgeIndexAroundZ"><strong>getNextEdgeIndexAroundZ</strong></a>(edge, faces, remainingEdgeTable)</dt><dd><tt>Get the next edge index in the mesh carve.</tt></dd></dl> + <dl><dt><a name="-getOverhangDirection"><strong>getOverhangDirection</strong></a>(belowOutsetLoops, segmentBegin, segmentEnd)</dt><dd><tt>Add to span direction from the endpoint segments which overhang the layer below.</tt></dd></dl> + <dl><dt><a name="-getOverlapRatio"><strong>getOverlapRatio</strong></a>(loop, pointTable)</dt><dd><tt>Get the overlap ratio between the loop and the point table.</tt></dd></dl> + <dl><dt><a name="-getPath"><strong>getPath</strong></a>(edges, pathIndexes, loop, z)</dt><dd><tt>Get the path from the edge intersections.</tt></dd></dl> + <dl><dt><a name="-getRemainingEdgeTable"><strong>getRemainingEdgeTable</strong></a>(edges, vertices, z)</dt><dd><tt>Get the remaining edge hashtable.</tt></dd></dl> + <dl><dt><a name="-getSharedFace"><strong>getSharedFace</strong></a>(firstEdge, faces, secondEdge)</dt><dd><tt>Get the face which is shared by two edges.</tt></dd></dl> + <dl><dt><a name="-getTriangleMesh"><strong>getTriangleMesh</strong></a>(fileName<font color="#909090">=''</font>)</dt><dd><tt>Carve a GNU Triangulated Surface file. If no fileName is specified, carve the first GNU Triangulated Surface file in this folder.</tt></dd></dl> + <dl><dt><a name="-isInline"><strong>isInline</strong></a>(beginComplex, centerComplex, endComplex)</dt><dd><tt>Determine if the three complex points form a line.</tt></dd></dl> + <dl><dt><a name="-isPathAdded"><strong>isPathAdded</strong></a>(edges, faces, loops, remainingEdgeTable, vertices, z)</dt><dd><tt>Get the path indexes around a triangle mesh carve and add the path to the flat loops.</tt></dd></dl> + <dl><dt><a name="-isZInEdge"><strong>isZInEdge</strong></a>(edge, vertices, z)</dt><dd><tt>Determine if z is inside the edge.</tt></dd></dl> </td></tr></table><p> <table width="100%" cellspacing=0 cellpadding=2 border=0 summary="section"> <tr bgcolor="#55aa55"> diff --git a/trunk/reprap/miscellaneous/python-beanshell-scripts/documentation/skeinforge_tools.skeinforge_utilities.vec3.html b/trunk/reprap/miscellaneous/python-beanshell-scripts/documentation/skeinforge_tools.skeinforge_utilities.vec3.html index ccf9ddf9..e692a441 100644 --- a/trunk/reprap/miscellaneous/python-beanshell-scripts/documentation/skeinforge_tools.skeinforge_utilities.vec3.html +++ b/trunk/reprap/miscellaneous/python-beanshell-scripts/documentation/skeinforge_tools.skeinforge_utilities.vec3.html @@ -8,7 +8,7 @@ <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>.<a href="skeinforge_tools.skeinforge_utilities.html"><font color="#ffffff">skeinforge_utilities</font></a>.vec3</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/skeinforge_utilities/vec3.py">/home/enrique/Desktop/backup/babbleold/script/reprap/pyRepRap/skeinforge_tools/skeinforge_utilities/vec3.py</a></font></td></tr></table> +><font color="#ffffff" face="helvetica, arial"><a href=".">index</a><br><a href="file:/home/enrique/Desktop/backup/babbleold/script/reprap/pyRepRap/skeinforge_tools/skeinforge_utilities/vec3.pyc">/home/enrique/Desktop/backup/babbleold/script/reprap/pyRepRap/skeinforge_tools/skeinforge_utilities/vec3.pyc</a></font></td></tr></table> <p><tt><a href="#Vec3">Vec3</a> is a three dimensional vector class.<br> <br> #Class vec3 is deprecated, please use <a href="#Vec3">Vec3</a> instead.<br> @@ -22,11 +22,11 @@ Below are examples of <a href="#Vec3">Vec3</a> use.<br> >>> pythagoras = <a href="#Vec3">Vec3</a>( 3, 4, 0 )<br> >>> pythagoras<br> 3.0, 4.0, 0.0<br> ->>> pythagoras.length()<br> +>>> pythagoras.magnitude()<br> 5.0<br> ->>> pythagoras.length2()<br> +>>> pythagoras.magnitudeSquared()<br> 25<br> ->>> triplePythagoras = pythagoras.times( 3.0 )<br> +>>> triplePythagoras = pythagoras * 3.0<br> >>> triplePythagoras<br> 9.0, 12.0, 0.0<br> >>> plane = pythagoras.dropAxis( 2 )<br> @@ -41,7 +41,8 @@ Below are examples of <a href="#Vec3">Vec3</a> use.<br> <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> </td><td width="25%" valign=top><a href="math.html">math</a><br> -</td><td width="25%" valign=top></td><td width="25%" valign=top></td></tr></table></td></tr></table><p> +</td><td width="25%" valign=top><a href="operator.html">operator</a><br> +</td><td width="25%" valign=top></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> @@ -61,70 +62,86 @@ Below are examples of <a href="#Vec3">Vec3</a> use.<br> <td colspan=2><tt>A three dimensional vector class.<br> </tt></td></tr> <tr><td> </td> <td width="100%">Methods defined here:<br> -<dl><dt><a name="Vec3-__eq__"><strong>__eq__</strong></a>(self, another)</dt><dd><tt>Determine whether this vector is identical to another one.</tt></dd></dl> +<dl><dt><a name="Vec3-__abs__"><strong>__abs__</strong></a>(self)</dt><dd><tt>Get the magnitude of the <a href="#Vec3">Vec3</a>.</tt></dd></dl> -<dl><dt><a name="Vec3-__hash__"><strong>__hash__</strong></a>(self)</dt><dd><tt>Determine whether this vector is identical to another one.</tt></dd></dl> +<dl><dt><a name="Vec3-__add__"><strong>__add__</strong></a>(self, other)</dt><dd><tt>Get the sum of this <a href="#Vec3">Vec3</a> and other one.</tt></dd></dl> + +<dl><dt><a name="Vec3-__copy__"><strong>__copy__</strong></a>(self)</dt><dd><tt>Get the copy of this <a href="#Vec3">Vec3</a>.</tt></dd></dl> + +<dl><dt><a name="Vec3-__div__"><strong>__div__</strong></a>(self, other)</dt><dd><tt>Get a new <a href="#Vec3">Vec3</a> by dividing each component of this one.</tt></dd></dl> + +<dl><dt><a name="Vec3-__eq__"><strong>__eq__</strong></a>(self, other)</dt><dd><tt>Determine whether this vector is identical to other one.</tt></dd></dl> + +<dl><dt><a name="Vec3-__floordiv__"><strong>__floordiv__</strong></a>(self, other)</dt><dd><tt>Get a new <a href="#Vec3">Vec3</a> by floor dividing each component of this one.</tt></dd></dl> + +<dl><dt><a name="Vec3-__hash__"><strong>__hash__</strong></a>(self)</dt><dd><tt>Determine whether this vector is identical to other one.</tt></dd></dl> + +<dl><dt><a name="Vec3-__iadd__"><strong>__iadd__</strong></a>(self, other)</dt><dd><tt>Add other <a href="#Vec3">Vec3</a> to this one.</tt></dd></dl> + +<dl><dt><a name="Vec3-__idiv__"><strong>__idiv__</strong></a>(self, other)</dt><dd><tt>Divide each component of this <a href="#Vec3">Vec3</a>.</tt></dd></dl> + +<dl><dt><a name="Vec3-__ifloordiv__"><strong>__ifloordiv__</strong></a>(self, other)</dt><dd><tt>Floor divide each component of this <a href="#Vec3">Vec3</a>.</tt></dd></dl> + +<dl><dt><a name="Vec3-__imul__"><strong>__imul__</strong></a>(self, other)</dt><dd><tt>Multiply each component of this <a href="#Vec3">Vec3</a>.</tt></dd></dl> <dl><dt><a name="Vec3-__init__"><strong>__init__</strong></a>(self, x<font color="#909090">=0.0</font>, y<font color="#909090">=0.0</font>, z<font color="#909090">=0.0</font>)</dt></dl> -<dl><dt><a name="Vec3-__ne__"><strong>__ne__</strong></a>(self, another)</dt><dd><tt>Determine whether this vector is not identical to another one.</tt></dd></dl> +<dl><dt><a name="Vec3-__isub__"><strong>__isub__</strong></a>(self, other)</dt><dd><tt>Subtract other <a href="#Vec3">Vec3</a> from this one.</tt></dd></dl> -<dl><dt><a name="Vec3-__repr__"><strong>__repr__</strong></a>(self)</dt><dd><tt>Get the string representation of this <a href="#Vec3">Vec3</a>.</tt></dd></dl> +<dl><dt><a name="Vec3-__itruediv__"><strong>__itruediv__</strong></a>(self, other)</dt><dd><tt>True divide each component of this <a href="#Vec3">Vec3</a>.</tt></dd></dl> -<dl><dt><a name="Vec3-add"><strong>add</strong></a>(self, another)</dt><dd><tt>Add another <a href="#Vec3">Vec3</a> to this one.</tt></dd></dl> +<dl><dt><a name="Vec3-__mul__"><strong>__mul__</strong></a>(self, other)</dt><dd><tt>Get a new <a href="#Vec3">Vec3</a> by multiplying each component of this one.</tt></dd></dl> -<dl><dt><a name="Vec3-distance"><strong>distance</strong></a>(self, another)</dt><dd><tt>Get the Euclidean distance between this vector and another one.</tt></dd></dl> +<dl><dt><a name="Vec3-__ne__"><strong>__ne__</strong></a>(self, other)</dt><dd><tt>Determine whether this vector is not identical to other one.</tt></dd></dl> -<dl><dt><a name="Vec3-distance2"><strong>distance2</strong></a>(self, another)</dt><dd><tt>Get the square of the Euclidean distance between this vector and another one.</tt></dd></dl> +<dl><dt><a name="Vec3-__neg__"><strong>__neg__</strong></a>(self)</dt></dl> -<dl><dt><a name="Vec3-distance2XYPlane"><strong>distance2XYPlane</strong></a>(self, another)</dt><dd><tt>Get the square of the Euclidean distance between this vector and another one in the xy plane.</tt></dd></dl> +<dl><dt><a name="Vec3-__nonzero__"><strong>__nonzero__</strong></a>(self)</dt></dl> -<dl><dt><a name="Vec3-distanceXYPlane"><strong>distanceXYPlane</strong></a>(self, another)</dt><dd><tt>Get the Euclidean distance between this vector and another one in the xy plane.</tt></dd></dl> +<dl><dt><a name="Vec3-__pos__"><strong>__pos__</strong></a> = <a href="#Vec3-__copy__">__copy__</a>(self)</dt></dl> -<dl><dt><a name="Vec3-dot"><strong>dot</strong></a>(self, another)</dt><dd><tt>Calculate the dot product of this vector with another one.</tt></dd></dl> +<dl><dt><a name="Vec3-__rdiv__"><strong>__rdiv__</strong></a>(self, other)</dt><dd><tt>Get a new <a href="#Vec3">Vec3</a> by dividing each component of this one.</tt></dd></dl> -<dl><dt><a name="Vec3-dropAxis"><strong>dropAxis</strong></a>(self, which)</dt><dd><tt>Get a complex by removing one axis of this one.<br> - <br> -Keyword arguments:<br> -which -- the axis to drop (0=X, 1=Y, 2=Z)</tt></dd></dl> +<dl><dt><a name="Vec3-__repr__"><strong>__repr__</strong></a>(self)</dt><dd><tt>Get the string representation of this <a href="#Vec3">Vec3</a>.</tt></dd></dl> -<dl><dt><a name="Vec3-equals"><strong>equals</strong></a>(self, another)</dt><dd><tt>Determine whether this vector is identical to another one.</tt></dd></dl> +<dl><dt><a name="Vec3-__rfloordiv__"><strong>__rfloordiv__</strong></a>(self, other)</dt><dd><tt>Get a new <a href="#Vec3">Vec3</a> by floor dividing each component of this one.</tt></dd></dl> -<dl><dt><a name="Vec3-getFromVec3"><strong>getFromVec3</strong></a>(self, another)</dt><dd><tt>Get a new <a href="#Vec3">Vec3</a> identical to another one.</tt></dd></dl> +<dl><dt><a name="Vec3-__rmul__"><strong>__rmul__</strong></a>(self, other)</dt><dd><tt>Get a new <a href="#Vec3">Vec3</a> by multiplying each component of this one.</tt></dd></dl> -<dl><dt><a name="Vec3-getFromXYZ"><strong>getFromXYZ</strong></a>(self, x, y, z)</dt><dd><tt>Get a new <a href="#Vec3">Vec3</a> with the specified x, y, and z components.</tt></dd></dl> +<dl><dt><a name="Vec3-__rtruediv__"><strong>__rtruediv__</strong></a>(self, other)</dt><dd><tt>Get a new <a href="#Vec3">Vec3</a> by true dividing each component of this one.</tt></dd></dl> -<dl><dt><a name="Vec3-length"><strong>length</strong></a>(self)</dt><dd><tt>Get the length of the <a href="#Vec3">Vec3</a>.</tt></dd></dl> +<dl><dt><a name="Vec3-__sub__"><strong>__sub__</strong></a>(self, other)</dt><dd><tt>Get the difference between the <a href="#Vec3">Vec3</a> and other one.</tt></dd></dl> -<dl><dt><a name="Vec3-length2"><strong>length2</strong></a>(self)</dt><dd><tt>Get the square of the length of the <a href="#Vec3">Vec3</a>.</tt></dd></dl> +<dl><dt><a name="Vec3-__truediv__"><strong>__truediv__</strong></a>(self, other)</dt><dd><tt>Get a new <a href="#Vec3">Vec3</a> by true dividing each component of this one.</tt></dd></dl> -<dl><dt><a name="Vec3-length2XYPlane"><strong>length2XYPlane</strong></a>(self)</dt><dd><tt>Get the square of the length of the <a href="#Vec3">Vec3</a> in the xy plane.</tt></dd></dl> +<dl><dt><a name="Vec3-copy"><strong>copy</strong></a> = <a href="#Vec3-__copy__">__copy__</a>(self)</dt></dl> -<dl><dt><a name="Vec3-lengthXYPlane"><strong>lengthXYPlane</strong></a>(self)</dt><dd><tt>Get the length of the <a href="#Vec3">Vec3</a>.</tt></dd></dl> +<dl><dt><a name="Vec3-cross"><strong>cross</strong></a>(self, other)</dt><dd><tt>Calculate the cross product of this vector with other one.</tt></dd></dl> -<dl><dt><a name="Vec3-minus"><strong>minus</strong></a>(self, subtractVec3)</dt><dd><tt>Get the difference between the <a href="#Vec3">Vec3</a> and another one.<br> - <br> -Keyword arguments:<br> -subtractVec3 -- <a href="#Vec3">Vec3</a> which will be subtracted from the original</tt></dd></dl> +<dl><dt><a name="Vec3-distance"><strong>distance</strong></a>(self, other)</dt><dd><tt>Get the Euclidean distance between this vector and other one.</tt></dd></dl> -<dl><dt><a name="Vec3-multiply"><strong>multiply</strong></a>(self, another)</dt><dd><tt>Multiply each component of this vector by the corresponding component of another vector.</tt></dd></dl> +<dl><dt><a name="Vec3-distanceSquared"><strong>distanceSquared</strong></a>(self, other)</dt><dd><tt>Get the square of the Euclidean distance between this vector and other one.</tt></dd></dl> -<dl><dt><a name="Vec3-normalize"><strong>normalize</strong></a>(self)</dt><dd><tt>Scale each component of this <a href="#Vec3">Vec3</a> so that it has a length of 1. If this <a href="#Vec3">Vec3</a> has a length of 0, this method has no effect.</tt></dd></dl> +<dl><dt><a name="Vec3-dot"><strong>dot</strong></a>(self, other)</dt><dd><tt>Calculate the dot product of this vector with other one.</tt></dd></dl> -<dl><dt><a name="Vec3-plus"><strong>plus</strong></a>(self, plusVec3)</dt><dd><tt>Get the sum of this <a href="#Vec3">Vec3</a> and another one.<br> +<dl><dt><a name="Vec3-dropAxis"><strong>dropAxis</strong></a>(self, which)</dt><dd><tt>Get a complex by removing one axis of this one.<br> <br> Keyword arguments:<br> -plusVec3 -- <a href="#Vec3">Vec3</a> which will be added to the original</tt></dd></dl> +which -- the axis to drop (0=X, 1=Y, 2=Z)</tt></dd></dl> -<dl><dt><a name="Vec3-scale"><strong>scale</strong></a>(self, multiplier)</dt><dd><tt>Scale each component of this <a href="#Vec3">Vec3</a> by a multiplier.</tt></dd></dl> +<dl><dt><a name="Vec3-getNormalized"><strong>getNormalized</strong></a>(self, other)</dt><dd><tt>Get the normalized <a href="#Vec3">Vec3</a>.</tt></dd></dl> -<dl><dt><a name="Vec3-setToVec3"><strong>setToVec3</strong></a>(self, another)</dt><dd><tt>Set this <a href="#Vec3">Vec3</a> to be identical to another one.</tt></dd></dl> +<dl><dt><a name="Vec3-magnitude"><strong>magnitude</strong></a> = <a href="#Vec3-__abs__">__abs__</a>(self)</dt></dl> -<dl><dt><a name="Vec3-setToXYZ"><strong>setToXYZ</strong></a>(self, x, y, z)</dt><dd><tt>Set the x, y, and z components of this <a href="#Vec3">Vec3</a>.</tt></dd></dl> +<dl><dt><a name="Vec3-magnitudeSquared"><strong>magnitudeSquared</strong></a>(self)</dt><dd><tt>Get the square of the magnitude of the <a href="#Vec3">Vec3</a>.</tt></dd></dl> + +<dl><dt><a name="Vec3-normalize"><strong>normalize</strong></a>(self)</dt><dd><tt>Scale each component of this <a href="#Vec3">Vec3</a> so that it has a magnitude of 1. If this <a href="#Vec3">Vec3</a> has a magnitude of 0, this method has no effect.</tt></dd></dl> -<dl><dt><a name="Vec3-subtract"><strong>subtract</strong></a>(self, another)</dt><dd><tt>Subtract another <a href="#Vec3">Vec3</a> from this one.</tt></dd></dl> +<dl><dt><a name="Vec3-reflect"><strong>reflect</strong></a>(self, normal)</dt><dd><tt>Reflect the <a href="#Vec3">Vec3</a> across the normal, which is assumed to be normalized.</tt></dd></dl> -<dl><dt><a name="Vec3-times"><strong>times</strong></a>(self, multiplier)</dt><dd><tt>Get a new <a href="#Vec3">Vec3</a> by multiplying each component of this one by a multiplier.</tt></dd></dl> +<dl><dt><a name="Vec3-setToVec3"><strong>setToVec3</strong></a>(self, other)</dt><dd><tt>Set this <a href="#Vec3">Vec3</a> to be identical to other one.</tt></dd></dl> + +<dl><dt><a name="Vec3-setToXYZ"><strong>setToXYZ</strong></a>(self, x, y, z)</dt><dd><tt>Set the x, y, and z components of this <a href="#Vec3">Vec3</a>.</tt></dd></dl> </td></tr></table></td></tr></table><p> <table width="100%" cellspacing=0 cellpadding=2 border=0 summary="section"> diff --git a/trunk/reprap/miscellaneous/python-beanshell-scripts/documentation/skeinforge_tools.skeinforge_utilities.vector3.html b/trunk/reprap/miscellaneous/python-beanshell-scripts/documentation/skeinforge_tools.skeinforge_utilities.vector3.html new file mode 100644 index 00000000..2f3be7b5 --- /dev/null +++ b/trunk/reprap/miscellaneous/python-beanshell-scripts/documentation/skeinforge_tools.skeinforge_utilities.vector3.html @@ -0,0 +1,171 @@ + +<!doctype html PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN"> +<html><head><title>Python: module skeinforge_tools.skeinforge_utilities.vector3</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>.<a href="skeinforge_tools.skeinforge_utilities.html"><font color="#ffffff">skeinforge_utilities</font></a>.vector3</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/skeinforge_utilities/vector3.py">/home/enrique/Desktop/backup/babbleold/script/reprap/pyRepRap/skeinforge_tools/skeinforge_utilities/vector3.py</a></font></td></tr></table> + <p><tt>Vec3 is a three dimensional vector class.<br> + <br> +Below are examples of <a href="#Vector3">Vector3</a> use.<br> + <br> +>>> from vector3 import <a href="#Vector3">Vector3</a><br> +>>> origin = <a href="#Vector3">Vector3</a>()<br> +>>> origin<br> +0.0, 0.0, 0.0<br> +>>> pythagoras = <a href="#Vector3">Vector3</a>( 3, 4, 0 )<br> +>>> pythagoras<br> +3.0, 4.0, 0.0<br> +>>> pythagoras.magnitude()<br> +5.0<br> +>>> pythagoras.magnitudeSquared()<br> +25<br> +>>> triplePythagoras = pythagoras * 3.0<br> +>>> triplePythagoras<br> +9.0, 12.0, 0.0<br> +>>> plane = pythagoras.dropAxis( 2 )<br> +>>> plane<br> +(3+4j)</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> +</td><td width="25%" valign=top><a href="math.html">math</a><br> +</td><td width="25%" valign=top><a href="operator.html">operator</a><br> +</td><td width="25%" valign=top></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.skeinforge_utilities.vector3.html#Vector3">Vector3</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="Vector3">class <strong>Vector3</strong></a></font></td></tr> + +<tr bgcolor="#ffc8d8"><td rowspan=2><tt> </tt></td> +<td colspan=2><tt>A three dimensional vector class.<br> </tt></td></tr> +<tr><td> </td> +<td width="100%">Methods defined here:<br> +<dl><dt><a name="Vector3-__abs__"><strong>__abs__</strong></a>(self)</dt><dd><tt>Get the magnitude of the <a href="#Vector3">Vector3</a>.</tt></dd></dl> + +<dl><dt><a name="Vector3-__add__"><strong>__add__</strong></a>(self, other)</dt><dd><tt>Get the sum of this <a href="#Vector3">Vector3</a> and other one.</tt></dd></dl> + +<dl><dt><a name="Vector3-__copy__"><strong>__copy__</strong></a>(self)</dt><dd><tt>Get the copy of this <a href="#Vector3">Vector3</a>.</tt></dd></dl> + +<dl><dt><a name="Vector3-__div__"><strong>__div__</strong></a>(self, other)</dt><dd><tt>Get a new <a href="#Vector3">Vector3</a> by dividing each component of this one.</tt></dd></dl> + +<dl><dt><a name="Vector3-__eq__"><strong>__eq__</strong></a>(self, other)</dt><dd><tt>Determine whether this vector is identical to other one.</tt></dd></dl> + +<dl><dt><a name="Vector3-__floordiv__"><strong>__floordiv__</strong></a>(self, other)</dt><dd><tt>Get a new <a href="#Vector3">Vector3</a> by floor dividing each component of this one.</tt></dd></dl> + +<dl><dt><a name="Vector3-__hash__"><strong>__hash__</strong></a>(self)</dt><dd><tt>Determine whether this vector is identical to other one.</tt></dd></dl> + +<dl><dt><a name="Vector3-__iadd__"><strong>__iadd__</strong></a>(self, other)</dt><dd><tt>Add other <a href="#Vector3">Vector3</a> to this one.</tt></dd></dl> + +<dl><dt><a name="Vector3-__idiv__"><strong>__idiv__</strong></a>(self, other)</dt><dd><tt>Divide each component of this <a href="#Vector3">Vector3</a>.</tt></dd></dl> + +<dl><dt><a name="Vector3-__ifloordiv__"><strong>__ifloordiv__</strong></a>(self, other)</dt><dd><tt>Floor divide each component of this <a href="#Vector3">Vector3</a>.</tt></dd></dl> + +<dl><dt><a name="Vector3-__imul__"><strong>__imul__</strong></a>(self, other)</dt><dd><tt>Multiply each component of this <a href="#Vector3">Vector3</a>.</tt></dd></dl> + +<dl><dt><a name="Vector3-__init__"><strong>__init__</strong></a>(self, x<font color="#909090">=0.0</font>, y<font color="#909090">=0.0</font>, z<font color="#909090">=0.0</font>)</dt></dl> + +<dl><dt><a name="Vector3-__isub__"><strong>__isub__</strong></a>(self, other)</dt><dd><tt>Subtract other <a href="#Vector3">Vector3</a> from this one.</tt></dd></dl> + +<dl><dt><a name="Vector3-__itruediv__"><strong>__itruediv__</strong></a>(self, other)</dt><dd><tt>True divide each component of this <a href="#Vector3">Vector3</a>.</tt></dd></dl> + +<dl><dt><a name="Vector3-__mul__"><strong>__mul__</strong></a>(self, other)</dt><dd><tt>Get a new <a href="#Vector3">Vector3</a> by multiplying each component of this one.</tt></dd></dl> + +<dl><dt><a name="Vector3-__ne__"><strong>__ne__</strong></a>(self, other)</dt><dd><tt>Determine whether this vector is not identical to other one.</tt></dd></dl> + +<dl><dt><a name="Vector3-__neg__"><strong>__neg__</strong></a>(self)</dt></dl> + +<dl><dt><a name="Vector3-__nonzero__"><strong>__nonzero__</strong></a>(self)</dt></dl> + +<dl><dt><a name="Vector3-__pos__"><strong>__pos__</strong></a> = <a href="#Vector3-__copy__">__copy__</a>(self)</dt></dl> + +<dl><dt><a name="Vector3-__rdiv__"><strong>__rdiv__</strong></a>(self, other)</dt><dd><tt>Get a new <a href="#Vector3">Vector3</a> by dividing each component of this one.</tt></dd></dl> + +<dl><dt><a name="Vector3-__repr__"><strong>__repr__</strong></a>(self)</dt><dd><tt>Get the string representation of this <a href="#Vector3">Vector3</a>.</tt></dd></dl> + +<dl><dt><a name="Vector3-__rfloordiv__"><strong>__rfloordiv__</strong></a>(self, other)</dt><dd><tt>Get a new <a href="#Vector3">Vector3</a> by floor dividing each component of this one.</tt></dd></dl> + +<dl><dt><a name="Vector3-__rmul__"><strong>__rmul__</strong></a>(self, other)</dt><dd><tt>Get a new <a href="#Vector3">Vector3</a> by multiplying each component of this one.</tt></dd></dl> + +<dl><dt><a name="Vector3-__rtruediv__"><strong>__rtruediv__</strong></a>(self, other)</dt><dd><tt>Get a new <a href="#Vector3">Vector3</a> by true dividing each component of this one.</tt></dd></dl> + +<dl><dt><a name="Vector3-__sub__"><strong>__sub__</strong></a>(self, other)</dt><dd><tt>Get the difference between the <a href="#Vector3">Vector3</a> and other one.</tt></dd></dl> + +<dl><dt><a name="Vector3-__truediv__"><strong>__truediv__</strong></a>(self, other)</dt><dd><tt>Get a new <a href="#Vector3">Vector3</a> by true dividing each component of this one.</tt></dd></dl> + +<dl><dt><a name="Vector3-copy"><strong>copy</strong></a> = <a href="#Vector3-__copy__">__copy__</a>(self)</dt></dl> + +<dl><dt><a name="Vector3-cross"><strong>cross</strong></a>(self, other)</dt><dd><tt>Calculate the cross product of this vector with other one.</tt></dd></dl> + +<dl><dt><a name="Vector3-distance"><strong>distance</strong></a>(self, other)</dt><dd><tt>Get the Euclidean distance between this vector and other one.</tt></dd></dl> + +<dl><dt><a name="Vector3-distanceSquared"><strong>distanceSquared</strong></a>(self, other)</dt><dd><tt>Get the square of the Euclidean distance between this vector and other one.</tt></dd></dl> + +<dl><dt><a name="Vector3-dot"><strong>dot</strong></a>(self, other)</dt><dd><tt>Calculate the dot product of this vector with other one.</tt></dd></dl> + +<dl><dt><a name="Vector3-dropAxis"><strong>dropAxis</strong></a>(self, which)</dt><dd><tt>Get a complex by removing one axis of this one.<br> + <br> +Keyword arguments:<br> +which -- the axis to drop (0=X, 1=Y, 2=Z)</tt></dd></dl> + +<dl><dt><a name="Vector3-getNormalized"><strong>getNormalized</strong></a>(self, other)</dt><dd><tt>Get the normalized <a href="#Vector3">Vector3</a>.</tt></dd></dl> + +<dl><dt><a name="Vector3-magnitude"><strong>magnitude</strong></a> = <a href="#Vector3-__abs__">__abs__</a>(self)</dt></dl> + +<dl><dt><a name="Vector3-magnitudeSquared"><strong>magnitudeSquared</strong></a>(self)</dt><dd><tt>Get the square of the magnitude of the <a href="#Vector3">Vector3</a>.</tt></dd></dl> + +<dl><dt><a name="Vector3-normalize"><strong>normalize</strong></a>(self)</dt><dd><tt>Scale each component of this <a href="#Vector3">Vector3</a> so that it has a magnitude of 1. If this <a href="#Vector3">Vector3</a> has a magnitude of 0, this method has no effect.</tt></dd></dl> + +<dl><dt><a name="Vector3-reflect"><strong>reflect</strong></a>(self, normal)</dt><dd><tt>Reflect the <a href="#Vector3">Vector3</a> across the normal, which is assumed to be normalized.</tt></dd></dl> + +<dl><dt><a name="Vector3-setToVec3"><strong>setToVec3</strong></a>(self, other)</dt><dd><tt>Set this <a href="#Vector3">Vector3</a> to be identical to other one.</tt></dd></dl> + +<dl><dt><a name="Vector3-setToXYZ"><strong>setToXYZ</strong></a>(self, x, y, z)</dt><dd><tt>Set the x, y, and z components of this <a href="#Vector3">Vector3</a>.</tt></dd></dl> + +</td></tr></table></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> = 'Nophead <http://forums.reprap.org/profile.php?12,28><font color="#c040c0">\n</font>Art of Illusion <http://www.artofillusion.org/>'<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><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%">Nophead <<a href="http://forums.reprap.org/profile.php?12,28">http://forums.reprap.org/profile.php?12,28</a>><br> +Art of Illusion <<a href="http://www.artofillusion.org/">http://www.artofillusion.org/</a>></td></tr></table> +</body></html>
\ No newline at end of file diff --git a/trunk/reprap/miscellaneous/python-beanshell-scripts/documentation/skeinforge_tools.slice_shape.html b/trunk/reprap/miscellaneous/python-beanshell-scripts/documentation/skeinforge_tools.slice_shape.html deleted file mode 100644 index d945e601..00000000 --- a/trunk/reprap/miscellaneous/python-beanshell-scripts/documentation/skeinforge_tools.slice_shape.html +++ /dev/null @@ -1,237 +0,0 @@ - -<!doctype html PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN"> -<html><head><title>Python: module skeinforge_tools.slice_shape</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>.slice_shape</strong></big></big> ($Date: 2008/02/05 $)</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/slice_shape.py">/home/enrique/Desktop/backup/babbleold/script/reprap/pyRepRap/skeinforge_tools/slice_shape.py</a></font></td></tr></table> - <p><tt>Slice shape is a script to slice a GNU Triangulated Surface file.<br> - <br> -Slice slices a GNU Triangulated Surface file into gcode extrusion layers. The 'Extrusion Diameter' is the diameter of the extrusion at the<br> -default extruder speed, this is the most important slice preference. The 'Extrusion Height over Diameter' is the ratio of the extrusion<br> -height over the extrusion diameter. The 'Extrusion Width over Diameter' ratio is the ratio of the extrusion width over the extrusion<br> -diameter. A ratio of one means the extrusion is a circle, a typical ratio of 1.5 means the extrusion is a wide oval. These values should<br> -be measured from a test extrusion line.<br> - <br> -The extrusion fill density ratio that is printed to the console, ( it is not a parameter ) is the area of the extrusion diameter over the<br> -extrusion width over the extrusion height. Assuming the extrusion diameter is correct, a high value means the filament will be packed<br> -tightly, and the object will be almost as dense as the filament. If the value is too high, there could be too little room for the filament,<br> -and the extruder will end up plowing through the extra filament. A low value means the filaments will be far away from each other, the<br> -object will be leaky and light. The value with the default extrusion preferences is around 0.82.<br> - <br> -Rarely changed preferences are Import Coarseness, Mesh Type, Infill Bridge Width Over Thickness & Infill in Direction<br> -of Bridges. When the triangle mesh has holes in it, slice switches over to a slow algorithm that spans gaps in the mesh. The higher the<br> -import coarseness, the wider the gaps in the mesh it will span. An import coarseness of one means it will span gaps the width of the<br> -extrusion. When the Mesh Type preference is correct, the mesh will be accurately sliced, and if a hole is found, slice will switch over to<br> -the algorithm that spans gaps. If the Mesh Type preference is Unproven, slice will use the gap spanning algorithm from the start. The<br> -problem with the gap spanning algothm is that it will span gaps, even if there actually is a gap in the model. Infill bridge width<br> -over thickness ratio is the ratio of the extrusion width over the layer thickness on a bridge layer. If the infill in direction of bridges<br> -preference is chosen, the infill will be in the direction of bridges across gaps, so that the fill will be able to span a bridge easier.<br> - <br> -If the "Start at Home" preference is selected, the G28 gcode will be added at the beginning of the file.<br> - <br> -When slice is generating the code, if there is a file start.txt, it will add that to the very beginning of the gcode. After it has added some<br> -initialization code and just before it adds the extrusion gcode, it will add the file endofthebeginning.txt if it exists. At the very end, it will<br> -add the file end.txt if it exists. Slice does not care if the text file names are capitalized, but some file systems do not handle file name<br> -cases properly, so to be on the safe side you should give them lower case names. It will first look for the file in the same directory as<br> -slice, if it does not find it it will look in ~/.skeinforge/gcode_scripts. To run slice, in a shell type:<br> -> python slice.py<br> - <br> -The following examples slice the GNU Triangulated Surface file Hollow Square.gts. The examples are run in a terminal in the folder which<br> -contains Hollow Square.gts and slice.py. The preferences can be set in the dialog or by changing the preferences file 'slice.csv' with a text editor<br> -or a spreadsheet program set to separate tabs.<br> - <br> - <br> -> python slice.py<br> -This brings up the dialog, after clicking 'Slice', the following is printed:<br> -File Hollow Square.gcode is being sliced.<br> -The sliced file is saved as Hollow Square_slice.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 slice<br> ->>> slice.<a href="#-main">main</a>()<br> -File Hollow Square.gts is being sliced.<br> -The sliced file is saved as Hollow Square_slice.gcode<br> -It took 3 seconds to slice the file.<br> - <br> - <br> ->>> slice.<a href="#-writeOutput">writeOutput</a>()<br> -File Hollow Square.gcode is being sliced.<br> -The sliced file is saved as Hollow Square_slice.gcode<br> -It took 3 seconds to slice the file.<br> - <br> - <br> ->>> slice.<a href="#-getSliceGcode">getSliceGcode</a>("<br> -54 162 108 Number of Vertices,Number of Edges,Number of Faces<br> --5.800000000000001 5.341893939393939 4.017841892579603 Vertex Coordinates XYZ<br> -5.800000000000001 5.341893939393939 4.017841892579603<br> -..<br> -many lines of GNU Triangulated Surface vertices, edges and faces<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="cmath.html">cmath</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.import_translator.html">skeinforge_tools.import_translator</a><br> -<a href="skeinforge_tools.skeinforge_utilities.intercircle.html">skeinforge_tools.skeinforge_utilities.intercircle</a><br> -</td><td width="25%" valign=top><a href="math.html">math</a><br> -<a href="os.html">os</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> -</td><td width="25%" valign=top><a href="sys.html">sys</a><br> -<a href="time.html">time</a><br> -<a href="skeinforge_tools.skeinforge_utilities.triangle_mesh.html">skeinforge_tools.skeinforge_utilities.triangle_mesh</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.slice_shape.html#LoopArea">LoopArea</a> -</font></dt><dt><font face="helvetica, arial"><a href="skeinforge_tools.slice_shape.html#SlicePreferences">SlicePreferences</a> -</font></dt><dt><font face="helvetica, arial"><a href="skeinforge_tools.slice_shape.html#SliceSkein">SliceSkein</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="LoopArea">class <strong>LoopArea</strong></a></font></td></tr> - -<tr bgcolor="#ffc8d8"><td rowspan=2><tt> </tt></td> -<td colspan=2><tt>Complex loop with an area.<br> </tt></td></tr> -<tr><td> </td> -<td width="100%">Methods defined here:<br> -<dl><dt><a name="LoopArea-__init__"><strong>__init__</strong></a>(self, loop)</dt></dl> - -<dl><dt><a name="LoopArea-__repr__"><strong>__repr__</strong></a>(self)</dt><dd><tt>Get the string representation of this flat path.</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="SlicePreferences">class <strong>SlicePreferences</strong></a></font></td></tr> - -<tr bgcolor="#ffc8d8"><td rowspan=2><tt> </tt></td> -<td colspan=2><tt>A class to handle the slice preferences.<br> </tt></td></tr> -<tr><td> </td> -<td width="100%">Methods defined here:<br> -<dl><dt><a name="SlicePreferences-__init__"><strong>__init__</strong></a>(self)</dt><dd><tt>Set the default preferences, execute title & preferences filename.</tt></dd></dl> - -<dl><dt><a name="SlicePreferences-execute"><strong>execute</strong></a>(self)</dt><dd><tt>Slice 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="SliceSkein">class <strong>SliceSkein</strong></a></font></td></tr> - -<tr bgcolor="#ffc8d8"><td rowspan=2><tt> </tt></td> -<td colspan=2><tt>A class to slice a GNU Triangulated Surface.<br> </tt></td></tr> -<tr><td> </td> -<td width="100%">Methods defined here:<br> -<dl><dt><a name="SliceSkein-__init__"><strong>__init__</strong></a>(self)</dt></dl> - -<dl><dt><a name="SliceSkein-addFromFile"><strong>addFromFile</strong></a>(self, filename)</dt><dd><tt>Add lines of text from the filename.</tt></dd></dl> - -<dl><dt><a name="SliceSkein-addFromUpperLowerFile"><strong>addFromUpperLowerFile</strong></a>(self, filename)</dt><dd><tt>Add lines of text from the filename or the lowercase filename, if there is no file by the original filename in the directory.</tt></dd></dl> - -<dl><dt><a name="SliceSkein-addGcodeFromPerimeterPaths"><strong>addGcodeFromPerimeterPaths</strong></a>(self, isIntersectingSelf, loop, loopLists, radius, z)</dt><dd><tt>Add the perimeter paths to the output.</tt></dd></dl> - -<dl><dt><a name="SliceSkein-addGcodeFromRemainingLoop"><strong>addGcodeFromRemainingLoop</strong></a>(self, loop, loopLists, radius, z)</dt><dd><tt>Add the remainder of the loop which does not overlap the alreadyFilledArounds loops.</tt></dd></dl> - -<dl><dt><a name="SliceSkein-addGcodeFromThreadZ"><strong>addGcodeFromThreadZ</strong></a>(self, thread, z)</dt><dd><tt>Add a thread to the output.</tt></dd></dl> - -<dl><dt><a name="SliceSkein-addGcodeMovementZ"><strong>addGcodeMovementZ</strong></a>(self, point, z)</dt><dd><tt>Add a movement to the output.</tt></dd></dl> - -<dl><dt><a name="SliceSkein-addInitializationToOutput"><strong>addInitializationToOutput</strong></a>(self)</dt><dd><tt>Add initialization gcode to the output.</tt></dd></dl> - -<dl><dt><a name="SliceSkein-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="SliceSkein-addShutdownToOutput"><strong>addShutdownToOutput</strong></a>(self)</dt><dd><tt>Add shutdown gcode to the output.</tt></dd></dl> - -<dl><dt><a name="SliceSkein-addToZoneArray"><strong>addToZoneArray</strong></a>(self, point, zoneArray, z)</dt><dd><tt>Add a height to the zone array.</tt></dd></dl> - -<dl><dt><a name="SliceSkein-getBridgeDirection"><strong>getBridgeDirection</strong></a>(self, layerLoops)</dt><dd><tt>Get span direction for the majority of the overhanging extrusion perimeter, if any.</tt></dd></dl> - -<dl><dt><a name="SliceSkein-getExtrudateLoopComplexes"><strong>getExtrudateLoopComplexes</strong></a>(self, halfWidth, loop)</dt><dd><tt>Get the inset extrudate loops from the loop.</tt></dd></dl> - -<dl><dt><a name="SliceSkein-getLoopsFromMesh"><strong>getLoopsFromMesh</strong></a>(self, z)</dt><dd><tt>Get loops from a slice of a mesh.</tt></dd></dl> - -<dl><dt><a name="SliceSkein-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="SliceSkein-getZAddExtruderPaths"><strong>getZAddExtruderPaths</strong></a>(self, z)</dt><dd><tt>Get next z and add extruder loops.</tt></dd></dl> - -<dl><dt><a name="SliceSkein-parseTriangleMesh"><strong>parseTriangleMesh</strong></a>(self, slicePreferences, triangleMesh)</dt><dd><tt>Parse gnu triangulated surface text and store the sliced gcode.</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="-addAlreadyFilledArounds"><strong>addAlreadyFilledArounds</strong></a>(alreadyFilledArounds, loop, radius)</dt><dd><tt>Add already filled loops around loop to alreadyFilledArounds.</tt></dd></dl> - <dl><dt><a name="-addEdgePair"><strong>addEdgePair</strong></a>(edgePairTable, edges, faceEdgeIndex, remainingEdgeIndex, remainingEdgeTable)</dt><dd><tt>Add edge pair to the edge pair table.</tt></dd></dl> - <dl><dt><a name="-addPointComplexesAtZ"><strong>addPointComplexesAtZ</strong></a>(edgePair, pointComplexes, radius, vertices, z)</dt><dd><tt>Add point complexes on the segment between the edge intersections with z.</tt></dd></dl> - <dl><dt><a name="-addSegmentOutlineComplex"><strong>addSegmentOutlineComplex</strong></a>(isThick, outlines, pointBegin, pointEnd, width)</dt><dd><tt>Add a diamond or hexagonal outline for a line segment.</tt></dd></dl> - <dl><dt><a name="-compareArea"><strong>compareArea</strong></a>(loopArea, otherLoopArea)</dt><dd><tt>Get comparison in order to sort loop areas in descending order of area.</tt></dd></dl> - <dl><dt><a name="-getCommonVertexIndex"><strong>getCommonVertexIndex</strong></a>(edgeFirst, edgeSecond)</dt><dd><tt>Get the vertex index that both edges have in common.</tt></dd></dl> - <dl><dt><a name="-getDoubledRoundZ"><strong>getDoubledRoundZ</strong></a>(overhangingSegment, segmentRoundZ)</dt><dd><tt>Get doubled plane angle around z of the overhanging segment.</tt></dd></dl> - <dl><dt><a name="-getLoopsFromCorrectMesh"><strong>getLoopsFromCorrectMesh</strong></a>(edges, faces, vertices, z)</dt><dd><tt>Get loops from a slice of a correct mesh.</tt></dd></dl> - <dl><dt><a name="-getLoopsFromUnprovenMesh"><strong>getLoopsFromUnprovenMesh</strong></a>(edges, extrusionWidth, faces, vertices, slicePreferences, z)</dt><dd><tt>Get loops from a slice of an unproven mesh.</tt></dd></dl> - <dl><dt><a name="-getLowestZoneIndex"><strong>getLowestZoneIndex</strong></a>(zoneArray, z)</dt><dd><tt>Get the lowest zone index.</tt></dd></dl> - <dl><dt><a name="-getNextEdgeIndexAroundZ"><strong>getNextEdgeIndexAroundZ</strong></a>(edge, faces, remainingEdgeTable)</dt><dd><tt>Get the next edge index in the mesh slice.</tt></dd></dl> - <dl><dt><a name="-getOverhangDirection"><strong>getOverhangDirection</strong></a>(belowOutsetLoops, segmentBegin, segmentEnd)</dt><dd><tt>Add to span direction from the endpoint segments which overhang the layer below.</tt></dd></dl> - <dl><dt><a name="-getPathComplex"><strong>getPathComplex</strong></a>(edges, pathIndexes, loop, z)</dt><dd><tt>Get the path from the edge intersections.</tt></dd></dl> - <dl><dt><a name="-getRemainingEdgeTable"><strong>getRemainingEdgeTable</strong></a>(edges, vertices, z)</dt><dd><tt>Get the remaining edge hashtable.</tt></dd></dl> - <dl><dt><a name="-getSegmentsFromPoints"><strong>getSegmentsFromPoints</strong></a>(loopLists, pointBegin, pointEnd)</dt><dd><tt>Get endpoint segments from the beginning and end of a line segment.</tt></dd></dl> - <dl><dt><a name="-getSharedFace"><strong>getSharedFace</strong></a>(firstEdge, faces, secondEdge)</dt><dd><tt>Get the face which is shared by two edges.</tt></dd></dl> - <dl><dt><a name="-getSliceGcode"><strong>getSliceGcode</strong></a>(filename, slicePreferences<font color="#909090">=None</font>)</dt><dd><tt>Slice a shape file.</tt></dd></dl> - <dl><dt><a name="-getSliceIntersectionComplexFromEdge"><strong>getSliceIntersectionComplexFromEdge</strong></a>(edge, vertices, z)</dt><dd><tt>Get the complex where the slice intersects the edge.</tt></dd></dl> - <dl><dt><a name="-isCloseToLast"><strong>isCloseToLast</strong></a>(paths, point, radius)</dt><dd><tt>Determine if the point is close to the last point of the last path.</tt></dd></dl> - <dl><dt><a name="-isIntersectingItself"><strong>isIntersectingItself</strong></a>(loop, width)</dt><dd><tt>Determine if the loop is intersecting itself.</tt></dd></dl> - <dl><dt><a name="-isIntersectingWithinList"><strong>isIntersectingWithinList</strong></a>(loop, loopList)</dt><dd><tt>Determine if the loop is intersecting or is within the loop list.</tt></dd></dl> - <dl><dt><a name="-isIntersectingWithinLists"><strong>isIntersectingWithinLists</strong></a>(loop, loopLists)</dt><dd><tt>Determine if the loop is intersecting or is within the loop lists.</tt></dd></dl> - <dl><dt><a name="-isPathAdded"><strong>isPathAdded</strong></a>(edges, faces, loopComplexes, remainingEdgeTable, vertices, z)</dt><dd><tt>Get the path indexes around a triangle mesh slice and add the path to the flat loops.</tt></dd></dl> - <dl><dt><a name="-isZInEdge"><strong>isZInEdge</strong></a>(edge, vertices, z)</dt><dd><tt>Determine if z is inside the edge.</tt></dd></dl> - <dl><dt><a name="-main"><strong>main</strong></a>()</dt><dd><tt>Display the slice dialog.</tt></dd></dl> - <dl><dt><a name="-writeOutput"><strong>writeOutput</strong></a>(filename<font color="#909090">=''</font>)</dt><dd><tt>Slice a GNU Triangulated Surface file. If no filename is specified, slice the first GNU Triangulated Surface 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/02/05 $'<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>
\ No newline at end of file diff --git a/trunk/reprap/miscellaneous/python-beanshell-scripts/documentation/skeinforge_tools.speed.html b/trunk/reprap/miscellaneous/python-beanshell-scripts/documentation/skeinforge_tools.speed.html index a8146361..379bc138 100644 --- a/trunk/reprap/miscellaneous/python-beanshell-scripts/documentation/skeinforge_tools.speed.html +++ b/trunk/reprap/miscellaneous/python-beanshell-scripts/documentation/skeinforge_tools.speed.html @@ -23,8 +23,20 @@ In the "Flowrate Choice" radio button group, output. If "Metric" is selected, the flowrate in cubic millimeters per second will be added to the output. If "PWM Setting" is<br> selected, the value in the "Flowrate PWM Setting" field will be added to the output.<br> <br> -The following examples speed the files Hollow Square.gcode & Hollow Square.gts. The examples are run in a terminal in the<br> -folder which contains Hollow Square.gcode, Hollow Square.gts and speed.py. The speed function will speed if "Activate<br> +The 'Perimeter Feedrate over Operating Feedrate' is the ratio of the feedrate of the perimeter over the feedrate of the infill. With<br> +the default of 1.0, the perimeter feedrate will be the same as the infill feedrate. The 'Perimeter Flowrate over Operating Flowrate'<br> +is the ratio of the flowrate of the perimeter over the flowrate of the infill. With the default of 1.0, the perimeter flow rate will be<br> +the same as the infill flow rate. To have higher build quality on the outside at the expense of slower build speed, a typical<br> +setting for the 'Perimeter Feedrate over Operating Feedrate' would be 0.5. To go along with that, if you are using a speed<br> +controlled extruder, the 'Perimeter Flowrate over Operating Flowrate' should also be 0.5. If you are using Pulse Width Modulation<br> +to control the speed, then you'll probably need a slightly higher ratio because there is a minimum voltage 'Flowrate PWM Setting'<br> +required for the extruder motor to turn. The flow rate PWM ratio would be determined by trial and error, with the first trial being:<br> +Perimeter Flowrate over Operating Flowrate ~<br> +Perimeter Feedrate over Operating Feedrate * ( Flowrate PWM Setting - Minimum Flowrate PWM Setting )<br> ++ Minimum Flowrate PWM Setting<br> + <br> +The following examples speed 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 speed.py. The speed function will speed if "Activate<br> Speed" is true, which can be set in the dialog or by changing the preferences file 'speed.csv' with a text editor or a spreadsheet<br> program set to separate tabs. The functions writeOutput and getSpeedChainGcode check to see if the text has been speeded,<br> if not they call getMultiplyChainGcode in multiply.py to get multiplied gcode; once they have the multiplied text, then they<br> @@ -33,8 +45,8 @@ speed.<br> <br> > python speed.py<br> This brings up the dialog, after clicking 'Speed', the following is printed:<br> -File Hollow Square.gts is being chain speeded.<br> -The speeded file is saved as Hollow Square_speed.gcode<br> +File Screw Holder Bottom.stl is being chain speeded.<br> +The speeded file is saved as Screw Holder Bottom_speed.gcode<br> <br> <br> >python<br> @@ -47,13 +59,13 @@ This brings up the speed dialog.<br> <br> <br> >>> speed.<a href="#-writeOutput">writeOutput</a>()<br> -Hollow Square.gts<br> -File Hollow Square.gts is being chain speeded.<br> -The speeded file is saved as Hollow Square_speed.gcode<br> +Screw Holder Bottom.stl<br> +File Screw Holder Bottom.stl is being chain speeded.<br> +The speeded file is saved as Screw Holder Bottom_speed.gcode<br> <br> <br> >>> speed.<a href="#-getSpeedGcode">getSpeedGcode</a>("<br> -( GCode generated by May 8, 2008 slice.py )<br> +( GCode generated by May 8, 2008 carve.py )<br> ( Extruder Initialization )<br> ..<br> many lines of gcode<br> @@ -62,7 +74,7 @@ many lines of gcode<br> <br> <br> >>> speed.<a href="#-getSpeedChainGcode">getSpeedChainGcode</a>("<br> -( GCode generated by May 8, 2008 slice.py )<br> +( GCode generated by May 8, 2008 carve.py )<br> ( Extruder Initialization )<br> ..<br> many lines of gcode<br> @@ -80,8 +92,8 @@ many lines of gcode<br> <a href="cStringIO.html">cStringIO</a><br> <a href="skeinforge_tools.skeinforge_utilities.euclidean.html">skeinforge_tools.skeinforge_utilities.euclidean</a><br> </td><td width="25%" valign=top><a href="skeinforge_tools.skeinforge_utilities.gcodec.html">skeinforge_tools.skeinforge_utilities.gcodec</a><br> -<a href="skeinforge_tools.import_translator.html">skeinforge_tools.import_translator</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> <a href="skeinforge_tools.material.html">skeinforge_tools.material</a><br> </td><td width="25%" valign=top><a href="math.html">math</a><br> <a href="skeinforge_tools.multiply.html">skeinforge_tools.multiply</a><br> @@ -110,7 +122,7 @@ many lines of gcode<br> <td colspan=2><tt>A class to handle the speed preferences.<br> </tt></td></tr> <tr><td> </td> <td width="100%">Methods defined here:<br> -<dl><dt><a name="SpeedPreferences-__init__"><strong>__init__</strong></a>(self)</dt><dd><tt>Set the default preferences, execute title & preferences filename.</tt></dd></dl> +<dl><dt><a name="SpeedPreferences-__init__"><strong>__init__</strong></a>(self)</dt><dd><tt>Set the default preferences, execute title & preferences fileName.</tt></dd></dl> <dl><dt><a name="SpeedPreferences-execute"><strong>execute</strong></a>(self)</dt><dd><tt>Speed button has been clicked.</tt></dd></dl> @@ -126,10 +138,12 @@ many lines of gcode<br> <td width="100%">Methods defined here:<br> <dl><dt><a name="SpeedSkein-__init__"><strong>__init__</strong></a>(self)</dt></dl> -<dl><dt><a name="SpeedSkein-addFlowrate"><strong>addFlowrate</strong></a>(self)</dt><dd><tt>Add flowrate line.</tt></dd></dl> +<dl><dt><a name="SpeedSkein-addFlowrateLine"><strong>addFlowrateLine</strong></a>(self, flowrateString)</dt><dd><tt>Add flowrate line.</tt></dd></dl> <dl><dt><a name="SpeedSkein-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="SpeedSkein-getFlowrateString"><strong>getFlowrateString</strong></a>(self)</dt><dd><tt>Get the flowrate string.</tt></dd></dl> + <dl><dt><a name="SpeedSkein-getGcodeFromFeedrateMovement"><strong>getGcodeFromFeedrateMovement</strong></a>(self, feedrateMinute, point)</dt><dd><tt>Get a gcode movement.</tt></dd></dl> <dl><dt><a name="SpeedSkein-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> @@ -149,11 +163,11 @@ many lines of gcode<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="-getSpeedChainGcode"><strong>getSpeedChainGcode</strong></a>(filename, gcodeText, speedPreferences<font color="#909090">=None</font>)</dt><dd><tt>Speed a gcode linear move text. Chain speed the gcode if it is not already speeded.</tt></dd></dl> +<td width="100%"><dl><dt><a name="-getSpeedChainGcode"><strong>getSpeedChainGcode</strong></a>(fileName, gcodeText, speedPreferences<font color="#909090">=None</font>)</dt><dd><tt>Speed a gcode linear move text. Chain speed the gcode if it is not already speeded.</tt></dd></dl> <dl><dt><a name="-getSpeedGcode"><strong>getSpeedGcode</strong></a>(gcodeText, speedPreferences<font color="#909090">=None</font>)</dt><dd><tt>Speed a gcode linear move text.</tt></dd></dl> <dl><dt><a name="-main"><strong>main</strong></a>()</dt><dd><tt>Display the speed dialog.</tt></dd></dl> - <dl><dt><a name="-writeOutput"><strong>writeOutput</strong></a>(filename<font color="#909090">=''</font>)</dt><dd><tt>Speed a gcode linear move file. Chain speed the gcode if it is not already speeded.<br> -If no filename is specified, speed the first unmodified gcode file in this folder.</tt></dd></dl> + <dl><dt><a name="-writeOutput"><strong>writeOutput</strong></a>(fileName<font color="#909090">=''</font>)</dt><dd><tt>Speed a gcode linear move file. Chain speed the gcode if it is not already speeded.<br> +If no fileName is specified, speed 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"> diff --git a/trunk/reprap/miscellaneous/python-beanshell-scripts/documentation/skeinforge_tools.stretch.html b/trunk/reprap/miscellaneous/python-beanshell-scripts/documentation/skeinforge_tools.stretch.html index dacb7ea9..d98ce281 100644 --- a/trunk/reprap/miscellaneous/python-beanshell-scripts/documentation/skeinforge_tools.stretch.html +++ b/trunk/reprap/miscellaneous/python-beanshell-scripts/documentation/skeinforge_tools.stretch.html @@ -30,21 +30,21 @@ similar but different from the algorithm, so to eliminate the inaccuracies caused by contraction, but it should reduce them. To run stretch, in a shell type:<br> > python stretch.py<br> <br> -The following examples stretch the files Hollow Square.gcode & Hollow Square.gts. The examples are run in a terminal in the<br> -folder which contains Hollow Square.gcode, Hollow Square.gts and stretch.py. The functions writeOutput and<br> +The following examples stretch 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 stretch.py. The functions writeOutput and<br> getStretchChainGcode check to see if the text has been stretched, if not they call the getCoolChainGcode in cool.py to cool the<br> text; once they have the cooled text, then they stretch.<br> <br> <br> -> python stretch.py Hollow Square.gts<br> -File Hollow Square.gts is being chain stretched.<br> -The stretched file is saved as Hollow Square_stretch.gcode<br> +> python stretch.py Screw Holder Bottom.stl<br> +File Screw Holder Bottom.stl is being chain stretched.<br> +The stretched file is saved as Screw Holder Bottom_stretch.gcode<br> <br> <br> > python stretch.py<br> This brings up the dialog, after clicking 'Stretch', the following is printed:<br> -File Hollow Square.gts is being chain stretched.<br> -The stretched file is saved as Hollow Square_stretch.gcode<br> +File Screw Holder Bottom.stl is being chain stretched.<br> +The stretched file is saved as Screw Holder Bottom_stretch.gcode<br> <br> <br> > python<br> @@ -57,13 +57,13 @@ This brings up the stretch dialog.<br> <br> <br> >>> stretch.<a href="#-writeOutput">writeOutput</a>()<br> -Hollow Square.gts<br> -File Hollow Square.gts is being chain stretched.<br> -The stretched file is saved as Hollow Square_stretch.gcode<br> +Screw Holder Bottom.stl<br> +File Screw Holder Bottom.stl is being chain stretched.<br> +The stretched file is saved as Screw Holder Bottom_stretch.gcode<br> <br> <br> >>> stretch.<a href="#-getStretchGcode">getStretchGcode</a>("<br> -( GCode generated by May 8, 2008 slice.py )<br> +( GCode generated by May 8, 2008 carve.py )<br> ( Extruder Initialization )<br> ..<br> many lines of gcode<br> @@ -72,7 +72,7 @@ many lines of gcode<br> <br> <br> >>> stretch.<a href="#-getStretchChainGcode">getStretchChainGcode</a>("<br> -( GCode generated by May 8, 2008 slice.py )<br> +( GCode generated by May 8, 2008 carve.py )<br> ( Extruder Initialization )<br> ..<br> many lines of gcode<br> @@ -91,8 +91,8 @@ many lines of gcode<br> </td><td width="25%" valign=top><a href="skeinforge_tools.cool.html">skeinforge_tools.cool</a><br> <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> -</td><td width="25%" valign=top><a href="skeinforge_tools.import_translator.html">skeinforge_tools.import_translator</a><br> -<a href="skeinforge_tools.skeinforge_utilities.intercircle.html">skeinforge_tools.skeinforge_utilities.intercircle</a><br> +</td><td width="25%" valign=top><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> <a href="skeinforge_tools.polyfile.html">skeinforge_tools.polyfile</a><br> </td><td width="25%" valign=top><a href="skeinforge_tools.skeinforge_utilities.preferences.html">skeinforge_tools.skeinforge_utilities.preferences</a><br> <a href="sys.html">sys</a><br> @@ -154,7 +154,7 @@ many lines of gcode<br> <td colspan=2><tt>A class to handle the stretch preferences.<br> </tt></td></tr> <tr><td> </td> <td width="100%">Methods defined here:<br> -<dl><dt><a name="StretchPreferences-__init__"><strong>__init__</strong></a>(self)</dt><dd><tt>Set the default preferences, execute title & preferences filename.</tt></dd></dl> +<dl><dt><a name="StretchPreferences-__init__"><strong>__init__</strong></a>(self)</dt><dd><tt>Set the default preferences, execute title & preferences fileName.</tt></dd></dl> <dl><dt><a name="StretchPreferences-execute"><strong>execute</strong></a>(self)</dt><dd><tt>Stretch button has been clicked.</tt></dd></dl> @@ -170,7 +170,7 @@ many lines of gcode<br> <td width="100%">Methods defined here:<br> <dl><dt><a name="StretchSkein-__init__"><strong>__init__</strong></a>(self)</dt></dl> -<dl><dt><a name="StretchSkein-addAlongWayLine"><strong>addAlongWayLine</strong></a>(self, alongRatio, location)</dt><dd><tt>Add stretched gcode line, along the way from the old location to the location.</tt></dd></dl> +<dl><dt><a name="StretchSkein-addAlongWayLine"><strong>addAlongWayLine</strong></a>(self, alongWay, location)</dt><dd><tt>Add stretched gcode line, along the way from the location to the old location.</tt></dd></dl> <dl><dt><a name="StretchSkein-addLine"><strong>addLine</strong></a>(self, line)</dt><dd><tt>Add a line of text and a newline to the output.</tt></dd></dl> @@ -199,10 +199,10 @@ many lines of gcode<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="-getStretchChainGcode"><strong>getStretchChainGcode</strong></a>(filename, gcodeText, stretchPreferences<font color="#909090">=None</font>)</dt><dd><tt>Stretch a gcode linear move text. Chain stretch the gcode if it is not already stretched.</tt></dd></dl> +<td width="100%"><dl><dt><a name="-getStretchChainGcode"><strong>getStretchChainGcode</strong></a>(fileName, gcodeText, stretchPreferences<font color="#909090">=None</font>)</dt><dd><tt>Stretch a gcode linear move text. Chain stretch the gcode if it is not already stretched.</tt></dd></dl> <dl><dt><a name="-getStretchGcode"><strong>getStretchGcode</strong></a>(gcodeText, stretchPreferences<font color="#909090">=None</font>)</dt><dd><tt>Stretch 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 stretch dialog.</tt></dd></dl> - <dl><dt><a name="-writeOutput"><strong>writeOutput</strong></a>(filename<font color="#909090">=''</font>)</dt><dd><tt>Stretch a gcode linear move file. Chain stretch the gcode if it is not already stretched. If no filename is specified, stretch the first unmodified gcode file in this folder.</tt></dd></dl> + <dl><dt><a name="-writeOutput"><strong>writeOutput</strong></a>(fileName<font color="#909090">=''</font>)</dt><dd><tt>Stretch a gcode linear move file. Chain stretch the gcode if it is not already stretched. If no fileName is specified, stretch 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"> diff --git a/trunk/reprap/miscellaneous/python-beanshell-scripts/documentation/skeinforge_tools.tower.html b/trunk/reprap/miscellaneous/python-beanshell-scripts/documentation/skeinforge_tools.tower.html index f54b1c0e..0ccd6753 100644 --- a/trunk/reprap/miscellaneous/python-beanshell-scripts/documentation/skeinforge_tools.tower.html +++ b/trunk/reprap/miscellaneous/python-beanshell-scripts/documentation/skeinforge_tools.tower.html @@ -32,8 +32,8 @@ support material. It is best to not tow different than that of the other layers. The default preference is one. To run tower, in a shell type:<br> > python tower.py<br> <br> -The following examples tower the files Hollow Square.gcode & Hollow Square.gts. The examples are run in a terminal in the folder<br> -which contains Hollow Square.gcode, Hollow Square.gts and tower.py. The tower function will tower if 'Maximum Tower Layers' is<br> +The following examples tower the files Screw Holder Bottom.gcode & Screw Holder Bottom.stl. The examples are run in a terminal in the folder<br> +which contains Screw Holder Bottom.gcode, Screw Holder Bottom.stl and tower.py. The tower function will tower if 'Maximum Tower Layers' is<br> greater than zero, which can be set in the dialog or by changing the preferences file 'tower.csv' with a text editor or a spreadsheet<br> program set to separate tabs. The functions writeOutput and getTowerChainGcode check to see if the text has been towered,<br> if not they call the getRaftChainGcode in raft.py to raft the text; once they have the rafted text, then they tower. Pictures of<br> @@ -43,8 +43,8 @@ towering in action are available from the Met <br> > python tower.py<br> This brings up the dialog, after clicking 'Tower', the following is printed:<br> -File Hollow Square.gts is being chain towered.<br> -The towered file is saved as Hollow Square_tower.gcode<br> +File Screw Holder Bottom.stl is being chain towered.<br> +The towered file is saved as Screw Holder Bottom_tower.gcode<br> <br> <br> >python<br> @@ -57,13 +57,13 @@ This brings up the tower dialog.<br> <br> <br> >>> tower.<a href="#-writeOutput">writeOutput</a>()<br> -Hollow Square.gts<br> -File Hollow Square.gts is being chain towered.<br> -The towered file is saved as Hollow Square_tower.gcode<br> +Screw Holder Bottom.stl<br> +File Screw Holder Bottom.stl is being chain towered.<br> +The towered file is saved as Screw Holder Bottom_tower.gcode<br> <br> <br> >>> tower.<a href="#-getTowerGcode">getTowerGcode</a>("<br> -( GCode generated by May 8, 2008 slice.py )<br> +( GCode generated by May 8, 2008 carve.py )<br> ( Extruder Initialization )<br> ..<br> many lines of gcode<br> @@ -72,7 +72,7 @@ many lines of gcode<br> <br> <br> >>> tower.<a href="#-getTowerChainGcode">getTowerChainGcode</a>("<br> -( GCode generated by May 8, 2008 slice.py )<br> +( GCode generated by May 8, 2008 carve.py )<br> ( Extruder Initialization )<br> ..<br> many lines of gcode<br> @@ -90,8 +90,8 @@ many lines of gcode<br> <a href="cStringIO.html">cStringIO</a><br> <a href="skeinforge_tools.skeinforge_utilities.euclidean.html">skeinforge_tools.skeinforge_utilities.euclidean</a><br> </td><td width="25%" valign=top><a href="skeinforge_tools.skeinforge_utilities.gcodec.html">skeinforge_tools.skeinforge_utilities.gcodec</a><br> -<a href="skeinforge_tools.import_translator.html">skeinforge_tools.import_translator</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> <a href="math.html">math</a><br> </td><td width="25%" valign=top><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> @@ -134,7 +134,7 @@ many lines of gcode<br> <td colspan=2><tt>A class to handle the tower preferences.<br> </tt></td></tr> <tr><td> </td> <td width="100%">Methods defined here:<br> -<dl><dt><a name="TowerPreferences-__init__"><strong>__init__</strong></a>(self)</dt><dd><tt>Set the default preferences, execute title & preferences filename.</tt></dd></dl> +<dl><dt><a name="TowerPreferences-__init__"><strong>__init__</strong></a>(self)</dt><dd><tt>Set the default preferences, execute title & preferences fileName.</tt></dd></dl> <dl><dt><a name="TowerPreferences-execute"><strong>execute</strong></a>(self)</dt><dd><tt>Tower button has been clicked.</tt></dd></dl> @@ -152,9 +152,9 @@ many lines of gcode<br> <dl><dt><a name="TowerSkein-addEntireLayer"><strong>addEntireLayer</strong></a>(self, layerIndex)</dt><dd><tt>Add entire thread layer.</tt></dd></dl> -<dl><dt><a name="TowerSkein-addGcodeFromThread"><strong>addGcodeFromThread</strong></a>(self, thread)</dt><dd><tt>Add a gcode thread to the output.</tt></dd></dl> +<dl><dt><a name="TowerSkein-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="TowerSkein-addGcodeMovement"><strong>addGcodeMovement</strong></a>(self, point)</dt><dd><tt>Add a movement to the output.</tt></dd></dl> +<dl><dt><a name="TowerSkein-addGcodeMovementZ"><strong>addGcodeMovementZ</strong></a>(self, point, z)</dt><dd><tt>Add a movement to the output.</tt></dd></dl> <dl><dt><a name="TowerSkein-addIfTravel"><strong>addIfTravel</strong></a>(self, splitLine)</dt><dd><tt>Add travel move around loops if this the extruder is off.</tt></dd></dl> @@ -195,13 +195,13 @@ many lines of gcode<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="-getTowerChainGcode"><strong>getTowerChainGcode</strong></a>(filename, gcodeText, towerPreferences<font color="#909090">=None</font>)</dt><dd><tt>Tower a gcode linear move text. Chain tower the gcode if it is not already towered.</tt></dd></dl> +<td width="100%"><dl><dt><a name="-getTowerChainGcode"><strong>getTowerChainGcode</strong></a>(fileName, gcodeText, towerPreferences<font color="#909090">=None</font>)</dt><dd><tt>Tower a gcode linear move text. Chain tower the gcode if it is not already towered.</tt></dd></dl> <dl><dt><a name="-getTowerGcode"><strong>getTowerGcode</strong></a>(gcodeText, towerPreferences<font color="#909090">=None</font>)</dt><dd><tt>Tower 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 tower dialog.</tt></dd></dl> <dl><dt><a name="-transferFillLoops"><strong>transferFillLoops</strong></a>(fillLoops, surroundingLoop)</dt><dd><tt>Transfer fill loops.</tt></dd></dl> <dl><dt><a name="-transferFillLoopsToSurroundingLoops"><strong>transferFillLoopsToSurroundingLoops</strong></a>(fillLoops, surroundingLoops)</dt><dd><tt>Transfer fill loops to surrounding loops.</tt></dd></dl> - <dl><dt><a name="-writeOutput"><strong>writeOutput</strong></a>(filename<font color="#909090">=''</font>)</dt><dd><tt>Tower a gcode linear move file. Chain tower the gcode if it is not already towered.<br> -If no filename is specified, tower the first unmodified gcode file in this folder.</tt></dd></dl> + <dl><dt><a name="-writeOutput"><strong>writeOutput</strong></a>(fileName<font color="#909090">=''</font>)</dt><dd><tt>Tower a gcode linear move file. Chain tower the gcode if it is not already towered.<br> +If no fileName is specified, tower 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"> diff --git a/trunk/reprap/miscellaneous/python-beanshell-scripts/documentation/skeinforge_tools.unpause.html b/trunk/reprap/miscellaneous/python-beanshell-scripts/documentation/skeinforge_tools.unpause.html index 0c4dfe24..fc2d9442 100644 --- a/trunk/reprap/miscellaneous/python-beanshell-scripts/documentation/skeinforge_tools.unpause.html +++ b/trunk/reprap/miscellaneous/python-beanshell-scripts/documentation/skeinforge_tools.unpause.html @@ -25,15 +25,15 @@ feedrate will be sped up to, compared to  To run unpause, in a shell type:<br> > python unpause.py<br> <br> -The following examples unpause the files Hollow Square.gts. The examples are run in a terminal in the folder which contains<br> -Hollow Square.gts & unpause.py. The function writeOutput checks to see if the text has been unpaused, if not they call<br> +The following examples unpause the files Screw Holder Bottom.stl. The examples are run in a terminal in the folder which contains<br> +Screw Holder Bottom.stl & unpause.py. The function writeOutput checks to see if the text has been unpaused, if not they call<br> getFilletChainGcode in fillet.py to fillet the text; once they have the filleted text, then it unpauses.<br> <br> <br> > python unpause.py<br> This brings up the dialog, after clicking 'Unpause', the following is printed:<br> -File Hollow Square.gts is being chain unpaused.<br> -The unpaused file is saved as Hollow Square_unpause.gcode<br> +File Screw Holder Bottom.stl is being chain unpaused.<br> +The unpaused file is saved as Screw Holder Bottom_unpause.gcode<br> <br> <br> >python<br> @@ -46,9 +46,9 @@ This brings up the unpause dialog.<br> <br> <br> >>> unpause.<a href="#-writeOutput">writeOutput</a>()<br> -Hollow Square.gts<br> -File Hollow Square.gts is being chain unpaused.<br> -The unpaused file is saved as Hollow Square_unpause.gcode<br> +Screw Holder Bottom.stl<br> +File Screw Holder Bottom.stl is being chain unpaused.<br> +The unpaused file is saved as Screw Holder Bottom_unpause.gcode<br> <br> The equation to set the feedrate is from Shane Hathaway's description at:<br> <a href="http://shane.willowrise.com/archives/delay-compensation-in-firmware/">http://shane.willowrise.com/archives/delay-compensation-in-firmware/</a></tt></p> @@ -65,8 +65,8 @@ The equation to set the feedrate is from  <a href="skeinforge_tools.skeinforge_utilities.euclidean.html">skeinforge_tools.skeinforge_utilities.euclidean</a><br> </td><td width="25%" valign=top><a href="skeinforge_tools.fillet.html">skeinforge_tools.fillet</a><br> <a href="skeinforge_tools.skeinforge_utilities.gcodec.html">skeinforge_tools.skeinforge_utilities.gcodec</a><br> -<a href="skeinforge_tools.import_translator.html">skeinforge_tools.import_translator</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="os.html">os</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> @@ -93,7 +93,7 @@ The equation to set the feedrate is from  <td colspan=2><tt>A class to handle the unpause preferences.<br> </tt></td></tr> <tr><td> </td> <td width="100%">Methods defined here:<br> -<dl><dt><a name="UnpausePreferences-__init__"><strong>__init__</strong></a>(self)</dt><dd><tt>Set the default preferences, execute title & preferences filename.</tt></dd></dl> +<dl><dt><a name="UnpausePreferences-__init__"><strong>__init__</strong></a>(self)</dt><dd><tt>Set the default preferences, execute title & preferences fileName.</tt></dd></dl> <dl><dt><a name="UnpausePreferences-execute"><strong>execute</strong></a>(self)</dt><dd><tt>Unpause button has been clicked.</tt></dd></dl> @@ -133,10 +133,10 @@ The equation to set the feedrate is from  <tr><td bgcolor="#eeaa77"><tt> </tt></td><td> </td> <td width="100%"><dl><dt><a name="-getSelectedPlugin"><strong>getSelectedPlugin</strong></a>(unpausePreferences)</dt><dd><tt>Get the selected plugin.</tt></dd></dl> - <dl><dt><a name="-getUnpauseChainGcode"><strong>getUnpauseChainGcode</strong></a>(filename, gcodeText, unpausePreferences<font color="#909090">=None</font>)</dt><dd><tt>Unpause a gcode linear move text. Chain unpause the gcode if it is not already unpaused.</tt></dd></dl> + <dl><dt><a name="-getUnpauseChainGcode"><strong>getUnpauseChainGcode</strong></a>(fileName, gcodeText, unpausePreferences<font color="#909090">=None</font>)</dt><dd><tt>Unpause a gcode linear move text. Chain unpause the gcode if it is not already unpaused.</tt></dd></dl> <dl><dt><a name="-getUnpauseGcode"><strong>getUnpauseGcode</strong></a>(gcodeText, unpausePreferences<font color="#909090">=None</font>)</dt><dd><tt>Unpause 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 unpause dialog.</tt></dd></dl> - <dl><dt><a name="-writeOutput"><strong>writeOutput</strong></a>(filename<font color="#909090">=''</font>)</dt><dd><tt>Unpause a gcode linear move file. Chain unpause the gcode if it is not already unpaused. If no filename is specified, unpause the first unmodified gcode file in this folder.</tt></dd></dl> + <dl><dt><a name="-writeOutput"><strong>writeOutput</strong></a>(fileName<font color="#909090">=''</font>)</dt><dd><tt>Unpause a gcode linear move file. Chain unpause the gcode if it is not already unpaused. If no fileName is specified, unpause 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"> diff --git a/trunk/reprap/miscellaneous/python-beanshell-scripts/documentation/skeinforge_tools.wipe.html b/trunk/reprap/miscellaneous/python-beanshell-scripts/documentation/skeinforge_tools.wipe.html new file mode 100644 index 00000000..3dadab10 --- /dev/null +++ b/trunk/reprap/miscellaneous/python-beanshell-scripts/documentation/skeinforge_tools.wipe.html @@ -0,0 +1,181 @@ + +<!doctype html PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN"> +<html><head><title>Python: module skeinforge_tools.wipe</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>.wipe</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/wipe.py">/home/enrique/Desktop/backup/babbleold/script/reprap/pyRepRap/skeinforge_tools/wipe.py</a></font></td></tr></table> + <p><tt>Wipe is a script to wipe the nozzle.<br> + <br> +At the beginning of a layer, depending on the preferences, wipe will move the nozzle with the extruder off to the arrival point,<br> +then to the wipe point, then to the departure point, then back to the layer.<br> + <br> +The default 'Activate Wipe' 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> +The "Location Arrival X" preference, is the x coordinate of the arrival location. The "Location Arrival Y" and "Location Arrival Z"<br> +preferences are the y & z coordinates of the location. The equivalent "Location Wipe.." and "Location Departure.." preferences<br> +are for the wipe and departure locations.<br> + <br> +The "Wipe Period (layers)" preference is the number of layers between wipes. Wipe will always wipe just before the first layer,<br> +afterwards it will wipe every "Wipe Period" layers. With the default of three, wipe will wipe just before the zeroth layer, the<br> +third layer, sixth layer and so on.<br> + <br> +To run wipe, in a shell which wipe is in type:<br> +> python wipe.py<br> + <br> +The following examples wipes the files Screw Holder Bottom.gcode & Screw Holder Bottom.stl. The examples are run in a<br> +terminal in the folder which contains Screw Holder Bottom.gcode, Screw Holder Bottom.stl and wipe.py. The wipe function<br> +will wipe if the 'Activate Wipe' checkbox is on. The functions writeOutput and getWipeChainGcode check to see if the text<br> +has been wiped, if not they call the getHopChainGcode in hop.py to hop the text; once they have the hopped text, then they<br> +wipe.<br> + <br> + <br> +> python wipe.py<br> +This brings up the dialog, after clicking 'Wipe', the following is printed:<br> +File Screw Holder Bottom.stl is being chain wiped.<br> +The wiped file is saved as Screw Holder Bottom_wipe.gcode<br> + <br> + <br> +> python wipe.py Screw Holder Bottom.stl<br> +File Screw Holder Bottom.stl is being chain wiped.<br> +The wiped file is saved as Screw Holder Bottom_wipe.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 wipe<br> +>>> wipe.<a href="#-main">main</a>()<br> +This brings up the wipe dialog.<br> + <br> + <br> +>>> wipe.<a href="#-writeOutput">writeOutput</a>()<br> +File Screw Holder Bottom.stl is being chain wiped.<br> +The wiped file is saved as Screw Holder Bottom_wipe.gcode<br> + <br> + <br> +>>> wipe.<a href="#-getWipeGcode">getWipeGcode</a>("<br> +( GCode generated by May 8, 2008 carve.py )<br> +( Extruder Initialization )<br> +..<br> +many lines of gcode<br> +..<br> +")<br> +Many line of wiped gcode.<br> + <br> +>>> wipe.<a href="#-getWipeChainGcode">getWipeChainGcode</a>("<br> +( GCode generated by May 8, 2008 carve.py )<br> +( Extruder Initialization )<br> +..<br> +many lines of gcode<br> +..<br> +")<br> +Many line of wiped gcode.</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> +</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.hop.html">skeinforge_tools.hop</a><br> +</td><td width="25%" valign=top><a href="skeinforge_tools.skeinforge_utilities.interpret.html">skeinforge_tools.skeinforge_utilities.interpret</a><br> +<a href="math.html">math</a><br> +<a href="skeinforge_tools.polyfile.html">skeinforge_tools.polyfile</a><br> +</td><td width="25%" valign=top><a href="skeinforge_tools.skeinforge_utilities.preferences.html">skeinforge_tools.skeinforge_utilities.preferences</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_tools.wipe.html#WipePreferences">WipePreferences</a> +</font></dt><dt><font face="helvetica, arial"><a href="skeinforge_tools.wipe.html#WipeSkein">WipeSkein</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="WipePreferences">class <strong>WipePreferences</strong></a></font></td></tr> + +<tr bgcolor="#ffc8d8"><td rowspan=2><tt> </tt></td> +<td colspan=2><tt>A class to handle the wipe preferences.<br> </tt></td></tr> +<tr><td> </td> +<td width="100%">Methods defined here:<br> +<dl><dt><a name="WipePreferences-__init__"><strong>__init__</strong></a>(self)</dt><dd><tt>Set the default preferences, execute title & preferences fileName.</tt></dd></dl> + +<dl><dt><a name="WipePreferences-execute"><strong>execute</strong></a>(self)</dt><dd><tt>Wipe 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="WipeSkein">class <strong>WipeSkein</strong></a></font></td></tr> + +<tr bgcolor="#ffc8d8"><td rowspan=2><tt> </tt></td> +<td colspan=2><tt>A class to wipe a skein of extrusions.<br> </tt></td></tr> +<tr><td> </td> +<td width="100%">Methods defined here:<br> +<dl><dt><a name="WipeSkein-__init__"><strong>__init__</strong></a>(self)</dt></dl> + +<dl><dt><a name="WipeSkein-addHop"><strong>addHop</strong></a>(self, begin, end)</dt><dd><tt>Add hop to highest point.</tt></dd></dl> + +<dl><dt><a name="WipeSkein-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="WipeSkein-addWipeTravel"><strong>addWipeTravel</strong></a>(self, splitLine)</dt><dd><tt>Add the wipe travel gcode.</tt></dd></dl> + +<dl><dt><a name="WipeSkein-getLinearMoveWithFeedrate"><strong>getLinearMoveWithFeedrate</strong></a>(self, feedrate, location)</dt><dd><tt>Get a linear move line with the feedrate.</tt></dd></dl> + +<dl><dt><a name="WipeSkein-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="WipeSkein-parseGcode"><strong>parseGcode</strong></a>(self, gcodeText, wipePreferences)</dt><dd><tt>Parse gcode text and store the wipe gcode.</tt></dd></dl> + +<dl><dt><a name="WipeSkein-parseInitialization"><strong>parseInitialization</strong></a>(self, wipePreferences)</dt><dd><tt>Parse gcode initialization and store the parameters.</tt></dd></dl> + +<dl><dt><a name="WipeSkein-parseLine"><strong>parseLine</strong></a>(self, line)</dt><dd><tt>Parse a gcode line and add it to the bevel gcode.</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="-getWipeChainGcode"><strong>getWipeChainGcode</strong></a>(fileName, gcodeText, wipePreferences<font color="#909090">=None</font>)</dt><dd><tt>Wipe a gcode linear move text. Chain wipe the gcode if it is not already wiped.</tt></dd></dl> + <dl><dt><a name="-getWipeGcode"><strong>getWipeGcode</strong></a>(gcodeText, wipePreferences<font color="#909090">=None</font>)</dt><dd><tt>Wipe 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 wipe dialog.</tt></dd></dl> + <dl><dt><a name="-writeOutput"><strong>writeOutput</strong></a>(fileName<font color="#909090">=''</font>)</dt><dd><tt>Wipe a gcode linear move file. Chain wipe the gcode if it is not already wiped. If no fileName is specified, wipe 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>
\ No newline at end of file diff --git a/trunk/reprap/miscellaneous/python-beanshell-scripts/skeinforge.py b/trunk/reprap/miscellaneous/python-beanshell-scripts/skeinforge.py index f55ae53b..b050731e 100644 --- a/trunk/reprap/miscellaneous/python-beanshell-scripts/skeinforge.py +++ b/trunk/reprap/miscellaneous/python-beanshell-scripts/skeinforge.py @@ -3,11 +3,11 @@ """ Introduction -Skeinforge is a tool chain to forge a gcode skein for a model. +Skeinforge is a GPL tool chain to forge a gcode skein for a model. -The tool chain starts with slice_shape, which slices the model into layers, then the layers are modified by other tools in turn like -fill, comb, tower, raft, stretch, hop, nozzle_wipe, oozebane, fillet & export. Each tool automatically gets the gcode from the -previous tool. So if you want a sliced & filled gcode, call the fill tool and it will call slice_shape, then it will fill and output the +The tool chain starts with carve, which carves the model into layers, then the layers are modified by other tools in turn like +fill, comb, tower, raft, stretch, hop, wipe, oozebane, fillet & export. Each tool automatically gets the gcode from the +previous tool. So if you want a carved & filled gcode, call the fill tool and it will call carve, then it will fill and output the gcode. If you want to use all the tools, call export and it will call in turn all the other tools down the chain to produce the gcode file. The skeinforge module provides a single place to call up all the preference dialogs. When the 'Skeinforge' button is clicked, @@ -27,10 +27,10 @@ There are also tools which handle preferences for the chain, like material & pol The analyze tool calls plugins in the analyze_plugins folder, which will analyze the gcode in some way when it is generated if their Activate checkbox is selected. -The import_translator tool accesses and displays the import plugins. +The interpret tool accesses and displays the import plugins. The default preferences are similar to those on Nophead's machine. A preference which is often different is the -'Extrusion Diameter' in slice_shape. +'Extrusion Diameter' in carve. @@ -71,11 +71,11 @@ Or you can turn files into gcode by adding the file name, for example: End of the Beginning -When slice is generating the code, if there is a file start.txt, it will add that to the very beginning of the gcode. After it has +When carve is generating the code, if there is a file start.txt, it will add that to the very beginning of the gcode. After it has added some initialization code and just before it adds the extrusion gcode, it will add the file endofthebeginning.txt if it exists. -At the very end, it will add the file end.txt if it exists. Slice does not care if the text file names are capitalized, but some file +At the very end, it will add the file end.txt if it exists. Carve 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. It will -first look for the file in the same directory as slice, if it does not find it it will look in ~/.skeinforge/gcode_scripts. +first look for the file in the same directory as carve, if it does not find it it will look in ~/.skeinforge/gcode_scripts. The computation intensive python modules will use psyco if it is available and run about twice as fast. Psyco is described at: http://psyco.sourceforge.net/index.html @@ -151,8 +151,8 @@ folder. STL is an inferior triangle surface format, described at: http://en.wikipedia.org/wiki/STL_(file_format) -If you're using an STL file and you can't even slice it, try converting it to a GNU Triangulated Surface file in Art of Illusion. If -it still doesn't slice, then follow the advice in the troubleshooting section. +If you're using an STL file and you can't even carve it, try converting it to a GNU Triangulated Surface file in Art of Illusion. If +it still doesn't carve, then follow the advice in the troubleshooting section. @@ -182,8 +182,8 @@ If there's a bug, try downloading the very latest version because sometimes I up Then you can ask for skeinforge help by sending a private message through the forum software by going to my page at: http://forums.reprap.org/profile.php?12,488 -or posting in the "How to Print Gcode from Host" thread at: -http://forums.reprap.org/read.php?12,10772 +or posting in the "Skeinforge Powwow" thread at: +http://forums.reprap.org/read.php?12,20013 When asking for help please include your object and your zipped skeinforge preferences. The skeinforge preferences are in the .skeinforge folder in your home directory. @@ -191,7 +191,7 @@ the .skeinforge folder in your home directory. Examples -The following examples slice and dice the STL file Screw Holder.stl. The examples are run in a terminal in the folder which +The following examples carve and dice the STL file Screw Holder.stl. The examples are run in a terminal in the folder which contains Screw Holder.gts and skeinforge.py. > python skeinforge.py @@ -221,7 +221,7 @@ from __future__ import absolute_import from skeinforge_tools.skeinforge_utilities import gcodec from skeinforge_tools.skeinforge_utilities import preferences -from skeinforge_tools import import_translator +from skeinforge_tools.skeinforge_utilities import interpret from skeinforge_tools import polyfile import cStringIO import sys @@ -233,11 +233,15 @@ Adrian Bowyer <http://forums.reprap.org/profile.php?12,13> Brendan Erwin <http://forums.reprap.org/profile.php?12,217> Greenarrow <http://forums.reprap.org/profile.php?12,81> Ian England <http://forums.reprap.org/profile.php?12,192> +John Gilmore <http://forums.reprap.org/profile.php?12,364> +Jonwise <http://forums.reprap.org/profile.php?12,716> Kyle Corbitt <http://forums.reprap.org/profile.php?12,90> Marius Kintel <http://reprap.soup.io/> Nophead <http://www.blogger.com/profile/12801535866788103677> +PJR <http://forums.reprap.org/profile.php?12,757> Reece.Arnott <http://forums.reprap.org/profile.php?12,152> Wade <http://forums.reprap.org/profile.php?12,489> +Zach Hoeken <http://blog.zachhoeken.com/> Organizations: Art of Illusion <http://www.artofillusion.org/>""" @@ -246,26 +250,26 @@ __license__ = "GPL 3.0" def getSkeinforgeToolFilenames(): - "Get skeinforge plugin filenames." + "Get skeinforge plugin fileNames." return gcodec.getPluginFilenames( 'skeinforge_tools', __file__ ) -def writeOutput( filename = '' ): - "Skeinforge a gcode file. If no filename is specified, skeinforge the first gcode file in this folder that is not modified." +def writeOutput( fileName = '' ): + "Skeinforge a gcode file. If no fileName is specified, skeinforge the first gcode file in this folder that is not modified." skeinforgePluginFilenames = getSkeinforgeToolFilenames() - toolNames = 'export fillet oozebane nozzle_wipe hop stretch clip comb tower raft speed multiply fill slice_shape'.split() + toolNames = 'export unpause fillet oozebane wipe hop stretch clip comb tower raft speed multiply fill inset carve'.split() for toolName in toolNames: for skeinforgePluginFilename in skeinforgePluginFilenames: if skeinforgePluginFilename == toolName: pluginModule = gcodec.getModule( skeinforgePluginFilename, 'skeinforge_tools', __file__ ) if pluginModule != None: - pluginModule.writeOutput( filename ) + pluginModule.writeOutput( fileName ) return class SkeinforgePreferences: "A class to handle the skeinforge preferences." def __init__( self ): - "Set the default preferences, execute title & preferences filename." + "Set the default preferences, execute title & preferences fileName." #Set the default preferences. self.archive = [] self.skeinforgeLabel = preferences.LabelDisplay().getFromName( 'Open Preferences: ' ) @@ -276,20 +280,20 @@ class SkeinforgePreferences: skeinforgeDisplayToolButton = preferences.DisplayToolButton().getFromFolderName( 'skeinforge_tools', __file__, skeinforgePluginFilename ) self.skeinforgeDisplayToolButtons.append( skeinforgeDisplayToolButton ) self.archive += self.skeinforgeDisplayToolButtons - self.filenameInput = preferences.Filename().getFromFilename( import_translator.getGNUTranslatorGcodeFileTypeTuples(), 'Open File to be Skeinforged', '' ) - self.archive.append( self.filenameInput ) - #Create the archive, title of the execute button, title of the dialog & preferences filename. + self.fileNameInput = preferences.Filename().getFromFilename( interpret.getGNUTranslatorGcodeFileTypeTuples(), 'Open File to be Skeinforged', '' ) + self.archive.append( self.fileNameInput ) + #Create the archive, title of the execute button, title of the dialog & preferences fileName. self.executeTitle = 'Skeinforge' - self.filenamePreferences = preferences.getPreferencesFilePath( 'skeinforge.csv' ) - self.filenameHelp = 'skeinforge.html' + self.fileNamePreferences = preferences.getPreferencesFilePath( 'skeinforge.csv' ) + self.fileNameHelp = 'skeinforge.html' self.saveTitle = None self.title = 'Skeinforge Preferences' def execute( self ): "Skeinforge button has been clicked." - filenames = polyfile.getFileOrDirectoryTypesUnmodifiedGcode( self.filenameInput.value, import_translator.getGNUTranslatorFileTypes(), self.filenameInput.wasCancelled ) - for filename in filenames: - writeOutput( filename ) + fileNames = polyfile.getFileOrDirectoryTypesUnmodifiedGcode( self.fileNameInput.value, interpret.getImportPluginFilenames(), self.fileNameInput.wasCancelled ) + for fileName in fileNames: + writeOutput( fileName ) def main(): "Display the skeinforge dialog." diff --git a/trunk/reprap/miscellaneous/python-beanshell-scripts/skeinforge_tools/analyze.py b/trunk/reprap/miscellaneous/python-beanshell-scripts/skeinforge_tools/analyze.py index e9414894..b16201f7 100644 --- a/trunk/reprap/miscellaneous/python-beanshell-scripts/skeinforge_tools/analyze.py +++ b/trunk/reprap/miscellaneous/python-beanshell-scripts/skeinforge_tools/analyze.py @@ -27,30 +27,30 @@ __license__ = "GPL 3.0" def getAnalyzePluginFilenames(): - "Get analyze plugin filenames." + "Get analyze plugin fileNames." return gcodec.getPluginFilenames( 'analyze_plugins', __file__ ) -def writeOutput( filename = '', gcodeText = '' ): - "Analyze a gcode file. If no filename is specified, comment the first gcode file in this folder that is not modified." - if filename == '': +def writeOutput( fileName = '', gcodeText = '' ): + "Analyze a gcode file. If no fileName is specified, comment the first gcode file in this folder that is not modified." + if fileName == '': unmodified = gcodec.getUncommentedGcodeFiles() if len( unmodified ) == 0: print( "There is no gcode file in this folder that is not a comment file." ) return - filename = unmodified[ 0 ] + fileName = unmodified[ 0 ] if gcodeText == '': - gcodeText = gcodec.getFileText( filename ) + gcodeText = gcodec.getFileText( fileName ) analyzePluginFilenames = getAnalyzePluginFilenames() for analyzePluginFilename in analyzePluginFilenames: pluginModule = gcodec.getModule( analyzePluginFilename, 'analyze_plugins', __file__ ) if pluginModule != None: - pluginModule.writeOutput( filename, gcodeText ) + pluginModule.writeOutput( fileName, gcodeText ) class AnalyzePreferences: "A class to handle the analyze preferences." def __init__( self ): - "Set the default preferences, execute title & preferences filename." + "Set the default preferences, execute title & preferences fileName." #Set the default preferences. self.archive = [] self.analyzeLabel = preferences.LabelDisplay().getFromName( 'Open Preferences: ' ) @@ -62,20 +62,20 @@ class AnalyzePreferences: self.analyzePlugins.append( analyzePlugin ) # self.analyzePlugins.sort( key = preferences.RadioCapitalized.getLowerName ) self.archive += self.analyzePlugins - self.filenameInput = preferences.Filename().getFromFilename( [ ( 'Gcode text files', '*.gcode' ) ], 'Open File to be Analyzed', '' ) - self.archive.append( self.filenameInput ) - #Create the archive, title of the execute button, title of the dialog & preferences filename. + self.fileNameInput = preferences.Filename().getFromFilename( [ ( 'Gcode text files', '*.gcode' ) ], 'Open File to be Analyzed', '' ) + self.archive.append( self.fileNameInput ) + #Create the archive, title of the execute button, title of the dialog & preferences fileName. self.executeTitle = 'Analyze' - self.filenamePreferences = preferences.getPreferencesFilePath( 'analyze.csv' ) - self.filenameHelp = 'skeinforge_tools.analyze.html' + self.fileNamePreferences = preferences.getPreferencesFilePath( 'analyze.csv' ) + self.fileNameHelp = 'skeinforge_tools.analyze.html' self.saveTitle = None self.title = 'Analyze Preferences' def execute( self ): "Analyze button has been clicked." - filenames = polyfile.getFileOrDirectoryTypesUnmodifiedGcode( self.filenameInput.value, [], self.filenameInput.wasCancelled ) - for filename in filenames: - writeOutput( filename ) + fileNames = polyfile.getFileOrDirectoryTypesUnmodifiedGcode( self.fileNameInput.value, [], self.fileNameInput.wasCancelled ) + for fileName in fileNames: + writeOutput( fileName ) def main( hashtable = None ): diff --git a/trunk/reprap/miscellaneous/python-beanshell-scripts/skeinforge_tools/analyze_plugins/analyze_utilities/enrique.py b/trunk/reprap/miscellaneous/python-beanshell-scripts/skeinforge_tools/analyze_plugins/analyze_utilities/enrique.py index e45c4822..39875054 100644 --- a/trunk/reprap/miscellaneous/python-beanshell-scripts/skeinforge_tools/analyze_plugins/analyze_utilities/enrique.py +++ b/trunk/reprap/miscellaneous/python-beanshell-scripts/skeinforge_tools/analyze_plugins/analyze_utilities/enrique.py @@ -4,10 +4,10 @@ from GifImagePlugin import getheader, getdata from skeinforge_tools.skeinforge_utilities.vector3 import Vector3 # Get the entire text of a file. -# @param filename name of the file +# @param fileName name of the file # @return entire text of a file. -def getFileText( filename ): - file = open( filename, 'r' ) +def getFileText( fileName ): + file = open( fileName, 'r' ) fileText = file.read() file.close() return fileText @@ -61,11 +61,11 @@ def makedelta(fp, sequence): class g2gif: - def __init__(self,filename, outfile): + def __init__(self,fileName, outfile): self.last_pos = Vector3() self.last_pos.z = 999 self.do_move = 1 - fileText = getFileText( filename ) + fileText = getFileText( fileName ) textLines = getTextLines( fileText ) self.images = [] self.image = None diff --git a/trunk/reprap/miscellaneous/python-beanshell-scripts/skeinforge_tools/analyze_plugins/analyze_utilities/gRead.py b/trunk/reprap/miscellaneous/python-beanshell-scripts/skeinforge_tools/analyze_plugins/analyze_utilities/gRead.py index aaee5656..7b1421d0 100644 --- a/trunk/reprap/miscellaneous/python-beanshell-scripts/skeinforge_tools/analyze_plugins/analyze_utilities/gRead.py +++ b/trunk/reprap/miscellaneous/python-beanshell-scripts/skeinforge_tools/analyze_plugins/analyze_utilities/gRead.py @@ -5,10 +5,10 @@ import __init__ from skeinforge_tools.skeinforge_utilities.vector3 import Vector3 # Get the entire text of a file. -# @param filename name of the file +# @param fileName name of the file # @return entire text of a file. -def getFileText( filename ): - file = open( filename, 'r' ) +def getFileText( fileName ): + file = open( fileName, 'r' ) fileText = file.read() file.close() return fileText @@ -36,9 +36,9 @@ def indexOfStartingWithSecond( letter, splitLine ): class gRead: - def __init__(self,filename, layers,gcodeText = ''): + def __init__(self,fileName, layers,gcodeText = ''): if gcodeText == '': - gcodeText = getFileText( filename ) + gcodeText = getFileText( fileName ) textLines = getTextLines( gcodeText ) self.last_pos = Vector3() self.layers = layers diff --git a/trunk/reprap/miscellaneous/python-beanshell-scripts/skeinforge_tools/analyze_plugins/analyze_utilities/preview.py b/trunk/reprap/miscellaneous/python-beanshell-scripts/skeinforge_tools/analyze_plugins/analyze_utilities/preview.py index b406d06f..d65ea648 100644 --- a/trunk/reprap/miscellaneous/python-beanshell-scripts/skeinforge_tools/analyze_plugins/analyze_utilities/preview.py +++ b/trunk/reprap/miscellaneous/python-beanshell-scripts/skeinforge_tools/analyze_plugins/analyze_utilities/preview.py @@ -57,10 +57,10 @@ class Preview: self.update() -def viewGif( filename, gcodeText = '' ): +def viewGif( fileName, gcodeText = '' ): layers = [] try: - gRead(filename, layers, gcodeText) + gRead(fileName, layers, gcodeText) Preview(layers) except Exception, why: print( 'Preview failed: ' + str( why ) ) diff --git a/trunk/reprap/miscellaneous/python-beanshell-scripts/skeinforge_tools/analyze_plugins/comment.py b/trunk/reprap/miscellaneous/python-beanshell-scripts/skeinforge_tools/analyze_plugins/comment.py index e3f5b524..ef7eadd1 100644 --- a/trunk/reprap/miscellaneous/python-beanshell-scripts/skeinforge_tools/analyze_plugins/comment.py +++ b/trunk/reprap/miscellaneous/python-beanshell-scripts/skeinforge_tools/analyze_plugins/comment.py @@ -51,15 +51,15 @@ __date__ = "$Date: 2008/21/04 $" __license__ = "GPL 3.0" -def commentFile( filename = '' ): - "Comment a gcode file. If no filename is specified, comment the first gcode file in this folder that is not modified." - if filename == '': +def commentFile( fileName = '' ): + "Comment a gcode file. If no fileName is specified, comment the first gcode file in this folder that is not modified." + if fileName == '': unmodified = gcodec.getUnmodifiedGCodeFiles() if len( unmodified ) == 0: print( "There are no unmodified gcode files in this folder." ) return - filename = unmodified[ 0 ] - writeCommentFileGivenText( filename, gcodec.getFileText( filename ) ) + fileName = unmodified[ 0 ] + writeCommentFileGivenText( fileName, gcodec.getFileText( fileName ) ) def getCommentGcode( gcodeText ): "Get gcode text with added comments." @@ -67,18 +67,18 @@ def getCommentGcode( gcodeText ): skein.parseGcode( gcodeText ) return skein.output.getvalue() -def writeCommentFileGivenText( filename, gcodeText ): +def writeCommentFileGivenText( fileName, gcodeText ): "Write a commented gcode file for a gcode file." - gcodec.writeFileMessageEnd( '_comment.gcode', filename, getCommentGcode( gcodeText ), 'The commented file is saved as ' ) + gcodec.writeFileMessageEnd( '_comment.gcode', fileName, getCommentGcode( gcodeText ), 'The commented file is saved as ' ) -def writeOutput( filename, gcodeText = '' ): +def writeOutput( fileName, gcodeText = '' ): "Write a commented gcode file for a skeinforge gcode file, if 'Write Commented File for Skeinforge Chain' is selected." commentPreferences = CommentPreferences() preferences.readPreferences( commentPreferences ) if gcodeText == '': - gcodeText = gcodec.getFileText( filename ) + gcodeText = gcodec.getFileText( fileName ) if commentPreferences.activateComment.value: - writeCommentFileGivenText( filename, gcodeText ) + writeCommentFileGivenText( fileName, gcodeText ) class CommentSkein: @@ -154,25 +154,25 @@ class CommentSkein: class CommentPreferences: "A class to handle the comment preferences." def __init__( self ): - "Set the default preferences, execute title & preferences filename." + "Set the default preferences, execute title & preferences fileName." #Set the default preferences. self.archive = [] self.activateComment = preferences.BooleanPreference().getFromValue( 'Activate Comment', False ) self.archive.append( self.activateComment ) - self.filenameInput = preferences.Filename().getFromFilename( [ ( 'Gcode text files', '*.gcode' ) ], 'Open File to Write Comments for', '' ) - self.archive.append( self.filenameInput ) - #Create the archive, title of the execute button, title of the dialog & preferences filename. + self.fileNameInput = preferences.Filename().getFromFilename( [ ( 'Gcode text files', '*.gcode' ) ], 'Open File to Write Comments for', '' ) + self.archive.append( self.fileNameInput ) + #Create the archive, title of the execute button, title of the dialog & preferences fileName. self.executeTitle = 'Write Comments' - self.filenamePreferences = preferences.getPreferencesFilePath( 'comment.csv' ) - self.filenameHelp = 'skeinforge_tools.analyze_plugins.comment.html' + self.fileNamePreferences = preferences.getPreferencesFilePath( 'comment.csv' ) + self.fileNameHelp = 'skeinforge_tools.analyze_plugins.comment.html' self.saveTitle = 'Save Preferences' self.title = 'Comment Preferences' def execute( self ): "Write button has been clicked." - filenames = polyfile.getFileOrGcodeDirectory( self.filenameInput.value, self.filenameInput.wasCancelled, [ '_comment' ] ) - for filename in filenames: - commentFile( filename ) + fileNames = polyfile.getFileOrGcodeDirectory( self.fileNameInput.value, self.fileNameInput.wasCancelled, [ '_comment' ] ) + for fileName in fileNames: + commentFile( fileName ) def main(): diff --git a/trunk/reprap/miscellaneous/python-beanshell-scripts/skeinforge_tools/analyze_plugins/skeinview.py b/trunk/reprap/miscellaneous/python-beanshell-scripts/skeinforge_tools/analyze_plugins/skeinview.py index 8254cdae..d23d2996 100644 --- a/trunk/reprap/miscellaneous/python-beanshell-scripts/skeinforge_tools/analyze_plugins/skeinview.py +++ b/trunk/reprap/miscellaneous/python-beanshell-scripts/skeinforge_tools/analyze_plugins/skeinview.py @@ -85,24 +85,24 @@ def displaySkeinviewFileGivenText( gcodeText, skeinviewPreferences = None ): skein.parseGcode( gcodeText, skeinviewPreferences ) SkeinWindow( skein.arrowType, skeinviewPreferences.screenHorizontalInset.value, skeinviewPreferences.screenVerticalInset.value, skein.scaleSize, skein.skeinPanes ) -def skeinviewFile( filename = '' ): - "Skeinview a gcode file. If no filename is specified, skeinview the first gcode file in this folder that is not modified." - if filename == '': +def skeinviewFile( fileName = '' ): + "Skeinview a gcode file. If no fileName is specified, skeinview the first gcode file in this folder that is not modified." + if fileName == '': unmodified = gcodec.getUnmodifiedGCodeFiles() if len( unmodified ) == 0: print( "There are no unmodified gcode files in this folder." ) return - filename = unmodified[ 0 ] - gcodeText = gcodec.getFileText( filename ) + fileName = unmodified[ 0 ] + gcodeText = gcodec.getFileText( fileName ) displaySkeinviewFileGivenText( gcodeText ) -def writeOutput( filename, gcodeText = '' ): +def writeOutput( fileName, gcodeText = '' ): "Write a skeinviewed gcode file for a skeinforge gcode file, if 'Activate Skeinview' is selected." skeinviewPreferences = SkeinviewPreferences() preferences.readPreferences( skeinviewPreferences ) if skeinviewPreferences.activateSkeinview.value: if gcodeText == '': - gcodeText = gcodec.getFileText( filename ) + gcodeText = gcodec.getFileText( fileName ) displaySkeinviewFileGivenText( gcodeText, skeinviewPreferences ) @@ -125,15 +125,15 @@ class ColoredLine: class SkeinviewPreferences: "A class to handle the skeinview preferences." def __init__( self ): - "Set the default preferences, execute title & preferences filename." + "Set the default preferences, execute title & preferences fileName." #Set the default preferences. self.archive = [] self.activateSkeinview = preferences.BooleanPreference().getFromValue( 'Activate Skeinview', True ) self.archive.append( self.activateSkeinview ) self.drawArrows = preferences.BooleanPreference().getFromValue( 'Draw Arrows', True ) self.archive.append( self.drawArrows ) - self.filenameInput = preferences.Filename().getFromFilename( [ ( 'Gcode text files', '*.gcode' ) ], 'Open File to Skeinview', '' ) - self.archive.append( self.filenameInput ) + self.fileNameInput = preferences.Filename().getFromFilename( [ ( 'Gcode text files', '*.gcode' ) ], 'Open File to Skeinview', '' ) + self.archive.append( self.fileNameInput ) self.goAroundExtruderOffTravel = preferences.BooleanPreference().getFromValue( 'Go Around Extruder Off Travel', False ) self.archive.append( self.goAroundExtruderOffTravel ) self.pixelsWidthExtrusion = preferences.FloatPreference().getFromValue( 'Pixels over Extrusion Width (ratio):', 10.0 ) @@ -142,18 +142,18 @@ class SkeinviewPreferences: self.archive.append( self.screenHorizontalInset ) self.screenVerticalInset = preferences.IntPreference().getFromValue( 'Screen Vertical Inset (pixels):', 50 ) self.archive.append( self.screenVerticalInset ) - #Create the archive, title of the execute button, title of the dialog & preferences filename. + #Create the archive, title of the execute button, title of the dialog & preferences fileName. self.executeTitle = 'Skeinview' - self.filenamePreferences = preferences.getPreferencesFilePath( 'skeinview.csv' ) - self.filenameHelp = 'skeinforge_tools.analyze_plugins.skeinview.html' + self.fileNamePreferences = preferences.getPreferencesFilePath( 'skeinview.csv' ) + self.fileNameHelp = 'skeinforge_tools.analyze_plugins.skeinview.html' self.saveTitle = 'Save Preferences' self.title = 'Skeinview Preferences' def execute( self ): "Write button has been clicked." - filenames = polyfile.getFileOrGcodeDirectory( self.filenameInput.value, self.filenameInput.wasCancelled ) - for filename in filenames: - skeinviewFile( filename ) + fileNames = polyfile.getFileOrGcodeDirectory( self.fileNameInput.value, self.fileNameInput.wasCancelled ) + for fileName in fileNames: + skeinviewFile( fileName ) class SkeinviewSkein: diff --git a/trunk/reprap/miscellaneous/python-beanshell-scripts/skeinforge_tools/analyze_plugins/statistic.py b/trunk/reprap/miscellaneous/python-beanshell-scripts/skeinforge_tools/analyze_plugins/statistic.py index 1eb7d325..0e7ddd7e 100644 --- a/trunk/reprap/miscellaneous/python-beanshell-scripts/skeinforge_tools/analyze_plugins/statistic.py +++ b/trunk/reprap/miscellaneous/python-beanshell-scripts/skeinforge_tools/analyze_plugins/statistic.py @@ -5,6 +5,9 @@ The default 'Activate Statistic' checkbox is on. When it is on, the functions d 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 Statistic' checkbox is on, when statistic is run directly. +When the 'Print Statistics' checkbox is on, the statistics will be printed to the console, the default is on. When the 'Save +Statistics' checkbox is on, the statistics will be save as a .txt file, the default is off. + To run statistic, in a shell in the folder which statistic is in type: > python statistic.py @@ -60,60 +63,63 @@ def getStatisticGcode( gcodeText ): skein.parseGcode( gcodeText ) return skein.output.getvalue() -def statisticFile( filename = '' ): - "Write statistics for a gcode file. If no filename is specified, write statistics for the first gcode file in this folder that is not modified." - if filename == '': +def statisticFile( fileName = '' ): + "Write statistics for a gcode file. If no fileName is specified, write statistics for the first gcode file in this folder that is not modified." + if fileName == '': unmodified = gcodec.getUnmodifiedGCodeFiles() if len( unmodified ) == 0: print( "There are no unmodified gcode files in this folder." ) return - filename = unmodified[ 0 ] + fileName = unmodified[ 0 ] statisticPreferences = StatisticPreferences() preferences.readPreferences( statisticPreferences ) - writeStatisticFileGivenText( filename, gcodec.getFileText( filename ), statisticPreferences ) + writeStatisticFileGivenText( fileName, gcodec.getFileText( fileName ), statisticPreferences ) -def writeOutput( filename, gcodeText = '' ): +def writeOutput( fileName, gcodeText = '' ): "Write statistics for a skeinforge gcode file, if 'Write Statistics File for Skeinforge Chain' is selected." statisticPreferences = StatisticPreferences() preferences.readPreferences( statisticPreferences ) if gcodeText == '': - gcodeText = gcodec.getFileText( filename ) + gcodeText = gcodec.getFileText( fileName ) if statisticPreferences.activateStatistic.value: - writeStatisticFileGivenText( filename, gcodeText, statisticPreferences ) + writeStatisticFileGivenText( fileName, gcodeText, statisticPreferences ) -def writeStatisticFileGivenText( filename, gcodeText, statisticPreferences ): +def writeStatisticFileGivenText( fileName, gcodeText, statisticPreferences ): "Write statistics for a gcode file." - print( 'Statistics are being generated for the file ' + gcodec.getSummarizedFilename( filename ) ) + print( 'Statistics are being generated for the file ' + gcodec.getSummarizedFilename( fileName ) ) statisticGcode = getStatisticGcode( gcodeText ) - gcodec.writeFileMessageEnd( '.txt', filename, statisticGcode, 'The statistics file is saved as ' ) - if statisticPreferences.printStatisticFileSkeinforge.value: + if statisticPreferences.printStatistics.value: print( statisticGcode ) + if statisticPreferences.saveStatistics.value: + gcodec.writeFileMessageEnd( '.txt', fileName, statisticGcode, 'The statistics file is saved as ' ) class StatisticPreferences: "A class to handle the statistics preferences." def __init__( self ): - "Set the default preferences, execute title & preferences filename." + "Set the default preferences, execute title & preferences fileName." #Set the default preferences. self.archive = [] self.activateStatistic = preferences.BooleanPreference().getFromValue( 'Activate Statistic', True ) self.archive.append( self.activateStatistic ) - self.filenameInput = preferences.Filename().getFromFilename( [ ( 'Gcode text files', '*.gcode' ) ], 'Open File to Generate Statistics for', '' ) - self.archive.append( self.filenameInput ) - self.printStatisticFileSkeinforge = preferences.BooleanPreference().getFromValue( 'Print Statistics', False ) - self.archive.append( self.printStatisticFileSkeinforge ) - #Create the archive, title of the execute button, title of the dialog & preferences filename. + self.fileNameInput = preferences.Filename().getFromFilename( [ ( 'Gcode text files', '*.gcode' ) ], 'Open File to Generate Statistics for', '' ) + self.archive.append( self.fileNameInput ) + self.printStatistics = preferences.BooleanPreference().getFromValue( 'Print Statistics', True ) + self.archive.append( self.printStatistics ) + self.saveStatistics = preferences.BooleanPreference().getFromValue( 'Save Statistics', False ) + self.archive.append( self.saveStatistics ) + #Create the archive, title of the execute button, title of the dialog & preferences fileName. self.executeTitle = 'Generate Statistics' - self.filenamePreferences = preferences.getPreferencesFilePath( 'statistic.csv' ) - self.filenameHelp = 'skeinforge_tools.analyze_plugins.statistic.html' + self.fileNamePreferences = preferences.getPreferencesFilePath( 'statistic.csv' ) + self.fileNameHelp = 'skeinforge_tools.analyze_plugins.statistic.html' self.saveTitle = 'Save Preferences' self.title = 'Statistic Preferences' def execute( self ): "Write button has been clicked." - filenames = polyfile.getFileOrGcodeDirectory( self.filenameInput.value, self.filenameInput.wasCancelled, [ '_comment' ] ) - for filename in filenames: - statisticFile( filename ) + fileNames = polyfile.getFileOrGcodeDirectory( self.fileNameInput.value, self.fileNameInput.wasCancelled, [ '_comment' ] ) + for fileName in fileNames: + statisticFile( fileName ) class StatisticSkein: @@ -208,7 +214,7 @@ class StatisticSkein: self.extrusionDiameter = 0.5 self.extrusionWidth = 0.4 self.feedrateMinute = 600.0 - self.extrusionHeight = 0.4 + self.layerThickness = 0.4 self.numberOfLines = 0 self.procedures = [] self.totalBuildTime = 0.0 @@ -229,7 +235,7 @@ class StatisticSkein: roundedLow = euclidean.getRoundedPoint( self.cornerLow ) roundedExtent = euclidean.getRoundedPoint( extent ) axisString = " axis, the extrusion starts at " - volumeExtruded = 0.0009 * self.extrusionWidth * self.extrusionHeight * self.totalDistanceExtruded # the 9 comes from a typical fill density of 0.9 + volumeExtruded = 0.0009 * self.extrusionWidth * self.layerThickness * self.totalDistanceExtruded # the 9 comes from a typical fill density of 0.9 self.addLine( "On the X" + axisString + str( int ( roundedLow.x ) ) + " mm and ends at " + str( int ( roundedHigh.x ) ) + " mm, for a width of " + str( int ( extent.x ) ) + " mm" ) self.addLine( "On the Y" + axisString + str( int ( roundedLow.y ) ) + " mm and ends at " + str( int ( roundedHigh.y ) ) + " mm, for a depth of " + str( int ( extent.y ) ) + " mm" ) self.addLine( "On the Z" + axisString + str( int ( roundedLow.z ) ) + " mm and ends at " + str( int ( roundedHigh.z ) ) + " mm, for a height of " + str( int ( extent.z ) ) + " mm" ) @@ -242,7 +248,7 @@ class StatisticSkein: self.addLine( "The following procedures have been performed on the skein:" ) for procedure in self.procedures: self.addLine( procedure ) - self.addLine( "The layer thickness is " + str( self.extrusionHeight ) + " mm." ) + self.addLine( "The layer thickness is " + str( self.layerThickness ) + " mm." ) self.addLine( "The text has " + str( self.numberOfLines ) + " lines and a size of " + str( kilobytes ) + " KB." ) self.addLine( "The total build time is " + str( int( round( self.totalBuildTime ) ) ) + " s." ) self.addLine( "The total distance extruded is " + str( int( round( self.totalDistanceExtruded ) ) ) + " mm." ) @@ -275,8 +281,8 @@ class StatisticSkein: self.extrusionDiameter = gcodec.getDoubleAfterFirstLetter( splitLine[ 1 ] ) elif firstWord == '(<extrusionWidth>': self.extrusionWidth = gcodec.getDoubleAfterFirstLetter( splitLine[ 1 ] ) - elif firstWord == '(<extrusionHeight>': - self.extrusionHeight = gcodec.getDoubleAfterFirstLetter( splitLine[ 1 ] ) + elif firstWord == '(<layerThickness>': + self.layerThickness = gcodec.getDoubleAfterFirstLetter( splitLine[ 1 ] ) elif firstWord == '(<procedureDone>': self.procedures.append( splitLine[ 1 ] ) diff --git a/trunk/reprap/miscellaneous/python-beanshell-scripts/skeinforge_tools/analyze_plugins/vectorwrite.py b/trunk/reprap/miscellaneous/python-beanshell-scripts/skeinforge_tools/analyze_plugins/vectorwrite.py index b806621b..2e76e5f0 100644 --- a/trunk/reprap/miscellaneous/python-beanshell-scripts/skeinforge_tools/analyze_plugins/vectorwrite.py +++ b/trunk/reprap/miscellaneous/python-beanshell-scripts/skeinforge_tools/analyze_plugins/vectorwrite.py @@ -55,35 +55,35 @@ __license__ = "GPL 3.0" #add open webbrowser first time file is created choice -def writeOutput( filename, gcodeText = '' ): +def writeOutput( fileName, gcodeText = '' ): "Write scalable vector graphics for a skeinforge gcode file, if 'Write Scalable Vector Graphics for Skeinforge Chain' is selected." vectorwritePreferences = VectorwritePreferences() preferences.readPreferences( vectorwritePreferences ) if gcodeText == '': - gcodeText = gcodec.getFileText( filename ) + gcodeText = gcodec.getFileText( fileName ) if vectorwritePreferences.activateVectorwrite.value: - writeVectorFileGivenText( filename, gcodeText, vectorwritePreferences ) + writeVectorFileGivenText( fileName, gcodeText, vectorwritePreferences ) -def writeVectorFile( filename = '' ): - "Write scalable vector graphics for a gcode file. If no filename is specified, write scalable vector graphics for the first gcode file in this folder." - if filename == '': +def writeVectorFile( fileName = '' ): + "Write scalable vector graphics for a gcode file. If no fileName is specified, write scalable vector graphics for the first gcode file in this folder." + if fileName == '': unmodified = gcodec.getUnmodifiedGCodeFiles() if len( unmodified ) == 0: print( "There is no gcode file in this folder." ) return - filename = unmodified[ 0 ] + fileName = unmodified[ 0 ] vectorwritePreferences = VectorwritePreferences() preferences.readPreferences( vectorwritePreferences ) - gcodeText = gcodec.getFileText( filename ) - writeVectorFileGivenText( filename, gcodeText, vectorwritePreferences ) + gcodeText = gcodec.getFileText( fileName ) + writeVectorFileGivenText( fileName, gcodeText, vectorwritePreferences ) -def writeVectorFileGivenText( filename, gcodeText, vectorwritePreferences ): +def writeVectorFileGivenText( fileName, gcodeText, vectorwritePreferences ): "Write scalable vector graphics for a gcode file." if gcodeText == '': return '' skein = VectorwriteSkein() skein.parseGcode( gcodeText, vectorwritePreferences ) - print( 'The scalable vector graphics file is saved as ' + skein.getFilenameWriteFiles( filename ) ) + print( 'The scalable vector graphics file is saved as ' + skein.getFilenameWriteFiles( fileName ) ) class VectorWindow: @@ -149,21 +149,21 @@ class VectorWindow: class VectorwritePreferences: "A class to handle the vectorwrite preferences." def __init__( self ): - "Set the default preferences, execute title & preferences filename." + "Set the default preferences, execute title & preferences fileName." #Set the default preferences. self.archive = [] self.activateVectorwrite = preferences.BooleanPreference().getFromValue( 'Activate Vectorwrite', False ) self.archive.append( self.activateVectorwrite ) - self.filenameInput = preferences.Filename().getFromFilename( [ ( 'Gcode text files', '*.gcode' ) ], 'Open File to Write Vector Graphics for', '' ) - self.archive.append( self.filenameInput ) + self.fileNameInput = preferences.Filename().getFromFilename( [ ( 'Gcode text files', '*.gcode' ) ], 'Open File to Write Vector Graphics for', '' ) + self.archive.append( self.fileNameInput ) self.minimumNumberLayersMultipleFiles = preferences.IntPreference().getFromValue( 'Minimum Number of Layers for Multiple Files (integer):', 10 ) self.archive.append( self.minimumNumberLayersMultipleFiles ) self.pixelsWidthExtrusion = preferences.FloatPreference().getFromValue( 'Pixels over Extrusion Width (ratio):', 5.0 ) self.archive.append( self.pixelsWidthExtrusion ) - #Create the archive, title of the execute button, title of the dialog & preferences filename. + #Create the archive, title of the execute button, title of the dialog & preferences fileName. self.executeTitle = 'Write Vector Graphics' - self.filenamePreferences = preferences.getPreferencesFilePath( 'vectorwrite.csv' ) - self.filenameHelp = 'skeinforge_tools.analyze_plugins.vectorwrite.html' + self.fileNamePreferences = preferences.getPreferencesFilePath( 'vectorwrite.csv' ) + self.fileNameHelp = 'skeinforge_tools.analyze_plugins.vectorwrite.html' self.saveTitle = 'Save Preferences' self.title = 'Vectorwrite Preferences' @@ -206,10 +206,10 @@ class VectorwriteSkein: self.vectorWindow.setPaneCorners( self.scaleCornerLow, self.scaleCornerHigh ) self.vectorWindows.append( self.vectorWindow ) - def getFilenameWriteFiles( self, filename ): - "Write one or multiple files for the filename." - directoryName = os.path.dirname( filename ) - baseUnderscoredName = os.path.basename( filename ).replace( ' ', '_' ) + def getFilenameWriteFiles( self, fileName ): + "Write one or multiple files for the fileName." + directoryName = os.path.dirname( fileName ) + baseUnderscoredName = os.path.basename( fileName ).replace( ' ', '_' ) baseUnderscoredPrefix = baseUnderscoredName[ : baseUnderscoredName.rfind( '.' ) ] if not self.isMultiple: suffixFilename = os.path.join( directoryName, baseUnderscoredPrefix + '.svg' ) @@ -239,7 +239,7 @@ class VectorwriteSkein: return baseUnderscoredPrefix + '_' + zeroPrefixIndex def getSuffixFilename( self, baseUnderscoredPrefix, multipleDirectoryName, vectorWindowIndex ): - "Get suffix filename for a numbered vector window." + "Get suffix fileName for a numbered vector window." return os.path.join( multipleDirectoryName, self.getLinkBasename( baseUnderscoredPrefix, vectorWindowIndex ) + '.svg' ) def initializeActiveLocation( self ): @@ -361,9 +361,9 @@ class VectorwriteSkein: def execute( self ): "Write button has been clicked." - filenames = polyfile.getFileOrGcodeDirectory( self.filenameInput.value, self.filenameInput.wasCancelled ) - for filename in filenames: - writeVectorFile( filename ) + fileNames = polyfile.getFileOrGcodeDirectory( self.fileNameInput.value, self.fileNameInput.wasCancelled ) + for fileName in fileNames: + writeVectorFile( fileName ) def main( hashtable = None ): diff --git a/trunk/reprap/miscellaneous/python-beanshell-scripts/skeinforge_tools/carve.py b/trunk/reprap/miscellaneous/python-beanshell-scripts/skeinforge_tools/carve.py new file mode 100644 index 00000000..272fdd59 --- /dev/null +++ b/trunk/reprap/miscellaneous/python-beanshell-scripts/skeinforge_tools/carve.py @@ -0,0 +1,399 @@ +""" +Carve shape is a script to carve a list of slice layers. + +Carve carves a list of slices into svg slice layers. The 'Layer Thickness' is the thickness the extrusion layer at default extruder speed, +this is the most important carve preference. The 'Extrusion Diameter over Thickness is the ratio of the extrusion diameter over the +layer thickness, the default is 1.25. The 'Extrusion Width over Thickness' is the ratio of the extrusion width over the layer thickness, +the default is 1.5. A ratio of one means the extrusion is a circle, a typical ratio of 1.5 means the extrusion is a wide oval. These +values should be measured from a test extrusion line. + +The extrusion fill density ratio that is printed to the console, ( it is derived quantity not a parameter ) is the area of the extrusion diameter +over the extrusion width over the layer thickness. Assuming the extrusion diameter is correct, a high value means the filament will be +packed tightly, and the object will be almost as dense as the filament. If the value is too high, there could be too little room for the +filament, and the extruder will end up plowing through the extra filament. A low value means the filaments will be far away from each +other, the object will be leaky and light. The value with the default extrusion preferences is around 0.82. + +Rarely changed preferences are 'Import Coarseness', 'Mesh Type', 'Infill Bridge Width Over Thickness', 'Infill in Direction of Bridges' & +'Layer Thickness over Precision'. When a triangle mesh has holes in it, the triangle mesh slicer switches over to a slow algorithm that +spans gaps in the mesh. The higher the import coarseness, the wider the gaps in the mesh it will span. An import coarseness of one +means it will span gaps the width of the extrusion. When the Mesh Type preference is Correct Mesh, the mesh will be accurately +carved, and if a hole is found, carve will switch over to the algorithm that spans gaps. If the Mesh Type preference is Unproven +Mesh, carve will use the gap spanning algorithm from the start. The problem with the gap spanning algothm is that it will span gaps, +even if there actually is a gap in the model. Infill bridge width over thickness ratio is the ratio of the extrusion width over the layer +thickness on a bridge layer. If the infill in direction of bridges preference is chosen, the infill will be in the direction of bridges across +gaps, so that the fill will be able to span a bridge easier. The 'Layer Thickness over Precision' is the ratio of the layer thickness over +the smallest change in value. The higher the layer thickness over precision, the more significant figures the output numbers will have, +the default is ten. + +To run carve, in a shell type: +> python carve.py + +The following examples carve the GNU Triangulated Surface file Screw Holder Bottom.stl. The examples are run in a terminal in the +folder which contains Screw Holder Bottom.stl and carve.py. The preferences can be set in the dialog or by changing the preferences file +'carve.csv' with a text editor or a spreadsheet program set to separate tabs. + + +> python carve.py +This brings up the dialog, after clicking 'Carve', the following is printed: +File Screw Holder Bottom.stl is being carved. +The carved file is saved as Screw Holder Bottom_carve.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 carve +>>> carve.main() +File Screw Holder Bottom.stl is being carved. +The carved file is saved as Screw Holder Bottom_carve.svg +It took 3 seconds to carve the file. + + +>>> carve.writeOutput() +File Screw Holder Bottom.gcode is being carved. +The carved file is saved as Screw Holder Bottom_carve.svg +It took 3 seconds to carve the file. + + +>>> carve.getCarveGcode(" +54 162 108 Number of Vertices,Number of Edges,Number of Faces +-5.800000000000001 5.341893939393939 4.017841892579603 Vertex Coordinates XYZ +5.800000000000001 5.341893939393939 4.017841892579603 +.. +many lines of GNU Triangulated Surface vertices, edges and faces +.. +") + +""" + +from __future__ import absolute_import +try: + import psyco + psyco.full() +except: + pass +#Init has to be imported first because it has code to workaround the python bug where relative imports don't work if the module is imported as a main module. +import __init__ + +from skeinforge_tools.skeinforge_utilities import euclidean +from skeinforge_tools.skeinforge_utilities import gcodec +from skeinforge_tools.skeinforge_utilities import preferences +from skeinforge_tools.skeinforge_utilities import triangle_mesh +from skeinforge_tools import analyze +from skeinforge_tools.skeinforge_utilities import interpret +from skeinforge_tools import polyfile +import cStringIO +import math +import os +import sys +import time +import webbrowser + + +__author__ = "Enrique Perez (perez_enrique@yahoo.com)" +__date__ = "$Date: 2008/02/05 $" +__license__ = "GPL 3.0" + + +def getCarveGcode( fileName, carvePreferences = None ): + "Carve a shape file." + carving = getCarving( fileName ) + if carving == None: + return '' + if carvePreferences == None: + carvePreferences = CarvePreferences() + preferences.readPreferences( carvePreferences ) + skein = CarveSkein() + skein.parseCarving( carvePreferences, carving ) + return skein.output.getvalue() + +def getCarving( fileName ): + "Get a carving for the file using an import plugin." + importPluginFilenames = interpret.getImportPluginFilenames() + for importPluginFilename in importPluginFilenames: + fileTypeDot = '.' + importPluginFilename + if fileName[ - len( fileTypeDot ) : ].lower() == fileTypeDot: + pluginModule = gcodec.getModule( importPluginFilename, 'import_plugins', __file__ ) + if pluginModule != None: + return pluginModule.getCarving( fileName ) + print( 'Could not find plugin to handle ' + fileName ) + return None + +def getParameterFromJavascript( lines, parameterName, parameterValue ): + "Get a paramater from lines of javascript." + for line in lines: + strippedLine = line.replace( ';', ' ' ).lstrip() + splitLine = strippedLine.split() + firstWord = gcodec.getFirstWord( splitLine ) + if firstWord == parameterName: + return float( splitLine[ 2 ] ) + return parameterValue + +def getReplacedInQuotes( original, replacement, text ): + "Replace what follows in quotes after the word." + wordAndQuote = original + '="' + originalIndexStart = text.find( wordAndQuote ) + if originalIndexStart == - 1: + return text + originalIndexEnd = text.find( '"', originalIndexStart + len( wordAndQuote ) ) + if originalIndexEnd == - 1: + return text + wordAndBothQuotes = text[ originalIndexStart : originalIndexEnd + 1 ] + return text.replace( wordAndBothQuotes, wordAndQuote + replacement + '"' ) + +def getReplacedTagString( replacementTagString, tagID, text ): + "Get text with the tag string replaced." + idString = 'id="' + tagID + '"' + idStringIndexStart = text.find( idString ) + if idStringIndexStart == - 1: + return text + tagBeginIndex = text.rfind( '<', 0, idStringIndexStart ) + tagEndIndex = text.find( '>', idStringIndexStart ) + if tagBeginIndex == - 1 or tagEndIndex == - 1: + return text + originalTagString = text[ tagBeginIndex : tagEndIndex + 1 ] + return text.replace( originalTagString, replacementTagString ) + +def getReplacedWordAndInQuotes( original, replacement, text ): + "Replace the word in the text and replace what follows in quotes after the word." + text = text.replace( 'replaceWith' + original, replacement ) + return getReplacedInQuotes( original, replacement, text ) + +def writeOutput( fileName = '' ): + "Carve a GNU Triangulated Surface file. If no fileName is specified, carve the first GNU Triangulated Surface file in this folder." + if fileName == '': + unmodified = gcodec.getFilesWithFileTypesWithoutWords( interpret.getImportPluginFilenames() ) + if len( unmodified ) == 0: + print( "There are no GNU Triangulated Surface files in this folder." ) + return + fileName = unmodified[ 0 ] + startTime = time.time() + carvePreferences = CarvePreferences() + preferences.readPreferences( carvePreferences ) + print( 'File ' + gcodec.getSummarizedFilename( fileName ) + ' is being carved.' ) + carveGcode = getCarveGcode( fileName, carvePreferences ) + if carveGcode == '': + return + suffixFilename = fileName[ : fileName.rfind( '.' ) ] + '_carve.svg' + suffixFilename = suffixFilename.replace( ' ', '_' ) + gcodec.writeFileText( suffixFilename, carveGcode ) + print( 'The carved file is saved as ' + gcodec.getSummarizedFilename( suffixFilename ) ) +# packageFilePath = os.path.abspath( __file__ ) +# for level in xrange( numberOfLevelsDeepInPackageHierarchy + 1 ): +# packageFilePath = os.path.dirname( packageFilePath ) +# documentationPath = os.path.join( os.path.join( packageFilePath, 'documentation' ), self.displayPreferences.fileNameHelp ) +# os.system( webbrowser.get().name + ' ' + documentationPath )#used this instead of webbrowser.open() to workaround webbrowser open() bug +# analyze.writeOutput( suffixFilename, carveGcode ) + os.system( webbrowser.get().name + ' ' + suffixFilename )#used this instead of webbrowser.open() to workaround webbrowser open() bug + print( 'It took ' + str( int( round( time.time() - startTime ) ) ) + ' seconds to carve the file.' ) + + +class CarvePreferences: + "A class to handle the carve preferences." + def __init__( self ): + "Set the default preferences, execute title & preferences fileName." + #Set the default preferences. + self.archive = [] + self.extrusionDiameterOverThickness = preferences.FloatPreference().getFromValue( 'Extrusion Diameter over Thickness (ratio):', 1.25 ) + self.archive.append( self.extrusionDiameterOverThickness ) + self.extrusionWidthOverThickness = preferences.FloatPreference().getFromValue( 'Extrusion Width over Thickness (ratio):', 1.5 ) + self.archive.append( self.extrusionWidthOverThickness ) + self.fileNameInput = preferences.Filename().getFromFilename( interpret.getTranslatorFileTypeTuples(), 'Open File to be Carved', '' ) + self.archive.append( self.fileNameInput ) + self.importCoarseness = preferences.FloatPreference().getFromValue( 'Import Coarseness (ratio):', 1.0 ) + self.archive.append( self.importCoarseness ) + self.meshTypeLabel = preferences.LabelDisplay().getFromName( 'Mesh Type: ' ) + self.archive.append( self.meshTypeLabel ) + importRadio = [] + self.correctMesh = preferences.Radio().getFromRadio( 'Correct Mesh', importRadio, True ) + self.archive.append( self.correctMesh ) + self.unprovenMesh = preferences.Radio().getFromRadio( 'Unproven Mesh', importRadio, False ) + self.archive.append( self.unprovenMesh ) + self.infillBridgeWidthOverThickness = preferences.FloatPreference().getFromValue( 'Infill Bridge Width over Thickness (ratio):', 1.5 ) + self.archive.append( self.infillBridgeWidthOverThickness ) + self.infillDirectionBridge = preferences.BooleanPreference().getFromValue( 'Infill in Direction of Bridges', True ) + self.archive.append( self.infillDirectionBridge ) + self.layerThickness = preferences.FloatPreference().getFromValue( 'Layer Thickness (mm):', 0.4 ) + self.archive.append( self.layerThickness ) + self.layerThicknessOverPrecision = preferences.FloatPreference().getFromValue( 'Layer Thickness over Precision (ratio):', 10.0 ) + self.archive.append( self.layerThicknessOverPrecision ) + #Create the archive, title of the execute button, title of the dialog & preferences fileName. + self.executeTitle = 'Carve' + self.fileNamePreferences = preferences.getPreferencesFilePath( 'carve.csv' ) + self.fileNameHelp = 'skeinforge_tools.carve.html' + self.saveTitle = 'Save Preferences' + self.title = 'Carve Preferences' + + def execute( self ): + "Carve button has been clicked." + fileNames = polyfile.getFileOrDirectoryTypes( self.fileNameInput.value, interpret.getImportPluginFilenames(), self.fileNameInput.wasCancelled ) + for fileName in fileNames: + writeOutput( fileName ) + + +class CarveSkein: + "A class to carve a GNU Triangulated Surface." + def __init__( self ): + self.margin = 20 + self.output = cStringIO.StringIO() + self.textHeight = 22.5 + self.unitScale = 3.7 + + def addInitializationToOutputSVG( self ): + "Add initialization gcode to the output." + endOfSVGHeaderIndex = self.svgTemplateLines.index( '//End of svg header' ) + self.addLines( self.svgTemplateLines[ : endOfSVGHeaderIndex ] ) + self.addLine( '\tdecimalPlacesCarried = ' + str( self.decimalPlacesCarried ) ) # Set decimal places carried. + self.addLine( '\textrusionDiameter = ' + self.getRounded( self.extrusionDiameter ) ) # Set extrusion diameter. + self.addLine( '\tlayerThickness = ' + self.getRounded( self.layerThickness ) ) # Set layer thickness. + self.addLine( '\textrusionWidth = ' + self.getRounded( self.extrusionWidth ) ) # Set extrusion width. + # Set bridge extrusion width over solid extrusion width. + self.addLine( '\tbridgeExtrusionWidthOverSolid = ' + euclidean.getRoundedToThreePlaces( self.bridgeExtrusionWidth / self.extrusionWidth ) ) + self.addLine( '\tprocedureDone = "carve"' ) # The skein has been carved. + self.addLine( '\textrusionStart = 1' ) # Initialization is finished, extrusion is starting. + beginningOfPathSectionIndex = self.svgTemplateLines.index( '//Beginning of path section' ) + self.addLines( self.svgTemplateLines[ endOfSVGHeaderIndex + 1 : beginningOfPathSectionIndex ] ) + + def addLayerStart( self, layerIndex, z ): + "Add the start lines for the layer." +# y = (1 * i + 1) * ( margin + sliceDimY * unitScale) + i * txtHeight + layerTranslateY = layerIndex * self.textHeight + ( layerIndex + 1 ) * ( self.extent.y * self.unitScale + self.margin ) + zRounded = self.getRounded( z ) + self.addLine( '\t\t<g id="z %s" transform="translate(%s, %s)">' % ( zRounded, self.getRounded( self.margin ), self.getRounded( layerTranslateY ) ) ) + self.addLine( '\t\t\t<text y="15" fill="#000" stroke="none">Layer %s, z %s</text>' % ( layerIndex, zRounded ) ) +# <g id="z 0.1" transform="translate(20, 242)"> +# <text y="15" fill="#000" stroke="none">Layer 1, z 0.1</text> +# unit scale (mm=3.7, in=96) +# +# g transform +# x = margin +# y = (layer + 1) * ( margin + (slice height * unit scale)) + (layer * 20) +# +# text +# y = text height +# +# path transform +# scale = (unit scale) (-1 * unitscale) +# translate = (-1 * minX) (-1 * minY) + + def addLine( self, line ): + "Add a line of text and a newline to the output." + self.output.write( line + "\n" ) + + def addLines( self, lines ): + "Add lines of text to the output." + for line in lines: + self.addLine( line ) + + def addRotatedLoopLayersToOutput( self, rotatedBoundaryLayers ): + "Add rotated boundary layers to the output." + for rotatedBoundaryLayerIndex in xrange( len( rotatedBoundaryLayers ) ): + rotatedBoundaryLayer = rotatedBoundaryLayers[ rotatedBoundaryLayerIndex ] + self.addRotatedLoopLayerToOutput( rotatedBoundaryLayerIndex, rotatedBoundaryLayer ) + + def addRotatedLoopLayerToOutput( self, layerIndex, rotatedBoundaryLayer ): + "Add rotated boundary layer to the output." + self.addLayerStart( layerIndex, rotatedBoundaryLayer.z ) + if rotatedBoundaryLayer.rotation != None: + self.addLine('\t\t\t//bridgeDirection %s' % rotatedBoundaryLayer.rotation ) # Indicate the bridge direction. +# <path transform="scale(3.7, -3.7) translate(0, 5)" d="M 0 -5 L 50 0 L60 50 L 5 50 z M 5 3 L5 15 L15 15 L15 5 z"/> +# transform = 'scale(' + unitScale + ' ' + (unitScale * -1) + ') translate(' + (sliceMinX * -1) + ' ' + (sliceMinY * -1) + ')' + pathString = '\t\t\t<path transform="scale(%s, %s) translate(%s, %s)" d="' % ( self.unitScale, - self.unitScale, self.getRounded( - self.cornerMinimum.x ), self.getRounded( - self.cornerMinimum.y ) ) + if len( rotatedBoundaryLayer.loops ) > 0: + pathString += self.getSVGLoopString( rotatedBoundaryLayer.loops[ 0 ] ) + for loop in rotatedBoundaryLayer.loops[ 1 : ]: + pathString += ' ' + self.getSVGLoopString( loop ) + pathString += '"/>' + self.addLine( pathString ) + self.addLine( '\t\t</g>' ) + + def addShutdownToOutput( self ): + "Add shutdown svg to the output." + endOfPathSectionIndex = self.svgTemplateLines.index( '//End of path section' ) + self.addLines( self.svgTemplateLines[ endOfPathSectionIndex + 1 : ] ) + + def getReplacedSVGTemplateLines( self, rotatedBoundaryLayers ): + "Get the lines of text from the svg_template.txt file." +#( layers.length + 1 ) * (margin + sliceDimY * unitScale + txtHeight) + margin + txtHeight + margin + 110 + svgTemplateText = gcodec.getFileTextInFileDirectory( __file__, 'svg_template.svg' ) + originalTextLines = gcodec.getTextLines( svgTemplateText ) + self.margin = getParameterFromJavascript( originalTextLines, 'margin', self.margin ) + self.textHeight = getParameterFromJavascript( originalTextLines, 'textHeight', self.textHeight ) + javascriptControlsWidth = getParameterFromJavascript( originalTextLines, 'javascripControlBoxX', 510.0 ) + noJavascriptControlsHeight = getParameterFromJavascript( originalTextLines, 'noJavascriptControlBoxY', 110.0 ) + controlTop = len( rotatedBoundaryLayers ) * ( self.margin + self.extent.y * self.unitScale + self.textHeight ) + 2.0 * self.margin + self.textHeight +# width = margin + (sliceDimX * unitScale) + margin; + svgTemplateText = getReplacedInQuotes( 'height', self.getRounded( controlTop + noJavascriptControlsHeight + self.margin ), svgTemplateText ) + width = 2.0 * self.margin + max( self.extent.y * self.unitScale, javascriptControlsWidth ) + svgTemplateText = getReplacedInQuotes( 'width', self.getRounded( width ), svgTemplateText ) + svgTemplateText = getReplacedWordAndInQuotes( 'layerThickness', self.getRounded( self.layerThickness ), svgTemplateText ) + svgTemplateText = getReplacedWordAndInQuotes( 'maxX', self.getRounded( self.cornerMaximum.x ), svgTemplateText ) + svgTemplateText = getReplacedWordAndInQuotes( 'minX', self.getRounded( self.cornerMinimum.x ), svgTemplateText ) + svgTemplateText = getReplacedWordAndInQuotes( 'dimX', self.getRounded( self.extent.x ), svgTemplateText ) + svgTemplateText = getReplacedWordAndInQuotes( 'maxY', self.getRounded( self.cornerMaximum.y ), svgTemplateText ) + svgTemplateText = getReplacedWordAndInQuotes( 'minY', self.getRounded( self.cornerMinimum.y ), svgTemplateText ) + svgTemplateText = getReplacedWordAndInQuotes( 'dimY', self.getRounded( self.extent.y ), svgTemplateText ) + svgTemplateText = getReplacedWordAndInQuotes( 'maxZ', self.getRounded( self.cornerMaximum.z ), svgTemplateText ) + svgTemplateText = getReplacedWordAndInQuotes( 'minZ', self.getRounded( self.cornerMinimum.z ), svgTemplateText ) + svgTemplateText = getReplacedWordAndInQuotes( 'dimZ', self.getRounded( self.extent.z ), svgTemplateText ) + noJavascriptControlsTagString = '<g id="noJavascriptControls" fill="#000" transform="translate(%s, %s)">' % ( self.getRounded( self.margin ), self.getRounded( controlTop ) ) + svgTemplateText = getReplacedTagString( noJavascriptControlsTagString, 'noJavascriptControls', svgTemplateText ) +# <g id="noJavascriptControls" fill="#000" transform="translate(20, 1400)"> + return gcodec.getTextLines( svgTemplateText ) + + def getRounded( self, number ): + "Get number rounded to the number of carried decimal places as a string." + return euclidean.getRoundedToDecimalPlaces( self.decimalPlacesCarried, number ) + + def getSVGLoopString( self, loop ): + "Get the svg loop string." + svgLoopString = '' + for pointIndex in xrange( len( loop ) ): + point = loop[ pointIndex ] + stringBeginning = 'M ' + if pointIndex > 0: + stringBeginning = ' L ' + svgLoopString += stringBeginning + self.getRounded( point.real ) + ' ' + self.getRounded( point.imag ) + return svgLoopString + ' z' + + def parseCarving( self, carvePreferences, carving ): + "Parse gnu triangulated surface text and store the carved gcode." + self.layerThickness = carvePreferences.layerThickness.value + self.setExtrusionDiameterWidth( carvePreferences ) + if carvePreferences.infillDirectionBridge.value: + carving.setCarveBridgeLayerThickness( self.bridgeLayerThickness ) + carving.setCarveLayerThickness( self.layerThickness ) + carving.setCarveExtrusionWidth( self.extrusionWidth ) + carving.setCarveImportCoarseness( carvePreferences.importCoarseness.value ) + carving.setCarveIsCorrectMesh( carvePreferences.correctMesh.value ) + rotatedBoundaryLayers = carving.getCarveRotatedBoundaryLayers() + self.cornerMaximum = carving.getCarveCornerMaximum() + self.cornerMinimum = carving.getCarveCornerMinimum() + #reset from slicable + self.layerThickness = carving.getCarveLayerThickness() + self.setExtrusionDiameterWidth( carvePreferences ) + self.decimalPlacesCarried = int( max( 0.0, math.ceil( 1.0 - math.log10( self.layerThickness / carvePreferences.layerThicknessOverPrecision.value ) ) ) ) + self.extent = self.cornerMaximum - self.cornerMinimum + self.svgTemplateLines = self.getReplacedSVGTemplateLines( rotatedBoundaryLayers ) + self.addInitializationToOutputSVG() + self.addRotatedLoopLayersToOutput( rotatedBoundaryLayers ) + self.addShutdownToOutput() + + def setExtrusionDiameterWidth( self, carvePreferences ): + "Set the extrusion diameter & width and the bridge thickness & width." + self.extrusionDiameter = carvePreferences.extrusionDiameterOverThickness.value * self.layerThickness + self.extrusionWidth = carvePreferences.extrusionWidthOverThickness.value * self.layerThickness + self.bridgeExtrusionWidth = carvePreferences.infillBridgeWidthOverThickness.value * self.layerThickness + self.bridgeLayerThickness = self.layerThickness * self.extrusionWidth / self.bridgeExtrusionWidth + + +def main(): + "Display the carve dialog." + if len( sys.argv ) > 1: + writeOutput( ' '.join( sys.argv[ 1 : ] ) ) + else: + preferences.displayDialog( CarvePreferences() ) + +if __name__ == "__main__": + main() diff --git a/trunk/reprap/miscellaneous/python-beanshell-scripts/skeinforge_tools/clip.py b/trunk/reprap/miscellaneous/python-beanshell-scripts/skeinforge_tools/clip.py index eed7b9ad..9f6dc1aa 100644 --- a/trunk/reprap/miscellaneous/python-beanshell-scripts/skeinforge_tools/clip.py +++ b/trunk/reprap/miscellaneous/python-beanshell-scripts/skeinforge_tools/clip.py @@ -44,7 +44,7 @@ The clipped file is saved as Screw Holder Bottom_clip.gcode >>> clip.getClipGcode(" -( GCode generated by May 8, 2008 slice.py ) +( GCode generated by May 8, 2008 carve.py ) ( Extruder Initialization ) .. many lines of gcode @@ -53,7 +53,7 @@ many lines of gcode >>> clip.getClipChainGcode(" -( GCode generated by May 8, 2008 slice.py ) +( GCode generated by May 8, 2008 carve.py ) ( Extruder Initialization ) .. many lines of gcode @@ -72,7 +72,7 @@ from skeinforge_tools.skeinforge_utilities import intercircle from skeinforge_tools.skeinforge_utilities import preferences from skeinforge_tools import analyze from skeinforge_tools import comb -from skeinforge_tools import import_translator +from skeinforge_tools.skeinforge_utilities import interpret from skeinforge_tools import polyfile import cStringIO import math @@ -84,11 +84,11 @@ __author__ = "Enrique Perez (perez_enrique@yahoo.com)" __date__ = "$Date: 2008/21/04 $" __license__ = "GPL 3.0" -def getClipChainGcode( filename, gcodeText, loopTailorPreferences = None ): +def getClipChainGcode( fileName, gcodeText, loopTailorPreferences = None ): "Clip a gcode linear move text. Chain clip the gcode if it is not already clipped." - gcodeText = gcodec.getGcodeFileText( filename, gcodeText ) + gcodeText = gcodec.getGcodeFileText( fileName, gcodeText ) if not gcodec.isProcedureDone( gcodeText, 'comb' ): - gcodeText = comb.getCombChainGcode( filename, gcodeText ) + gcodeText = comb.getCombChainGcode( fileName, gcodeText ) return getClipGcode( gcodeText, loopTailorPreferences ) def getClipGcode( gcodeText, loopTailorPreferences = None ): @@ -106,20 +106,20 @@ def getClipGcode( gcodeText, loopTailorPreferences = None ): skein.parseGcode( gcodeText, loopTailorPreferences ) return skein.output.getvalue() -def writeOutput( filename = '' ): - "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." - if filename == '': - unmodified = import_translator.getGNUTranslatorFilesUnmodified() +def writeOutput( fileName = '' ): + "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." + if fileName == '': + unmodified = interpret.getGNUTranslatorFilesUnmodified() if len( unmodified ) == 0: print( "There are no unmodified gcode files in this folder." ) return - filename = unmodified[ 0 ] + fileName = unmodified[ 0 ] loopTailorPreferences = ClipPreferences() preferences.readPreferences( loopTailorPreferences ) startTime = time.time() - print( 'File ' + gcodec.getSummarizedFilename( filename ) + ' is being chain clipped.' ) - suffixFilename = filename[ : filename.rfind( '.' ) ] + '_clip.gcode' - loopTailorGcode = getClipChainGcode( filename, '', loopTailorPreferences ) + print( 'File ' + gcodec.getSummarizedFilename( fileName ) + ' is being chain clipped.' ) + suffixFilename = fileName[ : fileName.rfind( '.' ) ] + '_clip.gcode' + loopTailorGcode = getClipChainGcode( fileName, '', loopTailorPreferences ) if loopTailorGcode == '': return gcodec.writeFileText( suffixFilename, loopTailorGcode ) @@ -131,27 +131,27 @@ def writeOutput( filename = '' ): class ClipPreferences: "A class to handle the clip preferences." def __init__( self ): - "Set the default preferences, execute title & preferences filename." + "Set the default preferences, execute title & preferences fileName." #Set the default preferences. self.archive = [] self.activateClip = preferences.BooleanPreference().getFromValue( 'Activate Clip', True ) self.archive.append( self.activateClip ) self.clipOverExtrusionWidth = preferences.FloatPreference().getFromValue( 'Clip Over Extrusion Width (ratio):', 0.15 ) self.archive.append( self.clipOverExtrusionWidth ) - self.filenameInput = preferences.Filename().getFromFilename( import_translator.getGNUTranslatorGcodeFileTypeTuples(), 'Open File to be Clipped', '' ) - self.archive.append( self.filenameInput ) - #Create the archive, title of the execute button, title of the dialog & preferences filename. + self.fileNameInput = preferences.Filename().getFromFilename( interpret.getGNUTranslatorGcodeFileTypeTuples(), 'Open File to be Clipped', '' ) + self.archive.append( self.fileNameInput ) + #Create the archive, title of the execute button, title of the dialog & preferences fileName. self.executeTitle = 'Clip' - self.filenamePreferences = preferences.getPreferencesFilePath( 'clip.csv' ) - self.filenameHelp = 'skeinforge_tools.clip.html' + self.fileNamePreferences = preferences.getPreferencesFilePath( 'clip.csv' ) + self.fileNameHelp = 'skeinforge_tools.clip.html' self.saveTitle = 'Save Preferences' self.title = 'Clip Preferences' def execute( self ): "Clip button has been clicked." - filenames = polyfile.getFileOrDirectoryTypesUnmodifiedGcode( self.filenameInput.value, import_translator.getGNUTranslatorFileTypes(), self.filenameInput.wasCancelled ) - for filename in filenames: - writeOutput( filename ) + fileNames = polyfile.getFileOrDirectoryTypesUnmodifiedGcode( self.fileNameInput.value, interpret.getImportPluginFilenames(), self.fileNameInput.wasCancelled ) + for fileName in fileNames: + writeOutput( fileName ) class ClipSkein: diff --git a/trunk/reprap/miscellaneous/python-beanshell-scripts/skeinforge_tools/comb.py b/trunk/reprap/miscellaneous/python-beanshell-scripts/skeinforge_tools/comb.py index baf0741b..b7ba70e1 100644 --- a/trunk/reprap/miscellaneous/python-beanshell-scripts/skeinforge_tools/comb.py +++ b/trunk/reprap/miscellaneous/python-beanshell-scripts/skeinforge_tools/comb.py @@ -4,7 +4,7 @@ Comb is a script to comb the extrusion hair of a gcode file. The default 'Activate Comb' checkbox is on. When it is on, the functions described below will work, when it is off, the functions will not be called. -Comb bends the extruder travel paths around holes in the slice, to avoid stringers. It moves the extruder to the inside of outer +Comb bends the extruder travel paths around holes in the carve, to avoid stringers. It moves the extruder to the inside of outer perimeters before turning the extruder on so any start up ooze will be inside the shape. It jitters the loop end position to a different place on each layer to prevent the a ridge from forming. The 'Arrival Inset Follow Distance over Extrusion Width' is the ratio of the amount before the start of the outer perimeter the extruder will be moved to. A high value means the extruder will @@ -48,7 +48,7 @@ The combed file is saved as Screw Holder Bottom_comb.gcode >>> comb.getCombGcode(" -( GCode generated by May 8, 2008 slice.py ) +( GCode generated by May 8, 2008 carve.py ) ( Extruder Initialization ) .. many lines of gcode @@ -57,7 +57,7 @@ many lines of gcode >>> comb.getCombChainGcode(" -( GCode generated by May 8, 2008 slice.py ) +( GCode generated by May 8, 2008 carve.py ) ( Extruder Initialization ) .. many lines of gcode @@ -75,7 +75,7 @@ from skeinforge_tools.skeinforge_utilities import gcodec from skeinforge_tools.skeinforge_utilities import intercircle from skeinforge_tools.skeinforge_utilities import preferences from skeinforge_tools import analyze -from skeinforge_tools import import_translator +from skeinforge_tools.skeinforge_utilities import interpret from skeinforge_tools import polyfile from skeinforge_tools import tower import cStringIO @@ -90,11 +90,11 @@ __license__ = "GPL 3.0" #patched over falling tower comb bug if location.z < self.getBetweens()[ 0 ][ 0 ].z + 0.5 * self.extrusionWidth, but a real solution would be nice #addLoopsBeforeLeavingPerimeter or something before crossing bug, seen on layer 8 of Screw holder -def getCombChainGcode( filename, gcodeText, combPreferences = None ): +def getCombChainGcode( fileName, gcodeText, combPreferences = None ): "Comb a gcode linear move text. Chain comb the gcode if it is not already combed." - gcodeText = gcodec.getGcodeFileText( filename, gcodeText ) + gcodeText = gcodec.getGcodeFileText( fileName, gcodeText ) if not gcodec.isProcedureDone( gcodeText, 'tower' ): - gcodeText = tower.getTowerChainGcode( filename, gcodeText ) + gcodeText = tower.getTowerChainGcode( fileName, gcodeText ) return getCombGcode( gcodeText, combPreferences ) def getCombGcode( gcodeText, combPreferences = None ): @@ -118,20 +118,20 @@ def isLoopNumberEqual( betweenX, betweenXIndex, loopNumber ): return False return betweenX[ betweenXIndex ].index == loopNumber -def writeOutput( filename = '' ): - "Comb a gcode linear move file. Chain comb the gcode if it is not already combed. If no filename is specified, comb the first unmodified gcode file in this folder." - if filename == '': - unmodified = import_translator.getGNUTranslatorFilesUnmodified() +def writeOutput( fileName = '' ): + "Comb a gcode linear move file. Chain comb the gcode if it is not already combed. If no fileName is specified, comb the first unmodified gcode file in this folder." + if fileName == '': + unmodified = interpret.getGNUTranslatorFilesUnmodified() if len( unmodified ) == 0: print( "There are no unmodified gcode files in this folder." ) return - filename = unmodified[ 0 ] + fileName = unmodified[ 0 ] combPreferences = CombPreferences() preferences.readPreferences( combPreferences ) startTime = time.time() - print( 'File ' + gcodec.getSummarizedFilename( filename ) + ' is being chain combed.' ) - suffixFilename = filename[ : filename.rfind( '.' ) ] + '_comb.gcode' - combGcode = getCombChainGcode( filename, '', combPreferences ) + print( 'File ' + gcodec.getSummarizedFilename( fileName ) + ' is being chain combed.' ) + suffixFilename = fileName[ : fileName.rfind( '.' ) ] + '_comb.gcode' + combGcode = getCombChainGcode( fileName, '', combPreferences ) if combGcode == '': return gcodec.writeFileText( suffixFilename, combGcode ) @@ -143,7 +143,7 @@ def writeOutput( filename = '' ): class CombPreferences: "A class to handle the comb preferences." def __init__( self ): - "Set the default preferences, execute title & preferences filename." + "Set the default preferences, execute title & preferences fileName." #Set the default preferences. self.archive = [] self.activateComb = preferences.BooleanPreference().getFromValue( 'Activate Comb', True ) @@ -154,20 +154,20 @@ class CombPreferences: self.archive.append( self.jitterOverExtrusionWidth ) self.minimumPerimeterDepartureDistanceOverExtrusionWidth = preferences.FloatPreference().getFromValue( 'Minimum Perimeter Departure Distance over Extrusion Width (ratio):', 30.0 ) self.archive.append( self.minimumPerimeterDepartureDistanceOverExtrusionWidth ) - self.filenameInput = preferences.Filename().getFromFilename( import_translator.getGNUTranslatorGcodeFileTypeTuples(), 'Open File to be Combed', '' ) - self.archive.append( self.filenameInput ) - #Create the archive, title of the execute button, title of the dialog & preferences filename. + self.fileNameInput = preferences.Filename().getFromFilename( interpret.getGNUTranslatorGcodeFileTypeTuples(), 'Open File to be Combed', '' ) + self.archive.append( self.fileNameInput ) + #Create the archive, title of the execute button, title of the dialog & preferences fileName. self.executeTitle = 'Comb' - self.filenamePreferences = preferences.getPreferencesFilePath( 'comb.csv' ) - self.filenameHelp = 'skeinforge_tools.comb.html' + self.fileNamePreferences = preferences.getPreferencesFilePath( 'comb.csv' ) + self.fileNameHelp = 'skeinforge_tools.comb.html' self.saveTitle = 'Save Preferences' self.title = 'Comb Preferences' def execute( self ): "Comb button has been clicked." - filenames = polyfile.getFileOrDirectoryTypesUnmodifiedGcode( self.filenameInput.value, import_translator.getGNUTranslatorFileTypes(), self.filenameInput.wasCancelled ) - for filename in filenames: - writeOutput( filename ) + fileNames = polyfile.getFileOrDirectoryTypesUnmodifiedGcode( self.fileNameInput.value, interpret.getImportPluginFilenames(), self.fileNameInput.wasCancelled ) + for fileName in fileNames: + writeOutput( fileName ) class CombSkein: @@ -491,7 +491,8 @@ class CombSkein: if self.isLoopPerimeter: if self.isNextExtruderOn(): self.loopPath = euclidean.PathZ( location.z ) - self.beforeLoopLocation = self.oldLocation.dropAxis( 2 ) + if self.oldLocation != None: + self.beforeLoopLocation = self.oldLocation.dropAxis( 2 ) if self.loopPath != None: self.loopPath.path.append( location.dropAxis( 2 ) ) self.oldLocation = location diff --git a/trunk/reprap/miscellaneous/python-beanshell-scripts/skeinforge_tools/cool.py b/trunk/reprap/miscellaneous/python-beanshell-scripts/skeinforge_tools/cool.py index b93f1624..c585406d 100644 --- a/trunk/reprap/miscellaneous/python-beanshell-scripts/skeinforge_tools/cool.py +++ b/trunk/reprap/miscellaneous/python-beanshell-scripts/skeinforge_tools/cool.py @@ -55,7 +55,7 @@ It took 34 seconds to cool the file. >>> cool.getCoolGcode(" -( GCode generated by May 8, 2008 slice.py ) +( GCode generated by May 8, 2008 carve.py ) ( Extruder Initialization ) .. many lines of gcode @@ -64,7 +64,7 @@ many lines of gcode >>> cool.getCoolChainGcode(" -( GCode generated by May 8, 2008 slice.py ) +( GCode generated by May 8, 2008 carve.py ) ( Extruder Initialization ) .. many lines of gcode @@ -83,7 +83,7 @@ from skeinforge_tools.skeinforge_utilities import intercircle from skeinforge_tools.skeinforge_utilities import preferences from skeinforge_tools import analyze from skeinforge_tools import clip -from skeinforge_tools import import_translator +from skeinforge_tools.skeinforge_utilities import interpret from skeinforge_tools import polyfile import cStringIO import math @@ -96,11 +96,11 @@ __date__ = "$Date: 2008/21/04 $" __license__ = "GPL 3.0" -def getCoolChainGcode( filename, gcodeText, coolPreferences = None ): +def getCoolChainGcode( fileName, gcodeText, coolPreferences = None ): "Cool a gcode linear move text. Chain cool the gcode if it is not already cooled." - gcodeText = gcodec.getGcodeFileText( filename, gcodeText ) + gcodeText = gcodec.getGcodeFileText( fileName, gcodeText ) if not gcodec.isProcedureDone( gcodeText, 'clip' ): - gcodeText = clip.getClipChainGcode( filename, gcodeText ) + gcodeText = clip.getClipChainGcode( fileName, gcodeText ) return getCoolGcode( gcodeText, coolPreferences ) def getCoolGcode( gcodeText, coolPreferences = None ): @@ -118,20 +118,20 @@ def getCoolGcode( gcodeText, coolPreferences = None ): skein.parseGcode( gcodeText, coolPreferences ) return skein.output.getvalue() -def writeOutput( filename = '' ): - "Cool a gcode linear move file. Chain cool the gcode if it is not already cooled. If no filename is specified, cool the first unmodified gcode file in this folder." - if filename == '': - unmodified = import_translator.getGNUTranslatorFilesUnmodified() +def writeOutput( fileName = '' ): + "Cool a gcode linear move file. Chain cool the gcode if it is not already cooled. If no fileName is specified, cool the first unmodified gcode file in this folder." + if fileName == '': + unmodified = interpret.getGNUTranslatorFilesUnmodified() if len( unmodified ) == 0: print( "There are no unmodified gcode files in this folder." ) return - filename = unmodified[ 0 ] + fileName = unmodified[ 0 ] coolPreferences = CoolPreferences() preferences.readPreferences( coolPreferences ) startTime = time.time() - print( 'File ' + gcodec.getSummarizedFilename( filename ) + ' is being chain cooled.' ) - suffixFilename = filename[ : filename.rfind( '.' ) ] + '_cool.gcode' - coolGcode = getCoolChainGcode( filename, '', coolPreferences ) + print( 'File ' + gcodec.getSummarizedFilename( fileName ) + ' is being chain cooled.' ) + suffixFilename = fileName[ : fileName.rfind( '.' ) ] + '_cool.gcode' + coolGcode = getCoolChainGcode( fileName, '', coolPreferences ) if coolGcode == '': return gcodec.writeFileText( suffixFilename, coolGcode ) @@ -231,31 +231,31 @@ class CoolSkein: class CoolPreferences: "A class to handle the cool preferences." def __init__( self ): - "Set the default preferences, execute title & preferences filename." + "Set the default preferences, execute title & preferences fileName." #Set the default preferences. self.archive = [] self.activateCool = preferences.BooleanPreference().getFromValue( 'Activate Cool', True ) self.archive.append( self.activateCool ) - self.filenameInput = preferences.Filename().getFromFilename( import_translator.getGNUTranslatorGcodeFileTypeTuples(), 'Open File to be Cooled', '' ) - self.archive.append( self.filenameInput ) + self.fileNameInput = preferences.Filename().getFromFilename( interpret.getGNUTranslatorGcodeFileTypeTuples(), 'Open File to be Cooled', '' ) + self.archive.append( self.fileNameInput ) self.minimumLayerTime = preferences.FloatPreference().getFromValue( 'Minimum Layer Time (seconds):', 60.0 ) self.archive.append( self.minimumLayerTime ) self.turnFanOnAtBeginning = preferences.BooleanPreference().getFromValue( 'Turn Fan On at Beginning', True ) self.archive.append( self.turnFanOnAtBeginning ) self.turnFanOffAtEnding = preferences.BooleanPreference().getFromValue( 'Turn Fan Off at Ending', True ) self.archive.append( self.turnFanOffAtEnding ) - #Create the archive, title of the execute button, title of the dialog & preferences filename. + #Create the archive, title of the execute button, title of the dialog & preferences fileName. self.executeTitle = 'Cool' - self.filenamePreferences = preferences.getPreferencesFilePath( 'cool.csv' ) - self.filenameHelp = 'skeinforge_tools.cool.html' + self.fileNamePreferences = preferences.getPreferencesFilePath( 'cool.csv' ) + self.fileNameHelp = 'skeinforge_tools.cool.html' self.saveTitle = 'Save Preferences' self.title = 'Cool Preferences' def execute( self ): "Cool button has been clicked." - filenames = polyfile.getFileOrDirectoryTypesUnmodifiedGcode( self.filenameInput.value, import_translator.getGNUTranslatorFileTypes(), self.filenameInput.wasCancelled ) - for filename in filenames: - writeOutput( filename ) + fileNames = polyfile.getFileOrDirectoryTypesUnmodifiedGcode( self.fileNameInput.value, interpret.getImportPluginFilenames(), self.fileNameInput.wasCancelled ) + for fileName in fileNames: + writeOutput( fileName ) def main( hashtable = None ): diff --git a/trunk/reprap/miscellaneous/python-beanshell-scripts/skeinforge_tools/export.py b/trunk/reprap/miscellaneous/python-beanshell-scripts/skeinforge_tools/export.py index 3e29331a..b5b3f203 100644 --- a/trunk/reprap/miscellaneous/python-beanshell-scripts/skeinforge_tools/export.py +++ b/trunk/reprap/miscellaneous/python-beanshell-scripts/skeinforge_tools/export.py @@ -56,7 +56,7 @@ from skeinforge_tools.skeinforge_utilities import gcodec from skeinforge_tools.skeinforge_utilities import intercircle from skeinforge_tools.skeinforge_utilities import preferences from skeinforge_tools import analyze -from skeinforge_tools import import_translator +from skeinforge_tools.skeinforge_utilities import interpret from skeinforge_tools import polyfile from skeinforge_tools import unpause import cStringIO @@ -92,23 +92,23 @@ def getSelectedPlugin( exportPreferences ): return plugin return None -def writeOutput( filename = '' ): +def writeOutput( fileName = '' ): """Export a gcode linear move file. Chain export the gcode if it is not already exported. - If no filename is specified, export the first unmodified gcode file in this folder.""" - if filename == '': - unmodified = import_translator.getGNUTranslatorFilesUnmodified() + If no fileName is specified, export the first unmodified gcode file in this folder.""" + if fileName == '': + unmodified = interpret.getGNUTranslatorFilesUnmodified() if len( unmodified ) == 0: print( "There are no unmodified gcode files in this folder." ) return - filename = unmodified[ 0 ] + fileName = unmodified[ 0 ] exportPreferences = ExportPreferences() preferences.readPreferences( exportPreferences ) startTime = time.time() - print( 'File ' + gcodec.getSummarizedFilename( filename ) + ' is being chain exported.' ) - suffixFilename = filename[ : filename.rfind( '.' ) ] + '_export.' + exportPreferences.fileExtension.value - gcodeText = gcodec.getGcodeFileText( filename, '' ) + print( 'File ' + gcodec.getSummarizedFilename( fileName ) + ' is being chain exported.' ) + suffixFilename = fileName[ : fileName.rfind( '.' ) ] + '_export.' + exportPreferences.fileExtension.value + gcodeText = gcodec.getGcodeFileText( fileName, '' ) if not gcodec.isProcedureDone( gcodeText, 'unpause' ): - gcodeText = unpause.getUnpauseChainGcode( filename, gcodeText ) + gcodeText = unpause.getUnpauseChainGcode( fileName, gcodeText ) if gcodeText == '': return analyze.writeOutput( suffixFilename, gcodeText ) @@ -133,7 +133,7 @@ def writeOutput( filename = '' ): class ExportPreferences: "A class to handle the export preferences." def __init__( self ): - "Set the default preferences, execute title & preferences filename." + "Set the default preferences, execute title & preferences fileName." #Set the default preferences. self.archive = [] self.activateExport = preferences.BooleanPreference().getFromValue( 'Activate Export', True ) @@ -169,20 +169,20 @@ class ExportPreferences: self.archive += self.exportOperationsButtons self.fileExtension = preferences.StringPreference().getFromValue( 'File Extension:', 'gcode' ) self.archive.append( self.fileExtension ) - self.filenameInput = preferences.Filename().getFromFilename( import_translator.getGNUTranslatorGcodeFileTypeTuples(), 'Open File to be Exported', '' ) - self.archive.append( self.filenameInput ) - #Create the archive, title of the execute button, title of the dialog & preferences filename. + self.fileNameInput = preferences.Filename().getFromFilename( interpret.getGNUTranslatorGcodeFileTypeTuples(), 'Open File to be Exported', '' ) + self.archive.append( self.fileNameInput ) + #Create the archive, title of the execute button, title of the dialog & preferences fileName. self.executeTitle = 'Export' - self.filenamePreferences = preferences.getPreferencesFilePath( 'export.csv' ) - self.filenameHelp = 'skeinforge_tools.export.html' + self.fileNamePreferences = preferences.getPreferencesFilePath( 'export.csv' ) + self.fileNameHelp = 'skeinforge_tools.export.html' self.saveTitle = 'Save Preferences' self.title = 'Export Preferences' def execute( self ): "Export button has been clicked." - filenames = polyfile.getFileOrDirectoryTypesUnmodifiedGcode( self.filenameInput.value, import_translator.getGNUTranslatorFileTypes(), self.filenameInput.wasCancelled ) - for filename in filenames: - writeOutput( filename ) + fileNames = polyfile.getFileOrDirectoryTypesUnmodifiedGcode( self.fileNameInput.value, interpret.getImportPluginFilenames(), self.fileNameInput.wasCancelled ) + for fileName in fileNames: + writeOutput( fileName ) class ExportSkein: diff --git a/trunk/reprap/miscellaneous/python-beanshell-scripts/skeinforge_tools/export_plugins/binary_16_byte.py b/trunk/reprap/miscellaneous/python-beanshell-scripts/skeinforge_tools/export_plugins/binary_16_byte.py index 09507e73..e3a81d6d 100644 --- a/trunk/reprap/miscellaneous/python-beanshell-scripts/skeinforge_tools/export_plugins/binary_16_byte.py +++ b/trunk/reprap/miscellaneous/python-beanshell-scripts/skeinforge_tools/export_plugins/binary_16_byte.py @@ -61,7 +61,7 @@ from __future__ import absolute_import import __init__ from skeinforge_tools.skeinforge_utilities import gcodec from skeinforge_tools.skeinforge_utilities import preferences -from skeinforge_tools import import_translator +from skeinforge_tools.skeinforge_utilities import interpret from skeinforge_tools import polyfile from struct import Struct import cStringIO @@ -107,11 +107,11 @@ def getStringFromCharacterSplitLine( character, splitLine ): return None return splitLine[ indexOfCharacter ][ 1 : ] -def getSummarizedFilename( filename ): - "Get the filename basename if the file is in the current working directory, otherwise return the original full name." - if os.getcwd() == os.path.dirname( filename ): - return os.path.basename( filename ) - return filename +def getSummarizedFilename( fileName ): + "Get the fileName basename if the file is in the current working directory, otherwise return the original full name." + if os.getcwd() == os.path.dirname( fileName ): + return os.path.basename( fileName ) + return fileName def getTextLines( text ): "Get the all the lines of text of a text." @@ -130,28 +130,28 @@ def isArchivable(): "Return whether or not this plugin is archivable." return True -def writeFileText( filename, fileText ): +def writeFileText( fileName, fileText ): "Write a text to a file." try: - file = open( filename, 'wb' ) + file = open( fileName, 'wb' ) file.write( fileText ) file.close() except IOError: - print( 'The file ' + filename + ' can not be written to.' ) + print( 'The file ' + fileName + ' can not be written to.' ) -def writeOutput( filename = '', gcodeText = '' ): +def writeOutput( fileName = '', gcodeText = '' ): "Write the exported version of a gcode file. This function, getOutput and isArchivable are the only necessary functions in a skeinforge export plugin." - if filename == '': - unmodified = import_translator.getGNUTranslatorFilesUnmodified() + if fileName == '': + unmodified = interpret.getGNUTranslatorFilesUnmodified() if len( unmodified ) == 0: print( "There are no unmodified gcode files in this folder." ) return - filename = unmodified[ 0 ] + fileName = unmodified[ 0 ] binary16BytePreferences = Binary16BytePreferences() preferences.readPreferences( binary16BytePreferences ) - gcodeText = gcodec.getGcodeFileText( filename, gcodeText ) + gcodeText = gcodec.getGcodeFileText( fileName, gcodeText ) skeinOutput = getOutput( gcodeText, binary16BytePreferences ) - suffixFilename = filename[ : filename.rfind( '.' ) ] + '_export.' + binary16BytePreferences.fileExtension.value + suffixFilename = fileName[ : fileName.rfind( '.' ) ] + '_export.' + binary16BytePreferences.fileExtension.value writeFileText( suffixFilename, skeinOutput ) print( 'The converted file is saved as ' + getSummarizedFilename( suffixFilename ) ) @@ -159,13 +159,13 @@ def writeOutput( filename = '', gcodeText = '' ): class Binary16BytePreferences: "A class to handle the export preferences." def __init__( self ): - "Set the default preferences, execute title & preferences filename." + "Set the default preferences, execute title & preferences fileName." #Set the default preferences. self.archive = [] self.fileExtension = preferences.StringPreference().getFromValue( 'File Extension:', 'bin' ) self.archive.append( self.fileExtension ) - self.filenameInput = preferences.Filename().getFromFilename( [ ( 'Gcode text files', '*.gcode' ) ], 'Open File to be Converted to Binary 16 Byte', '' ) - self.archive.append( self.filenameInput ) + self.fileNameInput = preferences.Filename().getFromFilename( [ ( 'Gcode text files', '*.gcode' ) ], 'Open File to be Converted to Binary 16 Byte', '' ) + self.archive.append( self.fileNameInput ) self.feedrateStepLength = preferences.FloatPreference().getFromValue( 'Feedrate Step Length (millimeters/second)', 0.1 ) self.archive.append( self.feedrateStepLength ) self.xStepLength = preferences.FloatPreference().getFromValue( 'X Step Length (millimeters)', 0.1 ) @@ -180,18 +180,18 @@ class Binary16BytePreferences: self.archive.append( self.yOffset ) self.zOffset = preferences.FloatPreference().getFromValue( 'Z Offset (millimeters)', 0.0 ) self.archive.append( self.zOffset ) - #Create the archive, title of the execute button, title of the dialog & preferences filename. + #Create the archive, title of the execute button, title of the dialog & preferences fileName. self.executeTitle = 'Convert to Binary 16 Byte' - self.filenamePreferences = preferences.getPreferencesFilePath( 'binary_16_byte.csv' ) - self.filenameHelp = 'skeinforge_tools.export_plugins.binary_16_byte.html' + self.fileNamePreferences = preferences.getPreferencesFilePath( 'binary_16_byte.csv' ) + self.fileNameHelp = 'skeinforge_tools.export_plugins.binary_16_byte.html' self.saveTitle = 'Save Preferences' self.title = 'Binary 16 Byte Preferences' def execute( self ): "Convert to binary 16 byte button has been clicked." - filenames = polyfile.getFileOrDirectoryTypesUnmodifiedGcode( self.filenameInput.value, [ '.gcode' ], self.filenameInput.wasCancelled ) - for filename in filenames: - writeOutput( filename ) + fileNames = polyfile.getFileOrDirectoryTypesUnmodifiedGcode( self.fileNameInput.value, [ '.gcode' ], self.fileNameInput.wasCancelled ) + for fileName in fileNames: + writeOutput( fileName ) class Binary16ByteSkein: diff --git a/trunk/reprap/miscellaneous/python-beanshell-scripts/skeinforge_tools/export_plugins/gcode_small.py b/trunk/reprap/miscellaneous/python-beanshell-scripts/skeinforge_tools/export_plugins/gcode_small.py index 3bc5c49a..710b7d47 100644 --- a/trunk/reprap/miscellaneous/python-beanshell-scripts/skeinforge_tools/export_plugins/gcode_small.py +++ b/trunk/reprap/miscellaneous/python-beanshell-scripts/skeinforge_tools/export_plugins/gcode_small.py @@ -37,11 +37,11 @@ def getStringFromCharacterSplitLine( character, splitLine ): return None return splitLine[ indexOfCharacter ][ 1 : ] -def getSummarizedFilename( filename ): - "Get the filename basename if the file is in the current working directory, otherwise return the original full name." - if os.getcwd() == os.path.dirname( filename ): - return os.path.basename( filename ) - return filename +def getSummarizedFilename( fileName ): + "Get the fileName basename if the file is in the current working directory, otherwise return the original full name." + if os.getcwd() == os.path.dirname( fileName ): + return os.path.basename( fileName ) + return fileName def getTextLines( text ): "Get the all the lines of text of a text." @@ -60,20 +60,20 @@ def isArchivable(): "Return whether or not this plugin is archivable." return False -def writeFileText( filename, fileText ): +def writeFileText( fileName, fileText ): "Write a text to a file." try: - file = open( filename, 'w+' ) + file = open( fileName, 'w+' ) file.write( fileText ) file.close() except IOError: - print( 'The file ' + filename + ' can not be written to.' ) + print( 'The file ' + fileName + ' can not be written to.' ) -def writeOutput( filename, gcodeText ): +def writeOutput( fileName, gcodeText ): "Write the exported version of a gcode file. This function, getOutput and isArchivable are the only necessary functions in a skeinforge export plugin." output = getOutput( gcodeText ) - writeFileText( filename, output ) - print( 'The exported file is saved as ' + getSummarizedFilename( filename ) ) + writeFileText( fileName, output ) + print( 'The exported file is saved as ' + getSummarizedFilename( fileName ) ) class GcodeSmallSkein: diff --git a/trunk/reprap/miscellaneous/python-beanshell-scripts/skeinforge_tools/export_plugins/gcode_step.py b/trunk/reprap/miscellaneous/python-beanshell-scripts/skeinforge_tools/export_plugins/gcode_step.py index 87f998c1..6a799242 100644 --- a/trunk/reprap/miscellaneous/python-beanshell-scripts/skeinforge_tools/export_plugins/gcode_step.py +++ b/trunk/reprap/miscellaneous/python-beanshell-scripts/skeinforge_tools/export_plugins/gcode_step.py @@ -26,7 +26,7 @@ from __future__ import absolute_import import __init__ from skeinforge_tools.skeinforge_utilities import gcodec from skeinforge_tools.skeinforge_utilities import preferences -from skeinforge_tools import import_translator +from skeinforge_tools.skeinforge_utilities import interpret from skeinforge_tools import polyfile from struct import Struct import cStringIO @@ -74,11 +74,11 @@ def getStringFromCharacterSplitLine( character, splitLine ): return None return splitLine[ indexOfCharacter ][ 1 : ] -def getSummarizedFilename( filename ): - "Get the filename basename if the file is in the current working directory, otherwise return the original full name." - if os.getcwd() == os.path.dirname( filename ): - return os.path.basename( filename ) - return filename +def getSummarizedFilename( fileName ): + "Get the fileName basename if the file is in the current working directory, otherwise return the original full name." + if os.getcwd() == os.path.dirname( fileName ): + return os.path.basename( fileName ) + return fileName def getTextLines( text ): "Get the all the lines of text of a text." @@ -97,38 +97,38 @@ def isArchivable(): "Return whether or not this plugin is archivable." return True -def writeFileText( filename, fileText ): +def writeFileText( fileName, fileText ): "Write a text to a file." try: - file = open( filename, 'wb' ) + file = open( fileName, 'wb' ) file.write( fileText ) file.close() except IOError: - print( 'The file ' + filename + ' can not be written to.' ) + print( 'The file ' + fileName + ' can not be written to.' ) -def writeOutput( filename = '', gcodeText = '' ): +def writeOutput( fileName = '', gcodeText = '' ): "Write the exported version of a gcode file. This function, getOutput and isArchivable are the only necessary functions in a skeinforge export plugin." - if filename == '': - unmodified = import_translator.getGNUTranslatorFilesUnmodified() + if fileName == '': + unmodified = interpret.getGNUTranslatorFilesUnmodified() if len( unmodified ) == 0: print( "There are no unmodified gcode files in this folder." ) return - filename = unmodified[ 0 ] + fileName = unmodified[ 0 ] gcodeStepPreferences = GcodeStepPreferences() preferences.readPreferences( gcodeStepPreferences ) if gcodeText == '': - if filename[ - len( '.gcode' ) : ] == '.gcode': - gcodeText = gcodec.getFileText( filename ) - filename = filename[ : filename.rfind( '.' ) ] + '_export.gcode' + if fileName[ - len( '.gcode' ) : ] == '.gcode': + gcodeText = gcodec.getFileText( fileName ) + fileName = fileName[ : fileName.rfind( '.' ) ] + '_export.gcode' output = getOutput( gcodeText, gcodeStepPreferences ) - writeFileText( filename, output ) - print( 'The converted file is saved as ' + getSummarizedFilename( filename ) ) + writeFileText( fileName, output ) + print( 'The converted file is saved as ' + getSummarizedFilename( fileName ) ) class GcodeStepPreferences: "A class to handle the export preferences." def __init__( self ): - "Set the default preferences, execute title & preferences filename." + "Set the default preferences, execute title & preferences fileName." #Set the default preferences. self.archive = [] self.addFeedrateEvenWhenUnchanging = preferences.BooleanPreference().getFromValue( 'Add Feedrate Even When Unchanging', True ) @@ -137,8 +137,8 @@ class GcodeStepPreferences: self.archive.append( self.addSpaceBetweenWords ) self.addZEvenWhenUnchanging = preferences.BooleanPreference().getFromValue( 'Add Z Even When Unchanging', True ) self.archive.append( self.addZEvenWhenUnchanging ) - self.filenameInput = preferences.Filename().getFromFilename( [ ( 'Gcode text files', '*.gcode' ) ], 'Open File to be Converted to Gcode Step', '' ) - self.archive.append( self.filenameInput ) + self.fileNameInput = preferences.Filename().getFromFilename( [ ( 'Gcode text files', '*.gcode' ) ], 'Open File to be Converted to Gcode Step', '' ) + self.archive.append( self.fileNameInput ) self.feedrateStepLength = preferences.FloatPreference().getFromValue( 'Feedrate Step Length (millimeters/second)', 0.1 ) self.archive.append( self.feedrateStepLength ) self.radiusStepLength = preferences.FloatPreference().getFromValue( 'Radius Step Length (millimeters)', 0.1 ) @@ -155,18 +155,18 @@ class GcodeStepPreferences: self.archive.append( self.yOffset ) self.zOffset = preferences.FloatPreference().getFromValue( 'Z Offset (millimeters)', 0.0 ) self.archive.append( self.zOffset ) - #Create the archive, title of the execute button, title of the dialog & preferences filename. + #Create the archive, title of the execute button, title of the dialog & preferences fileName. self.executeTitle = 'Convert to Gcode Step' - self.filenamePreferences = preferences.getPreferencesFilePath( 'gcode_step.csv' ) - self.filenameHelp = 'skeinforge_tools.export_plugins.gcode_step.html' + self.fileNamePreferences = preferences.getPreferencesFilePath( 'gcode_step.csv' ) + self.fileNameHelp = 'skeinforge_tools.export_plugins.gcode_step.html' self.saveTitle = 'Save Preferences' self.title = 'Gcode Step Preferences' def execute( self ): "Convert to gcode step button has been clicked." - filenames = polyfile.getFileOrDirectoryTypesUnmodifiedGcode( self.filenameInput.value, [ '.gcode' ], self.filenameInput.wasCancelled ) - for filename in filenames: - writeOutput( filename ) + fileNames = polyfile.getFileOrDirectoryTypesUnmodifiedGcode( self.fileNameInput.value, [ '.gcode' ], self.fileNameInput.wasCancelled ) + for fileName in fileNames: + writeOutput( fileName ) class GcodeStepSkein: diff --git a/trunk/reprap/miscellaneous/python-beanshell-scripts/skeinforge_tools/fill.py b/trunk/reprap/miscellaneous/python-beanshell-scripts/skeinforge_tools/fill.py index 0cfc0025..d7351f54 100644 --- a/trunk/reprap/miscellaneous/python-beanshell-scripts/skeinforge_tools/fill.py +++ b/trunk/reprap/miscellaneous/python-beanshell-scripts/skeinforge_tools/fill.py @@ -1,6 +1,6 @@ #! /usr/bin/env python """ -Fill is a script to fill the slices of a gcode file. +Fill is a script to fill the carves of a gcode file. The diaphragm is a solid group of layers, at regular intervals. It can be used with a sparse infill to give the object watertight, horizontal compartments and/or a higher shear strength. The "Diaphragm Period" is the number of layers between diaphrams. The "Diaphragm @@ -88,9 +88,9 @@ from skeinforge_tools.skeinforge_utilities import intercircle from skeinforge_tools.skeinforge_utilities import preferences from skeinforge_tools.skeinforge_utilities.vector3 import Vector3 from skeinforge_tools import analyze -from skeinforge_tools import import_translator +from skeinforge_tools.skeinforge_utilities import interpret +from skeinforge_tools import inset from skeinforge_tools import polyfile -from skeinforge_tools import slice_shape import cStringIO import math import sys @@ -101,8 +101,9 @@ __author__ = "Enrique Perez (perez_enrique@yahoo.com)" __date__ = "$Date: 2008/28/04 $" __license__ = "GPL 3.0" -#oozebane to handle minimum start up, add differential flow rates -#use slice format, carve & inset, slice aoi xml +#use slice svg and slc format +#move early startup to oozebane +#carve aoi xml #user mcodes #skeinedge #pyramidal @@ -125,7 +126,7 @@ __license__ = "GPL 3.0" #custom inclined plane, inclined plane from model, screw, fillet travel as well maybe #maybe much afterwards make congajure multistep view #maybe bridge supports although staggered spans are probably better -#maybe update slice to add perimeter path intersection information to the large loop also +#maybe update carve to add perimeter path intersection information to the large loop also #maybe stripe although mosaic alone can handle it #stretch fiber around shape #multiple heads around edge @@ -255,11 +256,11 @@ def addSparseEndpointsFromSegment( doubleExtrusionWidth, endpoints, fillLine, ho return endpoints += segment -def addSurroundingXIntersectionIndexes( surroundingSlices, xIntersectionIndexList, y ): +def addSurroundingXIntersectionIndexes( surroundingCarves, xIntersectionIndexList, y ): "Add x intersection indexes from surrounding layers." - for surroundingIndex in xrange( len( surroundingSlices ) ): - surroundingSlice = surroundingSlices[ surroundingIndex ] - euclidean.addXIntersectionIndexesFromLoops( surroundingSlice, surroundingIndex, xIntersectionIndexList, y ) + for surroundingIndex in xrange( len( surroundingCarves ) ): + surroundingCarve = surroundingCarves[ surroundingIndex ] + euclidean.addXIntersectionIndexesFromLoops( surroundingCarve, surroundingIndex, xIntersectionIndexList, y ) def addYIntersectionPathToList( pathIndex, pointIndex, y, yIntersection, yIntersectionPaths ): "Add the y intersection path to the y intersection paths." @@ -346,15 +347,15 @@ def getExtraFillLoops( insideLoops, outsideLoop, radius ): extraFillLoops.append( inset ) return extraFillLoops -def getFillChainGcode( filename, gcodeText, fillPreferences = None ): - "Fill the slices of a gcode text. Chain fill the gcode if it is not already sliced." - gcodeText = gcodec.getGcodeFileText( filename, gcodeText ) - if not gcodec.isProcedureDone( gcodeText, 'slice_shape' ): - gcodeText = slice_shape.getSliceGcode( filename ) +def getFillChainGcode( fileName, gcodeText, fillPreferences = None ): + "Fill the carves of a gcode text. Chain fill the gcode if it is not already carved." + gcodeText = gcodec.getGcodeFileText( fileName, gcodeText ) + if not gcodec.isProcedureDone( gcodeText, 'inset' ): + gcodeText = inset.getInsetChainGcode( fileName, gcodeText ) return getFillGcode( gcodeText, fillPreferences ) def getFillGcode( gcodeText, fillPreferences = None ): - "Fill the slices of a gcode text." + "Fill the carves of a gcode text." if gcodeText == '': return '' if gcodec.isProcedureDone( gcodeText, 'fill' ): @@ -413,11 +414,11 @@ def getPlusMinusSign( number ): return 1.0 return - 1.0 -def getSurroundingXIntersections( doubleSolidSurfaceThickness, surroundingSlices, y ): +def getSurroundingXIntersections( doubleSolidSurfaceThickness, surroundingCarves, y ): "Get x intersections from surrounding layers." xIntersectionIndexList = [] - addSurroundingXIntersectionIndexes( surroundingSlices, xIntersectionIndexList, y ) - if len( surroundingSlices ) < doubleSolidSurfaceThickness: + addSurroundingXIntersectionIndexes( surroundingCarves, xIntersectionIndexList, y ) + if len( surroundingCarves ) < doubleSolidSurfaceThickness: return None return getIntersectionOfXIntersectionIndexes( doubleSolidSurfaceThickness, xIntersectionIndexList ) @@ -720,20 +721,20 @@ def setIsOutside( yCloseToCenterPath, yIntersectionPaths ): return yCloseToCenterPath.isOutside = True -def writeOutput( filename = '' ): - "Fill the slices of a gcode file. Chain slice the file if it is a GNU TriangulatedSurface file. If no filename is specified, fill the first unmodified gcode file in this folder." - if filename == '': - unmodified = import_translator.getGNUTranslatorFilesUnmodified() +def writeOutput( fileName = '' ): + "Fill the carves of a gcode file. Chain carve the file if it is a GNU TriangulatedSurface file. If no fileName is specified, fill the first unmodified gcode file in this folder." + if fileName == '': + unmodified = interpret.getGNUTranslatorFilesUnmodified() if len( unmodified ) == 0: print( "There are no unmodified gcode files in this folder." ) return - filename = unmodified[ 0 ] + fileName = unmodified[ 0 ] startTime = time.time() fillPreferences = FillPreferences() preferences.readPreferences( fillPreferences ) - print( 'File ' + gcodec.getSummarizedFilename( filename ) + ' is being chain filled.' ) - suffixFilename = filename[ : filename.rfind( '.' ) ] + '_fill.gcode' - fillGcode = getFillChainGcode( filename, '', fillPreferences ) + print( 'File ' + gcodec.getSummarizedFilename( fileName ) + ' is being chain filled.' ) + suffixFilename = fileName[ : fileName.rfind( '.' ) ] + '_fill.gcode' + fillGcode = getFillChainGcode( fileName, '', fillPreferences ) if fillGcode == '': return gcodec.writeFileText( suffixFilename, fillGcode ) @@ -745,7 +746,7 @@ def writeOutput( filename = '' ): class FillPreferences: "A class to handle the fill preferences." def __init__( self ): - "Set the default preferences, execute title & preferences filename." + "Set the default preferences, execute title & preferences fileName." #Set the default preferences. self.archive = [] self.diaphragmPeriod = preferences.IntPreference().getFromValue( 'Diaphragm Period (layers):', 999999 ) @@ -762,8 +763,8 @@ class FillPreferences: self.archive.append( self.gridExtraOverlap ) self.gridJunctionSeparationOverInnerOctogonRadius = preferences.FloatPreference().getFromValue( 'Grid Junction Separation over Inner Octogon Radius (ratio):', 0.0 ) self.archive.append( self.gridJunctionSeparationOverInnerOctogonRadius ) - self.filenameInput = preferences.Filename().getFromFilename( import_translator.getGNUTranslatorGcodeFileTypeTuples(), 'Open File to be Filled', '' ) - self.archive.append( self.filenameInput ) + self.fileNameInput = preferences.Filename().getFromFilename( interpret.getGNUTranslatorGcodeFileTypeTuples(), 'Open File to be Filled', '' ) + self.archive.append( self.fileNameInput ) self.infillBeginRotation = preferences.FloatPreference().getFromValue( 'Infill Begin Rotation (degrees):', 45.0 ) self.archive.append( self.infillBeginRotation ) self.infillBeginRotationRepeat = preferences.IntPreference().getFromValue( 'Infill Begin Rotation Repeat (layers):', 1 ) @@ -785,18 +786,18 @@ class FillPreferences: self.archive.append( self.interiorInfillDensityOverExteriorDensity ) self.solidSurfaceThickness = preferences.IntPreference().getFromValue( 'Solid Surface Thickness (layers):', 3 ) self.archive.append( self.solidSurfaceThickness ) - #Create the archive, title of the execute button, title of the dialog & preferences filename. + #Create the archive, title of the execute button, title of the dialog & preferences fileName. self.executeTitle = 'Fill' - self.filenamePreferences = preferences.getPreferencesFilePath( 'fill.csv' ) - self.filenameHelp = 'skeinforge_tools.fill.html' + self.fileNamePreferences = preferences.getPreferencesFilePath( 'fill.csv' ) + self.fileNameHelp = 'skeinforge_tools.fill.html' self.saveTitle = 'Save Preferences' self.title = 'Fill Preferences' def execute( self ): "Fill button has been clicked." - filenames = polyfile.getFileOrDirectoryTypesUnmodifiedGcode( self.filenameInput.value, import_translator.getGNUTranslatorFileTypes(), self.filenameInput.wasCancelled ) - for filename in filenames: - writeOutput( filename ) + fileNames = polyfile.getFileOrDirectoryTypesUnmodifiedGcode( self.fileNameInput.value, interpret.getImportPluginFilenames(), self.fileNameInput.wasCancelled ) + for fileName in fileNames: + writeOutput( fileName ) class FillSkein: @@ -818,7 +819,7 @@ class FillSkein: self.thread = None def addFill( self, layerIndex ): - "Add fill to the slice layer." + "Add fill to the carve layer." # if layerIndex != 17 and layerIndex != 18: # return alreadyFilledArounds = [] @@ -855,14 +856,14 @@ class FillSkein: loops = [] for surroundingLoop in rotatedLayer.surroundingLoops: loops.append( surroundingLoop.boundary ) - surroundingSlices = [] + surroundingCarves = [] layerRemainder = layerIndex % int( round( self.fillPreferences.diaphragmPeriod.value ) ) if layerRemainder >= int( round( self.fillPreferences.diaphragmThickness.value ) ): for surroundingIndex in xrange( 1, self.solidSurfaceThickness + 1 ): - self.addRotatedSlice( layerIndex - surroundingIndex, reverseRotationAroundZAngle, surroundingSlices ) - self.addRotatedSlice( layerIndex + surroundingIndex, reverseRotationAroundZAngle, surroundingSlices ) + self.addRotatedCarve( layerIndex - surroundingIndex, reverseRotationAroundZAngle, surroundingCarves ) + self.addRotatedCarve( layerIndex + surroundingIndex, reverseRotationAroundZAngle, surroundingCarves ) extraShells = self.fillPreferences.extraShellsSparseLayer.value - if len( surroundingSlices ) < self.doubleSolidSurfaceThickness: + if len( surroundingCarves ) < self.doubleSolidSurfaceThickness: extraShells = self.fillPreferences.extraShellsAlternatingSolidLayer.value if self.lastExtraShells != self.fillPreferences.extraShellsBase.value: extraShells = self.fillPreferences.extraShellsBase.value @@ -899,7 +900,7 @@ class FillSkein: return back = euclidean.getBackOfLoops( arounds ) front = euclidean.getFrontOfLoops( arounds ) - area = self.getSliceArea( layerIndex ) + area = self.getCarveArea( layerIndex ) if area > 0.0: areaChange = 1.0 for surroundingIndex in xrange( 1, self.solidSurfaceThickness + 1 ): @@ -919,14 +920,14 @@ class FillSkein: for fillLine in xrange( len( horizontalSegments ) ): y = front + float( fillLine ) * layerExtrusionWidth horizontalEndpoints = horizontalSegments[ fillLine ] - surroundingXIntersections = getSurroundingXIntersections( self.doubleSolidSurfaceThickness, surroundingSlices, y ) + surroundingXIntersections = getSurroundingXIntersections( self.doubleSolidSurfaceThickness, surroundingCarves, y ) addSparseEndpoints( doubleExtrusionWidth, endpoints, fillLine, horizontalSegments, layerInfillSolidity, removedEndpoints, self.solidSurfaceThickness, surroundingXIntersections ) if len( endpoints ) < 1: euclidean.addToThreadsRemoveFromSurroundings( self.oldOrderedLocation, surroundingLoops, self ) return paths = euclidean.getPathsFromEndpoints( endpoints, layerFillInset, aroundPixelTable, aroundWidth ) if not self.fillPreferences.infillPatternLine.value: - self.addGrid( alreadyFilledArounds, arounds, fillLoops, gridPointInsetX, paths, aroundPixelTable, aroundWidth, reverseRotationAroundZAngle, rotatedExtruderLoops, surroundingSlices ) + self.addGrid( alreadyFilledArounds, arounds, fillLoops, gridPointInsetX, paths, aroundPixelTable, aroundWidth, reverseRotationAroundZAngle, rotatedExtruderLoops, surroundingCarves ) oldRemovedEndpointLength = len( removedEndpoints ) + 1 while oldRemovedEndpointLength - len( removedEndpoints ) > 0: oldRemovedEndpointLength = len( removedEndpoints ) @@ -953,8 +954,8 @@ class FillSkein: "Add a movement to the output." self.addLine( "G1 X%s Y%s Z%s" % ( self.getRounded( point.real ), self.getRounded( point.imag ), self.getRounded( z ) ) ) - def addGrid( self, alreadyFilledArounds, arounds, fillLoops, gridPointInsetX, paths, pixelTable, width, reverseRotationAroundZAngle, rotatedExtruderLoops, surroundingSlices ): - gridPoints = self.getGridPoints( alreadyFilledArounds, fillLoops, reverseRotationAroundZAngle, rotatedExtruderLoops, surroundingSlices ) + def addGrid( self, alreadyFilledArounds, arounds, fillLoops, gridPointInsetX, paths, pixelTable, width, reverseRotationAroundZAngle, rotatedExtruderLoops, surroundingCarves ): + gridPoints = self.getGridPoints( alreadyFilledArounds, fillLoops, reverseRotationAroundZAngle, rotatedExtruderLoops, surroundingCarves ) gridPointInsetY = gridPointInsetX * ( 1.0 - self.fillPreferences.gridExtraOverlap.value ) if self.fillPreferences.infillPatternGridRectangular.value: gridPointInsetX += self.gridJunctionSeparation @@ -968,7 +969,7 @@ class FillSkein: oldGridPointLength = len( gridPoints ) self.addRemainingGridPoints( arounds, gridPointInsetX, gridPointInsetY, gridPoints, False, paths, pixelTable, width ) - def addGridLinePoints( self, alreadyFilledArounds, begin, end, gridPoints, gridRotationAngle, offset, rotatedExtruderLoops, surroundingSlices, y ): + def addGridLinePoints( self, alreadyFilledArounds, begin, end, gridPoints, gridRotationAngle, offset, rotatedExtruderLoops, surroundingCarves, y ): "Add the segments of one line of a grid to the infill." if self.gridRadius == 0.0: return @@ -981,7 +982,7 @@ class FillSkein: while gridXOffset < end: gridPointComplex = complex( gridXOffset, y ) * gridRotationAngle gridPoint = complex( gridPointComplex.real, gridPointComplex.imag ) - if self.isPointInsideLineSegments( alreadyFilledArounds, gridPoint, rotatedExtruderLoops, surroundingSlices ): + if self.isPointInsideLineSegments( alreadyFilledArounds, gridPoint, rotatedExtruderLoops, surroundingCarves ): gridPoints.append( gridPoint ) gridXStep = self.getNextGripXStep( gridXStep ) gridXOffset = offset + gridWidth * float( gridXStep ) @@ -997,16 +998,16 @@ class FillSkein: gridPoint = gridPoints[ gridPointIndex ] addAroundGridPoint( arounds, gridPoint, gridPointInsetX, gridPointInsetY, gridPoints, self.gridRadius, isBothOrNone, self.isDoubleJunction, self.isJunctionWide, paths, pixelTable, width ) - def addRotatedSlice( self, layerIndex, reverseRotationAroundZAngle, surroundingSlices ): - "Add a rotated slice to the surrounding slices." + def addRotatedCarve( self, layerIndex, reverseRotationAroundZAngle, surroundingCarves ): + "Add a rotated carve to the surrounding carves." if layerIndex < 0 or layerIndex >= len( self.rotatedLayers ): return surroundingLoops = self.rotatedLayers[ layerIndex ].surroundingLoops - rotatedSlice = [] + rotatedCarve = [] for surroundingLoop in surroundingLoops: planeRotatedLoop = euclidean.getPointsRoundZAxis( reverseRotationAroundZAngle, surroundingLoop.boundary ) - rotatedSlice.append( planeRotatedLoop ) - surroundingSlices.append( rotatedSlice ) + rotatedCarve.append( planeRotatedLoop ) + surroundingCarves.append( rotatedCarve ) def addShutdownToOutput( self ): "Add shutdown gcode to the output." @@ -1026,11 +1027,11 @@ class FillSkein: self.thread.append( location.dropAxis( 2 ) ) def getAreaChange( self, area, layerIndex ): - "Get the difference between the area of the slice at the layer index and the given area." - layerArea = self.getSliceArea( layerIndex ) + "Get the difference between the area of the carve at the layer index and the given area." + layerArea = self.getCarveArea( layerIndex ) return min( area, layerArea ) / max( area, layerArea ) - def getGridPoints( self, alreadyFilledArounds, fillLoops, reverseRotationAroundZAngle, rotatedExtruderLoops, surroundingSlices ): + def getGridPoints( self, alreadyFilledArounds, fillLoops, reverseRotationAroundZAngle, rotatedExtruderLoops, surroundingCarves ): "Add a grid to the infill." if self.infillSolidity > 0.8: return [] @@ -1038,8 +1039,8 @@ class FillSkein: rotationBaseAngle = euclidean.getPolar( self.infillBeginRotation, 1.0 ) reverseRotationBaseAngle = complex( rotationBaseAngle.real, - rotationBaseAngle.imag ) gridRotationAngle = reverseRotationAroundZAngle * rotationBaseAngle - surroundingSlicesLength = len( surroundingSlices ) - if surroundingSlicesLength < self.doubleSolidSurfaceThickness: + surroundingCarvesLength = len( surroundingCarves ) + if surroundingCarvesLength < self.doubleSolidSurfaceThickness: return [] gridAlreadyFilledArounds = [] gridRotatedExtruderLoops = [] @@ -1082,7 +1083,7 @@ class FillSkein: end = max( endpointFirst.point.real, endpointSecond.point.real ) y = endpointFirst.point.imag offset = self.offsetMultiplier * self.gridRadius * ( round( y / self.gridRadius ) % 2 ) - self.addGridLinePoints( alreadyFilledArounds, begin, end, gridPoints, gridRotationAngle, offset, rotatedExtruderLoops, surroundingSlices, y ) + self.addGridLinePoints( alreadyFilledArounds, begin, end, gridPoints, gridRotationAngle, offset, rotatedExtruderLoops, surroundingCarves, y ) return gridPoints def getLayerRoundZ( self, layerIndex ): @@ -1106,8 +1107,8 @@ class FillSkein: "Get number rounded to the number of carried decimal places as a string." return euclidean.getRoundedToDecimalPlaces( self.decimalPlacesCarried, number ) - def getSliceArea( self, layerIndex ): - "Get the area of the slice." + def getCarveArea( self, layerIndex ): + "Get the area of the carve." if layerIndex < 0 or layerIndex >= len( self.rotatedLayers ): return 0.0 surroundingLoops = self.rotatedLayers[ layerIndex ].surroundingLoops @@ -1116,12 +1117,12 @@ class FillSkein: area += euclidean.getPolygonArea( surroundingLoop.boundary ) return area - def isPointInsideLineSegments( self, alreadyFilledArounds, gridPoint, rotatedExtruderLoops, surroundingSlices ): + def isPointInsideLineSegments( self, alreadyFilledArounds, gridPoint, rotatedExtruderLoops, surroundingCarves ): "Is the point inside the line segments of the loops." if self.solidSurfaceThickness <= 0: return True lineSegments = getHorizontalSegmentsFromLoopLists( rotatedExtruderLoops, alreadyFilledArounds, gridPoint.imag ) - surroundingXIntersections = getSurroundingXIntersections( self.doubleSolidSurfaceThickness, surroundingSlices, gridPoint.imag ) + surroundingXIntersections = getSurroundingXIntersections( self.doubleSolidSurfaceThickness, surroundingCarves, gridPoint.imag ) for lineSegment in lineSegments: if isSegmentCompletelyInAnIntersection( lineSegment, surroundingXIntersections ): xFirst = lineSegment[ 0 ].point.real diff --git a/trunk/reprap/miscellaneous/python-beanshell-scripts/skeinforge_tools/fillet.py b/trunk/reprap/miscellaneous/python-beanshell-scripts/skeinforge_tools/fillet.py index b1953a02..2ff2868b 100644 --- a/trunk/reprap/miscellaneous/python-beanshell-scripts/skeinforge_tools/fillet.py +++ b/trunk/reprap/miscellaneous/python-beanshell-scripts/skeinforge_tools/fillet.py @@ -63,7 +63,7 @@ The beveled file is saved as Screw Holder Bottom_fillet.gcode >>> fillet.getArcPointGcode(" -( GCode generated by May 8, 2008 slice.py ) +( GCode generated by May 8, 2008 carve.py ) ( Extruder Initialization ) .. many lines of gcode @@ -72,7 +72,7 @@ many lines of gcode >>> fillet.getArcRadiusGcode(" -( GCode generated by May 8, 2008 slice.py ) +( GCode generated by May 8, 2008 carve.py ) ( Extruder Initialization ) .. many lines of gcode @@ -81,7 +81,7 @@ many lines of gcode >>> fillet.getArcSegmentGcode(" -( GCode generated by May 8, 2008 slice.py ) +( GCode generated by May 8, 2008 carve.py ) ( Extruder Initialization ) .. many lines of gcode @@ -90,7 +90,7 @@ many lines of gcode >>> fillet.getBevelGcode(" -( GCode generated by May 8, 2008 slice.py ) +( GCode generated by May 8, 2008 carve.py ) ( Extruder Initialization ) .. many lines of gcode @@ -99,7 +99,7 @@ many lines of gcode >>> fillet.getFilletGcode(" -( GCode generated by May 8, 2008 slice.py ) +( GCode generated by May 8, 2008 carve.py ) ( Extruder Initialization ) .. many lines of gcode @@ -108,7 +108,7 @@ many lines of gcode >>> fillet.getFilletChainGcode(" -( GCode generated by May 8, 2008 slice.py ) +( GCode generated by May 8, 2008 carve.py ) ( Extruder Initialization ) .. many lines of gcode @@ -131,7 +131,7 @@ from skeinforge_tools.skeinforge_utilities import euclidean from skeinforge_tools.skeinforge_utilities import gcodec from skeinforge_tools.skeinforge_utilities import preferences from skeinforge_tools import analyze -from skeinforge_tools import import_translator +from skeinforge_tools.skeinforge_utilities import interpret from skeinforge_tools import oozebane from skeinforge_tools import polyfile import cStringIO @@ -145,69 +145,69 @@ __date__ = "$Date: 2008/21/04 $" __license__ = "GPL 3.0" -def arcPointFile( filename = '' ): - "Fillet a gcode linear move file into a helical point move file. If no filename is specified, arc point the first unmodified gcode file in this folder." - if filename == '': +def arcPointFile( fileName = '' ): + "Fillet a gcode linear move file into a helical point move file. If no fileName is specified, arc point the first unmodified gcode file in this folder." + if fileName == '': unmodified = gcodec.getUnmodifiedGCodeFiles() if len( unmodified ) == 0: print( "There are no unmodified gcode files in this folder." ) return - filename = unmodified[ 0 ] + fileName = unmodified[ 0 ] filletPreferences = FilletPreferences() preferences.readPreferences( filletPreferences ) - print( 'File ' + gcodec.getSummarizedFilename( filename ) + ' is being filleted into arc points.' ) - gcodeText = gcodec.getFileText( filename ) + print( 'File ' + gcodec.getSummarizedFilename( fileName ) + ' is being filleted into arc points.' ) + gcodeText = gcodec.getFileText( fileName ) if gcodeText == '': return - gcodec.writeFileMessageSuffix( filename, getArcPointGcode( filletPreferences, gcodeText ), 'The arc point file is saved as ', '_fillet' ) + gcodec.writeFileMessageSuffix( fileName, getArcPointGcode( filletPreferences, gcodeText ), 'The arc point file is saved as ', '_fillet' ) -def arcRadiusFile( filename = '' ): - "Fillet a gcode linear move file into a helical radius move file. If no filename is specified, arc radius the first unmodified gcode file in this folder." - if filename == '': +def arcRadiusFile( fileName = '' ): + "Fillet a gcode linear move file into a helical radius move file. If no fileName is specified, arc radius the first unmodified gcode file in this folder." + if fileName == '': unmodified = gcodec.getUnmodifiedGCodeFiles() if len( unmodified ) == 0: print( "There are no unmodified gcode files in this folder." ) return - filename = unmodified[ 0 ] + fileName = unmodified[ 0 ] filletPreferences = FilletPreferences() preferences.readPreferences( filletPreferences ) - print( 'File ' + gcodec.getSummarizedFilename( filename ) + ' is being filleted into arc radiuses.' ) - gcodeText = gcodec.getFileText( filename ) + print( 'File ' + gcodec.getSummarizedFilename( fileName ) + ' is being filleted into arc radiuses.' ) + gcodeText = gcodec.getFileText( fileName ) if gcodeText == '': return - gcodec.writeFileMessageSuffix( filename, getArcRadiusGcode( filletPreferences, gcodeText ), 'The arc radius file is saved as ', '_fillet' ) + gcodec.writeFileMessageSuffix( fileName, getArcRadiusGcode( filletPreferences, gcodeText ), 'The arc radius file is saved as ', '_fillet' ) -def arcSegmentFile( filename = '' ): - "Fillet a gcode linear move file into an arc segment linear move file. If no filename is specified, arc segment the first unmodified gcode file in this folder." - if filename == '': +def arcSegmentFile( fileName = '' ): + "Fillet a gcode linear move file into an arc segment linear move file. If no fileName is specified, arc segment the first unmodified gcode file in this folder." + if fileName == '': unmodified = gcodec.getUnmodifiedGCodeFiles() if len( unmodified ) == 0: print( "There are no unmodified gcode files in this folder." ) return - filename = unmodified[ 0 ] + fileName = unmodified[ 0 ] filletPreferences = FilletPreferences() preferences.readPreferences( filletPreferences ) - print( 'File ' + gcodec.getSummarizedFilename( filename ) + ' is being arc segmented.' ) - gcodeText = gcodec.getFileText( filename ) + print( 'File ' + gcodec.getSummarizedFilename( fileName ) + ' is being arc segmented.' ) + gcodeText = gcodec.getFileText( fileName ) if gcodeText == '': return - gcodec.writeFileMessageSuffix( filename, getArcSegmentGcode( filletPreferences, gcodeText ), 'The arc segment file is saved as ', '_fillet' ) + gcodec.writeFileMessageSuffix( fileName, getArcSegmentGcode( filletPreferences, gcodeText ), 'The arc segment file is saved as ', '_fillet' ) -def bevelFile( filename = '' ): - "Bevel a gcode linear move file. If no filename is specified, bevel the first unmodified gcode file in this folder." - if filename == '': +def bevelFile( fileName = '' ): + "Bevel a gcode linear move file. If no fileName is specified, bevel the first unmodified gcode file in this folder." + if fileName == '': unmodified = gcodec.getUnmodifiedGCodeFiles() if len( unmodified ) == 0: print( "There are no unmodified gcode files in this folder." ) return - filename = unmodified[ 0 ] + fileName = unmodified[ 0 ] filletPreferences = FilletPreferences() preferences.readPreferences( filletPreferences ) - print( 'File ' + gcodec.getSummarizedFilename( filename ) + ' is being beveled.' ) - gcodeText = gcodec.getFileText( filename ) + print( 'File ' + gcodec.getSummarizedFilename( fileName ) + ' is being beveled.' ) + gcodeText = gcodec.getFileText( fileName ) if gcodeText == '': return - gcodec.writeFileMessageSuffix( filename, getBevelGcode( filletPreferences, gcodeText ), 'The beveled file is saved as ', '_fillet' ) + gcodec.writeFileMessageSuffix( fileName, getBevelGcode( filletPreferences, gcodeText ), 'The beveled file is saved as ', '_fillet' ) def getArcPointGcode( filletPreferences, gcodeText ): "Arc point a gcode linear move text into a helical point move gcode text." @@ -233,11 +233,11 @@ def getBevelGcode( filletPreferences, gcodeText ): skein.parseGcode( filletPreferences, gcodeText ) return skein.output.getvalue() -def getFilletChainGcode( filename, gcodeText, filletPreferences = None ): +def getFilletChainGcode( fileName, gcodeText, filletPreferences = None ): "Fillet a gcode linear move text. Chain oozebane the gcode if it is not already oozebaned." - gcodeText = gcodec.getGcodeFileText( filename, gcodeText ) + gcodeText = gcodec.getGcodeFileText( fileName, gcodeText ) if not gcodec.isProcedureDone( gcodeText, 'oozebane' ): - gcodeText = oozebane.getOozebaneChainGcode( filename, gcodeText ) + gcodeText = oozebane.getOozebaneChainGcode( fileName, gcodeText ) return getFilletGcode( gcodeText, filletPreferences ) def getFilletGcode( gcodeText, filletPreferences = None ): @@ -261,22 +261,22 @@ def getFilletGcode( gcodeText, filletPreferences = None ): return getBevelGcode( filletPreferences, gcodeText ) return gcodeText -def writeOutput( filename = '' ): +def writeOutput( fileName = '' ): """Fillet a gcode linear move file. Chain fill the gcode if it is not already filled. Depending on the preferences, either arcPoint, arcRadius, arcSegment, bevel or do nothing. - If no filename is specified, fillet the first unmodified gcode file in this folder.""" - if filename == '': - unmodified = import_translator.getGNUTranslatorFilesUnmodified() + If no fileName is specified, fillet the first unmodified gcode file in this folder.""" + if fileName == '': + unmodified = interpret.getGNUTranslatorFilesUnmodified() if len( unmodified ) == 0: print( "There are no unmodified gcode files in this folder." ) return - filename = unmodified[ 0 ] + fileName = unmodified[ 0 ] filletPreferences = FilletPreferences() preferences.readPreferences( filletPreferences ) startTime = time.time() - print( 'File ' + gcodec.getSummarizedFilename( filename ) + ' is being chain filleted.' ) - suffixFilename = filename[ : filename.rfind( '.' ) ] + '_fillet.gcode' - filletGcode = getFilletChainGcode( filename, '', filletPreferences ) + print( 'File ' + gcodec.getSummarizedFilename( fileName ) + ' is being chain filleted.' ) + suffixFilename = fileName[ : fileName.rfind( '.' ) ] + '_fillet.gcode' + filletGcode = getFilletChainGcode( fileName, '', filletPreferences ) if filletGcode == '': return gcodec.writeFileText( suffixFilename, filletGcode ) @@ -543,7 +543,7 @@ class ArcRadiusSkein( ArcPointSkein ): class FilletPreferences: "A class to handle the fillet preferences." def __init__( self ): - "Set the default preferences, execute title & preferences filename." + "Set the default preferences, execute title & preferences fileName." #Set the default preferences. self.archive = [] self.activateFillet = preferences.BooleanPreference().getFromValue( 'Activate Fillet', True ) @@ -563,24 +563,24 @@ class FilletPreferences: self.archive.append( self.cornerFeedrateOverOperatingFeedrate ) self.filletRadiusOverExtrusionWidth = preferences.FloatPreference().getFromValue( 'Fillet Radius over Extrusion Width (ratio):', 0.35 ) self.archive.append( self.filletRadiusOverExtrusionWidth ) - self.filenameInput = preferences.Filename().getFromFilename( import_translator.getGNUTranslatorGcodeFileTypeTuples(), 'Open File to be Filleted', '' ) - self.archive.append( self.filenameInput ) + self.fileNameInput = preferences.Filename().getFromFilename( interpret.getGNUTranslatorGcodeFileTypeTuples(), 'Open File to be Filleted', '' ) + self.archive.append( self.fileNameInput ) self.reversalSlowdownDistanceOverExtrusionWidth = preferences.FloatPreference().getFromValue( 'Reversal Slowdown Distance over Extrusion Width (ratio):', 0.5 ) self.archive.append( self.reversalSlowdownDistanceOverExtrusionWidth ) self.useIntermediateFeedrateInCorners = preferences.BooleanPreference().getFromValue( 'Use Intermediate Feedrate in Corners', True ) self.archive.append( self.useIntermediateFeedrateInCorners ) - #Create the archive, title of the execute button, title of the dialog & preferences filename. + #Create the archive, title of the execute button, title of the dialog & preferences fileName. self.executeTitle = 'Fillet' - self.filenamePreferences = preferences.getPreferencesFilePath( 'fillet.csv' ) - self.filenameHelp = 'skeinforge_tools.fillet.html' + self.fileNamePreferences = preferences.getPreferencesFilePath( 'fillet.csv' ) + self.fileNameHelp = 'skeinforge_tools.fillet.html' self.saveTitle = 'Save Preferences' self.title = 'Fillet Preferences' def execute( self ): "Fillet button has been clicked." - filenames = polyfile.getFileOrDirectoryTypesUnmodifiedGcode( self.filenameInput.value, import_translator.getGNUTranslatorFileTypes(), self.filenameInput.wasCancelled ) - for filename in filenames: - writeOutput( filename ) + fileNames = polyfile.getFileOrDirectoryTypesUnmodifiedGcode( self.fileNameInput.value, interpret.getImportPluginFilenames(), self.fileNameInput.wasCancelled ) + for fileName in fileNames: + writeOutput( fileName ) def main(): diff --git a/trunk/reprap/miscellaneous/python-beanshell-scripts/skeinforge_tools/hop.py b/trunk/reprap/miscellaneous/python-beanshell-scripts/skeinforge_tools/hop.py index 666f36ca..e09f357f 100644 --- a/trunk/reprap/miscellaneous/python-beanshell-scripts/skeinforge_tools/hop.py +++ b/trunk/reprap/miscellaneous/python-beanshell-scripts/skeinforge_tools/hop.py @@ -4,8 +4,8 @@ Hop is a script to raise the extruder when it is not extruding. The default 'Activate Hop' checkbox is off. It is off because Vik and Nophead found better results without hopping. When it is on, the functions described below will work, when it is off, the functions will not be called. -The important value for the hop preferences is "Hop Over Extrusion Height (ratio)" which is the ratio of the hop height over the -extrusion height, the default is 1.0. The 'Minimum Hop Angle (degrees)' is the minimum angle that the path of the extruder +The important value for the hop preferences is "Hop Over Layer Thickness (ratio)" which is the ratio of the hop height over the +layer thickness, the default is 1.0. The 'Minimum Hop Angle (degrees)' is the minimum angle that the path of the extruder will be raised. An angle of ninety means that the extruder will go straight up as soon as it is not extruding and a low angle means the extruder path will gradually rise to the hop height, the default is 20 degrees. @@ -40,7 +40,7 @@ The hopped file is saved as Screw Holder Bottom_hop.gcode >>> hop.getHopGcode(" -( GCode generated by May 8, 2008 slice.py ) +( GCode generated by May 8, 2008 carve.py ) ( Extruder Initialization ) .. many lines of gcode @@ -49,7 +49,7 @@ many lines of gcode >>> hop.getHopChainGcode(" -( GCode generated by May 8, 2008 slice.py ) +( GCode generated by May 8, 2008 carve.py ) ( Extruder Initialization ) .. many lines of gcode @@ -66,7 +66,7 @@ from skeinforge_tools.skeinforge_utilities import euclidean from skeinforge_tools.skeinforge_utilities import gcodec from skeinforge_tools.skeinforge_utilities import preferences from skeinforge_tools import analyze -from skeinforge_tools import import_translator +from skeinforge_tools.skeinforge_utilities import interpret from skeinforge_tools import polyfile from skeinforge_tools import stretch import cStringIO @@ -80,11 +80,11 @@ __date__ = "$Date: 2008/21/04 $" __license__ = "GPL 3.0" -def getHopChainGcode( filename, gcodeText, hopPreferences = None ): +def getHopChainGcode( fileName, gcodeText, hopPreferences = None ): "Hop a gcode linear move text. Chain hop the gcode if it is not already hopped." - gcodeText = gcodec.getGcodeFileText( filename, gcodeText ) + gcodeText = gcodec.getGcodeFileText( fileName, gcodeText ) if not gcodec.isProcedureDone( gcodeText, 'stretch' ): - gcodeText = stretch.getStretchChainGcode( filename, gcodeText ) + gcodeText = stretch.getStretchChainGcode( fileName, gcodeText ) return getHopGcode( gcodeText, hopPreferences ) def getHopGcode( gcodeText, hopPreferences = None ): @@ -102,20 +102,20 @@ def getHopGcode( gcodeText, hopPreferences = None ): skein.parseGcode( gcodeText, hopPreferences ) return skein.output.getvalue() -def writeOutput( filename = '' ): - "Hop a gcode linear move file. Chain hop the gcode if it is not already hopped. If no filename is specified, hop the first unmodified gcode file in this folder." - if filename == '': - unmodified = import_translator.getGNUTranslatorFilesUnmodified() +def writeOutput( fileName = '' ): + "Hop a gcode linear move file. Chain hop the gcode if it is not already hopped. If no fileName is specified, hop the first unmodified gcode file in this folder." + if fileName == '': + unmodified = interpret.getGNUTranslatorFilesUnmodified() if len( unmodified ) == 0: print( "There are no unmodified gcode files in this folder." ) return - filename = unmodified[ 0 ] + fileName = unmodified[ 0 ] hopPreferences = HopPreferences() preferences.readPreferences( hopPreferences ) startTime = time.time() - print( 'File ' + gcodec.getSummarizedFilename( filename ) + ' is being chain hopped.' ) - suffixFilename = filename[ : filename.rfind( '.' ) ] + '_hop.gcode' - hopGcode = getHopChainGcode( filename, '', hopPreferences ) + print( 'File ' + gcodec.getSummarizedFilename( fileName ) + ' is being chain hopped.' ) + suffixFilename = fileName[ : fileName.rfind( '.' ) ] + '_hop.gcode' + hopGcode = getHopChainGcode( fileName, '', hopPreferences ) if hopGcode == '': return gcodec.writeFileText( suffixFilename, hopGcode ) @@ -127,29 +127,29 @@ def writeOutput( filename = '' ): class HopPreferences: "A class to handle the hop preferences." def __init__( self ): - "Set the default preferences, execute title & preferences filename." + "Set the default preferences, execute title & preferences fileName." #Set the default preferences. self.archive = [] self.activateHop = preferences.BooleanPreference().getFromValue( 'Activate Hop', False ) self.archive.append( self.activateHop ) - self.filenameInput = preferences.Filename().getFromFilename( import_translator.getGNUTranslatorGcodeFileTypeTuples(), 'Open File to be Hopped', '' ) - self.archive.append( self.filenameInput ) - self.hopOverExtrusionHeight = preferences.FloatPreference().getFromValue( 'Hop Over Extrusion Height (ratio):', 1.0 ) - self.archive.append( self.hopOverExtrusionHeight ) + self.fileNameInput = preferences.Filename().getFromFilename( interpret.getGNUTranslatorGcodeFileTypeTuples(), 'Open File to be Hopped', '' ) + self.archive.append( self.fileNameInput ) + self.hopOverLayerThickness = preferences.FloatPreference().getFromValue( 'Hop Over Layer Thickness (ratio):', 1.0 ) + self.archive.append( self.hopOverLayerThickness ) self.minimumHopAngle = preferences.FloatPreference().getFromValue( 'Minimum Hop Angle (degrees):', 30.0 ) self.archive.append( self.minimumHopAngle ) - #Create the archive, title of the execute button, title of the dialog & preferences filename. + #Create the archive, title of the execute button, title of the dialog & preferences fileName. self.executeTitle = 'Hop' - self.filenamePreferences = preferences.getPreferencesFilePath( 'hop.csv' ) - self.filenameHelp = 'skeinforge_tools.hop.html' + self.fileNamePreferences = preferences.getPreferencesFilePath( 'hop.csv' ) + self.fileNameHelp = 'skeinforge_tools.hop.html' self.saveTitle = 'Save Preferences' self.title = 'Hop Preferences' def execute( self ): "Hop button has been clicked." - filenames = polyfile.getFileOrDirectoryTypesUnmodifiedGcode( self.filenameInput.value, import_translator.getGNUTranslatorFileTypes(), self.filenameInput.wasCancelled ) - for filename in filenames: - writeOutput( filename ) + fileNames = polyfile.getFileOrDirectoryTypesUnmodifiedGcode( self.fileNameInput.value, interpret.getImportPluginFilenames(), self.fileNameInput.wasCancelled ) + for fileName in fileNames: + writeOutput( fileName ) class HopSkein: @@ -247,10 +247,10 @@ class HopSkein: firstWord = '' if len( splitLine ) > 0: firstWord = splitLine[ 0 ] - if firstWord == '(<extrusionHeight>': - extrusionHeight = float( splitLine[ 1 ] ) - self.hopHeight = hopPreferences.hopOverExtrusionHeight.value * extrusionHeight - self.minimumDistance = 0.5 * extrusionHeight + if firstWord == '(<layerThickness>': + layerThickness = float( splitLine[ 1 ] ) + self.hopHeight = hopPreferences.hopOverLayerThickness.value * layerThickness + self.minimumDistance = 0.5 * layerThickness elif firstWord == '(<bridgeExtrusionWidthOverSolid>': self.bridgeExtrusionWidthOverSolid = float( splitLine[ 1 ] ) elif firstWord == '(<decimalPlacesCarried>': diff --git a/trunk/reprap/miscellaneous/python-beanshell-scripts/skeinforge_tools/import_plugins/gts.py b/trunk/reprap/miscellaneous/python-beanshell-scripts/skeinforge_tools/import_plugins/gts.py new file mode 100644 index 00000000..0cacbbf8 --- /dev/null +++ b/trunk/reprap/miscellaneous/python-beanshell-scripts/skeinforge_tools/import_plugins/gts.py @@ -0,0 +1,94 @@ +""" +The gts.py script is an import translator plugin to get a carving from an gts file. + +An import plugin is a script in the import_plugins folder which has the function getCarving. It is meant to be run from the +interpret tool. To ensure that the plugin works on platforms which do not handle file capitalization properly, give the plugin +a lower case name. + +The getCarving function takes the file name of an gts file and returns the carving. + +The GNU Triangulated Surface (.gts) format is described at: +http://gts.sourceforge.net/reference/gts-surfaces.html#GTS-SURFACE-WRITE + +This example gets a carving for the gts file Screw Holder Bottom.gts. This example is run in a terminal in the folder which +contains Screw Holder Bottom.gts and gts.py. + + +> 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 gts +>>> gts.getCarving() +[11.6000003815, 10.6837882996, 7.80209827423 +.. +many more lines of the carving +.. + +""" + + +from __future__ import absolute_import +#Init has to be imported first because it has code to workaround the python bug where relative imports don't work if the module is imported as a main module. +import __init__ + +from skeinforge_tools.skeinforge_utilities.vector3 import Vector3 +from skeinforge_tools.skeinforge_utilities import gcodec +from skeinforge_tools.skeinforge_utilities import triangle_mesh + +__author__ = "Enrique Perez (perez_enrique@yahoo.com)" +__credits__ = 'Nophead <http://hydraraptor.blogspot.com/>\nArt of Illusion <http://www.artofillusion.org/>' +__date__ = "$Date: 2008/21/04 $" +__license__ = "GPL 3.0" + + +def getFromGNUTriangulatedSurfaceText( gnuTriangulatedSurfaceText, triangleMesh ): + "Initialize from a GNU Triangulated Surface Text." + if gnuTriangulatedSurfaceText == '': + return None + lines = gcodec.getTextLines( gnuTriangulatedSurfaceText ) + linesWithoutComments = [] + for line in lines: + if len( line ) > 0: + firstCharacter = line[ 0 ] + if firstCharacter != '#' and firstCharacter != '!': + linesWithoutComments.append( line ) + splitLine = linesWithoutComments[ 0 ].split() + numberOfVertices = int( splitLine[ 0 ] ) + numberOfEdges = int( splitLine[ 1 ] ) + numberOfFaces = int( splitLine[ 2 ] ) + faceTriples = [] + for vertexIndex in xrange( numberOfVertices ): + line = linesWithoutComments[ vertexIndex + 1 ] + splitLine = line.split() + vertex = Vector3( float( splitLine[ 0 ] ), float( splitLine[ 1 ] ), float( splitLine[ 2 ] ) ) + triangleMesh.vertices.append( vertex ) + edgeStart = numberOfVertices + 1 + for edgeIndex in xrange( numberOfEdges ): + line = linesWithoutComments[ edgeIndex + edgeStart ] + splitLine = line.split() + vertexIndexes = [] + for word in splitLine[ : 2 ]: + vertexIndexes.append( int( word ) - 1 ) + edge = triangle_mesh.Edge().getFromVertexIndexes( edgeIndex, vertexIndexes ) + triangleMesh.edges.append( edge ) + faceStart = edgeStart + numberOfEdges + for faceIndex in xrange( numberOfFaces ): + line = linesWithoutComments[ faceIndex + faceStart ] + splitLine = line.split() + edgeIndexes = [] + for word in splitLine[ : 3 ]: + edgeIndexes.append( int( word ) - 1 ) + face = triangle_mesh.Face().getFromEdgeIndexes( edgeIndexes, triangleMesh.edges, faceIndex ) + triangleMesh.faces.append( face ) + return triangleMesh + +def getCarving( fileName = '' ): + "Get the triangle mesh for the gts file." + if fileName == '': + unmodified = gcodec.getFilesWithFileTypeWithoutWords( 'gts' ) + if len( unmodified ) == 0: + print( "There is no gts file in this folder." ) + return None + fileName = unmodified[ 0 ] + return getFromGNUTriangulatedSurfaceText( gcodec.getFileText( fileName ), triangle_mesh.TriangleMesh() ) diff --git a/trunk/reprap/miscellaneous/python-beanshell-scripts/skeinforge_tools/import_plugins/slc.py b/trunk/reprap/miscellaneous/python-beanshell-scripts/skeinforge_tools/import_plugins/slc.py new file mode 100644 index 00000000..3f1b13a0 --- /dev/null +++ b/trunk/reprap/miscellaneous/python-beanshell-scripts/skeinforge_tools/import_plugins/slc.py @@ -0,0 +1,200 @@ +""" +The slc.py script is an import translator plugin to get a carving from an slc file. + +An import plugin is a script in the import_plugins folder which has the function getCarving. It is meant to be run from the +interpret tool. To ensure that the plugin works on platforms which do not handle file capitalization properly, give the plugin +a lower case name. + +The getCarving function takes the file name of an slc file and returns the carving. + +This example gets a triangle mesh for the slc file rotor.slc. This example is run in a terminal in the folder which contains +rotor.slc and slc.py. + + +> 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 slc +>>> slc.getCarving() +0.20000000298, 999999999.0, -999999999.0, [8.72782748851e-17, None +.. +many more lines of the carving +.. + + +An explanation of the SLC format can be found at: +http://rapid.lpt.fi/archives/rp-ml-1999/0713.html + +""" + + +from __future__ import absolute_import +#Init has to be imported first because it has code to workaround the python bug where relative imports don't work if the module is imported as a main module. +import __init__ + +from skeinforge_tools.skeinforge_utilities.vector3 import Vector3 +from skeinforge_tools.skeinforge_utilities import euclidean +from skeinforge_tools.skeinforge_utilities import gcodec +from struct import unpack +import sys + +__author__ = "Enrique Perez (perez_enrique@yahoo.com)" +__credits__ = 'Nophead <http://hydraraptor.blogspot.com/>\nArt of Illusion <http://www.artofillusion.org/>' +__date__ = "$Date: 2008/21/04 $" +__license__ = "GPL 3.0" + + +def getCarving( fileName = '' ): + "Get the triangle mesh for the slc file." + if fileName == '': + unmodified = gcodec.getFilesWithFileTypeWithoutWords( 'slc' ) + if len( unmodified ) == 0: + print( "There is no slc file in this folder." ) + return None + fileName = unmodified[ 0 ] + carving = SLCCarving() + carving.readFile( fileName ) + return carving + +def getLittleEndianFloatGivenFile( file ): + "Get little endian float given a file." + return unpack( '<f', file.read( 4 ) )[ 0 ] + +def getLittleEndianUnsignedLongGivenFile( file ): + "Get little endian float given a file." + return unpack( '<L', file.read( 4 ) )[ 0 ] + +def getPointsFromFile( numPoints, file ): + "Process the vertice points for a given boundary." + points = [] + for pointIndex in xrange( numPoints ): + x = getLittleEndianFloatGivenFile( file ) + y = getLittleEndianFloatGivenFile( file ) + points.append( complex( x, y ) ) + return points + +def readHeader( file ): + "Read the slc header." + while ord( file.read( 1 ) ) != 0x1A: + pass + + +class SampleTableEntry: + "Sample table entry." + def __init__( self, file ): + "Read in the sampling table section. It contains a table length (byte) and the table entries." + self.min_z_level = getLittleEndianFloatGivenFile( file ) + self.layer_thickness = getLittleEndianFloatGivenFile( file ) + self.beam_comp = getLittleEndianFloatGivenFile( file ) + getLittleEndianFloatGivenFile( file ) + print( self ) + + def __repr__( self ): + "Get the string representation of this sample table entry." + return '%s, %s, %s' % ( self.min_z_level, self.layer_thickness, self.beam_comp ) + + +class SLCCarving: + "An slc carving." + def __init__( self ): + "Add empty lists." + self.maximumZ = - 999999999.0 + self.minimumZ = 999999999.0 + self.layerThickness = None + self.rotatedBoundaryLayers = [] + + def __repr__( self ): + "Get the string representation of this carving." + return '%s, %s, %s, %s' % ( self.layerThickness, self.minimumZ, self.maximumZ, self.rotatedBoundaryLayers ) + + def getCarveCornerMaximum( self ): + "Get the corner maximum of the vertices." + return self.cornerMaximum + + def getCarveCornerMinimum( self ): + "Get the corner minimum of the vertices." + return self.cornerMinimum + + def getCarveLayerThickness( self ): + "Get the layer thickness." + return self.layerThickness + + def getCarveRotatedBoundaryLayers( self ): + "Get the rotated boundary layers." + self.cornerMaximum = Vector3( - 999999999.0, - 999999999.0, self.maximumZ ) + self.cornerMinimum = Vector3( 999999999.0, 999999999.0, self.minimumZ ) + for rotatedBoundaryLayer in self.rotatedBoundaryLayers: + for loop in rotatedBoundaryLayer.loops: + for point in loop: + pointVector3 = Vector3( point.real, point.imag, rotatedBoundaryLayer.z ) + self.cornerMaximum = euclidean.getPointMaximum( self.cornerMaximum, pointVector3 ) + self.cornerMinimum = euclidean.getPointMinimum( self.cornerMinimum, pointVector3 ) + halfLayerThickness = 0.5 * self.layerThickness + self.cornerMaximum.z += halfLayerThickness + self.cornerMinimum.z -= halfLayerThickness + return self.rotatedBoundaryLayers + + def processContourLayers( self, file ): + "Process a contour layer at a time until the top of the part." + while True: + minLayer = getLittleEndianFloatGivenFile( file ) + numContours = getLittleEndianUnsignedLongGivenFile( file ) + if numContours == 0xFFFFFFFF: + return + rotatedBoundaryLayer = euclidean.RotatedLoopLayer( minLayer ) + self.rotatedBoundaryLayers.append( rotatedBoundaryLayer ) + for contourIndex in xrange( numContours ): + numPoints = getLittleEndianUnsignedLongGivenFile( file ) + numGaps = getLittleEndianUnsignedLongGivenFile( file ) + rotatedBoundaryLayer.loops.append( getPointsFromFile( numPoints, file ) ) + + def readFile( self, fileName ): + "Read SLC and store the layers." + pslcfile = open( fileName, 'rb' ) + readHeader( pslcfile ) + pslcfile.read( 256 ) #Go past the 256 byte 3D Reserved Section. + self.readTableEntry( pslcfile ) + self.processContourLayers( pslcfile ) + pslcfile.close() + + def readTableEntry( self, file ): + "Read in the sampling table section. It contains a table length (byte) and the table entries." + tableEntrySize = ord( file.read( 1 ) ) + if tableEntrySize == 0: + print( "Sampling table size is zero!" ) + exit() +# print( "Sampling table size: %s\n", tableEntrySize ) +# print( "Minimum z level, Layer thickness, Line width compensation, Reserved" ) + for index in xrange( tableEntrySize ): + sampleTableEntry = SampleTableEntry( file ) + self.layerThickness = sampleTableEntry.layer_thickness + + def setCarveBridgeLayerThickness( self, bridgeLayerThickness ): + "Set the bridge layer thickness. If the infill is not in the direction of the bridge, the bridge layer thickness should be given as None or not set at all." + pass + + def setCarveLayerThickness( self, layerThickness ): + "Set the layer thickness." + pass + + def setCarveExtrusionWidth( self, extrusionWidth ): + "Set the extrusion width." + pass + + def setCarveImportCoarseness( self, importCoarseness ): + "Set the import coarseness." + pass + + def setCarveIsCorrectMesh( self, isCorrectMesh ): + "Set the is correct mesh flag." + pass + + +def main( hashtable = None ): + "Display the inset dialog." + if len( sys.argv ) > 1: + getCarving( ' '.join( sys.argv[ 1 : ] ) ) + +if __name__ == "__main__": + main() diff --git a/trunk/reprap/miscellaneous/python-beanshell-scripts/skeinforge_tools/import_plugins/stl.py b/trunk/reprap/miscellaneous/python-beanshell-scripts/skeinforge_tools/import_plugins/stl.py index 8b4e8c0b..2f19c057 100644 --- a/trunk/reprap/miscellaneous/python-beanshell-scripts/skeinforge_tools/import_plugins/stl.py +++ b/trunk/reprap/miscellaneous/python-beanshell-scripts/skeinforge_tools/import_plugins/stl.py @@ -1,11 +1,11 @@ """ -The stl.py script is an import translator plugin to get a triangle mesh from an stl file. +The stl.py script is an import translator plugin to get a carving from an stl file. -An import plugin is a script in the import_plugins folder which has the function getTriangleMesh. It is meant to be run from the -import_translator tool. To ensure that the plugin works on platforms which do not handle file capitalization properly, give the plugin +An import plugin is a script in the import_plugins folder which has the function getCarving. It is meant to be run from the +interpret tool. To ensure that the plugin works on platforms which do not handle file capitalization properly, give the plugin a lower case name. -The getTriangleMesh function takes the filename of an stl file and returns the triangle mesh. +The getCarving function takes the file name of an stl file and returns the carving. STL is an inferior triangle surface format, described at: http://en.wikipedia.org/wiki/STL_(file_format) @@ -13,8 +13,8 @@ http://en.wikipedia.org/wiki/STL_(file_format) A good triangle surface format is the GNU Triangulated Surface format which is described at: http://gts.sourceforge.net/reference/gts-surfaces.html#GTS-SURFACE-WRITE -This example gets a triangle mesh for the stl file Screw Holder Bottom.stl. This example is run in a terminal in the folder which contains -Screw Holder Bottom.stl and stl.py. +This example gets a carving for the stl file Screw Holder Bottom.stl. This example is run in a terminal in the folder which +contains Screw Holder Bottom.stl and stl.py. > python @@ -22,10 +22,10 @@ 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 stl ->>> stl.getTriangleMesh() +>>> stl.getCarving() [11.6000003815, 10.6837882996, 7.80209827423 .. -many more lines of the triangle mesh +many more lines of the carving .. """ @@ -90,15 +90,15 @@ def getFloatGivenBinary( byteIndex, stlData ): "Get vertex given stl vertex line." return unpack( 'f', stlData[ byteIndex : byteIndex + 4 ] )[ 0 ] -def getTriangleMesh( filename = '' ): +def getCarving( fileName = '' ): "Get the triangle mesh for the stl file." - if filename == '': + if fileName == '': unmodified = gcodec.getFilesWithFileTypeWithoutWords( 'stl' ) if len( unmodified ) == 0: print( "There is no stl file in this folder." ) - return - filename = unmodified[ 0 ] - stlData = gcodec.getFileText( filename, 'rb' ) + return None + fileName = unmodified[ 0 ] + stlData = gcodec.getFileText( fileName, 'rb' ) if stlData == '': return None triangleMesh = triangle_mesh.TriangleMesh() diff --git a/trunk/reprap/miscellaneous/python-beanshell-scripts/skeinforge_tools/import_plugins/svg.py b/trunk/reprap/miscellaneous/python-beanshell-scripts/skeinforge_tools/import_plugins/svg.py new file mode 100644 index 00000000..8b05912d --- /dev/null +++ b/trunk/reprap/miscellaneous/python-beanshell-scripts/skeinforge_tools/import_plugins/svg.py @@ -0,0 +1,199 @@ +""" +The svg.py script is an import translator plugin to get a carving from an svg file. + +An import plugin is a script in the import_plugins folder which has the function getCarving. It is meant to be run from the +interpret tool. To ensure that the plugin works on platforms which do not handle file capitalization properly, give the plugin +a lower case name. + +The getCarving function takes the file name of an svg file and returns the carving. + +This example gets a carving for the svg file Screw Holder Bottom.svg. This example is run in a terminal in the folder which +contains Screw Holder Bottom.svg and svg.py. + + +> 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 svg +>>> svg.getCarving() +0.20000000298, 999999999.0, -999999999.0, [8.72782748851e-17, None +.. +many more lines of the carving +.. +""" + + +from __future__ import absolute_import +#Init has to be imported first because it has code to workaround the python bug where relative imports don't work if the module is imported as a main module. +import __init__ + +from skeinforge_tools.skeinforge_utilities.vector3 import Vector3 +from skeinforge_tools.skeinforge_utilities import euclidean +from skeinforge_tools.skeinforge_utilities import gcodec + +__author__ = "Enrique Perez (perez_enrique@yahoo.com)" +__credits__ = 'Nophead <http://hydraraptor.blogspot.com/>\nArt of Illusion <http://www.artofillusion.org/>' +__date__ = "$Date: 2008/21/04 $" +__license__ = "GPL 3.0" + + +#later , make defaults for layerThickness, maxZ, minZ +def addPathData( line, loops ): + "Add the data from the path line." + line = line.replace( '"', ' ' ) + splitLine = line.split() + if splitLine[ 1 ] != 'transform=': + return + line = line.lower() + line = line.replace( 'm', ' ' ) + line = line.replace( 'l', ' ' ) + line = line.replace( '/>', ' ' ) + splitLine = line.split() + if 'd=' not in splitLine: + return + splitLine = splitLine[ splitLine.index( 'd=' ) + 1 : ] + pathSequence = [] + for word in splitLine: + if word == 'z': + loop = [] + for pathSequenceIndex in xrange( 0, len( pathSequence ), 2 ): + coordinate = complex( pathSequence[ pathSequenceIndex ], pathSequence[ pathSequenceIndex + 1 ] ) + loop.append( coordinate ) + loops.append( loop ) + pathSequence = [] + else: + pathSequence.append( float( word ) ) + +def addTextData( line, rotatedBoundaryLayers ): + "Add the data from the text line." + if line.find( 'layerThickness' ) != - 1: + return + line = line.replace( '>', ' ' ) + line = line.replace( '<', ' ' ) + line = line.replace( ',', ' ' ) + splitLine = line.split() + if 'Layer' not in splitLine: + return + splitLine = splitLine[ splitLine.index( 'Layer' ) + 1 : ] + if 'z' not in splitLine: + return + zIndex = splitLine.index( 'z' ) + rotatedBoundaryLayer = euclidean.RotatedLoopLayer( float( splitLine[ zIndex + 1 ] ) ) + rotatedBoundaryLayers.append( rotatedBoundaryLayer ) + +def getCarving( fileName = '' ): + "Get the triangle mesh for the gts file." + if fileName == '': + unmodified = gcodec.getFilesWithFileTypeWithoutWords( 'gts' ) + if len( unmodified ) == 0: + print( "There is no gts file in this folder." ) + return None + fileName = unmodified[ 0 ] + carving = SVGCarving() + carving.parseSVG( gcodec.getFileText( fileName ) ) + return carving + +def getValueInQuotes( name, text, value ): + "Get value in quotes after the name." + nameAndQuote = name + '="' + nameIndexStart = text.find( nameAndQuote ) + if nameIndexStart == - 1: + return value + valueStartIndex = nameIndexStart + len( nameAndQuote ) + nameIndexEnd = text.find( '"', valueStartIndex ) + if nameIndexEnd == - 1: + return value + return float( text[ valueStartIndex : nameIndexEnd ] ) + + +class SVGCarving: + "An svg carving." + def __init__( self ): + "Add empty lists." + self.maximumZ = - 999999999.0 + self.minimumZ = 999999999.0 + self.layerThickness = None + self.rotatedBoundaryLayers = [] + + def __repr__( self ): + "Get the string representation of this carving." + return str( self.rotatedBoundaryLayers ) + + def getCarveCornerMaximum( self ): + "Get the corner maximum of the vertices." + return self.cornerMaximum + + def getCarveCornerMinimum( self ): + "Get the corner minimum of the vertices." + return self.cornerMinimum + + def getCarveLayerThickness( self ): + "Get the layer thickness." + return self.layerThickness + + def getCarveRotatedBoundaryLayers( self ): + "Get the rotated boundary layers." + self.cornerMaximum = Vector3( - 999999999.0, - 999999999.0, self.maximumZ ) + self.cornerMinimum = Vector3( 999999999.0, 999999999.0, self.minimumZ ) + for rotatedBoundaryLayer in self.rotatedBoundaryLayers: + for loop in rotatedBoundaryLayer.loops: + for point in loop: + pointVector3 = Vector3( point.real, point.imag, rotatedBoundaryLayer.z ) + self.cornerMaximum = euclidean.getPointMaximum( self.cornerMaximum, pointVector3 ) + self.cornerMinimum = euclidean.getPointMinimum( self.cornerMinimum, pointVector3 ) + return self.rotatedBoundaryLayers + + def parseSVG( self, svgText ): + "Parse SVG text and store the layers." + if svgText == '': + return None + svgText = svgText.replace( '\t', ' ' ) + svgText = svgText.replace( ';', ' ' ) + self.lines = gcodec.getTextLines( svgText ) + self.parseInitialization() + for lineIndex in xrange( self.lineIndex, len( self.lines ) ): + self.parseLine( lineIndex ) + + def parseInitialization( self ): + "Parse gcode initialization and store the parameters." + for self.lineIndex in xrange( len( self.lines ) ): + line = self.lines[ self.lineIndex ].lstrip() + self.layerThickness = getValueInQuotes( 'layerThickness', line, self.layerThickness ) + self.maximumZ = getValueInQuotes( 'maxZ', line, self.maximumZ ) + self.minimumZ = getValueInQuotes( 'minZ', line, self.minimumZ ) + if line.find( '</metadata>' ) != - 1: + return + self.lineIndex = 2 + + def parseLine( self, lineIndex ): + "Parse a gcode line and add it to the inset skein." + line = self.lines[ lineIndex ].lstrip() + splitLine = line.split() + if len( splitLine ) < 1: + return + firstWord = splitLine[ 0 ] + if firstWord == '<path': + addPathData( line, self.rotatedBoundaryLayers[ - 1 ].loops ) + elif firstWord == '<text': + addTextData( line, self.rotatedBoundaryLayers ) + + def setCarveBridgeLayerThickness( self, bridgeLayerThickness ): + "Set the bridge layer thickness. If the infill is not in the direction of the bridge, the bridge layer thickness should be given as None or not set at all." + pass + + def setCarveLayerThickness( self, layerThickness ): + "Set the layer thickness." + pass + + def setCarveExtrusionWidth( self, extrusionWidth ): + "Set the extrusion width." + pass + + def setCarveImportCoarseness( self, importCoarseness ): + "Set the import coarseness." + pass + + def setCarveIsCorrectMesh( self, isCorrectMesh ): + "Set the is correct mesh flag." + pass diff --git a/trunk/reprap/miscellaneous/python-beanshell-scripts/skeinforge_tools/inset.py b/trunk/reprap/miscellaneous/python-beanshell-scripts/skeinforge_tools/inset.py new file mode 100644 index 00000000..ebd320f8 --- /dev/null +++ b/trunk/reprap/miscellaneous/python-beanshell-scripts/skeinforge_tools/inset.py @@ -0,0 +1,601 @@ +#! /usr/bin/env python +""" +Inset is a script to inset the carves of a gcode file. + +Inset insets the svg slices into gcode extrusion layers. The 'Extrusion Perimeter Width over Thickness' ratio is the ratio of the +extrusion perimeter width over the layer thickness. The higher the value the more the perimeter will be inset, the default is 1.8. + +The 'Infill Perimeter Overlap' ratio is the amount the infill overlaps the perimeter over the extrusion width. The higher the value the +more the infill will overlap the perimeter, and the thicker join between the infill and the perimeter. If the value is too high, the join will +be so thick that the nozzle will run plow through the join below making a mess, the default is 0.05. There are two choices for the +infill perimeter overlap method of calculation. If the 'Calculate Overlap from Perimeter and Infill' option is chosen, the overlap will be +calculated from the average of the perimeter width and the infill width, this is the default choice. If the 'Calculate Overlap from +Perimeter Only' option is chosen, the overlap will be calculated from the perimeter width only. + +If the "Start at Home" preference is selected, the G28 gcode will be added at the beginning of the file. + +When inset is generating the code, if there is a file start.txt, it will add that to the very beginning of the gcode. After it has added some +initialization code and just before it adds the extrusion gcode, it will add the file endofthebeginning.txt if it exists. At the very end, it will +add the file end.txt if it exists. Carve 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. It will first look for the file in the same directory as +inset, if it does not find it it will look in ~/.skeinforge/gcode_scripts. + +The following examples inset 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.stl and inset.py. + + +> python inset.py +This brings up the dialog, after clicking 'Inset', the following is printed: +File Screw Holder Bottom.stl is being chain insetted. +The insetted file is saved as Screw Holder Bottom_inset.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 inset +>>> inset.main() +File Screw Holder Bottom.stl is being insetted. +The insetted file is saved as Screw Holder Bottom_inset.gcode +It took 3 seconds to inset the file. + + +>>> inset.writeOutput() +File Screw Holder Bottom.stl is being insetted. +The insetted file is saved as Screw Holder Bottom_inset.gcode +It took 3 seconds to inset the file. + +""" + +from __future__ import absolute_import +try: + import psyco + psyco.full() +except: + pass +#Init has to be imported first because it has code to workaround the python bug where relative imports don't work if the module is imported as a main module. +import __init__ + +from skeinforge_tools.skeinforge_utilities import euclidean +from skeinforge_tools.skeinforge_utilities import gcodec +from skeinforge_tools.skeinforge_utilities import intercircle +from skeinforge_tools.skeinforge_utilities import preferences +from skeinforge_tools.skeinforge_utilities.vector3 import Vector3 +from skeinforge_tools import analyze +from skeinforge_tools.skeinforge_utilities import interpret +from skeinforge_tools import polyfile +from skeinforge_tools import carve +import cStringIO +import math +import os +import sys +import time + + +__author__ = "Enrique Perez (perez_enrique@yahoo.com)" +__date__ = "$Date: 2008/28/04 $" +__license__ = "GPL 3.0" + + +def addAlreadyFilledArounds( alreadyFilledArounds, loop, radius ): + "Add already filled loops around loop to alreadyFilledArounds." + alreadyFilledLoop = [] + slightlyGreaterThanRadius = 1.01 * radius + muchGreaterThanRadius = 2.5 * radius + circleNodes = intercircle.getCircleNodesFromLoop( loop, slightlyGreaterThanRadius ) + centers = intercircle.getCentersFromCircleNodes( circleNodes ) + for center in centers: + alreadyFilledInset = intercircle.getSimplifiedInsetFromClockwiseLoop( center, radius ) + if euclidean.getMaximumSpan( alreadyFilledInset ) > muchGreaterThanRadius or euclidean.isWiddershins( alreadyFilledInset ): + alreadyFilledLoop.append( alreadyFilledInset ) + if len( alreadyFilledLoop ) > 0: + alreadyFilledArounds.append( alreadyFilledLoop ) + +def addSegmentOutline( isThick, outlines, pointBegin, pointEnd, width ): + "Add a diamond or hexagonal outline for a line segment." + exclusionWidth = 0.6 * width + slope = 0.3 + if isThick: + slope = 3.0 + exclusionWidth = 0.8 * width + segment = pointEnd - pointBegin + segmentLength = abs( segment ) + if segmentLength == 0.0: + return + normalizedSegment = segment / segmentLength + outline = [] + segmentYMirror = complex( normalizedSegment.real, - normalizedSegment.imag ) + pointBeginRotated = segmentYMirror * pointBegin + pointEndRotated = segmentYMirror * pointEnd + along = 0.01 + alongLength = along * segmentLength + if alongLength > 0.1 * exclusionWidth: + along *= 0.1 * exclusionWidth / alongLength + alongEnd = 1.0 - along + remainingToHalf = 0.5 - along + alongToWidth = exclusionWidth / slope / segmentLength + pointBeginIntermediate = euclidean.getIntermediateLocation( along, pointBeginRotated, pointEndRotated ) + pointEndIntermediate = euclidean.getIntermediateLocation( alongEnd, pointBeginRotated, pointEndRotated ) + outline.append( pointBeginIntermediate ) + verticalWidth = complex( 0.0, exclusionWidth ) + if alongToWidth > 0.9 * remainingToHalf: + verticalWidth = complex( 0.0, slope * remainingToHalf ) + middle = ( pointBeginIntermediate + pointEndIntermediate ) * 0.5 + middleDown = middle - verticalWidth + middleUp = middle + verticalWidth + outline.append( middleUp ) + outline.append( pointEndIntermediate ) + outline.append( middleDown ) + else: + alongOutsideBegin = along + alongToWidth + alongOutsideEnd = alongEnd - alongToWidth + outsideBeginCenter = euclidean.getIntermediateLocation( alongOutsideBegin, pointBeginRotated, pointEndRotated ) + outsideBeginCenterDown = outsideBeginCenter - verticalWidth + outsideBeginCenterUp = outsideBeginCenter + verticalWidth + outsideEndCenter = euclidean.getIntermediateLocation( alongOutsideEnd, pointBeginRotated, pointEndRotated ) + outsideEndCenterDown = outsideEndCenter - verticalWidth + outsideEndCenterUp = outsideEndCenter + verticalWidth + outline.append( outsideBeginCenterUp ) + outline.append( outsideEndCenterUp ) + outline.append( pointEndIntermediate ) + outline.append( outsideEndCenterDown ) + outline.append( outsideBeginCenterDown ) + outlines.append( euclidean.getPointsRoundZAxis( normalizedSegment, outline ) ) + +def getInsetChainGcode( fileName, gcodeText, insetPreferences = None ): + "Inset the carves of a gcode text. Chain inset the gcode if it is not already carved." + if gcodeText == '': + if fileName[ - len( '.svg' ) : ] == '.svg': + gcodeText = gcodec.getFileText( fileName ) + if not gcodec.isProcedureDone( gcodeText, '"carve"' ): #"carve" is used instead of carve because quotes have to be used for strings in svg files + gcodeText = carve.getCarveGcode( fileName ) + return getInsetGcode( gcodeText, insetPreferences ) + +def getInsetGcode( gcodeText, insetPreferences = None ): + "Inset the carves of a gcode text." + if gcodeText == '': + return '' + if gcodec.isProcedureDone( gcodeText, 'inset' ): + return gcodeText + if insetPreferences == None: + insetPreferences = InsetPreferences() + preferences.readPreferences( insetPreferences ) + skein = InsetSkein() + skein.parseGcode( insetPreferences, gcodeText ) + return skein.output.getvalue() + +def getSegmentsFromPoints( aroundLists, loopLists, pointBegin, pointEnd ): + "Get endpoint segments from the beginning and end of a line segment." + normalizedSegment = pointEnd - pointBegin + normalizedSegmentLength = abs( normalizedSegment ) + if normalizedSegmentLength == 0.0: + return + normalizedSegment /= normalizedSegmentLength + segmentYMirror = complex( normalizedSegment.real, - normalizedSegment.imag ) + pointBeginRotated = segmentYMirror * pointBegin + pointEndRotated = segmentYMirror * pointEnd + rotatedLoopLists = [] + for loopList in loopLists: + rotatedLoopList = [] + rotatedLoopLists.append( rotatedLoopList ) + for loop in loopList: + rotatedLoop = euclidean.getPointsRoundZAxis( segmentYMirror, loop ) + rotatedLoopList.append( rotatedLoop ) + xIntersectionIndexList = [] + xIntersectionIndexList.append( euclidean.XIntersectionIndex( - 1, pointBeginRotated.real ) ) + xIntersectionIndexList.append( euclidean.XIntersectionIndex( - 1, pointEndRotated.real ) ) + euclidean.addXIntersectionIndexesFromLoopLists( rotatedLoopLists, xIntersectionIndexList, pointBeginRotated.imag ) + segments = euclidean.getSegmentsFromXIntersectionIndexes( xIntersectionIndexList, pointBeginRotated.imag ) + insideSegments = [] + for segment in segments: + endpointBegin = segment[ 0 ] + endpointBegin.point = normalizedSegment * endpointBegin.point + endpointEnd = segment[ 1 ] + endpointEnd.point = normalizedSegment * endpointEnd.point + if len( aroundLists ) < 1: + insideSegments.append( segment ) + elif isSegmentInsideAround( aroundLists, segment ): + insideSegments.append( segment ) + return insideSegments + +def isCloseToLast( paths, point, radius ): + "Determine if the point is close to the last point of the last path." + if len( paths ) < 1: + return False + lastPath = paths[ - 1 ] + return abs( lastPath[ - 1 ] - point ) < radius + +def isIntersectingWithinList( loop, loopList ): + "Determine if the loop is intersecting or is within the loop list." + if euclidean.isLoopIntersectingLoops( loop, loopList ): + return True + totalNumberOfIntersections = 0 + for otherLoop in loopList: + leftPoint = euclidean.getLeftPoint( otherLoop ) + totalNumberOfIntersections += euclidean.getNumberOfIntersectionsToLeft( leftPoint, loop ) + return totalNumberOfIntersections % 2 == 1 + +def isIntersectingWithinLists( loop, loopLists ): + "Determine if the loop is intersecting or is within the loop lists." + for loopList in loopLists: + if isIntersectingWithinList( loop, loopList ): + return True + return False + +def isIntersectingItself( loop, width ): + "Determine if the loop is intersecting itself." + outlines = [] + for pointIndex in xrange( len( loop ) ): + pointBegin = loop[ pointIndex ] + pointEnd = loop[ ( pointIndex + 1 ) % len( loop ) ] + if euclidean.isLineIntersectingLoops( outlines, pointBegin, pointEnd ): + return True + addSegmentOutline( False, outlines, pointBegin, pointEnd, width ) + return False + +def isSegmentInsideAround( aroundLists, segment ): + "Determine if the segment is inside an around." + midpoint = 0.5 * ( segment[ 0 ].point + segment[ 1 ].point ) + for aroundList in aroundLists: + for around in aroundList: + if euclidean.isPointInsideLoop( around, midpoint ): + return True + return False + +def writeOutput( fileName = '' ): + "Inset the carves of a gcode file. Chain carve the file if it is a GNU TriangulatedSurface file. If no fileName is specified, inset the first unmodified gcode file in this folder." + if fileName == '': + unmodified = interpret.getGNUTranslatorFilesUnmodified() + if len( unmodified ) == 0: + print( "There are no unmodified gcode files in this folder." ) + return + fileName = unmodified[ 0 ] + startTime = time.time() + insetPreferences = InsetPreferences() + preferences.readPreferences( insetPreferences ) + print( 'File ' + gcodec.getSummarizedFilename( fileName ) + ' is being chain insetted.' ) + suffixFilename = fileName[ : fileName.rfind( '.' ) ] + '_inset.gcode' + insetGcode = getInsetChainGcode( fileName, '', insetPreferences ) + if insetGcode == '': + return + gcodec.writeFileText( suffixFilename, insetGcode ) + print( 'The insetted file is saved as ' + suffixFilename ) + analyze.writeOutput( suffixFilename, insetGcode ) + print( 'It took ' + str( int( round( time.time() - startTime ) ) ) + ' seconds to inset the file.' ) + + +class InsetPreferences: + "A class to handle the inset preferences." + def __init__( self ): + "Set the default preferences, execute title & preferences fileName." + #Set the default preferences. + self.archive = [] + #Create the archive, title of the execute button, title of the dialog & preferences fileName. + self.extrusionPerimeterWidthOverThickness = preferences.FloatPreference().getFromValue( 'Extrusion Perimeter Width over Thickness (ratio):', 1.8 ) + self.archive.append( self.extrusionPerimeterWidthOverThickness ) + self.fileNameInput = preferences.Filename().getFromFilename( interpret.getGNUTranslatorGcodeFileTypeTuples(), 'Open File to be Insetted', '' ) + self.archive.append( self.fileNameInput ) + self.infillPerimeterOverlap = preferences.FloatPreference().getFromValue( 'Infill Perimeter Overlap (ratio):', 0.05 ) + self.archive.append( self.infillPerimeterOverlap ) + self.infillPerimeterOverlapMethodOfCalculationLabel = preferences.LabelDisplay().getFromName( 'Infill Perimeter Overlap Method of Calculation: ' ) + self.archive.append( self.infillPerimeterOverlapMethodOfCalculationLabel ) + infillRadio = [] + self.perimeterInfillPreference = preferences.Radio().getFromRadio( 'Calculate Overlap from Perimeter and Infill', infillRadio, True ) + self.archive.append( self.perimeterInfillPreference ) + self.perimeterPreference = preferences.Radio().getFromRadio( 'Calculate Overlap from Perimeter Only', infillRadio, False ) + self.archive.append( self.perimeterPreference ) + self.startAtHome = preferences.BooleanPreference().getFromValue( 'Start at Home', True ) + self.archive.append( self.startAtHome ) + #Create the archive, title of the execute button, title of the dialog & preferences fileName. + self.executeTitle = 'Inset' + self.fileNamePreferences = preferences.getPreferencesFilePath( 'inset.csv' ) + self.fileNameHelp = 'skeinforge_tools.inset.html' + self.saveTitle = 'Save Preferences' + self.title = 'Inset Preferences' + + def execute( self ): + "Inset button has been clicked." + fileNames = polyfile.getFileOrDirectoryTypesUnmodifiedGcode( self.fileNameInput.value, interpret.getImportPluginFilenames(), self.fileNameInput.wasCancelled ) + for fileName in fileNames: + writeOutput( fileName ) + + +class InsetSkein: + "A class to inset a skein of extrusions." + def __init__( self ): + self.boundary = None + self.decimalPlacesCarried = 3 + self.extruderActive = False + self.lineIndex = 0 + self.oldLocation = None + self.oldOrderedLocation = Vector3() + self.output = cStringIO.StringIO() + self.rotatedBoundaryLayers = [] + self.thread = None + + def addFromFile( self, fileName ): + "Add lines of text from the fileName." + fileLines = gcodec.getTextLines( gcodec.getFileTextInFileDirectory( __file__, fileName ) ) + for line in fileLines: + self.addLine( line ) + + def addFromUpperLowerFile( self, fileName ): + "Add lines of text from the fileName or the lowercase fileName, if there is no file by the original fileName in the directory." + directory = os.listdir( os.getcwd() ) + if fileName in directory: + self.addFromFile( fileName ) + return + lowerFilename = fileName.lower() + if lowerFilename in directory: + self.addFromFile( lowerFilename ) + return + gcodeDirectoryPath = os.path.join( preferences.getPreferencesDirectoryPath(), 'gcode_scripts' ) + try: + os.mkdir( gcodeDirectoryPath ) + except OSError: + pass + directory = os.listdir( gcodeDirectoryPath ) + if fileName in directory: + self.addFromFile( os.path.join( gcodeDirectoryPath, fileName ) ) + return + if lowerFilename in directory: + self.addFromFile( os.path.join( gcodeDirectoryPath, fileName.lower() ) ) + + def addGcodeFromPerimeterPaths( self, isIntersectingSelf, loop, loopLists, radius, z ): + "Add the perimeter paths to the output." + segments = [] + outlines = [] + thickOutlines = [] + allLoopLists = loopLists[ : ] + [ thickOutlines ] + for pointIndex in xrange( len( loop ) ): + pointBegin = loop[ pointIndex ] + pointEnd = loop[ ( pointIndex + 1 ) % len( loop ) ] + if isIntersectingSelf: + if euclidean.isLineIntersectingLoops( outlines, pointBegin, pointEnd ): + segments += getSegmentsFromPoints( loopLists, allLoopLists, pointBegin, pointEnd ) + else: + segments += getSegmentsFromPoints( loopLists, loopLists, pointBegin, pointEnd ) + addSegmentOutline( False, outlines, pointBegin, pointEnd, self.extrusionWidth ) + addSegmentOutline( True, thickOutlines, pointBegin, pointEnd, self.extrusionWidth ) + else: + segments += getSegmentsFromPoints( loopLists, loopLists, pointBegin, pointEnd ) + perimeterPaths = [] + path = [] + muchSmallerThanRadius = 0.1 * radius + for segment in segments: + pointBegin = segment[ 0 ].point + if not isCloseToLast( perimeterPaths, pointBegin, muchSmallerThanRadius ): + path = [ pointBegin ] + perimeterPaths.append( path ) + path.append( segment[ 1 ].point ) + if len( perimeterPaths ) > 1: + firstPath = perimeterPaths[ 0 ] + lastPath = perimeterPaths[ - 1 ] + if abs( lastPath[ - 1 ] - firstPath[ 0 ] ) < 0.1 * muchSmallerThanRadius: + connectedBeginning = lastPath[ : - 1 ] + firstPath + perimeterPaths[ 0 ] = connectedBeginning + perimeterPaths.remove( lastPath ) + for perimeterPath in perimeterPaths: + self.addGcodeFromThreadZ( perimeterPath, z ) + + def addGcodeFromRemainingLoop( self, loop, loopLists, radius, z ): + "Add the remainder of the loop which does not overlap the alreadyFilledArounds loops." + euclidean.addSurroundingLoopBeginning( loop, self, z ) + isIntersectingSelf = isIntersectingItself( loop, self.extrusionWidth ) + if isIntersectingWithinLists( loop, loopLists ) or isIntersectingSelf: + self.addGcodeFromPerimeterPaths( isIntersectingSelf, loop, loopLists, radius, z ) + else: + self.addLine( '(<perimeter> )' ) # Indicate that a perimeter is beginning. + self.addGcodeFromThreadZ( loop + [ loop[ 0 ] ], z ) + self.addLine( '(</surroundingLoop> )' ) + + def addGcodeFromThreadZ( self, thread, z ): + "Add a thread to the output." + if len( thread ) > 0: + self.addGcodeMovementZ( thread[ 0 ], z ) + else: + print( "zero length vertex positions array which was skipped over, this should never happen" ) + if len( thread ) < 2: + return + self.addLine( "M101" ) # Turn extruder on. + for point in thread[ 1 : ]: + self.addGcodeMovementZ( point, z ) + self.addLine( "M103" ) # Turn extruder off. + + def addGcodeMovementZ( self, point, z ): + "Add a movement to the output." + self.addLine( "G1 X%s Y%s Z%s" % ( self.getRounded( point.real ), self.getRounded( point.imag ), self.getRounded( z ) ) ) + + def addInitializationToOutput( self ): + "Add initialization gcode to the output." + self.addFromUpperLowerFile( 'Start.txt' ) # Add a start file if it exists. + self.addLine( '(<creator> skeinforge January 8, 2009 )' ) # GCode formatted comment + self.addLine( 'M110' ) # GCode for compatibility with Nophead's code. + self.addLine( '(<extruderInitialization> )' ) # GCode formatted comment + self.addLine( 'G21' ) # Set units to mm. + self.addLine( 'G90' ) # Set positioning to absolute. + if self.insetPreferences.startAtHome.value: + self.addLine( 'G28' ) # Start at home. + self.addLine( 'M103' ) # Turn extruder off. + self.addLine( 'M105' ) # Custom code for temperature reading. + self.addFromUpperLowerFile( 'EndOfTheBeginning.txt' ) # Add a second start file if it exists. + self.addLine( '(<decimalPlacesCarried> ' + str( self.decimalPlacesCarried ) + ' )' ) # Set decimal places carried. + self.addLine( '(<extrusionDiameter> ' + self.getRounded( self.extrusionDiameter ) + ' )' ) # Set extrusion diameter. + self.addLine( '(<layerThickness> ' + self.getRounded( self.layerThickness ) + ' )' ) # Set layer thickness. + self.addLine( '(<extrusionPerimeterWidth> ' + self.getRounded( self.extrusionPerimeterWidth ) + ' )' ) # Set extrusion perimeter width. + self.addLine( '(<extrusionWidth> ' + self.getRounded( self.extrusionWidth ) + ' )' ) # Set extrusion width. + self.addLine( '(<fillInset> ' + str( self.fillInset ) + ' )' ) # Set fill inset. + # Set bridge extrusion width over solid extrusion width. + self.addLine( '(<bridgeExtrusionWidthOverSolid> ' + euclidean.getRoundedToThreePlaces( self.bridgeExtrusionWidthOverSolid ) + ' )' ) + self.addLine( '(<procedureDone> carve )' ) # The skein has been carved. + self.addLine( '(<procedureDone> inset )' ) # The skein has been carved. + self.addLine( '(</extruderInitialization> )' ) # Initialization is finished, extrusion is starting. + self.addLine( '(<extrusionStart> )' ) # Initialization is finished, extrusion is starting. + circleArea = self.extrusionDiameter * self.extrusionDiameter * math.pi / 4.0 + print( 'The extrusion fill density ratio is ' + euclidean.getRoundedToThreePlaces( circleArea / self.extrusionWidth / self.layerThickness ) ) + + def addInset( self, layerIndex ): + "Add fill to the carve layer." + alreadyFilledArounds = [] + halfWidth = self.halfExtrusionPerimeterWidth + rotatedBoundaryLayer = self.rotatedBoundaryLayers[ layerIndex ] + self.addLine( '(<layerStart> %s )' % rotatedBoundaryLayer.z ) # Indicate that a new layer is starting. + if rotatedBoundaryLayer.rotation != None: + halfWidth *= self.bridgeExtrusionWidthOverSolid + self.addLine( '(<bridgeDirection> ' + str( rotatedBoundaryLayer.rotation ) + ' )' ) # Indicate the bridge direction. + for loop in rotatedBoundaryLayer.loops: + extrudateLoops = self.getExtrudateLoops( halfWidth, loop ) + for extrudateLoop in extrudateLoops: + self.addGcodeFromRemainingLoop( extrudateLoop, alreadyFilledArounds, halfWidth, rotatedBoundaryLayer.z ) + addAlreadyFilledArounds( alreadyFilledArounds, extrudateLoop, self.fillInset ) + + def addLine( self, line ): + "Add a line of text and a newline to the output." + if len( line ) > 0: + self.output.write( line + "\n" ) + + def addPathData( self, line ): + "Add the data from the path line." + line = line.replace( '"', ' ' ) + splitLine = line.split() + if splitLine[ 1 ] != 'transform=': + return + line = line.lower() + line = line.replace( 'm', ' ' ) + line = line.replace( 'l', ' ' ) + line = line.replace( '/>', ' ' ) + splitLine = line.split() + if 'd=' not in splitLine: + return + splitLine = splitLine[ splitLine.index( 'd=' ) + 1 : ] + pathSequence = [] + for word in splitLine: + if word == 'z': + loop = [] + for pathSequenceIndex in xrange( 0, len( pathSequence ), 2 ): + coordinate = complex( pathSequence[ pathSequenceIndex ], pathSequence[ pathSequenceIndex + 1 ] ) + loop.append( coordinate ) + self.rotatedBoundaryLayer.loops.append( loop ) + pathSequence = [] + else: + pathSequence.append( float( word ) ) + + def addRotatedLoopLayer( self, z ): + "Add rotated loop layer." + self.rotatedBoundaryLayer = euclidean.RotatedLoopLayer( z ) + self.rotatedBoundaryLayers.append( self.rotatedBoundaryLayer ) + + def addShutdownToOutput( self ): + "Add shutdown gcode to the output." + self.addLine( '(</extrusionStart> )' ) # GCode formatted comment + self.addLine( 'M103' ) # Turn extruder motor off. + self.addLine( 'M104 S0' ) # Turn extruder heater off. + self.addFromUpperLowerFile( 'End.txt' ) # Add an end file if it exists. + + def addTextData( self, line ): + "Add the data from the text line." + if line.find( 'layerThickness' ) != - 1: + return + line = line.replace( '>', ' ' ) + line = line.replace( '<', ' ' ) + line = line.replace( ',', ' ' ) + splitLine = line.split() + if 'Layer' not in splitLine: + return + splitLine = splitLine[ splitLine.index( 'Layer' ) + 1 : ] + if 'z' not in splitLine: + return + zIndex = splitLine.index( 'z' ) + self.addRotatedLoopLayer( float( splitLine[ zIndex + 1 ] ) ) + + def getExtrudateLoops( self, halfWidth, loop ): + "Get the inset extrudate loops from the loop." + slightlyGreaterThanHalfWidth = 1.1 * halfWidth + muchGreaterThanHalfWIdth = 2.5 * halfWidth + extrudateLoops = [] + circleNodes = intercircle.getCircleNodesFromLoop( loop, slightlyGreaterThanHalfWidth ) + centers = intercircle.getCentersFromCircleNodes( circleNodes ) + for center in centers: + extrudateLoop = intercircle.getSimplifiedInsetFromClockwiseLoop( center, halfWidth ) + if euclidean.isLargeSameDirection( extrudateLoop, center, muchGreaterThanHalfWIdth ): + if euclidean.isPathInsideLoop( loop, extrudateLoop ) == euclidean.isWiddershins( loop ): + extrudateLoop.reverse() + extrudateLoops.append( extrudateLoop ) + return extrudateLoops + + def getRounded( self, number ): + "Get number rounded to the number of carried decimal places as a string." + return euclidean.getRoundedToDecimalPlaces( self.decimalPlacesCarried, number ) + + def parseGcode( self, insetPreferences, gcodeText ): + "Parse gcode text and store the bevel gcode." + self.insetPreferences = insetPreferences + gcodeText = gcodeText.replace( '\t', ' ' ) + gcodeText = gcodeText.replace( ';', ' ' ) + self.lines = gcodec.getTextLines( gcodeText ) + self.parseInitialization() + self.addInitializationToOutput() + for lineIndex in xrange( self.lineIndex, len( self.lines ) ): + self.parseLine( lineIndex ) + for layerIndex in xrange( len( self.rotatedBoundaryLayers ) ): + self.addInset( layerIndex ) + self.addShutdownToOutput() + + def parseInitialization( self ): + "Parse gcode initialization and store the parameters." + for self.lineIndex in xrange( len( self.lines ) ): + line = self.lines[ self.lineIndex ].lstrip() + splitLine = gcodec.getWithoutBracketsEqualTab( line ).split() + firstWord = gcodec.getFirstWord( splitLine ) + if firstWord == 'bridgeExtrusionWidthOverSolid': + self.bridgeExtrusionWidthOverSolid = float( splitLine[ 1 ] ) + elif firstWord == 'decimalPlacesCarried': + self.decimalPlacesCarried = int( splitLine[ 1 ] ) + elif firstWord == 'extrusionDiameter': + self.extrusionDiameter = float( splitLine[ 1 ] ) + elif firstWord == 'layerThickness': + self.layerThickness = float( splitLine[ 1 ] ) + self.extrusionPerimeterWidth = self.insetPreferences.extrusionPerimeterWidthOverThickness.value * self.layerThickness + self.halfExtrusionPerimeterWidth = 0.5 * self.extrusionPerimeterWidth + elif firstWord == 'extrusionWidth': + self.extrusionWidth = float( splitLine[ 1 ] ) + self.fillInset = self.extrusionPerimeterWidth - self.extrusionPerimeterWidth * self.insetPreferences.infillPerimeterOverlap.value + if self.insetPreferences.perimeterInfillPreference.value: + self.fillInset = self.halfExtrusionPerimeterWidth + 0.5 * self.extrusionWidth - self.extrusionWidth * self.insetPreferences.infillPerimeterOverlap.value + elif firstWord == 'extrusionStart': + return + + def parseLine( self, lineIndex ): + "Parse a gcode line and add it to the inset skein." + line = self.lines[ lineIndex ].lstrip() + splitLine = line.split() + if len( splitLine ) < 1: + return + firstWord = splitLine[ 0 ] + if firstWord == '(<boundaryPoint>': + location = gcodec.getLocationFromSplitLine( None, splitLine ) + self.boundary.append( location.dropAxis( 2 ) ) + elif ( firstWord == '(<bridgeDirection>' or firstWord == '//bridgeDirection' ): + secondWordWithoutBrackets = splitLine[ 1 ].replace( '(', '' ).replace( ')', '' ) + self.rotatedBoundaryLayer.rotation = complex( secondWordWithoutBrackets ) + elif firstWord == '(<layerStart>': + self.addRotatedLoopLayer( float( splitLine[ 1 ] ) ) + elif firstWord == '<path': + self.addPathData( line ) + elif firstWord == '(<surroundingLoop>': + self.boundary = [] + self.rotatedBoundaryLayer.loops.append( self.boundary ) + elif firstWord == '<text': + self.addTextData( line ) + + +def main( hashtable = None ): + "Display the inset dialog." + if len( sys.argv ) > 1: + writeOutput( ' '.join( sys.argv[ 1 : ] ) ) + else: + preferences.displayDialog( InsetPreferences() ) + +if __name__ == "__main__": + main() diff --git a/trunk/reprap/miscellaneous/python-beanshell-scripts/skeinforge_tools/material.py b/trunk/reprap/miscellaneous/python-beanshell-scripts/skeinforge_tools/material.py index 7d8217bf..b34f2323 100644 --- a/trunk/reprap/miscellaneous/python-beanshell-scripts/skeinforge_tools/material.py +++ b/trunk/reprap/miscellaneous/python-beanshell-scripts/skeinforge_tools/material.py @@ -44,17 +44,17 @@ def getSelectedMaterial(): class MaterialPreferences: "A class to handle the material preferences." def __init__( self ): - "Set the default preferences, execute title & preferences filename." + "Set the default preferences, execute title & preferences fileName." #Set the default preferences. self.materialList = preferences.ListPreference().getFromValue( 'Material List:', [ 'ABS', 'HDPE', 'PCL', 'PLA' ] ) self.materialListbox = preferences.ListboxPreference().getFromListPreference( self.materialList, 'Material Selection:', 'ABS' ) self.addListboxSelection = preferences.AddListboxSelection().getFromListboxPreference( self.materialListbox ) self.deleteListboxSelection = preferences.DeleteListboxSelection().getFromListboxPreference( self.materialListbox ) - #Create the archive, title of the dialog & preferences filename. + #Create the archive, title of the dialog & preferences fileName. self.archive = [ self.materialList, self.materialListbox, self.addListboxSelection, self.deleteListboxSelection ] self.executeTitle = None - self.filenameHelp = 'skeinforge_tools.material.html' - self.filenamePreferences = preferences.getPreferencesFilePath( 'material.csv' ) + self.fileNameHelp = 'skeinforge_tools.material.html' + self.fileNamePreferences = preferences.getPreferencesFilePath( 'material.csv' ) self.saveTitle = 'Save Preferences' self.title = 'Material Preferences' diff --git a/trunk/reprap/miscellaneous/python-beanshell-scripts/skeinforge_tools/multiply.py b/trunk/reprap/miscellaneous/python-beanshell-scripts/skeinforge_tools/multiply.py index 07c07424..5f494af0 100644 --- a/trunk/reprap/miscellaneous/python-beanshell-scripts/skeinforge_tools/multiply.py +++ b/trunk/reprap/miscellaneous/python-beanshell-scripts/skeinforge_tools/multiply.py @@ -39,7 +39,7 @@ The multiplied file is saved as Screw Holder Bottom_multiply.gcode >>> multiply.getMultiplyGcode(" -( GCode generated by May 8, 2008 slice.py ) +( GCode generated by May 8, 2008 carve.py ) ( Extruder Initialization ) .. many lines of gcode @@ -48,7 +48,7 @@ many lines of gcode >>> multiply.getMultiplyChainGcode(" -( GCode generated by May 8, 2008 slice.py ) +( GCode generated by May 8, 2008 carve.py ) ( Extruder Initialization ) .. many lines of gcode @@ -68,7 +68,7 @@ from skeinforge_tools.skeinforge_utilities import intercircle from skeinforge_tools.skeinforge_utilities import preferences from skeinforge_tools import analyze from skeinforge_tools import fill -from skeinforge_tools import import_translator +from skeinforge_tools.skeinforge_utilities import interpret from skeinforge_tools import material from skeinforge_tools import polyfile import cStringIO @@ -82,11 +82,11 @@ __date__ = "$Date: 2008/21/04 $" __license__ = "GPL 3.0" -def getMultiplyChainGcode( filename, gcodeText, multiplyPreferences = None ): +def getMultiplyChainGcode( fileName, gcodeText, multiplyPreferences = None ): "Multiply a gcode linear move text. Chain multiply the gcode if it is not already multiplied." - gcodeText = gcodec.getGcodeFileText( filename, gcodeText ) + gcodeText = gcodec.getGcodeFileText( fileName, gcodeText ) if not gcodec.isProcedureDone( gcodeText, 'fill' ): - gcodeText = fill.getFillChainGcode( filename, gcodeText ) + gcodeText = fill.getFillChainGcode( fileName, gcodeText ) return getMultiplyGcode( gcodeText, multiplyPreferences ) def getMultiplyGcode( gcodeText, multiplyPreferences = None ): @@ -104,21 +104,21 @@ def getMultiplyGcode( gcodeText, multiplyPreferences = None ): skein.parseGcode( gcodeText, multiplyPreferences ) return skein.output.getvalue() -def writeOutput( filename = '' ): +def 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.""" - if filename == '': - unmodified = import_translator.getGNUTranslatorFilesUnmodified() + If no fileName is specified, multiply the first unmodified gcode file in this folder.""" + if fileName == '': + unmodified = interpret.getGNUTranslatorFilesUnmodified() if len( unmodified ) == 0: print( "There are no unmodified gcode files in this folder." ) return - filename = unmodified[ 0 ] + fileName = unmodified[ 0 ] multiplyPreferences = MultiplyPreferences() preferences.readPreferences( multiplyPreferences ) startTime = time.time() - print( 'File ' + gcodec.getSummarizedFilename( filename ) + ' is being chain multiplied.' ) - suffixFilename = filename[ : filename.rfind( '.' ) ] + '_multiply.gcode' - multiplyGcode = getMultiplyChainGcode( filename, '', multiplyPreferences ) + print( 'File ' + gcodec.getSummarizedFilename( fileName ) + ' is being chain multiplied.' ) + suffixFilename = fileName[ : fileName.rfind( '.' ) ] + '_multiply.gcode' + multiplyGcode = getMultiplyChainGcode( fileName, '', multiplyPreferences ) if multiplyGcode == '': return gcodec.writeFileText( suffixFilename, multiplyGcode ) @@ -130,35 +130,35 @@ def writeOutput( filename = '' ): class MultiplyPreferences: "A class to handle the multiply preferences." def __init__( self ): - "Set the default preferences, execute title & preferences filename." + "Set the default preferences, execute title & preferences fileName." #Set the default preferences. self.archive = [] - self.activateMultiply = preferences.BooleanPreference().getFromValue( 'Activate Multiply:', True ) + self.activateMultiply = preferences.BooleanPreference().getFromValue( 'Activate Multiply:', False ) self.archive.append( self.activateMultiply ) self.centerX = preferences.FloatPreference().getFromValue( 'Center X (millimeters):', 0.0 ) self.archive.append( self.centerX ) self.centerY = preferences.FloatPreference().getFromValue( 'Center Y (millimeters):', 0.0 ) self.archive.append( self.centerY ) - self.filenameInput = preferences.Filename().getFromFilename( import_translator.getGNUTranslatorGcodeFileTypeTuples(), 'Open File to be Multiplied', '' ) - self.archive.append( self.filenameInput ) + self.fileNameInput = preferences.Filename().getFromFilename( interpret.getGNUTranslatorGcodeFileTypeTuples(), 'Open File to be Multiplied', '' ) + self.archive.append( self.fileNameInput ) self.numberOfColumns = preferences.IntPreference().getFromValue( 'Number of Columns (integer):', 1 ) self.archive.append( self.numberOfColumns ) self.numberOfRows = preferences.IntPreference().getFromValue( 'Number of Rows (integer):', 1 ) self.archive.append( self.numberOfRows ) self.separationOverExtrusionWidth = preferences.FloatPreference().getFromValue( 'Separation over Extrusion Width (ratio):', 15.0 ) self.archive.append( self.separationOverExtrusionWidth ) - #Create the archive, title of the execute button, title of the dialog & preferences filename. + #Create the archive, title of the execute button, title of the dialog & preferences fileName. self.executeTitle = 'Multiply' - self.filenamePreferences = preferences.getPreferencesFilePath( 'multiply.csv' ) - self.filenameHelp = 'skeinforge_tools.multiply.html' + self.fileNamePreferences = preferences.getPreferencesFilePath( 'multiply.csv' ) + self.fileNameHelp = 'skeinforge_tools.multiply.html' self.saveTitle = 'Save Preferences' self.title = 'Multiply Preferences' def execute( self ): "Multiply button has been clicked." - filenames = polyfile.getFileOrDirectoryTypesUnmodifiedGcode( self.filenameInput.value, import_translator.getGNUTranslatorFileTypes(), self.filenameInput.wasCancelled ) - for filename in filenames: - writeOutput( filename ) + fileNames = polyfile.getFileOrDirectoryTypesUnmodifiedGcode( self.fileNameInput.value, interpret.getImportPluginFilenames(), self.fileNameInput.wasCancelled ) + for fileName in fileNames: + writeOutput( fileName ) class MultiplySkein: diff --git a/trunk/reprap/miscellaneous/python-beanshell-scripts/skeinforge_tools/oozebane.py b/trunk/reprap/miscellaneous/python-beanshell-scripts/skeinforge_tools/oozebane.py index f1005dee..2ffffbcd 100644 --- a/trunk/reprap/miscellaneous/python-beanshell-scripts/skeinforge_tools/oozebane.py +++ b/trunk/reprap/miscellaneous/python-beanshell-scripts/skeinforge_tools/oozebane.py @@ -14,8 +14,11 @@ the feedrate will be decreased and the larger the size of the resulting gcode fi Oozebane also turns the extruder on just before the start of a thread. The "Early Startup Maximum Distance Over Extrusion Width" preference is the ratio of the maximum distance before the thread starts that the extruder will be turned off over the extrusion width, -the default is 2.0. The longer the extruder has been off, the sooner the extruder will turn back on, the ratio is one minus one over e -to the power of the distance the extruder has been off over the "Early Startup Distance Constant Over Extrusion Width". +the default is 2.0. The longer the extruder has been off, the earlier the extruder will turn back on, the ratio is one minus one over e +to the power of the distance the extruder has been off over the "Early Startup Distance Constant Over Extrusion Width". The 'First +Early Startup Distance over Extrusion Width' preference is the ratio of the distance before the first thread starts that the extruder +will be turned off over the extrusion width. This value should be high because, according to Marius, the extruder takes a second or +two to extrude when starting for the first time, the default is forty. The "Minimum Distance for Early Startup over Extrusion Width" ratio is the minimum distance that the extruder has to be off before the thread begins over the extrusion width for the early start up feature to activate. The "Minimum Distance for Early Shutdown @@ -31,7 +34,7 @@ To run oozebane, in a shell which oozebane is in type: The following examples oozebane 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 oozebane.py. The oozebane function will oozebane if the 'Activate Oozebane' checkbox is on. The functions writeOutput and getOozebaneChainGcode check to see if the text has been -oozebaned, if not they call the getNozzleWipeChainGcode in nozzle_wipe.py to nozzle wipe the text; once they have the nozzle +oozebaned, if not they call the getWipeChainGcode in wipe.py to nozzle wipe the text; once they have the nozzle wiped text, then they oozebane. @@ -61,7 +64,7 @@ The oozebaned file is saved as Screw Holder Bottom_oozebane.gcode >>> oozebane.getOozebaneGcode(" -( GCode generated by May 8, 2008 slice.py ) +( GCode generated by May 8, 2008 carve.py ) ( Extruder Initialization ) .. many lines of gcode @@ -70,7 +73,7 @@ many lines of gcode >>> oozebane.getOozebaneChainGcode(" -( GCode generated by May 8, 2008 slice.py ) +( GCode generated by May 8, 2008 carve.py ) ( Extruder Initialization ) .. many lines of gcode @@ -87,8 +90,8 @@ from skeinforge_tools.skeinforge_utilities import euclidean from skeinforge_tools.skeinforge_utilities import gcodec from skeinforge_tools.skeinforge_utilities import preferences from skeinforge_tools import analyze -from skeinforge_tools import import_translator -from skeinforge_tools import nozzle_wipe +from skeinforge_tools.skeinforge_utilities import interpret +from skeinforge_tools import wipe from skeinforge_tools import polyfile import cStringIO import math @@ -101,11 +104,11 @@ __date__ = "$Date: 2008/21/04 $" __license__ = "GPL 3.0" -def getOozebaneChainGcode( filename, gcodeText, oozebanePreferences = None ): +def getOozebaneChainGcode( fileName, gcodeText, oozebanePreferences = None ): "Oozebane a gcode linear move text. Chain oozebane the gcode if it is not already oozebaned." - gcodeText = gcodec.getGcodeFileText( filename, gcodeText ) - if not gcodec.isProcedureDone( gcodeText, 'nozzle_wipe' ): - gcodeText = nozzle_wipe.getNozzleWipeChainGcode( filename, gcodeText ) + gcodeText = gcodec.getGcodeFileText( fileName, gcodeText ) + if not gcodec.isProcedureDone( gcodeText, 'wipe' ): + gcodeText = wipe.getWipeChainGcode( fileName, gcodeText ) return getOozebaneGcode( gcodeText, oozebanePreferences ) def getOozebaneGcode( gcodeText, oozebanePreferences = None ): @@ -123,20 +126,20 @@ def getOozebaneGcode( gcodeText, oozebanePreferences = None ): skein.parseGcode( gcodeText, oozebanePreferences ) return skein.output.getvalue() -def writeOutput( filename = '' ): - "Oozebane a gcode linear move file. Chain oozebane the gcode if it is not already oozebaned. If no filename is specified, oozebane the first unmodified gcode file in this folder." - if filename == '': - unmodified = import_translator.getGNUTranslatorFilesUnmodified() +def writeOutput( fileName = '' ): + "Oozebane a gcode linear move file. Chain oozebane the gcode if it is not already oozebaned. If no fileName is specified, oozebane the first unmodified gcode file in this folder." + if fileName == '': + unmodified = interpret.getGNUTranslatorFilesUnmodified() if len( unmodified ) == 0: print( "There are no unmodified gcode files in this folder." ) return - filename = unmodified[ 0 ] + fileName = unmodified[ 0 ] oozebanePreferences = OozebanePreferences() preferences.readPreferences( oozebanePreferences ) startTime = time.time() - print( 'File ' + gcodec.getSummarizedFilename( filename ) + ' is being chain oozebaned.' ) - suffixFilename = filename[ : filename.rfind( '.' ) ] + '_oozebane.gcode' - oozebaneGcode = getOozebaneChainGcode( filename, '', oozebanePreferences ) + print( 'File ' + gcodec.getSummarizedFilename( fileName ) + ' is being chain oozebaned.' ) + suffixFilename = fileName[ : fileName.rfind( '.' ) ] + '_oozebane.gcode' + oozebaneGcode = getOozebaneChainGcode( fileName, '', oozebanePreferences ) if oozebaneGcode == '': return gcodec.writeFileText( suffixFilename, oozebaneGcode ) @@ -148,7 +151,7 @@ def writeOutput( filename = '' ): class OozebanePreferences: "A class to handle the oozebane preferences." def __init__( self ): - "Set the default preferences, execute title & preferences filename." + "Set the default preferences, execute title & preferences fileName." #Set the default preferences. self.archive = [] self.activateOozebane = preferences.BooleanPreference().getFromValue( 'Activate Oozebane', False ) @@ -159,8 +162,10 @@ class OozebanePreferences: self.archive.append( self.earlyStartupDistanceConstantOverExtrusionWidth ) self.earlyStartupMaximumDistanceOverExtrusionWidth = preferences.FloatPreference().getFromValue( 'Early Startup Maximum Distance over Extrusion Width (ratio):', 2.0 ) self.archive.append( self.earlyStartupMaximumDistanceOverExtrusionWidth ) - self.filenameInput = preferences.Filename().getFromFilename( import_translator.getGNUTranslatorGcodeFileTypeTuples(), 'Open File to be Oozebaned', '' ) - self.archive.append( self.filenameInput ) + self.firstEarlyStartupDistanceOverExtrusionWidth = preferences.FloatPreference().getFromValue( 'First Early Startup Distance over Extrusion Width (ratio):', 40.0 ) + self.archive.append( self.firstEarlyStartupDistanceOverExtrusionWidth ) + self.fileNameInput = preferences.Filename().getFromFilename( interpret.getGNUTranslatorGcodeFileTypeTuples(), 'Open File to be Oozebaned', '' ) + self.archive.append( self.fileNameInput ) self.minimumDistanceForEarlyStartupOverExtrusionWidth = preferences.FloatPreference().getFromValue( 'Minimum Distance for Early Startup over Extrusion Width (ratio):', 10.0 ) self.archive.append( self.minimumDistanceForEarlyStartupOverExtrusionWidth ) self.minimumDistanceForEarlyShutdownOverExtrusionWidth = preferences.FloatPreference().getFromValue( 'Minimum Distance for Early Shutdown over Extrusion Width (ratio):', 10.0 ) @@ -169,18 +174,18 @@ class OozebanePreferences: self.archive.append( self.slowdownStartupSteps ) self.shutdownDistanceOverExtrusionWidth = preferences.FloatPreference().getFromValue( 'Shutdown Distance over Extrusion Width (ratio):', 2.0 ) self.archive.append( self.shutdownDistanceOverExtrusionWidth ) - #Create the archive, title of the execute button, title of the dialog & preferences filename. + #Create the archive, title of the execute button, title of the dialog & preferences fileName. self.executeTitle = 'Oozebane' - self.filenamePreferences = preferences.getPreferencesFilePath( 'oozebane.csv' ) - self.filenameHelp = 'skeinforge_tools.oozebane.html' + self.fileNamePreferences = preferences.getPreferencesFilePath( 'oozebane.csv' ) + self.fileNameHelp = 'skeinforge_tools.oozebane.html' self.saveTitle = 'Save Preferences' self.title = 'Oozebane Preferences' def execute( self ): "Oozebane button has been clicked." - filenames = polyfile.getFileOrDirectoryTypesUnmodifiedGcode( self.filenameInput.value, import_translator.getGNUTranslatorFileTypes(), self.filenameInput.wasCancelled ) - for filename in filenames: - writeOutput( filename ) + fileNames = polyfile.getFileOrDirectoryTypesUnmodifiedGcode( self.fileNameInput.value, interpret.getImportPluginFilenames(), self.fileNameInput.wasCancelled ) + for fileName in fileNames: + writeOutput( fileName ) class OozebaneSkein: @@ -189,9 +194,10 @@ class OozebaneSkein: self.decimalPlacesCarried = 3 self.distanceFromThreadEndToThreadBeginning = None self.earlyStartupDistance = None - self.extruderInactiveLongEnough= False + self.extruderInactiveLongEnough = True self.feedrateMinute = 961.0 self.isExtruderActive = False + self.isFirstExtrusion = True self.isShutdownEarly = False self.isShutdownNeeded = False self.isStartupEarly = False @@ -257,9 +263,9 @@ class OozebaneSkein: def getAddBeforeStartupLines( self, line ): "Get and / or add before the startup lines." distanceThreadBeginning = self.getDistanceToThreadBeginning() - splitLine = line.split() if distanceThreadBeginning == None: return line + splitLine = line.split() self.extruderInactiveLongEnough = False self.isStartupEarly = True location = gcodec.getLocationFromSplitLine( self.oldLocation, splitLine ) @@ -577,8 +583,12 @@ class OozebaneSkein: self.distanceFromThreadEndToThreadBeginning += location.distance( lastThreadLocation ) lastThreadLocation = location elif firstWord == 'M101': - distanceConstants = self.distanceFromThreadEndToThreadBeginning / self.earlyStartupDistanceConstant - self.earlyStartupDistance = self.getActiveFeedrateRatio() * self.earlyStartupMaximumDistance * ( 1.0 - math.exp( - distanceConstants ) ) + distanceConstantRatio = self.distanceFromThreadEndToThreadBeginning / self.earlyStartupDistanceConstant + earlyStartupOperatingDistance = self.earlyStartupMaximumDistance * ( 1.0 - math.exp( - distanceConstantRatio ) ) + if self.isFirstExtrusion: + earlyStartupOperatingDistance = self.oozebanePreferences.firstEarlyStartupDistanceOverExtrusionWidth.value * self.extrusionWidth + self.isFirstExtrusion = False + self.earlyStartupDistance = earlyStartupOperatingDistance * self.getActiveFeedrateRatio() return def setExtrusionWidth( self, oozebanePreferences ): diff --git a/trunk/reprap/miscellaneous/python-beanshell-scripts/skeinforge_tools/polyfile.py b/trunk/reprap/miscellaneous/python-beanshell-scripts/skeinforge_tools/polyfile.py index a5d01a75..84db0279 100644 --- a/trunk/reprap/miscellaneous/python-beanshell-scripts/skeinforge_tools/polyfile.py +++ b/trunk/reprap/miscellaneous/python-beanshell-scripts/skeinforge_tools/polyfile.py @@ -38,29 +38,29 @@ __date__ = "$Date: 2008/21/04 $" __license__ = "GPL 3.0" -def getFileOrGcodeDirectory( filename, wasCancelled, words = [] ): +def getFileOrGcodeDirectory( fileName, wasCancelled, words = [] ): "Get the gcode files in the directory the file is in if directory preference is true. Otherwise, return the file in a list." - if isEmptyOrCancelled( filename, wasCancelled ): + if isEmptyOrCancelled( fileName, wasCancelled ): return [] if isDirectoryPreference(): - return gcodec.getFilesWithFileTypeWithoutWords( 'gcode', words, filename ) - return [ filename ] + return gcodec.getFilesWithFileTypeWithoutWords( 'gcode', words, fileName ) + return [ fileName ] -def getFileOrDirectoryTypes( filename, fileTypes, wasCancelled ): +def getFileOrDirectoryTypes( fileName, fileTypes, wasCancelled ): "Get the gcode files in the directory the file is in if directory preference is true. Otherwise, return the file in a list." - if isEmptyOrCancelled( filename, wasCancelled ): + if isEmptyOrCancelled( fileName, wasCancelled ): return [] if isDirectoryPreference(): - return gcodec.getFilesWithFileTypesWithoutWords( fileTypes, [], filename ) - return [ filename ] + return gcodec.getFilesWithFileTypesWithoutWords( fileTypes, [], fileName ) + return [ fileName ] -def getFileOrDirectoryTypesUnmodifiedGcode( filename, fileTypes, wasCancelled ): +def getFileOrDirectoryTypesUnmodifiedGcode( fileName, fileTypes, wasCancelled ): "Get the gcode files in the directory the file is in if directory preference is true. Otherwise, return the file in a list." - if isEmptyOrCancelled( filename, wasCancelled ): + if isEmptyOrCancelled( fileName, wasCancelled ): return [] if isDirectoryPreference(): - return gcodec.getFilesWithFileTypesWithoutWords( fileTypes, [], filename ) + gcodec.getUnmodifiedGCodeFiles( filename ) - return [ filename ] + return gcodec.getFilesWithFileTypesWithoutWords( fileTypes, [], fileName ) + gcodec.getUnmodifiedGCodeFiles( fileName ) + return [ fileName ] def isDirectoryPreference(): "Determine if the directory preference is true." @@ -72,15 +72,15 @@ def isDirectoryPreference(): # print( '"Execute File" is selected, so only the opened file will be executed. To execute all the unmodified files in the directory, change the preference in polyfile.' ) return polyfilePreferences.directoryPreference.value -def isEmptyOrCancelled( filename, wasCancelled ): - "Determine if the filename is empty or the dialog was cancelled." - return str( filename ) == '' or str( filename ) == '()' or wasCancelled +def isEmptyOrCancelled( fileName, wasCancelled ): + "Determine if the fileName is empty or the dialog was cancelled." + return str( fileName ) == '' or str( fileName ) == '()' or wasCancelled class PolyfilePreferences: "A class to handle the polyfile preferences." def __init__( self ): - "Set the default preferences, execute title & preferences filename." + "Set the default preferences, execute title & preferences fileName." #Set the default preferences. self.archive = [] self.directoryOrFileChoiceLabel = preferences.LabelDisplay().getFromName( 'Directory or File Choice: ' ) @@ -90,10 +90,10 @@ class PolyfilePreferences: self.archive.append( self.directoryPreference ) self.filePreference = preferences.Radio().getFromRadio( 'Execute File', directoryRadio, True ) self.archive.append( self.filePreference ) - #Create the archive, title of the dialog & preferences filename. + #Create the archive, title of the dialog & preferences fileName. self.executeTitle = None - self.filenameHelp = 'skeinforge_tools.polyfile.html' - self.filenamePreferences = preferences.getPreferencesFilePath( 'polyfile.csv' ) + self.fileNameHelp = 'skeinforge_tools.polyfile.html' + self.fileNamePreferences = preferences.getPreferencesFilePath( 'polyfile.csv' ) self.saveTitle = 'Save Preferences' self.title = 'Polyfile Preferences' diff --git a/trunk/reprap/miscellaneous/python-beanshell-scripts/skeinforge_tools/raft.py b/trunk/reprap/miscellaneous/python-beanshell-scripts/skeinforge_tools/raft.py index 32ea205c..ef8b0e5e 100644 --- a/trunk/reprap/miscellaneous/python-beanshell-scripts/skeinforge_tools/raft.py +++ b/trunk/reprap/miscellaneous/python-beanshell-scripts/skeinforge_tools/raft.py @@ -23,14 +23,14 @@ those will be in the raft dialog. If there are no preferences for the new mater will have to set new preferences for the new material. The "Base Infill Density" preference is the infill density ratio of the base of the raft, the default ratio is half. The "Base Layer -Height over Extrusion Height" preference is the ratio of the height & width of the base layer compared to the height and width +Height over Layer Thickness" preference is the ratio of the height & width of the base layer compared to the height and width of the shape infill, the default is two. The feedrate will be slower for raft layers which have thicker extrusions than the shape infill. The "Base Layers" preference is the number of base layers, the default is one. The "Base Nozzle Lift over Half Base -Extrusion Height" is the amount the nozzle is above the center of the extrusion divided by half the base extrusion height. +Layer Thickness" is the amount the nozzle is above the center of the extrusion divided by half the base layer thickness. -The interface of the raft has equivalent preferences called "Interface Infill Density", "Interface Layer Height over Extrusion -Height", "Interface Layers" and "Interface Nozzle Lift over Half Base Extrusion Height". The shape has the equivalent -preference of called "Operating Nozzle Lift over Half Extrusion Height". +The interface of the raft has equivalent preferences called "Interface Infill Density", "Interface Layer Thickness over Extrusion +Height", "Interface Layers" and "Interface Nozzle Lift over Half Base Layer Thickness". The shape has the equivalent +preference of called "Operating Nozzle Lift over Half Layer Thickness". The altitude that the bottom of the raft will be set to the "Bottom Altitude" preference. @@ -63,10 +63,6 @@ preference sets the temperature of the next layers of the shape. The "Temperatu temperature of the support layer. The "Temperature of Supported Layers" preference sets the temperature of the layer of the shape above the support layer. -If the "Turn Extruder On Early" checkbox is checked, the extruder will be turned on before the first layer is extruded. Now that -oozebane turns on the extruder just before a thread begins, the "Turn Extruder On Early" option is probably not necesary so the -default is now off. - The following examples raft 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 raft.py. The raft function will raft if "Activate Raft, Elevate Nozzle, Orbit and Set Altitude" is true, which can be set in the dialog or by changing the preferences file 'raft.csv' with a text editor or a @@ -98,7 +94,7 @@ The rafted file is saved as Screw Holder Bottom_raft.gcode >>> raft.getRaftGcode(" -( GCode generated by May 8, 2008 slice.py ) +( GCode generated by May 8, 2008 carve.py ) ( Extruder Initialization ) .. many lines of gcode @@ -107,7 +103,7 @@ many lines of gcode >>> raft.getRaftChainGcode(" -( GCode generated by May 8, 2008 slice.py ) +( GCode generated by May 8, 2008 carve.py ) ( Extruder Initialization ) .. many lines of gcode @@ -126,7 +122,7 @@ from skeinforge_tools.skeinforge_utilities import gcodec from skeinforge_tools.skeinforge_utilities import intercircle from skeinforge_tools.skeinforge_utilities import preferences from skeinforge_tools import analyze -from skeinforge_tools import import_translator +from skeinforge_tools.skeinforge_utilities import interpret from skeinforge_tools import material from skeinforge_tools import polyfile from skeinforge_tools import speed @@ -203,11 +199,11 @@ def getJoinOfXIntersectionIndexes( xIntersectionIndexList ): return xIntersectionList #raft outline temperature http://hydraraptor.blogspot.com/2008/09/screw-top-pot.html -def getRaftChainGcode( filename, gcodeText, raftPreferences = None ): +def getRaftChainGcode( fileName, gcodeText, raftPreferences = None ): "Raft a gcode linear move text. Chain raft the gcode if it is not already rafted." - gcodeText = gcodec.getGcodeFileText( filename, gcodeText ) + gcodeText = gcodec.getGcodeFileText( fileName, gcodeText ) if not gcodec.isProcedureDone( gcodeText, 'speed' ): - gcodeText = speed.getSpeedChainGcode( filename, gcodeText ) + gcodeText = speed.getSpeedChainGcode( fileName, gcodeText ) return getRaftGcode( gcodeText, raftPreferences ) def getRaftGcode( gcodeText, raftPreferences = None ): @@ -274,21 +270,21 @@ def subtractFill( fillXIntersectionIndexTable, supportSegmentLayerTable ): else: del supportSegmentLayerTable[ supportSegmentLayerTableKey ] -def writeOutput( filename = '' ): +def writeOutput( fileName = '' ): """Raft a gcode linear move file. Chain raft the gcode if it is not already rafted. - If no filename is specified, raft the first unmodified gcode file in this folder.""" - if filename == '': - unmodified = import_translator.getGNUTranslatorFilesUnmodified() + If no fileName is specified, raft the first unmodified gcode file in this folder.""" + if fileName == '': + unmodified = interpret.getGNUTranslatorFilesUnmodified() if len( unmodified ) == 0: print( "There are no unmodified gcode files in this folder." ) return - filename = unmodified[ 0 ] + fileName = unmodified[ 0 ] raftPreferences = RaftPreferences() preferences.readPreferences( raftPreferences ) startTime = time.time() - print( 'File ' + gcodec.getSummarizedFilename( filename ) + ' is being chain rafted.' ) - suffixFilename = filename[ : filename.rfind( '.' ) ] + '_raft.gcode' - raftGcode = getRaftChainGcode( filename, '', raftPreferences ) + print( 'File ' + gcodec.getSummarizedFilename( fileName ) + ' is being chain rafted.' ) + suffixFilename = fileName[ : fileName.rfind( '.' ) ] + '_raft.gcode' + raftGcode = getRaftChainGcode( fileName, '', raftPreferences ) if raftGcode == '': return gcodec.writeFileText( suffixFilename, raftGcode ) @@ -300,7 +296,7 @@ def writeOutput( filename = '' ): class RaftPreferences: "A class to handle the raft preferences." def __init__( self ): - "Set the default preferences, execute title & preferences filename." + "Set the default preferences, execute title & preferences fileName." materialName = material.getSelectedMaterial() #Set the default preferences. self.archive = [] @@ -310,30 +306,30 @@ class RaftPreferences: self.archive.append( self.addRaftElevateNozzleOrbitSetAltitude ) self.baseInfillDensity = preferences.FloatPreference().getFromValue( 'Base Infill Density (ratio):', 0.5 ) self.archive.append( self.baseInfillDensity ) - self.baseLayerHeightOverExtrusionHeight = preferences.FloatPreference().getFromValue( 'Base Layer Height over Extrusion Height:', 2.0 ) - self.archive.append( self.baseLayerHeightOverExtrusionHeight ) + self.baseLayerThicknessOverLayerThickness = preferences.FloatPreference().getFromValue( 'Base Layer Thickness over Layer Thickness:', 2.0 ) + self.archive.append( self.baseLayerThicknessOverLayerThickness ) self.baseLayers = preferences.IntPreference().getFromValue( 'Base Layers (integer):', 1 ) self.archive.append( self.baseLayers ) - self.baseNozzleLiftOverHalfBaseExtrusionHeight = preferences.FloatPreference().getFromValue( 'Base Nozzle Lift over Half Base Extrusion Height (ratio):', 0.75 ) - self.archive.append( self.baseNozzleLiftOverHalfBaseExtrusionHeight ) + self.baseNozzleLiftOverHalfBaseLayerThickness = preferences.FloatPreference().getFromValue( 'Base Nozzle Lift over Half Base Layer Thickness (ratio):', 0.75 ) + self.archive.append( self.baseNozzleLiftOverHalfBaseLayerThickness ) self.bottomAltitude = preferences.FloatPreference().getFromValue( 'Bottom Altitude:', 0.0 ) self.archive.append( self.bottomAltitude ) - self.filenameInput = preferences.Filename().getFromFilename( import_translator.getGNUTranslatorGcodeFileTypeTuples(), 'Open File to be Rafted', '' ) - self.archive.append( self.filenameInput ) + self.fileNameInput = preferences.Filename().getFromFilename( interpret.getGNUTranslatorGcodeFileTypeTuples(), 'Open File to be Rafted', '' ) + self.archive.append( self.fileNameInput ) self.infillOverhang = preferences.FloatPreference().getFromValue( 'Infill Overhang (ratio):', 0.1 ) self.archive.append( self.infillOverhang ) self.interfaceInfillDensity = preferences.FloatPreference().getFromValue( 'Interface Infill Density (ratio):', 0.5 ) self.archive.append( self.interfaceInfillDensity ) - self.interfaceLayerHeightOverExtrusionHeight = preferences.FloatPreference().getFromValue( 'Interface Layer Height over Extrusion Height:', 1.0 ) - self.archive.append( self.interfaceLayerHeightOverExtrusionHeight ) + self.interfaceLayerThicknessOverLayerThickness = preferences.FloatPreference().getFromValue( 'Interface Layer Thickness over Layer Thickness:', 1.0 ) + self.archive.append( self.interfaceLayerThicknessOverLayerThickness ) self.interfaceLayers = preferences.IntPreference().getFromValue( 'Interface Layers (integer):', 2 ) self.archive.append( self.interfaceLayers ) - self.interfaceNozzleLiftOverHalfInterfaceExtrusionHeight = preferences.FloatPreference().getFromValue( 'Interface Nozzle Lift over Half Interface Extrusion Height (ratio):', 1.0 ) - self.archive.append( self.interfaceNozzleLiftOverHalfInterfaceExtrusionHeight ) + self.interfaceNozzleLiftOverHalfInterfaceLayerThickness = preferences.FloatPreference().getFromValue( 'Interface Nozzle Lift over Half Interface Layer Thickness (ratio):', 1.0 ) + self.archive.append( self.interfaceNozzleLiftOverHalfInterfaceLayerThickness ) self.material = preferences.LabelDisplay().getFromName( 'Material: ' + materialName ) self.archive.append( self.material ) - self.operatingNozzleLiftOverHalfExtrusionHeight = preferences.FloatPreference().getFromValue( 'Operating Nozzle Lift over Half Extrusion Height (ratio):', 1.0 ) - self.archive.append( self.operatingNozzleLiftOverHalfExtrusionHeight ) + self.operatingNozzleLiftOverHalfLayerThickness = preferences.FloatPreference().getFromValue( 'Operating Nozzle Lift over Half Layer Thickness (ratio):', 1.0 ) + self.archive.append( self.operatingNozzleLiftOverHalfLayerThickness ) self.raftOutsetRadiusOverExtrusionWidth = preferences.FloatPreference().getFromValue( 'Raft Outset Radius over Extrusion Width (ratio):', 15.0 ) self.archive.append( self.raftOutsetRadiusOverExtrusionWidth ) self.supportInsetOverPerimeterExtrusionWidth = preferences.FloatPreference().getFromValue( 'Support Inset over Perimeter Extrusion Width (ratio):', 0.0 ) @@ -371,20 +367,18 @@ class RaftPreferences: self.archive.append( self.temperatureShapeSupportLayers ) self.temperatureShapeSupportedLayers = preferences.FloatPreference().getFromValue( 'Temperature of Supported Layers (Celcius):', 230.0 ) self.archive.append( self.temperatureShapeSupportedLayers ) - self.turnExtruderOnEarly = preferences.BooleanPreference().getFromValue( 'Turn Extruder On Early:', False ) - self.archive.append( self.turnExtruderOnEarly ) - #Create the archive, title of the execute button, title of the dialog & preferences filename. + #Create the archive, title of the execute button, title of the dialog & preferences fileName. self.executeTitle = 'Raft' - self.filenamePreferences = preferences.getPreferencesFilePath( 'raft_' + materialName + '.csv' ) - self.filenameHelp = 'skeinforge_tools.raft.html' + self.fileNamePreferences = preferences.getPreferencesFilePath( 'raft_' + materialName + '.csv' ) + self.fileNameHelp = 'skeinforge_tools.raft.html' self.saveTitle = 'Save Preferences' self.title = 'Raft Preferences' def execute( self ): "Raft button has been clicked." - filenames = polyfile.getFileOrDirectoryTypesUnmodifiedGcode( self.filenameInput.value, import_translator.getGNUTranslatorFileTypes(), self.filenameInput.wasCancelled ) - for filename in filenames: - writeOutput( filename ) + fileNames = polyfile.getFileOrDirectoryTypesUnmodifiedGcode( self.fileNameInput.value, interpret.getImportPluginFilenames(), self.fileNameInput.wasCancelled ) + for fileName in fileNames: + writeOutput( fileName ) class RaftSkein: @@ -392,7 +386,7 @@ class RaftSkein: def __init__( self ): self.boundaryLayers = [] self.decimalPlacesCarried = 3 - self.extrusionHeight = 0.4 + self.layerThickness = 0.4 self.extrusionStart = True self.extrusionTop = 0.0 self.extrusionWidth = 0.6 @@ -413,16 +407,16 @@ class RaftSkein: def addBaseLayer( self, baseExtrusionWidth, baseStep, stepBegin, stepEnd ): "Add a base layer." - baseExtrusionHeight = self.extrusionHeight * self.baseLayerHeightOverExtrusionHeight - halfBaseExtrusionHeight = 0.5 * baseExtrusionHeight + baseLayerThickness = self.layerThickness * self.baseLayerThicknessOverLayerThickness + halfBaseLayerThickness = 0.5 * baseLayerThickness halfBaseExtrusionWidth = 0.5 * baseExtrusionWidth stepsUntilEnd = self.getStepsUntilEnd( stepBegin.real + halfBaseExtrusionWidth, stepEnd.real, baseStep ) baseOverhang = self.raftPreferences.infillOverhang.value * halfBaseExtrusionWidth - halfBaseExtrusionWidth beginY = stepBegin.imag - baseOverhang endY = stepEnd.imag + baseOverhang segments = [] - zCenter = self.extrusionTop + halfBaseExtrusionHeight - z = zCenter + halfBaseExtrusionHeight * self.raftPreferences.baseNozzleLiftOverHalfBaseExtrusionHeight.value + zCenter = self.extrusionTop + halfBaseLayerThickness + z = zCenter + halfBaseLayerThickness * self.raftPreferences.baseNozzleLiftOverHalfBaseLayerThickness.value for x in stepsUntilEnd: begin = complex( x, beginY ) end = complex( x, endY ) @@ -430,7 +424,7 @@ class RaftSkein: if len( segments ) < 1: print( 'This should never happen, the base layer has a size of zero.' ) return - self.addLayerFromSegments( self.feedrateMinute / self.baseLayerHeightOverExtrusionHeight / self.baseLayerHeightOverExtrusionHeight, baseExtrusionHeight, segments, zCenter, z ) + self.addLayerFromSegments( self.feedrateMinute / self.baseLayerThicknessOverLayerThickness / self.baseLayerThicknessOverLayerThickness, baseLayerThickness, segments, zCenter, z ) def addGcodeFromFeedrateThreadZ( self, feedrateMinute, thread, z ): "Add a thread to the output." @@ -451,11 +445,11 @@ class RaftSkein: def addInterfaceLayer( self ): "Add an interface layer." - interfaceExtrusionHeight = self.extrusionHeight * self.interfaceLayerHeightOverExtrusionHeight - halfInterfaceExtrusionHeight = 0.5 * interfaceExtrusionHeight + interfaceLayerThickness = self.layerThickness * self.interfaceLayerThicknessOverLayerThickness + halfInterfaceLayerThickness = 0.5 * interfaceLayerThickness segments = [] - zCenter = self.extrusionTop + halfInterfaceExtrusionHeight - z = zCenter + halfInterfaceExtrusionHeight * self.raftPreferences.interfaceNozzleLiftOverHalfInterfaceExtrusionHeight.value + zCenter = self.extrusionTop + halfInterfaceLayerThickness + z = zCenter + halfInterfaceLayerThickness * self.raftPreferences.interfaceNozzleLiftOverHalfInterfaceLayerThickness.value for y in self.interfaceStepsUntilEnd: begin = complex( self.interfaceBeginX, y ) end = complex( self.interfaceEndX, y ) @@ -463,9 +457,9 @@ class RaftSkein: if len( segments ) < 1: print( 'This should never happen, the interface layer has a size of zero.' ) return - self.addLayerFromSegments( self.feedrateMinute / self.interfaceLayerHeightOverExtrusionHeight / self.interfaceLayerHeightOverExtrusionHeight, interfaceExtrusionHeight, segments, zCenter, z ) + self.addLayerFromSegments( self.feedrateMinute / self.interfaceLayerThicknessOverLayerThickness / self.interfaceLayerThicknessOverLayerThickness, interfaceLayerThickness, segments, zCenter, z ) - def addLayerFromSegments( self, feedrateMinute, layerExtrusionHeight, segments, zCenter, z ): + def addLayerFromSegments( self, feedrateMinute, layerLayerThickness, segments, zCenter, z ): "Add a layer from segments and raise the extrusion top." firstSegment = segments[ 0 ] nearestPoint = firstSegment[ 1 ].point @@ -482,7 +476,7 @@ class RaftSkein: path.append( nearestPoint ) self.addLine( '(<layerStart> ' + self.getRounded( zCenter ) + ' )' ) # Indicate that a new layer is starting. self.addGcodeFromFeedrateThreadZ( feedrateMinute, path, z ) - self.extrusionTop += layerExtrusionHeight + self.extrusionTop += layerLayerThickness def addLine( self, line ): "Add a line of text and a newline to the output." @@ -492,15 +486,15 @@ class RaftSkein: def addRaft( self ): self.extrusionTop = self.raftPreferences.bottomAltitude.value complexRadius = complex( self.raftOutsetRadius, self.raftOutsetRadius ) - self.baseLayerHeightOverExtrusionHeight = self.raftPreferences.baseLayerHeightOverExtrusionHeight.value - baseExtrusionWidth = self.extrusionWidth * self.baseLayerHeightOverExtrusionHeight + self.baseLayerThicknessOverLayerThickness = self.raftPreferences.baseLayerThicknessOverLayerThickness.value + baseExtrusionWidth = self.extrusionWidth * self.baseLayerThicknessOverLayerThickness baseStep = baseExtrusionWidth / self.raftPreferences.baseInfillDensity.value - self.interfaceLayerHeightOverExtrusionHeight = self.raftPreferences.interfaceLayerHeightOverExtrusionHeight.value - interfaceExtrusionWidth = self.extrusionWidth * self.interfaceLayerHeightOverExtrusionHeight + self.interfaceLayerThicknessOverLayerThickness = self.raftPreferences.interfaceLayerThicknessOverLayerThickness.value + interfaceExtrusionWidth = self.extrusionWidth * self.interfaceLayerThicknessOverLayerThickness self.interfaceStep = interfaceExtrusionWidth / self.raftPreferences.interfaceInfillDensity.value self.setCornersZ() self.cornerLowComplex = self.cornerLow.dropAxis( 2 ) - halfExtrusionHeight = 0.5 * self.extrusionHeight + halfLayerThickness = 0.5 * self.layerThickness self.complexHigh = complexRadius + self.cornerHighComplex self.complexLow = self.cornerLowComplex - complexRadius extent = self.complexHigh - self.complexLow @@ -510,7 +504,7 @@ class RaftSkein: extentStep = complex( extentStepX, extentStepY ) stepBegin = center - 0.5 * extentStep stepEnd = stepBegin + extentStep - zBegin = self.extrusionTop + self.extrusionHeight + zBegin = self.extrusionTop + self.layerThickness beginLoop = getSquareLoop( self.cornerLowComplex, self.cornerHighComplex ) extrudeRaft = self.raftPreferences.baseLayers.value > 0 or self.raftPreferences.interfaceLayers.value > 0 if extrudeRaft: @@ -524,7 +518,7 @@ class RaftSkein: self.setInterfaceVariables( interfaceExtrusionWidth, stepBegin, stepEnd ) for interfaceLayerIndex in xrange( self.raftPreferences.interfaceLayers.value ): self.addInterfaceLayer() - self.operatingJump = self.extrusionTop - self.cornerLow.z + halfExtrusionHeight + halfExtrusionHeight * self.raftPreferences.operatingNozzleLiftOverHalfExtrusionHeight.value + self.operatingJump = self.extrusionTop - self.cornerLow.z + halfLayerThickness + halfLayerThickness * self.raftPreferences.operatingNozzleLiftOverHalfLayerThickness.value self.setBoundaryLayers() if extrudeRaft and len( self.boundaryLayers ) > 0: self.addTemperature( self.raftPreferences.temperatureShapeFirstLayerOutline.value ) @@ -710,9 +704,6 @@ class RaftSkein: if raftPreferences.addRaftElevateNozzleOrbitSetAltitude.value: self.addRaft() self.addTemperature( raftPreferences.temperatureShapeFirstLayerOutline.value ) - if raftPreferences.turnExtruderOnEarly.value: - self.addLine( 'M101' ) - self.isStartupEarly = True for line in self.lines[ self.lineIndex : ]: self.parseLine( line ) @@ -724,8 +715,8 @@ class RaftSkein: firstWord = gcodec.getFirstWord( splitLine ) if firstWord == '(<decimalPlacesCarried>': self.decimalPlacesCarried = int( splitLine[ 1 ] ) - elif firstWord == '(<extrusionHeight>': - self.extrusionHeight = float( splitLine[ 1 ] ) + elif firstWord == '(<layerThickness>': + self.layerThickness = float( splitLine[ 1 ] ) elif firstWord == '(<extrusionPerimeterWidth>': self.extrusionPerimeterWidth = float( splitLine[ 1 ] ) self.supportOutset = self.extrusionPerimeterWidth - self.extrusionPerimeterWidth * self.raftPreferences.supportInsetOverPerimeterExtrusionWidth.value diff --git a/trunk/reprap/miscellaneous/python-beanshell-scripts/skeinforge_tools/skeinforge_utilities/euclidean.py b/trunk/reprap/miscellaneous/python-beanshell-scripts/skeinforge_tools/skeinforge_utilities/euclidean.py index f38aeccd..4ec82645 100644 --- a/trunk/reprap/miscellaneous/python-beanshell-scripts/skeinforge_tools/skeinforge_utilities/euclidean.py +++ b/trunk/reprap/miscellaneous/python-beanshell-scripts/skeinforge_tools/skeinforge_utilities/euclidean.py @@ -1068,6 +1068,18 @@ class PathZ: return '%s, %s' % ( self.path, self.z ) +class RotatedLoopLayer: + "A rotated layer." + def __init__( self, z ): + self.loops = [] + self.rotation = None + self.z = z + + def __repr__( self ): + "Get the string representation of this rotated loop layer." + return '%s, %s, %s' % ( self.z, self.rotation, self.loops ) + + class SurroundingLoop: "A loop that surrounds paths." def __init__( self ): diff --git a/trunk/reprap/miscellaneous/python-beanshell-scripts/skeinforge_tools/skeinforge_utilities/gcodec.py b/trunk/reprap/miscellaneous/python-beanshell-scripts/skeinforge_tools/skeinforge_utilities/gcodec.py index 67e46ef0..96b81f91 100644 --- a/trunk/reprap/miscellaneous/python-beanshell-scripts/skeinforge_tools/skeinforge_utilities/gcodec.py +++ b/trunk/reprap/miscellaneous/python-beanshell-scripts/skeinforge_tools/skeinforge_utilities/gcodec.py @@ -35,15 +35,15 @@ def createInitFile(): fileText = '__all__ = ' + str( getPythonFilenamesExceptInit() ) writeFileText( '__init__.py', fileText ) -def findWords( filenames, search ): +def findWords( fileNames, search ): "Find in files the search." print( search + ' is being searched for.' ) - for filename in filenames: - fileText = getFileText( filename ) + for fileName in fileNames: + fileText = getFileText( fileName ) if fileText != '': whereInText = fileText.find( search ) if whereInText != - 1: - print( filename ) + print( fileName ) print( whereInText ) whereInTextFromEnd = fileText.rfind( search ) if whereInTextFromEnd != whereInText: @@ -97,51 +97,56 @@ def getFilesWithFileTypeWithoutWords( fileType, words = [], fileInDirectory = '' if fileInDirectory != '': directoryName = os.path.dirname( fileInDirectory ) directory = os.listdir( directoryName ) - for filename in directory: - joinedFilename = filename + for fileName in directory: + joinedFilename = fileName if fileInDirectory != '': - joinedFilename = os.path.join( directoryName, filename ) + joinedFilename = os.path.join( directoryName, fileName ) if isFileWithFileTypeWithoutWords( fileType, joinedFilename, words ): filesWithFileType.append( joinedFilename ) filesWithFileType.sort() return filesWithFileType -def getFileText( filename, readMode = 'r' ): +def getFileText( fileName, readMode = 'r' ): "Get the entire text of a file." try: - file = open( filename, readMode ) + file = open( fileName, readMode ) fileText = file.read() file.close() return fileText except IOError: - print( 'The file ' + filename + ' does not exist, an empty string will be returned.' ) + print( 'The file ' + fileName + ' does not exist, an empty string will be returned.' ) return '' +def getFileTextInFileDirectory( fileInDirectory, fileName, readMode = 'r' ): + "Get the entire text of a file in the directory of the file in directory." + absoluteFilePathInFileDirectory = os.path.join( os.path.dirname( fileInDirectory ), fileName ) + return getFileText( absoluteFilePathInFileDirectory, readMode ) + def getFirstWord( splitLine ): "Get the first word of a split line." if len( splitLine ) > 0: return splitLine[ 0 ] return '' -def getGcodeFileText( filename, gcodeText ): +def getGcodeFileText( fileName, gcodeText ): "Get the gcode text from a file if it the gcode text is empty and if the file is a gcode file." if gcodeText != '': return gcodeText - if filename[ - len( '.gcode' ) : ] == '.gcode': - return getFileText( filename ) + if fileName[ - len( '.gcode' ) : ] == '.gcode': + return getFileText( fileName ) return '' #def getGNUGcode( fileInDirectory = '' ): # "Get GNU Triangulated Surface files and gcode files which are not modified." # return getGNUTriangulatedSurfaceFiles( fileInDirectory ) + getUnmodifiedGCodeFiles( fileInDirectory ) -#def getGNUDirectoryOrFile( isDirectory, filename, wasCancelled ): +#def getGNUDirectoryOrFile( isDirectory, fileName, wasCancelled ): # "Get the GNU Triangulated Surface files in the directory the file is in if isDirectory is true. Otherwise, return the file in a list." -# if str( filename ) == '()' or wasCancelled: +# if str( fileName ) == '()' or wasCancelled: # return [] # if isDirectory: -# return getGNUTriangulatedSurfaceFiles( filename ) -# return [ filename ] +# return getGNUTriangulatedSurfaceFiles( fileName ) +# return [ fileName ] #def getGNUTriangulatedSurfaceFiles( fileInDirectory = '' ): # "Get GNU Triangulated Surface files." @@ -156,31 +161,31 @@ def getLocationFromSplitLine( oldLocation, splitLine ): getDoubleFromCharacterSplitLineValue( 'Y', splitLine, oldLocation.y ), getDoubleFromCharacterSplitLineValue( 'Z', splitLine, oldLocation.z ) ) -def getModule( filename, folderName, moduleFilename ): - "Get the module from the filename and folder name." +def getModule( fileName, folderName, moduleFilename ): + "Get the module from the fileName and folder name." absoluteDirectory = os.path.join( os.path.dirname( os.path.abspath( moduleFilename ) ), folderName ) originalSystemPath = sys.path[ : ] try: sys.path.insert( 0, absoluteDirectory ) - folderPluginsModule = __import__( filename ) + folderPluginsModule = __import__( fileName ) sys.path = originalSystemPath return folderPluginsModule except Exception, why: sys.path = originalSystemPath print( why ) print( '' ) - print( 'That error means; could not import a module with the filename ' + filename ) + print( 'That error means; could not import a module with the fileName ' + fileName ) print( 'folder name ' + folderName ) - print( 'and module filename ' + moduleFilename ) + print( 'and module fileName ' + moduleFilename ) print( 'giving an absolute directory name of ' + absoluteDirectory ) print( '' ) - print( 'The plugin could not be imported. So to run ' + filename + ' directly and at least get a more informative error message,' ) + print( 'The plugin could not be imported. So to run ' + fileName + ' directly and at least get a more informative error message,' ) print( 'in a shell in the ' + folderName + ' folder type ' ) - print( '> python ' + filename + '.py' ) + print( '> python ' + fileName + '.py' ) return None def getPluginFilenames( folderName, moduleFilename ): - "Get the filenames of the python plugins in the export_plugins folder." + "Get the fileNames of the python plugins in the export_plugins folder." pluginsFolderName = os.path.join( os.path.dirname( os.path.abspath( moduleFilename ) ), folderName ) fileInDirectory = os.path.join( pluginsFolderName, '__init__.py' ) fullPluginFilenames = getPythonFilenamesExceptInit( fileInDirectory ) @@ -195,8 +200,8 @@ def getPythonDirectoryNames( directoryName ): "Get the python directories." pythonDirectoryNames = [] directory = os.listdir( directoryName ) - for filename in directory: - subdirectoryName = os.path.join( directoryName, filename ) + for fileName in directory: + subdirectoryName = os.path.join( directoryName, fileName ) if os.path.isdir( subdirectoryName ): if os.path.isfile( os.path.join( subdirectoryName, '__init__.py' ) ): pythonDirectoryNames.append( subdirectoryName ) @@ -217,13 +222,13 @@ def getPythonDirectoryNamesRecursively( directoryName = '' ): return recursivePythonDirectoryNames def getPythonFilenamesExceptInit( fileInDirectory = '' ): - "Get the python filenames of the directory which the fileInDirectory is in, except for the __init__.py file." + "Get the python fileNames of the directory which the fileInDirectory is in, except for the __init__.py file." pythonFilenamesExceptInit = getFilesWithFileTypeWithoutWords( 'py', [ '__init__.py' ], fileInDirectory ) pythonFilenamesExceptInit.sort() return pythonFilenamesExceptInit def getPythonFilenamesExceptInitRecursively( directoryName = '' ): - "Get the python filenames of the directory recursively, except for the __init__.py files." + "Get the python fileNames of the directory recursively, except for the __init__.py files." pythonDirectoryNames = getPythonDirectoryNamesRecursively( directoryName ) pythonFilenamesExceptInitRecursively = [] for pythonDirectoryName in pythonDirectoryNames: @@ -231,21 +236,29 @@ def getPythonFilenamesExceptInitRecursively( directoryName = '' ): pythonFilenamesExceptInitRecursively.sort() return pythonFilenamesExceptInitRecursively -def getSummarizedFilename( filename ): - "Get the filename basename if the file is in the current working directory, otherwise return the original full name." - if os.getcwd() == os.path.dirname( filename ): - return os.path.basename( filename ) - return filename +def getSummarizedFilename( fileName ): + "Get the fileName basename if the file is in the current working directory, otherwise return the original full name." + if os.getcwd() == os.path.dirname( fileName ): + return os.path.basename( fileName ) + return fileName def getTextLines( text ): "Get the all the lines of text of a text." - return text.replace( '\r', '\n' ).split( '\n' ) + return text.replace( '\r', '\n' ).replace( '\n\n', '\n' ).split( '\n' ) def getUnmodifiedGCodeFiles( fileInDirectory = '' ): "Get gcode files which are not modified." - words = '_clip _comb _comment _cool _fill _fillet _hop _nozzle_wipe _oozebane _raft _slice _statistic _stretch _tower _transform _wipe'.split() + #transform may be needed in future but probably won't + words = ' carve clip comb comment cool fill fillet hop inset oozebane raft stretch tower wipe'.replace( ' ', ' _' ).split() return getFilesWithFileTypeWithoutWords( 'gcode', words, fileInDirectory ) +def getWithoutBracketsEqualTab( line ): + "Get a string without the greater than sign, the bracket and less than sign, the equal sign or the tab." + line = line.replace( '=', ' ' ) + line = line.replace( '(<', '' ) + line = line.replace( '>', '' ) + return line.replace( '\t', '' ) + def indexOfStartingWithSecond( letter, splitLine ): "Get index of the first occurence of the given letter in the split line, starting with the second word. Return - 1 if letter is not found" for wordIndex in xrange( 1, len( splitLine ) ): @@ -255,19 +268,19 @@ def indexOfStartingWithSecond( letter, splitLine ): return wordIndex return - 1 -def isFileWithFileTypeWithoutWords( fileType, filename, words ): +def isFileWithFileTypeWithoutWords( fileType, fileName, words ): """Determine if file has a given file type, but with does not contain a word in a list. Keyword arguments: fileType -- file type required - filename -- name of the file - words -- list of words which the filename must not have""" - filename = os.path.basename( filename ) + fileName -- name of the file + words -- list of words which the fileName must not have""" + fileName = os.path.basename( fileName ) fileTypeDot = '.' + fileType - if filename[ - len( fileTypeDot ) : ] != fileTypeDot: + if fileName[ - len( fileTypeDot ) : ] != fileTypeDot: return False for word in words: - if filename.find( word ) >= 0: + if fileName.find( word ) >= 0: return False return True @@ -277,14 +290,12 @@ def isProcedureDone( gcodeText, procedure ): return False lines = getTextLines( gcodeText ) for line in lines: - splitLine = line.split( ' ' ) - firstWord = '' - if len( splitLine ) > 0: - firstWord = splitLine[ 0 ] - if firstWord == '(<procedureDone>': + splitLine = getWithoutBracketsEqualTab( line ).split() + firstWord = getFirstWord( splitLine ) + if firstWord == 'procedureDone': if splitLine[ 1 ].find( procedure ) != - 1: return True - elif firstWord == '(<extrusionStart>': + elif firstWord == 'extrusionStart': return False return False @@ -297,30 +308,30 @@ def isThereAFirstWord( firstWord, lines, startIndex ): return True return False -def replaceWords( filenames, original, replacement ): +def replaceWords( fileNames, original, replacement ): "Replace in files the original with the replacement." print( original + ' is being replaced with ' + replacement + ' in the following files:' ) - for filename in filenames: - fileText = getFileText( filename ) + for fileName in fileNames: + fileText = getFileText( fileName ) if fileText != '': whereInText = fileText.find( original ) if whereInText != - 1: - print( filename ) + print( fileName ) print( whereInText ) fileText = fileText.replace( original, replacement ) - writeFileText( filename, fileText ) + writeFileText( fileName, fileText ) -def writeFileMessageEnd( end, filename, fileText, message ): - "Write to a filename with a suffix and print a message." - suffixFilename = filename[ : filename.rfind( '.' ) ] + end +def writeFileMessageEnd( end, fileName, fileText, message ): + "Write to a fileName with a suffix and print a message." + suffixFilename = fileName[ : fileName.rfind( '.' ) ] + end writeFileText( suffixFilename, fileText ) print( message + getSummarizedFilename( suffixFilename ) ) -def writeFileText( filename, fileText, writeMode = 'w+' ): +def writeFileText( fileName, fileText, writeMode = 'w+' ): "Write a text to a file." try: - file = open( filename, writeMode ) + file = open( fileName, writeMode ) file.write( fileText ) file.close() except IOError: - print( 'The file ' + filename + ' can not be written to.' ) + print( 'The file ' + fileName + ' can not be written to.' ) diff --git a/trunk/reprap/miscellaneous/python-beanshell-scripts/skeinforge_tools/skeinforge_utilities/interpret.py b/trunk/reprap/miscellaneous/python-beanshell-scripts/skeinforge_tools/skeinforge_utilities/interpret.py new file mode 100644 index 00000000..edd7aa12 --- /dev/null +++ b/trunk/reprap/miscellaneous/python-beanshell-scripts/skeinforge_tools/skeinforge_utilities/interpret.py @@ -0,0 +1,59 @@ +""" +Interpret is a collection of utilities to list the import plugins. + +An import plugin is a script in the import_plugins folder which has the function getTriangleMesh. + +The following examples shows functions of interpret. The examples are run in a terminal in the folder which contains interpret.py. + + +> 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 interpret +>>> interpret.getGNUTranslatorGcodeFileTypeTuples() +[('GTS files', '*.gts'), ('Gcode text files', '*.gcode'), ('STL files', '*.stl'), ('SVG files', '*.svg')] + +>>> interpret.getImportPluginFilenames() +['gts', 'stl', 'svg'] + +""" + +from __future__ import absolute_import +#Init has to be imported first because it has code to workaround the python bug where relative imports don't work if the module is imported as a main module. +import __init__ + +from skeinforge_tools.skeinforge_utilities import gcodec +import os + + +__author__ = "Enrique Perez (perez_enrique@yahoo.com)" +__date__ = "$Date: 2008/21/04 $" +__license__ = "GPL 3.0" + + +def getGNUTranslatorGcodeFileTypeTuples(): + "Get the file type tuples from the translators in the import plugins folder plus gcode." + fileTypeTuples = getTranslatorFileTypeTuples() + fileTypeTuples.append( ( 'Gcode text files', '*.gcode' ) ) + fileTypeTuples.sort() + return fileTypeTuples + +def getGNUTranslatorFilesUnmodified(): + "Get the file types from the translators in the import plugins folder." + return gcodec.getFilesWithFileTypesWithoutWords( getImportPluginFilenames() ) + [ gcodec.getUnmodifiedGCodeFiles() ] + +def getImportPluginFilenames(): + "Get analyze plugin fileNames." + return gcodec.getPluginFilenames( 'import_plugins', os.path.dirname( __file__ ) ) + +def getTranslatorFileTypeTuples(): + "Get the file types from the translators in the import plugins folder." + importPluginFilenames = getImportPluginFilenames() + fileTypeTuples = [] + for importPluginFilename in importPluginFilenames: + fileTypeTitle = importPluginFilename.upper() + ' files' + fileType = ( fileTypeTitle, '*.' + importPluginFilename ) + fileTypeTuples.append( fileType ) + fileTypeTuples.sort() + return fileTypeTuples diff --git a/trunk/reprap/miscellaneous/python-beanshell-scripts/skeinforge_tools/skeinforge_utilities/preferences.py b/trunk/reprap/miscellaneous/python-beanshell-scripts/skeinforge_tools/skeinforge_utilities/preferences.py index 874ac89d..dfb9d494 100644 --- a/trunk/reprap/miscellaneous/python-beanshell-scripts/skeinforge_tools/skeinforge_utilities/preferences.py +++ b/trunk/reprap/miscellaneous/python-beanshell-scripts/skeinforge_tools/skeinforge_utilities/preferences.py @@ -50,23 +50,23 @@ def getPreferencesDirectoryPath(): "Get the preferences directory path, which is the home directory joined with .skeinforge." return os.path.join( os.path.expanduser( '~' ), '.skeinforge' ) -def getPreferencesFilePath( filename ): - "Get the preferences file path, which is the home directory joined with .skeinforge and filename." +def getPreferencesFilePath( fileName ): + "Get the preferences file path, which is the home directory joined with .skeinforge and fileName." directoryName = getPreferencesDirectoryPath() try: os.mkdir( directoryName ) except OSError: pass - return os.path.join( directoryName, filename ) + return os.path.join( directoryName, fileName ) def readPreferences( preferences ): "Set an archive to the preferences read from a file." - text = gcodec.getFileText( preferences.filenamePreferences ) + text = gcodec.getFileText( preferences.fileNamePreferences ) if text == '': print( 'Since the preferences file:' ) - print( preferences.filenamePreferences ) + print( preferences.fileNamePreferences ) print( 'does not exist, the default preferences will be written to that file.' ) - text = gcodec.getFileText( os.path.join( 'defaults', os.path.basename( preferences.filenamePreferences ) ) ) + text = gcodec.getFileText( os.path.join( 'defaults', os.path.basename( preferences.fileNamePreferences ) ) ) if text != '': readPreferencesFromText( preferences, text ) writePreferences( preferences ) @@ -94,7 +94,7 @@ def setArchiveToLine( lineIndex, lines, preferenceTable ): def writePreferences( preferences ): "Write the preferences to a file." - gcodec.writeFileText( preferences.filenamePreferences, getArchiveText( preferences ) ) + gcodec.writeFileText( preferences.fileNamePreferences, getArchiveText( preferences ) ) class AddListboxSelection: @@ -276,7 +276,7 @@ class Filename( BooleanPreference ): "Add this to the dialog." preferencesDialog.executables.append( self ) - "A class to display, read & write a filename." + "A class to display, read & write a fileName." def execute( self ): try: import tkFileDialog @@ -286,13 +286,13 @@ class Filename( BooleanPreference ): initialDirectory += os.sep else: initialDirectory = "." - filename = tkFileDialog.askopenfilename( filetypes = self.getFilenameFirstTypes(), initialdir = initialDirectory, initialfile = os.path.basename( summarized ), title = self.name ) - if ( str( filename ) == '()' or str( filename ) == '' ): + fileName = tkFileDialog.askopenfilename( filetypes = self.getFilenameFirstTypes(), initialdir = initialDirectory, initialfile = os.path.basename( summarized ), title = self.name ) + if ( str( fileName ) == '()' or str( fileName ) == '' ): self.wasCancelled = True else: - self.value = filename + self.value = fileName except: - print( 'Oops, ' + self.name + ' could not get filename.' ) + print( 'Oops, ' + self.name + ' could not get fileName.' ) def getFromFilename( self, fileTypes, name, value ): "Initialize." @@ -302,7 +302,7 @@ class Filename( BooleanPreference ): return self def getFilenameFirstTypes( self ): - "Get the file types with the file type of the filename moved to the front of the list." + "Get the file types with the file type of the fileName moved to the front of the list." basename = os.path.basename( self.value ) splitFile = basename.split( '.' ) allReadables = [] @@ -316,9 +316,9 @@ class Filename( BooleanPreference ): for fileType in self.fileTypes: fileExtension = fileType[ 1 ].split( '.' )[ - 1 ] if fileExtension == baseExtension: - filenameFirstTypes = self.fileTypes[ : ] - filenameFirstTypes.remove( fileType ) - return [ fileType ] + filenameFirstTypes + allReadables + fileNameFirstTypes = self.fileTypes[ : ] + fileNameFirstTypes.remove( fileType ) + return [ fileType ] + fileNameFirstTypes + allReadables return self.fileTypes + allReadables def setToDisplay( self ): @@ -326,7 +326,7 @@ class Filename( BooleanPreference ): pass def setValueToString( self, valueString ): - "Set the filename to the string." + "Set the fileName to the string." self.value = valueString @@ -582,7 +582,7 @@ class PreferencesDialog: packageFilePath = os.path.abspath( __file__ ) for level in xrange( numberOfLevelsDeepInPackageHierarchy + 1 ): packageFilePath = os.path.dirname( packageFilePath ) - documentationPath = os.path.join( os.path.join( packageFilePath, 'documentation' ), self.displayPreferences.filenameHelp ) + documentationPath = os.path.join( os.path.join( packageFilePath, 'documentation' ), self.displayPreferences.fileNameHelp ) os.system( webbrowser.get().name + ' ' + documentationPath )#used this instead of webbrowser.open() to workaround webbrowser open() bug def savePreferences( self ): diff --git a/trunk/reprap/miscellaneous/python-beanshell-scripts/skeinforge_tools/skeinforge_utilities/triangle_mesh.py b/trunk/reprap/miscellaneous/python-beanshell-scripts/skeinforge_tools/skeinforge_utilities/triangle_mesh.py index acbce2fb..b38ca8d8 100644 --- a/trunk/reprap/miscellaneous/python-beanshell-scripts/skeinforge_tools/skeinforge_utilities/triangle_mesh.py +++ b/trunk/reprap/miscellaneous/python-beanshell-scripts/skeinforge_tools/skeinforge_utilities/triangle_mesh.py @@ -3,7 +3,7 @@ Triangle Mesh holds the faces and edges of a triangular mesh. It can read from and write to a GNU Triangulated Surface (.gts) file. -The following examples slice the GNU Triangulated Surface file Screw Holder Bottom.stl. The examples are run in a terminal in the folder which +The following examples carve the GNU Triangulated Surface file Screw Holder Bottom.stl. The examples are run in a terminal in the folder which contains Screw Holder Bottom.stl and triangle_mesh.py. @@ -11,20 +11,20 @@ contains Screw Holder Bottom.stl and triangle_mesh.py. 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 slice ->>> slice.main() -File Screw Holder Bottom.stl is being sliced. -The sliced file is saved as Screw Holder Bottom_slice.gcode -It took 3 seconds to slice the file. +>>> import carve +>>> carve.main() +File Screw Holder Bottom.stl is being carved. +The carved file is saved as Screw Holder Bottom_carve.gcode +It took 3 seconds to carve the file. ->>> slice.writeOutput() -File Screw Holder Bottom.gcode is being sliced. -The sliced file is saved as Screw Holder Bottom_slice.gcode -It took 3 seconds to slice the file. +>>> carve.writeOutput() +File Screw Holder Bottom.gcode is being carved. +The carved file is saved as Screw Holder Bottom_carve.gcode +It took 3 seconds to carve the file. ->>> slice.getSliceGcode(" +>>> carve.getCarveGcode(" 54 162 108 Number of Vertices,Number of Edges,Number of Faces -5.800000000000001 5.341893939393939 4.017841892579603 Vertex Coordinates XYZ 5.800000000000001 5.341893939393939 4.017841892579603 @@ -40,8 +40,12 @@ from __future__ import absolute_import import __init__ from skeinforge_tools.skeinforge_utilities.vector3 import Vector3 +from skeinforge_tools.skeinforge_utilities import euclidean from skeinforge_tools.skeinforge_utilities import gcodec +from skeinforge_tools.skeinforge_utilities import intercircle +import cmath import cStringIO +import math __author__ = "Enrique Perez (perez_enrique@yahoo.com)" @@ -50,6 +54,82 @@ __date__ = "$Date: 2008/02/05 $" __license__ = "GPL 3.0" +def addEdgePair( edgePairTable, edges, faceEdgeIndex, remainingEdgeIndex, remainingEdgeTable ): + "Add edge pair to the edge pair table." + if faceEdgeIndex == remainingEdgeIndex: + return + if not faceEdgeIndex in remainingEdgeTable: + return + edgePair = triangle_mesh.EdgePair().getFromIndexesEdges( [ remainingEdgeIndex, faceEdgeIndex ], edges ) + edgePairTable[ str( edgePair ) ] = edgePair + +def addLoopToPointTable( loop, pointTable ): + "Add the points in the loop to the point table." + for point in loop: + pointTable[ point ] = loop + +def addPointsAtZ( edgePair, points, radius, vertices, z ): + "Add point complexes on the segment between the edge intersections with z." + carveIntersectionFirst = getCarveIntersectionFromEdge( edgePair.edges[ 0 ], vertices, z ) + carveIntersectionSecond = getCarveIntersectionFromEdge( edgePair.edges[ 1 ], vertices, z ) + intercircle.addPointsFromSegment( points, radius, carveIntersectionFirst, carveIntersectionSecond, 0.3 ) + +def addWithLeastLength( loops, point, shortestAdditionalLength ): + "Insert a point into a loop, at the index at which the loop would be shortest." + shortestLoop = None + shortestPointIndex = None + for loop in loops: + if len( loop ) > 2: + for pointIndex in xrange( len( loop ) ): + additionalLength = getAdditionalLoopLength( loop, point, pointIndex ) + if additionalLength < shortestAdditionalLength: + shortestAdditionalLength = additionalLength + shortestLoop = loop + shortestPointIndex = pointIndex + if shortestPointIndex != None: + afterCenterComplex = shortestLoop[ shortestPointIndex ] + afterEndComplex = shortestLoop[ ( shortestPointIndex + 1 ) % len( shortestLoop ) ] + isInlineAfter = isInline( point, afterCenterComplex, afterEndComplex ) + beforeCenterComplex = shortestLoop[ ( shortestPointIndex + len( shortestLoop ) - 1 ) % len( shortestLoop ) ] + beforeEndComplex = shortestLoop[ ( shortestPointIndex + len( shortestLoop ) - 2 ) % len( shortestLoop ) ] + isInlineBefore = isInline( point, beforeCenterComplex, beforeEndComplex ) + if isInlineAfter or isInlineBefore: + shortestLoop.insert( shortestPointIndex, point ) + +def compareArea( loopArea, otherLoopArea ): + "Get comparison in order to sort loop areas in descending order of area." + if loopArea.area < otherLoopArea.area: + return 1 + if loopArea.area > otherLoopArea.area: + return - 1 + return 0 + +def getAdditionalLoopLength( loop, point, pointIndex ): + "Get the additional length added by inserting a point into a loop." + afterPoint = loop[ pointIndex ] + beforePoint = loop[ ( pointIndex + len( loop ) - 1 ) % len( loop ) ] + return abs( point - beforePoint ) + abs( point - afterPoint ) - abs( afterPoint - beforePoint ) + +def getCommonVertexIndex( edgeFirst, edgeSecond ): + "Get the vertex index that both edges have in common." + for edgeFirstVertexIndex in edgeFirst.vertexIndexes: + if edgeFirstVertexIndex == edgeSecond.vertexIndexes[ 0 ] or edgeFirstVertexIndex == edgeSecond.vertexIndexes[ 1 ]: + return edgeFirstVertexIndex + print( "Inconsistent GNU Triangulated Surface" ) + print( edgeFirst ) + print( edgeSecond ) + return 0 + +def getCarveIntersectionFromEdge( edge, vertices, z ): + "Get the complex where the carve intersects the edge." + firstVertex = vertices[ edge.vertexIndexes[ 0 ] ] + firstVertexComplex = firstVertex.dropAxis( 2 ) + secondVertex = vertices[ edge.vertexIndexes[ 1 ] ] + secondVertexComplex = secondVertex.dropAxis( 2 ) + zMinusFirst = z - firstVertex.z + up = secondVertex.z - firstVertex.z + return zMinusFirst * ( secondVertexComplex - firstVertexComplex ) / up + firstVertexComplex + def getCommonVertexIndex( edgeFirst, edgeSecond ): "Get the vertex index that both edges have in common." for edgeFirstVertexIndex in edgeFirst.vertexIndexes: @@ -60,20 +140,224 @@ def getCommonVertexIndex( edgeFirst, edgeSecond ): print( edgeSecond ) return 0 -def getTriangleMesh( filename = '' ): - "Slice a GNU Triangulated Surface file. If no filename is specified, slice the first GNU Triangulated Surface file in this folder." - if filename == '': +def getDoubledRoundZ( overhangingSegment, segmentRoundZ ): + "Get doubled plane angle around z of the overhanging segment." + endpoint = overhangingSegment[ 0 ] + roundZ = endpoint.point - endpoint.otherEndpoint.point + roundZ *= segmentRoundZ + if abs( roundZ ) == 0.0: + return complex() + if roundZ.real < 0.0: + roundZ *= - 1.0 + roundZLength = abs( roundZ ) + return roundZ * roundZ / roundZLength + +def getLoopsFromCorrectMesh( edges, faces, vertices, z ): + "Get loops from a carve of a correct mesh." + remainingEdgeTable = getRemainingEdgeTable( edges, vertices, z ) + remainingValues = remainingEdgeTable.values() + for edge in remainingValues: + if len( edge.faceIndexes ) < 2: + print( 'This should never happen, there is a hole in the triangle mesh, each edge should have two faces.' ) + print( edge ) + print( "Something will still be printed, but there is no guarantee that it will be the correct shape." ) + print( 'Once the gcode is saved, you should check over the layer with a z of:' ) + print( z ) + return [] + loops = [] + while isPathAdded( edges, faces, loops, remainingEdgeTable, vertices, z ): + pass + return loops +# untouchables = [] +# for boundingLoop in boundingLoops: +# if not boundingLoop.isIntersectingList( untouchables ): +# untouchables.append( boundingLoop ) +# if len( untouchables ) < len( boundingLoops ): +# print( 'This should never happen, the carve layer intersects itself. Something will still be printed, but there is no guarantee that it will be the correct shape.' ) +# print( 'Once the gcode is saved, you should check over the layer with a z of:' ) +# print( z ) +# remainingLoops = [] +# for untouchable in untouchables: +# remainingLoops.append( untouchable.loop ) +# return remainingLoops + +def getLoopsFromUnprovenMesh( edges, extrusionWidth, faces, importCoarseness, vertices, z ): + "Get loops from a carve of an unproven mesh." + edgePairTable = {} + importRadius = importCoarseness * extrusionWidth + points = [] + pointTable = {} + remainingEdgeTable = getRemainingEdgeTable( edges, vertices, z ) + remainingEdgeTableKeys = remainingEdgeTable.keys() + for remainingEdgeIndexKey in remainingEdgeTable: + edge = remainingEdgeTable[ remainingEdgeIndexKey ] + carveIntersection = getCarveIntersectionFromEdge( edge, vertices, z ) + points.append( carveIntersection ) + for edgeFaceIndex in edge.faceIndexes: + face = faces[ edgeFaceIndex ] + for edgeIndex in face.edgeIndexes: + addEdgePair( edgePairTable, edges, edgeIndex, remainingEdgeIndexKey, remainingEdgeTable ) + onlyPoints = points[ : ] + for edgePairValue in edgePairTable.values(): + addPointsAtZ( edgePairValue, points, importRadius, vertices, z ) + circleNodes = intercircle.getCircleNodesFromPoints( points, importRadius ) + centers = intercircle.getCentersFromCircleNodes( circleNodes ) + loops = intercircle.getLoopsFromLoopsDirection( True, centers ) + for loop in loops: + addLoopToPointTable( loop, pointTable ) + clockwiseLoops = getLoopsInDescendingOrderOfArea( intercircle.getLoopsFromLoopsDirection( False, centers ) ) + clockwiseLoops.reverse() + for clockwiseLoop in clockwiseLoops: + if len( clockwiseLoop ) > 2 and euclidean.getMaximumSpan( clockwiseLoop ) > 2.5 * importRadius: + if getOverlapRatio( clockwiseLoop, pointTable ) < 0.45: + loops.append( clockwiseLoop ) + addLoopToPointTable( clockwiseLoop, pointTable ) + shortestAdditionalLength = 0.85 * importRadius + for onlyPoint in onlyPoints: + if onlyPoint not in pointTable: + addWithLeastLength( loops, onlyPoint, shortestAdditionalLength ) + return loops + +def getLoopsInDescendingOrderOfArea( loops ): + "Get the lowest zone index." + loopAreas = [] + for loop in loops: + loopArea = LoopArea( loop ) + loopAreas.append( loopArea ) + loopAreas.sort( compareArea ) + loopsInDescendingOrderOfArea = [] + for loopArea in loopAreas: + loopsInDescendingOrderOfArea.append( loopArea.loop ) + return loopsInDescendingOrderOfArea + +def getLowestZoneIndex( zoneArray, z ): + "Get the lowest zone index." + lowestZoneIndex = 0 + lowestZone = 99999999.0 + for zoneIndex in xrange( len( zoneArray ) ): + zone = zoneArray[ zoneIndex ] + if zone < lowestZone: + lowestZone = zone + lowestZoneIndex = zoneIndex + return lowestZoneIndex + +def getNextEdgeIndexAroundZ( edge, faces, remainingEdgeTable ): + "Get the next edge index in the mesh carve." + for faceIndex in edge.faceIndexes: + face = faces[ faceIndex ] + for edgeIndex in face.edgeIndexes: + if edgeIndex in remainingEdgeTable: + return edgeIndex + return - 1 + +def getOverhangDirection( belowOutsetLoops, segmentBegin, segmentEnd ): + "Add to span direction from the endpoint segments which overhang the layer below." + segment = segmentEnd - segmentBegin + normalizedSegment = euclidean.getNormalized( complex( segment.real, segment.imag ) ) + segmentYMirror = complex( normalizedSegment.real, - normalizedSegment.imag ) + segmentBegin = segmentYMirror * segmentBegin + segmentEnd = segmentYMirror * segmentEnd + solidXIntersectionList = [] + y = segmentBegin.imag + solidXIntersectionList.append( euclidean.XIntersectionIndex( - 1.0, segmentBegin.real ) ) + solidXIntersectionList.append( euclidean.XIntersectionIndex( - 1.0, segmentEnd.real ) ) + for belowLoopIndex in xrange( len( belowOutsetLoops ) ): + belowLoop = belowOutsetLoops[ belowLoopIndex ] + rotatedOutset = euclidean.getPointsRoundZAxis( segmentYMirror, belowLoop ) + euclidean.addXIntersectionIndexes( rotatedOutset, belowLoopIndex, solidXIntersectionList, y ) + overhangingSegments = euclidean.getSegmentsFromXIntersectionIndexes( solidXIntersectionList, y ) + overhangDirection = complex() + for overhangingSegment in overhangingSegments: + overhangDirection += getDoubledRoundZ( overhangingSegment, normalizedSegment ) + return overhangDirection + +def getOverlapRatio( loop, pointTable ): + "Get the overlap ratio between the loop and the point table." + numberOfOverlaps = 0 + for point in loop: + if point in pointTable: + numberOfOverlaps += 1 + return float( numberOfOverlaps ) / float( len( loop ) ) + +def getPath( edges, pathIndexes, loop, z ): + "Get the path from the edge intersections." + path = [] + for pathIndexIndex in xrange( len( pathIndexes ) ): + pathIndex = pathIndexes[ pathIndexIndex ] + edge = edges[ pathIndex ] + carveIntersection = getCarveIntersectionFromEdge( edge, loop, z ) + path.append( carveIntersection ) + return path + +def getRemainingEdgeTable( edges, vertices, z ): + "Get the remaining edge hashtable." + remainingEdgeTable = {} + for edgeIndex in xrange( len( edges ) ): + edge = edges[ edgeIndex ] + if isZInEdge( edge, vertices, z ): + remainingEdgeTable[ edgeIndex ] = edge + return remainingEdgeTable + +def getSharedFace( firstEdge, faces, secondEdge ): + "Get the face which is shared by two edges." + for firstEdgeFaceIndex in firstEdge.faceIndexes: + for secondEdgeFaceIndex in secondEdge.faceIndexes: + if firstEdgeFaceIndex == secondEdgeFaceIndex: + return faces[ firstEdgeFaceIndex ] + return None + +def getTriangleMesh( fileName = '' ): + "Carve a GNU Triangulated Surface file. If no fileName is specified, carve the first GNU Triangulated Surface file in this folder." + if fileName == '': unmodified = gcodec.getGNUTriangulatedSurfaceFiles() if len( unmodified ) == 0: print( "There are no GNU Triangulated Surface files in this folder." ) return None - filename = unmodified[ 0 ] - gnuTriangulatedSurfaceText = gcodec.getFileText( filename ) + fileName = unmodified[ 0 ] + gnuTriangulatedSurfaceText = gcodec.getFileText( fileName ) if gnuTriangulatedSurfaceText == '': return None triangleMesh = TriangleMesh().getFromGNUTriangulatedSurfaceText( gnuTriangulatedSurfaceText ) return triangleMesh +def isInline( beginComplex, centerComplex, endComplex ): + "Determine if the three complex points form a line." + centerBeginComplex = beginComplex - centerComplex + centerEndComplex = endComplex - centerComplex + centerBeginLength = abs( centerBeginComplex ) + centerEndLength = abs( centerEndComplex ) + if centerBeginLength <= 0.0 or centerEndLength <= 0.0: + return False + centerBeginComplex /= centerBeginLength + centerEndComplex /= centerEndLength + return euclidean.getDotProduct( centerBeginComplex, centerEndComplex ) < - 0.999 + +def isPathAdded( edges, faces, loops, remainingEdgeTable, vertices, z ): + "Get the path indexes around a triangle mesh carve and add the path to the flat loops." + if len( remainingEdgeTable ) < 1: + return False + pathIndexes = [] + remainingEdgeIndexKey = remainingEdgeTable.keys()[ 0 ] + pathIndexes.append( remainingEdgeIndexKey ) + del remainingEdgeTable[ remainingEdgeIndexKey ] + nextEdgeIndexAroundZ = getNextEdgeIndexAroundZ( edges[ remainingEdgeIndexKey ], faces, remainingEdgeTable ) + while nextEdgeIndexAroundZ != - 1: + pathIndexes.append( nextEdgeIndexAroundZ ) + del remainingEdgeTable[ nextEdgeIndexAroundZ ] + nextEdgeIndexAroundZ = getNextEdgeIndexAroundZ( edges[ nextEdgeIndexAroundZ ], faces, remainingEdgeTable ) + if len( pathIndexes ) < 3: + print( "Dangling edges, will use intersecting circles to get import layer at height " + z.toString() ) + del loops[ : ] + return False + loops.append( getPath( edges, pathIndexes, vertices, z ) ) + return True + +def isZInEdge( edge, vertices, z ): + "Determine if z is inside the edge." + vertex1ZHigher = vertices[ edge.vertexIndexes[ 0 ] ].z > z + vertex2ZHigher = vertices[ edge.vertexIndexes[ 1 ] ].z > z + return vertex1ZHigher != vertex2ZHigher + class Edge: "An edge of a triangle mesh." @@ -120,6 +404,7 @@ class EdgePair: self.edges.append( edges[ edgeIndex ] ) return self + class Face: "A face of a triangle mesh." def __init__( self ): @@ -169,6 +454,17 @@ class Face: return self +class LoopArea: + "Complex loop with an area." + def __init__( self, loop ): + self.area = abs( euclidean.getPolygonArea( loop ) ) + self.loop = loop + + def __repr__( self ): + "Get the string representation of this flat path." + return '%s, %s' % ( self.area, self.loop ) + + """ Quoted from http://gts.sourceforge.net/reference/gts-surfaces.html#GTS-SURFACE-WRITE "All the lines beginning with GTS_COMMENTS (#!) are ignored. The first line contains three unsigned integers separated by spaces. The first integer is the number of vertices, nv, the second is the number of edges, ne and the third is the number of faces, nf. @@ -182,14 +478,96 @@ class TriangleMesh: "A triangle mesh." def __init__( self ): "Add empty lists." + self.belowLoops = None + self.bridgeLayerThickness = None self.edges = [] self.faces = [] + self.rotatedBoundaryLayers = [] self.vertices = [] def __repr__( self ): "Get the string representation of this TriangleMesh." return str( self.vertices ) + '\n' + str( self.edges ) + '\n' + str( self.faces ) + def addToZoneArray( self, point, zoneArray, z ): + "Add a height to the zone array." + zoneLayer = int( round( ( point.z - z ) / self.zZoneInterval ) ) + zoneAround = 2 * int( abs( zoneLayer ) ) + if zoneLayer < 0: + zoneAround -= 1 + if zoneAround < len( zoneArray ): + zoneArray[ zoneAround ] += 1 + + def getBridgeDirection( self, layerLoops ): + "Get span direction for the majority of the overhanging extrusion perimeter, if any." + if self.bridgeLayerThickness == None: + return None + if self.belowLoops == None: + return None + belowOutsetLoops = [] + overhangInset = 1.25 * self.extrusionWidth + slightlyGreaterThanOverhang = 1.1 * overhangInset + muchGreaterThanOverhang = 2.5 * overhangInset + for loop in self.belowLoops: + centers = intercircle.getCentersFromLoopDirection( True, loop, slightlyGreaterThanOverhang ) + for center in centers: + outset = intercircle.getSimplifiedInsetFromClockwiseLoop( center, overhangInset ) + if euclidean.isLargeSameDirection( outset, center, muchGreaterThanOverhang ): + belowOutsetLoops.append( outset ) + bridgeDirection = complex() + for loop in layerLoops: + for pointIndex in xrange( len( loop ) ): + previousIndex = ( pointIndex + len( loop ) - 1 ) % len( loop ) + bridgeDirection += getOverhangDirection( belowOutsetLoops, loop[ previousIndex ], loop[ pointIndex ] ) + if abs( bridgeDirection ) < 0.5 * self.extrusionWidth: + return None + else: + bridgeDirection /= abs( bridgeDirection ) + return cmath.sqrt( bridgeDirection ) + + def getBridgeLoops( self, loop ): + "Get the inset bridge loops from the loop." + slightlyGreaterThanHalfWidth = 1.1 * self.extrusionWidth + muchGreaterThanHalfWIdth = 2.5 * self.extrusionWidth + extrudateLoops = [] + circleNodes = intercircle.getCircleNodesFromLoop( loop, slightlyGreaterThanHalfWidth ) + centers = intercircle.getCentersFromCircleNodes( circleNodes ) + for center in centers: + extrudateLoop = intercircle.getSimplifiedInsetFromClockwiseLoop( center, self.extrusionWidth ) + if euclidean.isLargeSameDirection( extrudateLoop, center, muchGreaterThanHalfWIdth ): + if euclidean.isPathInsideLoop( loop, extrudateLoop ) == euclidean.isWiddershins( loop ): + extrudateLoop.reverse() + extrudateLoops.append( extrudateLoop ) + return extrudateLoops + + def getCarveCornerMaximum( self ): + "Get the corner maximum of the vertices." + return self.cornerMaximum + + def getCarveCornerMinimum( self ): + "Get the corner minimum of the vertices." + return self.cornerMinimum + + def getCarveLayerThickness( self ): + "Get the layer thickness." + return self.layerThickness + + def getCarveRotatedBoundaryLayers( self ): + "Get the rotated boundary layers." + self.cornerMaximum = Vector3( - 999999999.0, - 999999999.0, - 999999999.0 ) + self.cornerMinimum = Vector3( 999999999.0, 999999999.0, 999999999.0 ) + for point in self.vertices: + self.cornerMaximum = euclidean.getPointMaximum( self.cornerMaximum, point ) + self.cornerMinimum = euclidean.getPointMinimum( self.cornerMinimum, point ) + halfHeight = 0.5 * self.layerThickness + zZoneLayers = 99 + self.zZoneInterval = self.layerThickness / zZoneLayers / 100.0 + layerTop = self.cornerMaximum.z - halfHeight * 0.5 + z = self.cornerMinimum.z + halfHeight + while z < layerTop: + z = self.getZAddExtruderPaths( z ) + return self.rotatedBoundaryLayers + def getGNUTriangulatedSurfaceText( self ): "Get this mesh in the GNU Triangulated Surface (.gts) format." output = cStringIO.StringIO() @@ -205,46 +583,71 @@ class TriangleMesh: output.write( '%s\n' % face.getGNUTriangulatedSurfaceLine() ) return output.getvalue() - def getFromGNUTriangulatedSurfaceText( self, gnuTriangulatedSurfaceText ): - "Initialize from a GNU Triangulated Surface Text." - if gnuTriangulatedSurfaceText == '': - return None - lines = gcodec.getTextLines( gnuTriangulatedSurfaceText ) - linesWithoutComments = [] - for line in lines: - if len( line ) > 0: - firstCharacter = line[ 0 ] - if firstCharacter != '#' and firstCharacter != '!': - linesWithoutComments.append( line ) - splitLine = linesWithoutComments[ 0 ].split() - numberOfVertices = int( splitLine[ 0 ] ) - numberOfEdges = int( splitLine[ 1 ] ) - numberOfFaces = int( splitLine[ 2 ] ) - faceTriples = [] - for vertexIndex in xrange( numberOfVertices ): - line = linesWithoutComments[ vertexIndex + 1 ] - splitLine = line.split() - vertex = Vector3( float( splitLine[ 0 ] ), float( splitLine[ 1 ] ), float( splitLine[ 2 ] ) ) - self.vertices.append( vertex ) - edgeStart = numberOfVertices + 1 - for edgeIndex in xrange( numberOfEdges ): - line = linesWithoutComments[ edgeIndex + edgeStart ] - splitLine = line.split() - vertexIndexes = [] - for word in splitLine[ : 2 ]: - vertexIndexes.append( int( word ) - 1 ) - edge = Edge().getFromVertexIndexes( edgeIndex, vertexIndexes ) - self.edges.append( edge ) - faceStart = edgeStart + numberOfEdges - for faceIndex in xrange( numberOfFaces ): - line = linesWithoutComments[ faceIndex + faceStart ] - splitLine = line.split() - edgeIndexes = [] - for word in splitLine[ : 3 ]: - edgeIndexes.append( int( word ) - 1 ) - face = Face().getFromEdgeIndexes( edgeIndexes, self.edges, faceIndex ) - self.faces.append( face ) - return self + def getLoopsFromMesh( self, z ): + "Get loops from a carve of a mesh." + originalLoops = [] + if self.isCorrectMesh: + originalLoops = getLoopsFromCorrectMesh( self.edges, self.faces, self.vertices, z ) + if len( originalLoops ) < 1: + originalLoops = getLoopsFromUnprovenMesh( self.edges, self.extrusionWidth, self.faces, self.importCoarseness, self.vertices, z ) + simplifiedLoops = [] + for originalLoop in originalLoops: + simplifiedLoops.append( euclidean.getSimplifiedLoop( originalLoop, self.extrusionWidth ) ) + loops = getLoopsInDescendingOrderOfArea( simplifiedLoops ) + for loopIndex in xrange( len( loops ) ): + loop = loops[ loopIndex ] + leftPoint = euclidean.getLeftPoint( loop ) + totalNumberOfIntersectionsToLeft = 0 + for otherLoop in loops[ : loopIndex ] + loops[ loopIndex + 1 : ]: + totalNumberOfIntersectionsToLeft += euclidean.getNumberOfIntersectionsToLeft( leftPoint, otherLoop ) + loopIsWiddershins = euclidean.isWiddershins( loop ) + isEven = totalNumberOfIntersectionsToLeft % 2 == 0 + if isEven != loopIsWiddershins: + loop.reverse() + return loops + + def getZAddExtruderPaths( self, z ): + "Get next z and add extruder loops." + zoneArray = [] + for point in self.vertices: + self.addToZoneArray( point, zoneArray, z ) + lowestZoneIndex = getLowestZoneIndex( zoneArray, z ) + halfAround = int( math.ceil( float( lowestZoneIndex ) / 2.0 ) ) + zAround = float( halfAround ) * self.zZoneInterval + if lowestZoneIndex % 2 == 1: + zAround = - zAround + zPlusAround = z + zAround + rotatedBoundaryLayer = euclidean.RotatedLoopLayer( zPlusAround ) + self.rotatedBoundaryLayers.append( rotatedBoundaryLayer ) + rotatedBoundaryLayer.loops = self.getLoopsFromMesh( zPlusAround ) + allExtrudateLoops = [] + for loop in rotatedBoundaryLayer.loops: + allExtrudateLoops += self.getBridgeLoops( loop ) + rotatedBoundaryLayer.rotation = self.getBridgeDirection( allExtrudateLoops ) + self.belowLoops = allExtrudateLoops + if rotatedBoundaryLayer.rotation == None: + return z + self.layerThickness + return z + self.bridgeLayerThickness + + def setCarveBridgeLayerThickness( self, bridgeLayerThickness ): + "Set the bridge layer thickness. If the infill is not in the direction of the bridge, the bridge layer thickness should be given as None or not set at all." + self.bridgeLayerThickness = bridgeLayerThickness + + def setCarveLayerThickness( self, layerThickness ): + "Set the layer thickness." + self.layerThickness = layerThickness + + def setCarveExtrusionWidth( self, extrusionWidth ): + "Set the extrusion width." + self.extrusionWidth = extrusionWidth + + def setCarveImportCoarseness( self, importCoarseness ): + "Set the import coarseness." + self.importCoarseness = importCoarseness + + def setCarveIsCorrectMesh( self, isCorrectMesh ): + "Set the is correct mesh flag." + self.isCorrectMesh = isCorrectMesh def setEdgesForAllFaces( self ): "Set the face edges of all the faces." diff --git a/trunk/reprap/miscellaneous/python-beanshell-scripts/skeinforge_tools/slice_shape.py b/trunk/reprap/miscellaneous/python-beanshell-scripts/skeinforge_tools/slice_shape.py deleted file mode 100644 index 8e40b5c8..00000000 --- a/trunk/reprap/miscellaneous/python-beanshell-scripts/skeinforge_tools/slice_shape.py +++ /dev/null @@ -1,929 +0,0 @@ -""" -Slice shape is a script to slice a GNU Triangulated Surface file. - -Slice slices a GNU Triangulated Surface file into gcode extrusion layers. The 'Extrusion Diameter' is the diameter of the extrusion at the -default extruder speed, this is the most important slice preference. The 'Extrusion Height over Diameter' is the ratio of the extrusion -height over the extrusion diameter. The 'Extrusion Width over Diameter' ratio is the ratio of the extrusion width over the extrusion -diameter. A ratio of one means the extrusion is a circle, a typical ratio of 1.5 means the extrusion is a wide oval. These values should -be measured from a test extrusion line. - -The extrusion fill density ratio that is printed to the console, ( it is not a parameter ) is the area of the extrusion diameter over the -extrusion width over the extrusion height. Assuming the extrusion diameter is correct, a high value means the filament will be packed -tightly, and the object will be almost as dense as the filament. If the value is too high, there could be too little room for the filament, -and the extruder will end up plowing through the extra filament. A low value means the filaments will be far away from each other, the -object will be leaky and light. The value with the default extrusion preferences is around 0.82. - -Rarely changed preferences are Import Coarseness, Mesh Type, Infill Bridge Width Over Thickness & Infill in Direction -of Bridges. When the triangle mesh has holes in it, slice switches over to a slow algorithm that spans gaps in the mesh. The higher the -import coarseness, the wider the gaps in the mesh it will span. An import coarseness of one means it will span gaps the width of the -extrusion. When the Mesh Type preference is correct, the mesh will be accurately sliced, and if a hole is found, slice will switch over to -the algorithm that spans gaps. If the Mesh Type preference is Unproven, slice will use the gap spanning algorithm from the start. The -problem with the gap spanning algothm is that it will span gaps, even if there actually is a gap in the model. Infill bridge width -over thickness ratio is the ratio of the extrusion width over the layer thickness on a bridge layer. If the infill in direction of bridges -preference is chosen, the infill will be in the direction of bridges across gaps, so that the fill will be able to span a bridge easier. - -If the "Start at Home" preference is selected, the G28 gcode will be added at the beginning of the file. - -When slice is generating the code, if there is a file start.txt, it will add that to the very beginning of the gcode. After it has added some -initialization code and just before it adds the extrusion gcode, it will add the file endofthebeginning.txt if it exists. At the very end, it will -add the file end.txt if it exists. Slice 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. It will first look for the file in the same directory as -slice, if it does not find it it will look in ~/.skeinforge/gcode_scripts. To run slice, in a shell type: -> python slice.py - -The following examples slice the GNU Triangulated Surface file Screw Holder Bottom.stl. The examples are run in a terminal in the -folder which contains Screw Holder Bottom.stl and slice.py. The preferences can be set in the dialog or by changing the preferences file -'slice.csv' with a text editor or a spreadsheet program set to separate tabs. - - -> python slice.py -This brings up the dialog, after clicking 'Slice', the following is printed: -File Screw Holder Bottom.stl is being sliced. -The sliced file is saved as Screw Holder Bottom_slice.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 slice ->>> slice.main() -File Screw Holder Bottom.stl is being sliced. -The sliced file is saved as Screw Holder Bottom_slice.gcode -It took 3 seconds to slice the file. - - ->>> slice.writeOutput() -File Screw Holder Bottom.gcode is being sliced. -The sliced file is saved as Screw Holder Bottom_slice.gcode -It took 3 seconds to slice the file. - - ->>> slice.getSliceGcode(" -54 162 108 Number of Vertices,Number of Edges,Number of Faces --5.800000000000001 5.341893939393939 4.017841892579603 Vertex Coordinates XYZ -5.800000000000001 5.341893939393939 4.017841892579603 -.. -many lines of GNU Triangulated Surface vertices, edges and faces -.. -") - -""" - -from __future__ import absolute_import -try: - import psyco - psyco.full() -except: - pass -#Init has to be imported first because it has code to workaround the python bug where relative imports don't work if the module is imported as a main module. -import __init__ - -from skeinforge_tools.skeinforge_utilities import euclidean -from skeinforge_tools.skeinforge_utilities import gcodec -from skeinforge_tools.skeinforge_utilities import intercircle -from skeinforge_tools.skeinforge_utilities import preferences -from skeinforge_tools.skeinforge_utilities import triangle_mesh -from skeinforge_tools import analyze -from skeinforge_tools import import_translator -from skeinforge_tools import polyfile -import cmath -import cStringIO -import math -import os -import sys -import time - - -__author__ = "Enrique Perez (perez_enrique@yahoo.com)" -__date__ = "$Date: 2008/02/05 $" -__license__ = "GPL 3.0" - -def addAlreadyFilledArounds( alreadyFilledArounds, loop, radius ): - "Add already filled loops around loop to alreadyFilledArounds." - alreadyFilledLoop = [] - slightlyGreaterThanRadius = 1.01 * radius - muchGreaterThanRadius = 2.5 * radius - circleNodes = intercircle.getCircleNodesFromLoop( loop, slightlyGreaterThanRadius ) - centers = intercircle.getCentersFromCircleNodes( circleNodes ) - for center in centers: - alreadyFilledInset = intercircle.getSimplifiedInsetFromClockwiseLoop( center, radius ) - if euclidean.getMaximumSpan( alreadyFilledInset ) > muchGreaterThanRadius or euclidean.isWiddershins( alreadyFilledInset ): - alreadyFilledLoop.append( alreadyFilledInset ) - if len( alreadyFilledLoop ) > 0: - alreadyFilledArounds.append( alreadyFilledLoop ) - -def addEdgePair( edgePairTable, edges, faceEdgeIndex, remainingEdgeIndex, remainingEdgeTable ): - "Add edge pair to the edge pair table." - if faceEdgeIndex == remainingEdgeIndex: - return - if not faceEdgeIndex in remainingEdgeTable: - return - edgePair = triangle_mesh.EdgePair().getFromIndexesEdges( [ remainingEdgeIndex, faceEdgeIndex ], edges ) - edgePairTable[ str( edgePair ) ] = edgePair - -def addLoopToPointTable( loop, pointTable ): - "Add the points in the loop to the point table." - for point in loop: - pointTable[ point ] = loop - -def addPointsAtZ( edgePair, points, radius, vertices, z ): - "Add point complexes on the segment between the edge intersections with z." - sliceIntersectionFirst = getSliceIntersectionFromEdge( edgePair.edges[ 0 ], vertices, z ) - sliceIntersectionSecond = getSliceIntersectionFromEdge( edgePair.edges[ 1 ], vertices, z ) - intercircle.addPointsFromSegment( points, radius, sliceIntersectionFirst, sliceIntersectionSecond, 0.3 ) - -def addSegmentOutline( isThick, outlines, pointBegin, pointEnd, width ): - "Add a diamond or hexagonal outline for a line segment." - exclusionWidth = 0.6 * width - slope = 0.3 - if isThick: - slope = 3.0 - exclusionWidth = 0.8 * width - segment = pointEnd - pointBegin - segmentLength = abs( segment ) - if segmentLength == 0.0: - return - normalizedSegment = segment / segmentLength - outline = [] - segmentYMirror = complex( normalizedSegment.real, - normalizedSegment.imag ) - pointBeginRotated = segmentYMirror * pointBegin - pointEndRotated = segmentYMirror * pointEnd - along = 0.01 - alongLength = along * segmentLength - if alongLength > 0.1 * exclusionWidth: - along *= 0.1 * exclusionWidth / alongLength - alongEnd = 1.0 - along - remainingToHalf = 0.5 - along - alongToWidth = exclusionWidth / slope / segmentLength - pointBeginIntermediate = euclidean.getIntermediateLocation( along, pointBeginRotated, pointEndRotated ) - pointEndIntermediate = euclidean.getIntermediateLocation( alongEnd, pointBeginRotated, pointEndRotated ) - outline.append( pointBeginIntermediate ) - verticalWidth = complex( 0.0, exclusionWidth ) - if alongToWidth > 0.9 * remainingToHalf: - verticalWidth = complex( 0.0, slope * remainingToHalf ) - middle = ( pointBeginIntermediate + pointEndIntermediate ) * 0.5 - middleDown = middle - verticalWidth - middleUp = middle + verticalWidth - outline.append( middleUp ) - outline.append( pointEndIntermediate ) - outline.append( middleDown ) - else: - alongOutsideBegin = along + alongToWidth - alongOutsideEnd = alongEnd - alongToWidth - outsideBeginCenter = euclidean.getIntermediateLocation( alongOutsideBegin, pointBeginRotated, pointEndRotated ) - outsideBeginCenterDown = outsideBeginCenter - verticalWidth - outsideBeginCenterUp = outsideBeginCenter + verticalWidth - outsideEndCenter = euclidean.getIntermediateLocation( alongOutsideEnd, pointBeginRotated, pointEndRotated ) - outsideEndCenterDown = outsideEndCenter - verticalWidth - outsideEndCenterUp = outsideEndCenter + verticalWidth - outline.append( outsideBeginCenterUp ) - outline.append( outsideEndCenterUp ) - outline.append( pointEndIntermediate ) - outline.append( outsideEndCenterDown ) - outline.append( outsideBeginCenterDown ) - outlines.append( euclidean.getPointsRoundZAxis( normalizedSegment, outline ) ) - -def addWithLeastLength( loops, point, shortestAdditionalLength ): - "Insert a point into a loop, at the index at which the loop would be shortest." - shortestLoop = None - shortestPointIndex = None - for loop in loops: - if len( loop ) > 2: - for pointIndex in xrange( len( loop ) ): - additionalLength = getAdditionalLoopLength( loop, point, pointIndex ) - if additionalLength < shortestAdditionalLength: - shortestAdditionalLength = additionalLength - shortestLoop = loop - shortestPointIndex = pointIndex - if shortestPointIndex != None: - afterCenterComplex = shortestLoop[ shortestPointIndex ] - afterEndComplex = shortestLoop[ ( shortestPointIndex + 1 ) % len( shortestLoop ) ] - isInlineAfter = isInline( point, afterCenterComplex, afterEndComplex ) - beforeCenterComplex = shortestLoop[ ( shortestPointIndex + len( shortestLoop ) - 1 ) % len( shortestLoop ) ] - beforeEndComplex = shortestLoop[ ( shortestPointIndex + len( shortestLoop ) - 2 ) % len( shortestLoop ) ] - isInlineBefore = isInline( point, beforeCenterComplex, beforeEndComplex ) - if isInlineAfter or isInlineBefore: - shortestLoop.insert( shortestPointIndex, point ) - -def compareArea( loopArea, otherLoopArea ): - "Get comparison in order to sort loop areas in descending order of area." - if loopArea.area < otherLoopArea.area: - return 1 - if loopArea.area > otherLoopArea.area: - return - 1 - return 0 - -def getAdditionalLoopLength( loop, point, pointIndex ): - "Get the additional length added by inserting a point into a loop." - afterPoint = loop[ pointIndex ] - beforePoint = loop[ ( pointIndex + len( loop ) - 1 ) % len( loop ) ] - return abs( point - beforePoint ) + abs( point - afterPoint ) - abs( afterPoint - beforePoint ) - -def getCommonVertexIndex( edgeFirst, edgeSecond ): - "Get the vertex index that both edges have in common." - for edgeFirstVertexIndex in edgeFirst.vertexIndexes: - if edgeFirstVertexIndex == edgeSecond.vertexIndexes[ 0 ] or edgeFirstVertexIndex == edgeSecond.vertexIndexes[ 1 ]: - return edgeFirstVertexIndex - print( "Inconsistent GNU Triangulated Surface" ) - print( edgeFirst ) - print( edgeSecond ) - return 0 - -def getDoubledRoundZ( overhangingSegment, segmentRoundZ ): - "Get doubled plane angle around z of the overhanging segment." - endpoint = overhangingSegment[ 0 ] - roundZ = endpoint.point - endpoint.otherEndpoint.point - roundZ *= segmentRoundZ - if abs( roundZ ) == 0.0: - return complex() - if roundZ.real < 0.0: - roundZ *= - 1.0 - roundZLength = abs( roundZ ) - return roundZ * roundZ / roundZLength - -def getLoopsFromCorrectMesh( edges, faces, vertices, z ): - "Get loops from a slice of a correct mesh." - remainingEdgeTable = getRemainingEdgeTable( edges, vertices, z ) - remainingValues = remainingEdgeTable.values() - for edge in remainingValues: - if len( edge.faceIndexes ) < 2: - print( 'This should never happen, there is a hole in the triangle mesh, each edge should have two faces.' ) - print( edge ) - print( "Something will still be printed, but there is no guarantee that it will be the correct shape." ) - print( 'Once the gcode is saved, you should check over the layer with a z of:' ) - print( z ) - return [] - loops = [] - while isPathAdded( edges, faces, loops, remainingEdgeTable, vertices, z ): - pass - return loops -# untouchables = [] -# for boundingLoop in boundingLoops: -# if not boundingLoop.isIntersectingList( untouchables ): -# untouchables.append( boundingLoop ) -# if len( untouchables ) < len( boundingLoops ): -# print( 'This should never happen, the slice layer intersects itself. Something will still be printed, but there is no guarantee that it will be the correct shape.' ) -# print( 'Once the gcode is saved, you should check over the layer with a z of:' ) -# print( z ) -# remainingLoops = [] -# for untouchable in untouchables: -# remainingLoops.append( untouchable.loop ) -# return remainingLoops - -def getLoopsFromUnprovenMesh( edges, extrusionWidth, faces, vertices, slicePreferences, z ): - "Get loops from a slice of an unproven mesh." - edgePairTable = {} - importRadius = slicePreferences.importCoarseness.value * extrusionWidth - points = [] - pointTable = {} - remainingEdgeTable = getRemainingEdgeTable( edges, vertices, z ) - remainingEdgeTableKeys = remainingEdgeTable.keys() - for remainingEdgeIndexKey in remainingEdgeTable: - edge = remainingEdgeTable[ remainingEdgeIndexKey ] - sliceIntersection = getSliceIntersectionFromEdge( edge, vertices, z ) - points.append( sliceIntersection ) - for edgeFaceIndex in edge.faceIndexes: - face = faces[ edgeFaceIndex ] - for edgeIndex in face.edgeIndexes: - addEdgePair( edgePairTable, edges, edgeIndex, remainingEdgeIndexKey, remainingEdgeTable ) - onlyPoints = points[ : ] - for edgePairValue in edgePairTable.values(): - addPointsAtZ( edgePairValue, points, importRadius, vertices, z ) - circleNodes = intercircle.getCircleNodesFromPoints( points, importRadius ) - centers = intercircle.getCentersFromCircleNodes( circleNodes ) - loops = intercircle.getLoopsFromLoopsDirection( True, centers ) - for loop in loops: - addLoopToPointTable( loop, pointTable ) - clockwiseLoops = getLoopsInDescendingOrderOfArea( intercircle.getLoopsFromLoopsDirection( False, centers ) ) - clockwiseLoops.reverse() - for clockwiseLoop in clockwiseLoops: - if len( clockwiseLoop ) > 2 and euclidean.getMaximumSpan( clockwiseLoop ) > 2.5 * importRadius: - if getOverlapRatio( clockwiseLoop, pointTable ) < 0.45: - loops.append( clockwiseLoop ) - addLoopToPointTable( clockwiseLoop, pointTable ) - shortestAdditionalLength = 0.85 * importRadius - for onlyPoint in onlyPoints: - if onlyPoint not in pointTable: - addWithLeastLength( loops, onlyPoint, shortestAdditionalLength ) - return loops - -def getLoopsInDescendingOrderOfArea( loops ): - "Get the lowest zone index." - loopAreas = [] - for loop in loops: - loopArea = LoopArea( loop ) - loopAreas.append( loopArea ) - loopAreas.sort( compareArea ) - loopsInDescendingOrderOfArea = [] - for loopArea in loopAreas: - loopsInDescendingOrderOfArea.append( loopArea.loop ) - return loopsInDescendingOrderOfArea - -def getLowestZoneIndex( zoneArray, z ): - "Get the lowest zone index." - lowestZoneIndex = 0 - lowestZone = 99999999.0 - for zoneIndex in xrange( len( zoneArray ) ): - zone = zoneArray[ zoneIndex ] - if zone < lowestZone: - lowestZone = zone - lowestZoneIndex = zoneIndex - return lowestZoneIndex - -def getNextEdgeIndexAroundZ( edge, faces, remainingEdgeTable ): - "Get the next edge index in the mesh slice." - for faceIndex in edge.faceIndexes: - face = faces[ faceIndex ] - for edgeIndex in face.edgeIndexes: - if edgeIndex in remainingEdgeTable: - return edgeIndex - return - 1 - -def getOverhangDirection( belowOutsetLoops, segmentBegin, segmentEnd ): - "Add to span direction from the endpoint segments which overhang the layer below." - segment = segmentEnd - segmentBegin - normalizedSegment = euclidean.getNormalized( complex( segment.real, segment.imag ) ) - segmentYMirror = complex( normalizedSegment.real, - normalizedSegment.imag ) - segmentBegin = segmentYMirror * segmentBegin - segmentEnd = segmentYMirror * segmentEnd - solidXIntersectionList = [] - y = segmentBegin.imag - solidXIntersectionList.append( euclidean.XIntersectionIndex( - 1.0, segmentBegin.real ) ) - solidXIntersectionList.append( euclidean.XIntersectionIndex( - 1.0, segmentEnd.real ) ) - for belowLoopIndex in xrange( len( belowOutsetLoops ) ): - belowLoop = belowOutsetLoops[ belowLoopIndex ] - rotatedOutset = euclidean.getPointsRoundZAxis( segmentYMirror, belowLoop ) - euclidean.addXIntersectionIndexes( rotatedOutset, belowLoopIndex, solidXIntersectionList, y ) - overhangingSegments = euclidean.getSegmentsFromXIntersectionIndexes( solidXIntersectionList, y ) - overhangDirection = complex() - for overhangingSegment in overhangingSegments: - overhangDirection += getDoubledRoundZ( overhangingSegment, normalizedSegment ) - return overhangDirection - -def getOverlapRatio( loop, pointTable ): - "Get the overlap ratio between the loop and the point table." - numberOfOverlaps = 0 - for point in loop: - if point in pointTable: - numberOfOverlaps += 1 - return float( numberOfOverlaps ) / float( len( loop ) ) - -def getPath( edges, pathIndexes, loop, z ): - "Get the path from the edge intersections." - path = [] - for pathIndexIndex in xrange( len( pathIndexes ) ): - pathIndex = pathIndexes[ pathIndexIndex ] - edge = edges[ pathIndex ] - sliceIntersection = getSliceIntersectionFromEdge( edge, loop, z ) - path.append( sliceIntersection ) - return path - -def getRemainingEdgeTable( edges, vertices, z ): - "Get the remaining edge hashtable." - remainingEdgeTable = {} - for edgeIndex in xrange( len( edges ) ): - edge = edges[ edgeIndex ] - if isZInEdge( edge, vertices, z ): - remainingEdgeTable[ edgeIndex ] = edge - return remainingEdgeTable - -def getSegmentsFromPoints( aroundLists, loopLists, pointBegin, pointEnd ): - "Get endpoint segments from the beginning and end of a line segment." - normalizedSegment = pointEnd - pointBegin - normalizedSegmentLength = abs( normalizedSegment ) - if normalizedSegmentLength == 0.0: - return - normalizedSegment /= normalizedSegmentLength - segmentYMirror = complex( normalizedSegment.real, - normalizedSegment.imag ) - pointBeginRotated = segmentYMirror * pointBegin - pointEndRotated = segmentYMirror * pointEnd - rotatedLoopLists = [] - for loopList in loopLists: - rotatedLoopList = [] - rotatedLoopLists.append( rotatedLoopList ) - for loop in loopList: - rotatedLoop = euclidean.getPointsRoundZAxis( segmentYMirror, loop ) - rotatedLoopList.append( rotatedLoop ) - xIntersectionIndexList = [] - xIntersectionIndexList.append( euclidean.XIntersectionIndex( - 1, pointBeginRotated.real ) ) - xIntersectionIndexList.append( euclidean.XIntersectionIndex( - 1, pointEndRotated.real ) ) - euclidean.addXIntersectionIndexesFromLoopLists( rotatedLoopLists, xIntersectionIndexList, pointBeginRotated.imag ) - segments = euclidean.getSegmentsFromXIntersectionIndexes( xIntersectionIndexList, pointBeginRotated.imag ) - insideSegments = [] - for segment in segments: - endpointBegin = segment[ 0 ] - endpointBegin.point = normalizedSegment * endpointBegin.point - endpointEnd = segment[ 1 ] - endpointEnd.point = normalizedSegment * endpointEnd.point - if len( aroundLists ) < 1: - insideSegments.append( segment ) - elif isSegmentInsideAround( aroundLists, segment ): - insideSegments.append( segment ) - return insideSegments - -def getSharedFace( firstEdge, faces, secondEdge ): - "Get the face which is shared by two edges." - for firstEdgeFaceIndex in firstEdge.faceIndexes: - for secondEdgeFaceIndex in secondEdge.faceIndexes: - if firstEdgeFaceIndex == secondEdgeFaceIndex: - return faces[ firstEdgeFaceIndex ] - return None - -def getSliceGcode( filename, slicePreferences = None ): - "Slice a shape file." - triangleMesh = None - if filename[ - 4 : ].lower() == '.gts': - triangleMesh = triangle_mesh.TriangleMesh().getFromGNUTriangulatedSurfaceText( gcodec.getFileText( filename ) ) - else: - triangleMesh = import_translator.getTriangleMesh( filename ) - if triangleMesh == None: - return '' - if slicePreferences == None: - slicePreferences = SlicePreferences() - preferences.readPreferences( slicePreferences ) - skein = SliceSkein() - skein.parseTriangleMesh( slicePreferences, triangleMesh ) - return skein.output.getvalue() - -def getSliceIntersectionFromEdge( edge, vertices, z ): - "Get the complex where the slice intersects the edge." - firstVertex = vertices[ edge.vertexIndexes[ 0 ] ] - firstVertexComplex = firstVertex.dropAxis( 2 ) - secondVertex = vertices[ edge.vertexIndexes[ 1 ] ] - secondVertexComplex = secondVertex.dropAxis( 2 ) - zMinusFirst = z - firstVertex.z - up = secondVertex.z - firstVertex.z - return zMinusFirst * ( secondVertexComplex - firstVertexComplex ) / up + firstVertexComplex - -def isCloseToLast( paths, point, radius ): - "Determine if the point is close to the last point of the last path." - if len( paths ) < 1: - return False - lastPath = paths[ - 1 ] - return abs( lastPath[ - 1 ] - point ) < radius - -def isInline( beginComplex, centerComplex, endComplex ): - "Determine if the three complex points form a line." - centerBeginComplex = beginComplex - centerComplex - centerEndComplex = endComplex - centerComplex - centerBeginLength = abs( centerBeginComplex ) - centerEndLength = abs( centerEndComplex ) - if centerBeginLength <= 0.0 or centerEndLength <= 0.0: - return False - centerBeginComplex /= centerBeginLength - centerEndComplex /= centerEndLength - return euclidean.getDotProduct( centerBeginComplex, centerEndComplex ) < - 0.999 - -def isIntersectingWithinList( loop, loopList ): - "Determine if the loop is intersecting or is within the loop list." - if euclidean.isLoopIntersectingLoops( loop, loopList ): - return True - totalNumberOfIntersections = 0 - for otherLoop in loopList: - leftPoint = euclidean.getLeftPoint( otherLoop ) - totalNumberOfIntersections += euclidean.getNumberOfIntersectionsToLeft( leftPoint, loop ) - return totalNumberOfIntersections % 2 == 1 - -def isIntersectingWithinLists( loop, loopLists ): - "Determine if the loop is intersecting or is within the loop lists." - for loopList in loopLists: - if isIntersectingWithinList( loop, loopList ): - return True - return False - -def isIntersectingItself( loop, width ): - "Determine if the loop is intersecting itself." - outlines = [] - for pointIndex in xrange( len( loop ) ): - pointBegin = loop[ pointIndex ] - pointEnd = loop[ ( pointIndex + 1 ) % len( loop ) ] - if euclidean.isLineIntersectingLoops( outlines, pointBegin, pointEnd ): - return True - addSegmentOutline( False, outlines, pointBegin, pointEnd, width ) - return False - -def isPathAdded( edges, faces, loops, remainingEdgeTable, vertices, z ): - "Get the path indexes around a triangle mesh slice and add the path to the flat loops." - if len( remainingEdgeTable ) < 1: - return False - pathIndexes = [] - remainingEdgeIndexKey = remainingEdgeTable.keys()[ 0 ] - pathIndexes.append( remainingEdgeIndexKey ) - del remainingEdgeTable[ remainingEdgeIndexKey ] - nextEdgeIndexAroundZ = getNextEdgeIndexAroundZ( edges[ remainingEdgeIndexKey ], faces, remainingEdgeTable ) - while nextEdgeIndexAroundZ != - 1: - pathIndexes.append( nextEdgeIndexAroundZ ) - del remainingEdgeTable[ nextEdgeIndexAroundZ ] - nextEdgeIndexAroundZ = getNextEdgeIndexAroundZ( edges[ nextEdgeIndexAroundZ ], faces, remainingEdgeTable ) - if len( pathIndexes ) < 3: - print( "Dangling edges, will use intersecting circles to get import layer at height " + z.toString() ) - del loops[ : ] - return False - loops.append( getPath( edges, pathIndexes, vertices, z ) ) - return True - -def isSegmentInsideAround( aroundLists, segment ): - "Determine if the segment is inside an around." - midpoint = 0.5 * ( segment[ 0 ].point + segment[ 1 ].point ) - for aroundList in aroundLists: - for around in aroundList: - if euclidean.isPointInsideLoop( around, midpoint ): - return True - return False - -def isZInEdge( edge, vertices, z ): - "Determine if z is inside the edge." - vertex1ZHigher = vertices[ edge.vertexIndexes[ 0 ] ].z > z - vertex2ZHigher = vertices[ edge.vertexIndexes[ 1 ] ].z > z - return vertex1ZHigher != vertex2ZHigher - -def writeOutput( filename = '' ): - "Slice a GNU Triangulated Surface file. If no filename is specified, slice the first GNU Triangulated Surface file in this folder." - if filename == '': - unmodified = gcodec.getFilesWithFileTypesWithoutWords( import_translator.getGNUTranslatorFileTypes() ) - if len( unmodified ) == 0: - print( "There are no GNU Triangulated Surface files in this folder." ) - return - filename = unmodified[ 0 ] - startTime = time.time() - slicePreferences = SlicePreferences() - preferences.readPreferences( slicePreferences ) - print( 'File ' + gcodec.getSummarizedFilename( filename ) + ' is being sliced.' ) - sliceGcode = getSliceGcode( filename, slicePreferences ) - if sliceGcode == '': - return - suffixFilename = filename[ : filename.rfind( '.' ) ] + '_slice.gcode' - gcodec.writeFileText( suffixFilename, sliceGcode ) - print( 'The sliced file is saved as ' + gcodec.getSummarizedFilename( suffixFilename ) ) - analyze.writeOutput( suffixFilename, sliceGcode ) - print( 'It took ' + str( int( round( time.time() - startTime ) ) ) + ' seconds to slice the file.' ) - - -class LoopArea: - "Complex loop with an area." - def __init__( self, loop ): - self.area = abs( euclidean.getPolygonArea( loop ) ) - self.loop = loop - - def __repr__( self ): - "Get the string representation of this flat path." - return '%s, %s' % ( self.area, self.loop ) - - -class SlicePreferences: - "A class to handle the slice preferences." - def __init__( self ): - "Set the default preferences, execute title & preferences filename." - #Set the default preferences. - self.archive = [] - self.extrusionDiameter = preferences.FloatPreference().getFromValue( 'Extrusion Diameter (mm):', 0.5 ) - self.archive.append( self.extrusionDiameter ) - self.extrusionDiameterOverPrecision = preferences.FloatPreference().getFromValue( 'Extrusion Diameter Over Precision (ratio):', 10.0 ) - self.archive.append( self.extrusionDiameterOverPrecision ) - self.extrusionHeightOverDiameter = preferences.FloatPreference().getFromValue( 'Extrusion Height Over Diameter (ratio):', 0.8 ) - self.archive.append( self.extrusionHeightOverDiameter ) - self.extrusionPerimeterWidthOverDiameter = preferences.FloatPreference().getFromValue( 'Extrusion Perimeter Width Over Diameter (ratio):', 1.44 ) - self.archive.append( self.extrusionPerimeterWidthOverDiameter ) - self.extrusionWidthOverDiameter = preferences.FloatPreference().getFromValue( 'Extrusion Width Over Diameter (ratio):', 1.2 ) - self.archive.append( self.extrusionWidthOverDiameter ) - self.filenameInput = preferences.Filename().getFromFilename( import_translator.getGNUTranslatorFileTypeTuples(), 'Open File to be Sliced', '' ) - self.archive.append( self.filenameInput ) - self.importCoarseness = preferences.FloatPreference().getFromValue( 'Import Coarseness (ratio):', 1.0 ) - self.archive.append( self.importCoarseness ) - self.meshTypeLabel = preferences.LabelDisplay().getFromName( 'Mesh Type: ' ) - self.archive.append( self.meshTypeLabel ) - importRadio = [] - self.correct = preferences.Radio().getFromRadio( 'Correct Mesh', importRadio, True ) - self.archive.append( self.correct ) - self.unproven = preferences.Radio().getFromRadio( 'Unproven Mesh', importRadio, False ) - self.archive.append( self.unproven ) - self.infillBridgeWidthOverDiameter = preferences.FloatPreference().getFromValue( 'Infill Bridge Width Over Thickness (ratio):', 1.2 ) - self.archive.append( self.infillBridgeWidthOverDiameter ) - self.infillDirectionBridge = preferences.BooleanPreference().getFromValue( 'Infill in Direction of Bridges', True ) - self.archive.append( self.infillDirectionBridge ) - self.infillPerimeterOverlap = preferences.FloatPreference().getFromValue( 'Infill Perimeter Overlap (ratio):', 0.05 ) - self.archive.append( self.infillPerimeterOverlap ) - self.infillPerimeterOverlapMethodOfCalculationLabel = preferences.LabelDisplay().getFromName( 'Infill Perimeter Overlap Method of Calculation: ' ) - self.archive.append( self.infillPerimeterOverlapMethodOfCalculationLabel ) - infillRadio = [] - self.perimeterInfillPreference = preferences.Radio().getFromRadio( 'Calculate Overlap from Perimeter and Infill', infillRadio, True ) - self.archive.append( self.perimeterInfillPreference ) - self.perimeterPreference = preferences.Radio().getFromRadio( 'Calculate Overlap from Perimeter Only', infillRadio, False ) - self.archive.append( self.perimeterPreference ) - self.startAtHome = preferences.BooleanPreference().getFromValue( 'Start at Home', True ) - self.archive.append( self.startAtHome ) - #Create the archive, title of the execute button, title of the dialog & preferences filename. - self.executeTitle = 'Slice' - self.filenamePreferences = preferences.getPreferencesFilePath( 'slice_shape.csv' ) - self.filenameHelp = 'skeinforge_tools.slice_shape.html' - self.saveTitle = 'Save Preferences' - self.title = 'Slice Preferences' - - def execute( self ): - "Slice button has been clicked." - filenames = polyfile.getFileOrDirectoryTypes( self.filenameInput.value, import_translator.getGNUTranslatorFileTypes(), self.filenameInput.wasCancelled ) - for filename in filenames: - writeOutput( filename ) - - -class SliceSkein: - "A class to slice a GNU Triangulated Surface." - def __init__( self ): - self.belowLoops = None - self.output = cStringIO.StringIO() - - def addFromFile( self, filename ): - "Add lines of text from the filename." - fileLines = gcodec.getTextLines( gcodec.getFileText( filename ) ) - for line in fileLines: - self.addLine( line ) - - def addFromUpperLowerFile( self, filename ): - "Add lines of text from the filename or the lowercase filename, if there is no file by the original filename in the directory." - directory = os.listdir( os.getcwd() ) - if filename in directory: - self.addFromFile( filename ) - return - lowerFilename = filename.lower() - if lowerFilename in directory: - self.addFromFile( lowerFilename ) - return - gcodeDirectoryPath = os.path.join( preferences.getPreferencesDirectoryPath(), 'gcode_scripts' ) - try: - os.mkdir( gcodeDirectoryPath ) - except OSError: - pass - directory = os.listdir( gcodeDirectoryPath ) - if filename in directory: - self.addFromFile( os.path.join( gcodeDirectoryPath, filename ) ) - return - if lowerFilename in directory: - self.addFromFile( os.path.join( gcodeDirectoryPath, filename.lower() ) ) - - def addGcodeFromPerimeterPaths( self, isIntersectingSelf, loop, loopLists, radius, z ): - "Add the perimeter paths to the output." - segments = [] - outlines = [] - thickOutlines = [] - allLoopLists = loopLists[ : ] + [ thickOutlines ] - for pointIndex in xrange( len( loop ) ): - pointBegin = loop[ pointIndex ] - pointEnd = loop[ ( pointIndex + 1 ) % len( loop ) ] - if isIntersectingSelf: - if euclidean.isLineIntersectingLoops( outlines, pointBegin, pointEnd ): - segments += getSegmentsFromPoints( loopLists, allLoopLists, pointBegin, pointEnd ) - else: - segments += getSegmentsFromPoints( loopLists, loopLists, pointBegin, pointEnd ) - addSegmentOutline( False, outlines, pointBegin, pointEnd, self.extrusionWidth ) - addSegmentOutline( True, thickOutlines, pointBegin, pointEnd, self.extrusionWidth ) - else: - segments += getSegmentsFromPoints( loopLists, loopLists, pointBegin, pointEnd ) - perimeterPaths = [] - path = [] - muchSmallerThanRadius = 0.1 * radius - for segment in segments: - pointBegin = segment[ 0 ].point - if not isCloseToLast( perimeterPaths, pointBegin, muchSmallerThanRadius ): - path = [ pointBegin ] - perimeterPaths.append( path ) - path.append( segment[ 1 ].point ) - if len( perimeterPaths ) > 1: - firstPath = perimeterPaths[ 0 ] - lastPath = perimeterPaths[ - 1 ] - if abs( lastPath[ - 1 ] - firstPath[ 0 ] ) < 0.1 * muchSmallerThanRadius: - connectedBeginning = lastPath[ : - 1 ] + firstPath - perimeterPaths[ 0 ] = connectedBeginning - perimeterPaths.remove( lastPath ) - for perimeterPath in perimeterPaths: - self.addGcodeFromThreadZ( perimeterPath, z ) - - def addGcodeFromRemainingLoop( self, loop, loopLists, radius, z ): - "Add the remainder of the loop which does not overlap the alreadyFilledArounds loops." - euclidean.addSurroundingLoopBeginning( loop, self, z ) - isIntersectingSelf = isIntersectingItself( loop, self.extrusionWidth ) - if isIntersectingWithinLists( loop, loopLists ) or isIntersectingSelf: - self.addGcodeFromPerimeterPaths( isIntersectingSelf, loop, loopLists, radius, z ) - else: - self.addLine( '(<perimeter> )' ) # Indicate that a perimeter is beginning. - self.addGcodeFromThreadZ( loop + [ loop[ 0 ] ], z ) - self.addLine( '(</surroundingLoop> )' ) - - def addGcodeFromThreadZ( self, thread, z ): - "Add a thread to the output." - if len( thread ) > 0: - self.addGcodeMovementZ( thread[ 0 ], z ) - else: - print( "zero length vertex positions array which was skipped over, this should never happen" ) - if len( thread ) < 2: - return - self.addLine( "M101" ) # Turn extruder on. - for point in thread[ 1 : ]: - self.addGcodeMovementZ( point, z ) - self.addLine( "M103" ) # Turn extruder off. - - def addGcodeMovementZ( self, point, z ): - "Add a movement to the output." - self.addLine( "G1 X%s Y%s Z%s" % ( self.getRounded( point.real ), self.getRounded( point.imag ), self.getRounded( z ) ) ) - - def addInitializationToOutput( self ): - "Add initialization gcode to the output." - # From http://www.ahha.com/VarsAndMacros.doc - # If you wish to run macros using comments in parentheses, the comment character must be changed from a semi-colon to a left parenthesis. - # Note: the original closing single quotation mark was not ascii, so I replaced it with an apostrophe. - # To do this, the following line should be placed at the beginning of the G-Code file that calls the macro: -# self.addLine( "(*CMST '('*)" ) # Gcode to convert the comment character to '('. - self.addFromUpperLowerFile( 'Start.txt' ) # Add a start file if it exists. - self.addLine( '(<creator> skeinforge May 28, 2008 )' ) # GCode formatted comment - self.addLine( 'M110' ) # GCode for compatibility with Nophead's code. - self.addLine( '(<extruderInitialization> )' ) # GCode formatted comment - self.addLine( 'G21' ) # Set units to mm. - self.addLine( 'G90' ) # Set positioning to absolute. - if self.slicePreferences.startAtHome.value: - self.addLine( 'G28' ) # Start at home. - self.addLine( 'M103' ) # Turn extruder off. - self.addLine( 'M105' ) # Custom code for temperature reading. - self.addFromUpperLowerFile( 'EndOfTheBeginning.txt' ) # Add a second start file if it exists. - self.addLine( '(<decimalPlacesCarried> ' + str( self.decimalPlacesCarried ) + ' )' ) # Set decimal places carried. - self.addLine( '(<extrusionDiameter> ' + self.getRounded( self.extrusionDiameter ) + ' )' ) # Set extrusion diameter. - self.addLine( '(<extrusionHeight> ' + self.getRounded( self.extrusionHeight ) + ' )' ) # Set layer thickness. - self.addLine( '(<extrusionPerimeterWidth> ' + self.getRounded( self.extrusionPerimeterWidth ) + ' )' ) # Set extrusion perimeter width. - self.addLine( '(<extrusionWidth> ' + self.getRounded( self.extrusionWidth ) + ' )' ) # Set extrusion width. - self.addLine( '(<fillInset> ' + str( self.fillInset ) + ' )' ) # Set fill inset. - # Set bridge extrusion width over solid extrusion width. - self.addLine( '(<bridgeExtrusionWidthOverSolid> ' + euclidean.getRoundedToThreePlaces( self.bridgeExtrusionWidth / self.extrusionWidth ) + ' )' ) - self.addLine( '(<procedureDone> slice_shape )' ) # The skein has been sliced. - self.addLine( '(<extrusionStart> )' ) # Initialization is finished, extrusion is starting. - circleArea = self.extrusionDiameter * self.extrusionDiameter * math.pi / 4.0 - print( 'The extrusion fill density ratio is ' + euclidean.getRoundedToThreePlaces( circleArea / self.extrusionWidth / self.extrusionHeight ) ) - - def addLine( self, line ): - "Add a line of text and a newline to the output." - self.output.write( line + "\n" ) - - def addShutdownToOutput( self ): - "Add shutdown gcode to the output." - self.addLine( '(</extrusionStart> )' ) # GCode formatted comment - self.addLine( 'M103' ) # Turn extruder motor off. - self.addLine( 'M104 S0' ) # Turn extruder heater off. -# self.addLine( 'M30' ) # End gcode program. - self.addFromUpperLowerFile( 'End.txt' ) # Add an end file if it exists. - - def addToZoneArray( self, point, zoneArray, z ): - "Add a height to the zone array." - zoneLayer = int( round( ( point.z - z ) / self.zZoneInterval ) ) - zoneAround = 2 * int( abs( zoneLayer ) ) - if zoneLayer < 0: - zoneAround -= 1 - if zoneAround < len( zoneArray ): - zoneArray[ zoneAround ] += 1 - - def getBridgeDirection( self, layerLoops ): - "Get span direction for the majority of the overhanging extrusion perimeter, if any." - if not self.slicePreferences.infillDirectionBridge.value: - return None - if self.belowLoops == None: - return None - belowOutsetLoops = [] - overhangInset = 1.25 * self.extrusionPerimeterWidth - slightlyGreaterThanOverhang = 1.1 * overhangInset - muchGreaterThanOverhang = 2.5 * overhangInset - for loop in self.belowLoops: - centers = intercircle.getCentersFromLoopDirection( True, loop, slightlyGreaterThanOverhang ) - for center in centers: - outset = intercircle.getSimplifiedInsetFromClockwiseLoop( center, overhangInset ) - if euclidean.isLargeSameDirection( outset, center, muchGreaterThanOverhang ): - belowOutsetLoops.append( outset ) - bridgeDirection = complex() - for loop in layerLoops: - for pointIndex in xrange( len( loop ) ): - previousIndex = ( pointIndex + len( loop ) - 1 ) % len( loop ) - bridgeDirection += getOverhangDirection( belowOutsetLoops, loop[ previousIndex ], loop[ pointIndex ] ) - if abs( bridgeDirection ) < self.halfExtrusionPerimeterWidth: - return None - else: - bridgeDirection /= abs( bridgeDirection ) - return cmath.sqrt( bridgeDirection ) - - def getExtrudateLoops( self, halfWidth, loop ): - "Get the inset extrudate loops from the loop." - slightlyGreaterThanHalfWidth = 1.1 * halfWidth - muchGreaterThanHalfWIdth = 2.5 * halfWidth - extrudateLoops = [] - circleNodes = intercircle.getCircleNodesFromLoop( loop, slightlyGreaterThanHalfWidth ) - centers = intercircle.getCentersFromCircleNodes( circleNodes ) - for center in centers: - extrudateLoop = intercircle.getSimplifiedInsetFromClockwiseLoop( center, halfWidth ) - if euclidean.isLargeSameDirection( extrudateLoop, center, muchGreaterThanHalfWIdth ): - if euclidean.isPathInsideLoop( loop, extrudateLoop ) == euclidean.isWiddershins( loop ): - extrudateLoop.reverse() - extrudateLoops.append( extrudateLoop ) - return extrudateLoops - - def getLoopsFromMesh( self, z ): - "Get loops from a slice of a mesh." - originalLoops = [] - if self.slicePreferences.correct.value: - originalLoops = getLoopsFromCorrectMesh( self.triangleMesh.edges, self.triangleMesh.faces, self.triangleMesh.vertices, z ) - if len( originalLoops ) < 1: - originalLoops = getLoopsFromUnprovenMesh( self.triangleMesh.edges, self.extrusionPerimeterWidth, self.triangleMesh.faces, self.triangleMesh.vertices, self.slicePreferences, z ) - simplifiedLoops = [] - for originalLoop in originalLoops: - simplifiedLoops.append( euclidean.getSimplifiedLoop( originalLoop, self.extrusionWidth ) ) - loops = getLoopsInDescendingOrderOfArea( simplifiedLoops ) - for loopIndex in xrange( len( loops ) ): - loop = loops[ loopIndex ] - leftPoint = euclidean.getLeftPoint( loop ) - totalNumberOfIntersectionsToLeft = 0 - for otherLoop in loops[ : loopIndex ] + loops[ loopIndex + 1 : ]: - totalNumberOfIntersectionsToLeft += euclidean.getNumberOfIntersectionsToLeft( leftPoint, otherLoop ) - loopIsWiddershins = euclidean.isWiddershins( loop ) - isEven = totalNumberOfIntersectionsToLeft % 2 == 0 - if isEven != loopIsWiddershins: - loop.reverse() - return loops - - def getRounded( self, number ): - "Get number rounded to the number of carried decimal places as a string." - return euclidean.getRoundedToDecimalPlaces( self.decimalPlacesCarried, number ) - - def getZAddExtruderPaths( self, z ): - "Get next z and add extruder loops." - alreadyFilledArounds = [] - zoneArray = [] - for point in self.triangleMesh.vertices: - self.addToZoneArray( point, zoneArray, z ) - lowestZoneIndex = getLowestZoneIndex( zoneArray, z ) - halfAround = int( math.ceil( float( lowestZoneIndex ) / 2.0 ) ) - zAround = float( halfAround ) * self.zZoneInterval - if lowestZoneIndex % 2 == 1: - zAround = - zAround - loops = self.getLoopsFromMesh( z + zAround ) - centers = [] - extruderPaths = [] - halfWidth = self.halfExtrusionPerimeterWidth - slightlyGreaterThanExtrusionWIdth = 1.1 * halfWidth - muchGreaterThanExtrusionWidth = 2.5 * halfWidth - allExtrudateLoops = [] - for loop in loops: - allExtrudateLoops += self.getExtrudateLoops( halfWidth, loop ) - bridgeDirection = self.getBridgeDirection( allExtrudateLoops ) - self.addLine( '(<layerStart> ' + self.getRounded( z ) + ' )' ) # Indicate that a new layer is starting. - halfBridgeMinusLayer = 0.0 - if bridgeDirection != None: - halfWidth *= self.bridgeExtrusionWidth / self.extrusionWidth - slightlyGreaterThanExtrusionWIdth *= self.bridgeExtrusionWidth / self.extrusionWidth - self.addLine( '(<bridgeDirection> ' + str( bridgeDirection ) + ' )' ) # Indicate the bridge direction. - halfBridgeMinusLayer = 0.5 * ( self.bridgeExtrusionHeight - self.extrusionHeight ) - zPlusBridge = z + halfBridgeMinusLayer - for loop in loops: - extrudateLoops = self.getExtrudateLoops( halfWidth, loop ) - for extrudateLoop in extrudateLoops: - self.addGcodeFromRemainingLoop( extrudateLoop, alreadyFilledArounds, halfWidth, zPlusBridge ) - addAlreadyFilledArounds( alreadyFilledArounds, extrudateLoop, self.fillInset ) - self.belowLoops = allExtrudateLoops - if bridgeDirection == None: - return z + self.extrusionHeight - return z + self.bridgeExtrusionHeight - - def parseTriangleMesh( self, slicePreferences, triangleMesh ): - "Parse gnu triangulated surface text and store the sliced gcode." - self.slicePreferences = slicePreferences - self.triangleMesh = triangleMesh - self.extrusionDiameter = slicePreferences.extrusionDiameter.value - self.decimalPlacesCarried = int( max( 0.0, math.ceil( 1.0 - math.log10( self.extrusionDiameter / slicePreferences.extrusionDiameterOverPrecision.value ) ) ) ) - self.bridgeExtrusionWidth = slicePreferences.infillBridgeWidthOverDiameter.value * self.extrusionDiameter - self.extrusionHeight = slicePreferences.extrusionHeightOverDiameter.value * self.extrusionDiameter - self.extrusionPerimeterWidth = slicePreferences.extrusionPerimeterWidthOverDiameter.value * self.extrusionDiameter - self.extrusionWidth = slicePreferences.extrusionWidthOverDiameter.value * self.extrusionDiameter - self.halfExtrusionPerimeterWidth = 0.5 * self.extrusionPerimeterWidth - self.fillInset = self.extrusionPerimeterWidth - self.extrusionPerimeterWidth * slicePreferences.infillPerimeterOverlap.value - if slicePreferences.perimeterInfillPreference.value: - self.fillInset = self.halfExtrusionPerimeterWidth + 0.5 * self.extrusionWidth - self.extrusionWidth * slicePreferences.infillPerimeterOverlap.value - self.bridgeExtrusionHeight = self.extrusionHeight * slicePreferences.extrusionWidthOverDiameter.value / slicePreferences.infillBridgeWidthOverDiameter.value - self.halfThickness = 0.5 * self.extrusionHeight - self.zZoneLayers = 99 - self.zZoneInterval = self.extrusionHeight / self.zZoneLayers / 100.0 - self.bottom = 999999999.0 - self.top = - self.bottom - for point in self.triangleMesh.vertices: - self.bottom = min( self.bottom, point.z ) - self.top = max( self.top, point.z ) - self.layerBottom = self.bottom + self.halfThickness - self.layerTop = self.top - self.halfThickness * 0.5 - self.addInitializationToOutput() - z = self.layerBottom - while z < self.layerTop: - z = self.getZAddExtruderPaths( z ) - self.addShutdownToOutput() - - -def main(): - "Display the slice dialog." - if len( sys.argv ) > 1: - writeOutput( ' '.join( sys.argv[ 1 : ] ) ) - else: - preferences.displayDialog( SlicePreferences() ) - -if __name__ == "__main__": - main() diff --git a/trunk/reprap/miscellaneous/python-beanshell-scripts/skeinforge_tools/speed.py b/trunk/reprap/miscellaneous/python-beanshell-scripts/skeinforge_tools/speed.py index dd6aecb7..0afcb01b 100644 --- a/trunk/reprap/miscellaneous/python-beanshell-scripts/skeinforge_tools/speed.py +++ b/trunk/reprap/miscellaneous/python-beanshell-scripts/skeinforge_tools/speed.py @@ -13,6 +13,18 @@ In the "Flowrate Choice" radio button group, if "Do Not Add Flowrate" is selecte output. If "Metric" is selected, the flowrate in cubic millimeters per second will be added to the output. If "PWM Setting" is selected, the value in the "Flowrate PWM Setting" field will be added to the output. +The 'Perimeter Feedrate over Operating Feedrate' is the ratio of the feedrate of the perimeter over the feedrate of the infill. With +the default of 1.0, the perimeter feedrate will be the same as the infill feedrate. The 'Perimeter Flowrate over Operating Flowrate' +is the ratio of the flowrate of the perimeter over the flowrate of the infill. With the default of 1.0, the perimeter flow rate will be +the same as the infill flow rate. To have higher build quality on the outside at the expense of slower build speed, a typical +setting for the 'Perimeter Feedrate over Operating Feedrate' would be 0.5. To go along with that, if you are using a speed +controlled extruder, the 'Perimeter Flowrate over Operating Flowrate' should also be 0.5. If you are using Pulse Width Modulation +to control the speed, then you'll probably need a slightly higher ratio because there is a minimum voltage 'Flowrate PWM Setting' +required for the extruder motor to turn. The flow rate PWM ratio would be determined by trial and error, with the first trial being: +Perimeter Flowrate over Operating Flowrate ~ +Perimeter Feedrate over Operating Feedrate * ( Flowrate PWM Setting - Minimum Flowrate PWM Setting ) ++ Minimum Flowrate PWM Setting + The following examples speed 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 speed.py. The speed function will speed if "Activate Speed" is true, which can be set in the dialog or by changing the preferences file 'speed.csv' with a text editor or a spreadsheet @@ -43,7 +55,7 @@ The speeded file is saved as Screw Holder Bottom_speed.gcode >>> speed.getSpeedGcode(" -( GCode generated by May 8, 2008 slice.py ) +( GCode generated by May 8, 2008 carve.py ) ( Extruder Initialization ) .. many lines of gcode @@ -52,7 +64,7 @@ many lines of gcode >>> speed.getSpeedChainGcode(" -( GCode generated by May 8, 2008 slice.py ) +( GCode generated by May 8, 2008 carve.py ) ( Extruder Initialization ) .. many lines of gcode @@ -70,7 +82,7 @@ from skeinforge_tools.skeinforge_utilities import gcodec from skeinforge_tools.skeinforge_utilities import intercircle from skeinforge_tools.skeinforge_utilities import preferences from skeinforge_tools import analyze -from skeinforge_tools import import_translator +from skeinforge_tools.skeinforge_utilities import interpret from skeinforge_tools import material from skeinforge_tools import multiply from skeinforge_tools import polyfile @@ -85,11 +97,11 @@ __date__ = "$Date: 2008/21/04 $" __license__ = "GPL 3.0" -def getSpeedChainGcode( filename, gcodeText, speedPreferences = None ): +def getSpeedChainGcode( fileName, gcodeText, speedPreferences = None ): "Speed a gcode linear move text. Chain speed the gcode if it is not already speeded." - gcodeText = gcodec.getGcodeFileText( filename, gcodeText ) + gcodeText = gcodec.getGcodeFileText( fileName, gcodeText ) if not gcodec.isProcedureDone( gcodeText, 'multiply' ): - gcodeText = multiply.getMultiplyChainGcode( filename, gcodeText ) + gcodeText = multiply.getMultiplyChainGcode( fileName, gcodeText ) return getSpeedGcode( gcodeText, speedPreferences ) def getSpeedGcode( gcodeText, speedPreferences = None ): @@ -107,21 +119,21 @@ def getSpeedGcode( gcodeText, speedPreferences = None ): skein.parseGcode( gcodeText, speedPreferences ) return skein.output.getvalue() -def writeOutput( filename = '' ): +def writeOutput( fileName = '' ): """Speed a gcode linear move file. Chain speed the gcode if it is not already speeded. - If no filename is specified, speed the first unmodified gcode file in this folder.""" - if filename == '': - unmodified = import_translator.getGNUTranslatorFilesUnmodified() + If no fileName is specified, speed the first unmodified gcode file in this folder.""" + if fileName == '': + unmodified = interpret.getGNUTranslatorFilesUnmodified() if len( unmodified ) == 0: print( "There are no unmodified gcode files in this folder." ) return - filename = unmodified[ 0 ] + fileName = unmodified[ 0 ] speedPreferences = SpeedPreferences() preferences.readPreferences( speedPreferences ) startTime = time.time() - print( 'File ' + gcodec.getSummarizedFilename( filename ) + ' is being chain speeded.' ) - suffixFilename = filename[ : filename.rfind( '.' ) ] + '_speed.gcode' - speedGcode = getSpeedChainGcode( filename, '', speedPreferences ) + print( 'File ' + gcodec.getSummarizedFilename( fileName ) + ' is being chain speeded.' ) + suffixFilename = fileName[ : fileName.rfind( '.' ) ] + '_speed.gcode' + speedGcode = getSpeedChainGcode( fileName, '', speedPreferences ) if speedGcode == '': return gcodec.writeFileText( suffixFilename, speedGcode ) @@ -133,15 +145,15 @@ def writeOutput( filename = '' ): class SpeedPreferences: "A class to handle the speed preferences." def __init__( self ): - "Set the default preferences, execute title & preferences filename." + "Set the default preferences, execute title & preferences fileName." #Set the default preferences. self.archive = [] self.activateSpeed = preferences.BooleanPreference().getFromValue( 'Activate Speed:', True ) self.archive.append( self.activateSpeed ) self.feedrateSecond = preferences.FloatPreference().getFromValue( 'Feedrate (mm/s):', 16.0 ) self.archive.append( self.feedrateSecond ) - self.filenameInput = preferences.Filename().getFromFilename( import_translator.getGNUTranslatorGcodeFileTypeTuples(), 'Open File to be Speeded', '' ) - self.archive.append( self.filenameInput ) + self.fileNameInput = preferences.Filename().getFromFilename( interpret.getGNUTranslatorGcodeFileTypeTuples(), 'Open File to be Speeded', '' ) + self.archive.append( self.fileNameInput ) flowrateRadio = [] self.flowrateChoiceLabel = preferences.LabelDisplay().getFromName( 'Flowrate Choice: ' ) self.archive.append( self.flowrateChoiceLabel ) @@ -159,18 +171,18 @@ class SpeedPreferences: self.archive.append( self.perimeterFeedrateOverOperatingFeedrate ) self.perimeterFlowrateOverOperatingFlowrate = preferences.FloatPreference().getFromValue( 'Perimeter Flowrate over Operating Flowrate (ratio):', 1.0 ) self.archive.append( self.perimeterFlowrateOverOperatingFlowrate ) - #Create the archive, title of the execute button, title of the dialog & preferences filename. + #Create the archive, title of the execute button, title of the dialog & preferences fileName. self.executeTitle = 'Speed' - self.filenamePreferences = preferences.getPreferencesFilePath( 'speed.csv' ) - self.filenameHelp = 'skeinforge_tools.speed.html' + self.fileNamePreferences = preferences.getPreferencesFilePath( 'speed.csv' ) + self.fileNameHelp = 'skeinforge_tools.speed.html' self.saveTitle = 'Save Preferences' self.title = 'Speed Preferences' def execute( self ): "Speed button has been clicked." - filenames = polyfile.getFileOrDirectoryTypesUnmodifiedGcode( self.filenameInput.value, import_translator.getGNUTranslatorFileTypes(), self.filenameInput.wasCancelled ) - for filename in filenames: - writeOutput( filename ) + fileNames = polyfile.getFileOrDirectoryTypesUnmodifiedGcode( self.fileNameInput.value, interpret.getImportPluginFilenames(), self.fileNameInput.wasCancelled ) + for fileName in fileNames: + writeOutput( fileName ) class SpeedSkein: diff --git a/trunk/reprap/miscellaneous/python-beanshell-scripts/skeinforge_tools/stretch.py b/trunk/reprap/miscellaneous/python-beanshell-scripts/skeinforge_tools/stretch.py index 0c50c3c8..4c691347 100644 --- a/trunk/reprap/miscellaneous/python-beanshell-scripts/skeinforge_tools/stretch.py +++ b/trunk/reprap/miscellaneous/python-beanshell-scripts/skeinforge_tools/stretch.py @@ -53,7 +53,7 @@ The stretched file is saved as Screw Holder Bottom_stretch.gcode >>> stretch.getStretchGcode(" -( GCode generated by May 8, 2008 slice.py ) +( GCode generated by May 8, 2008 carve.py ) ( Extruder Initialization ) .. many lines of gcode @@ -62,7 +62,7 @@ many lines of gcode >>> stretch.getStretchChainGcode(" -( GCode generated by May 8, 2008 slice.py ) +( GCode generated by May 8, 2008 carve.py ) ( Extruder Initialization ) .. many lines of gcode @@ -82,7 +82,7 @@ from skeinforge_tools.skeinforge_utilities import intercircle from skeinforge_tools.skeinforge_utilities import preferences from skeinforge_tools import analyze from skeinforge_tools import cool -from skeinforge_tools import import_translator +from skeinforge_tools.skeinforge_utilities import interpret from skeinforge_tools import polyfile import cStringIO import sys @@ -95,11 +95,11 @@ __license__ = "GPL 3.0" #maybe speed up feedrate option -def getStretchChainGcode( filename, gcodeText, stretchPreferences = None ): +def getStretchChainGcode( fileName, gcodeText, stretchPreferences = None ): "Stretch a gcode linear move text. Chain stretch the gcode if it is not already stretched." - gcodeText = gcodec.getGcodeFileText( filename, gcodeText ) + gcodeText = gcodec.getGcodeFileText( fileName, gcodeText ) if not gcodec.isProcedureDone( gcodeText, 'cool' ): - gcodeText = cool.getCoolChainGcode( filename, gcodeText ) + gcodeText = cool.getCoolChainGcode( fileName, gcodeText ) return getStretchGcode( gcodeText, stretchPreferences ) def getStretchGcode( gcodeText, stretchPreferences = None ): @@ -117,20 +117,20 @@ def getStretchGcode( gcodeText, stretchPreferences = None ): skein.parseGcode( gcodeText, stretchPreferences ) return skein.output.getvalue() -def writeOutput( filename = '' ): - "Stretch a gcode linear move file. Chain stretch the gcode if it is not already stretched. If no filename is specified, stretch the first unmodified gcode file in this folder." - if filename == '': - unmodified = import_translator.getGNUTranslatorFilesUnmodified() +def writeOutput( fileName = '' ): + "Stretch a gcode linear move file. Chain stretch the gcode if it is not already stretched. If no fileName is specified, stretch the first unmodified gcode file in this folder." + if fileName == '': + unmodified = interpret.getGNUTranslatorFilesUnmodified() if len( unmodified ) == 0: print( "There are no unmodified gcode files in this folder." ) return - filename = unmodified[ 0 ] + fileName = unmodified[ 0 ] stretchPreferences = StretchPreferences() preferences.readPreferences( stretchPreferences ) startTime = time.time() - print( 'File ' + gcodec.getSummarizedFilename( filename ) + ' is being chain stretched.' ) - suffixFilename = filename[ : filename.rfind( '.' ) ] + '_stretch.gcode' - stretchGcode = getStretchChainGcode( filename, '', stretchPreferences ) + print( 'File ' + gcodec.getSummarizedFilename( fileName ) + ' is being chain stretched.' ) + suffixFilename = fileName[ : fileName.rfind( '.' ) ] + '_stretch.gcode' + stretchGcode = getStretchChainGcode( fileName, '', stretchPreferences ) if stretchGcode == '': return gcodec.writeFileText( suffixFilename, stretchGcode ) @@ -247,7 +247,7 @@ class LineIteratorForward: class StretchPreferences: "A class to handle the stretch preferences." def __init__( self ): - "Set the default preferences, execute title & preferences filename." + "Set the default preferences, execute title & preferences fileName." #Set the default preferences. self.archive = [] self.activateStretch = preferences.BooleanPreference().getFromValue( 'Activate Stretch', False ) @@ -256,24 +256,24 @@ class StretchPreferences: self.archive.append( self.loopStretchOverExtrusionWidth ) self.pathStretchOverExtrusionWidth = preferences.FloatPreference().getFromValue( 'Path Stretch Over Extrusion Width (ratio):', 0.0 ) self.archive.append( self.pathStretchOverExtrusionWidth ) - self.filenameInput = preferences.Filename().getFromFilename( import_translator.getGNUTranslatorGcodeFileTypeTuples(), 'Open File to be Stretched', '' ) - self.archive.append( self.filenameInput ) + self.fileNameInput = preferences.Filename().getFromFilename( interpret.getGNUTranslatorGcodeFileTypeTuples(), 'Open File to be Stretched', '' ) + self.archive.append( self.fileNameInput ) self.stretchFromDistanceOverExtrusionWidth = preferences.FloatPreference().getFromValue( 'Stretch From Distance Over Extrusion Width (ratio):', 2.0 ) self.archive.append( self.stretchFromDistanceOverExtrusionWidth ) self.perimeterStretchOverExtrusionWidth = preferences.FloatPreference().getFromValue( 'Perimeter Maximum Stretch Over Extrusion Width (ratio):', 0.3 ) self.archive.append( self.perimeterStretchOverExtrusionWidth ) - #Create the archive, title of the execute button, title of the dialog & preferences filename. + #Create the archive, title of the execute button, title of the dialog & preferences fileName. self.executeTitle = 'Stretch' - self.filenamePreferences = preferences.getPreferencesFilePath( 'stretch.csv' ) - self.filenameHelp = 'skeinforge_tools.stretch.html' + self.fileNamePreferences = preferences.getPreferencesFilePath( 'stretch.csv' ) + self.fileNameHelp = 'skeinforge_tools.stretch.html' self.saveTitle = 'Save Preferences' self.title = 'Stretch Preferences' def execute( self ): "Stretch button has been clicked." - filenames = polyfile.getFileOrDirectoryTypesUnmodifiedGcode( self.filenameInput.value, import_translator.getGNUTranslatorFileTypes(), self.filenameInput.wasCancelled ) - for filename in filenames: - writeOutput( filename ) + fileNames = polyfile.getFileOrDirectoryTypesUnmodifiedGcode( self.fileNameInput.value, interpret.getImportPluginFilenames(), self.fileNameInput.wasCancelled ) + for fileName in fileNames: + writeOutput( fileName ) class StretchSkein: diff --git a/trunk/reprap/miscellaneous/python-beanshell-scripts/skeinforge_tools/tower.py b/trunk/reprap/miscellaneous/python-beanshell-scripts/skeinforge_tools/tower.py index cf7e0f40..2f550304 100644 --- a/trunk/reprap/miscellaneous/python-beanshell-scripts/skeinforge_tools/tower.py +++ b/trunk/reprap/miscellaneous/python-beanshell-scripts/skeinforge_tools/tower.py @@ -53,7 +53,7 @@ The towered file is saved as Screw Holder Bottom_tower.gcode >>> tower.getTowerGcode(" -( GCode generated by May 8, 2008 slice.py ) +( GCode generated by May 8, 2008 carve.py ) ( Extruder Initialization ) .. many lines of gcode @@ -62,7 +62,7 @@ many lines of gcode >>> tower.getTowerChainGcode(" -( GCode generated by May 8, 2008 slice.py ) +( GCode generated by May 8, 2008 carve.py ) ( Extruder Initialization ) .. many lines of gcode @@ -81,7 +81,7 @@ from skeinforge_tools.skeinforge_utilities import gcodec from skeinforge_tools.skeinforge_utilities import intercircle from skeinforge_tools.skeinforge_utilities import preferences from skeinforge_tools import analyze -from skeinforge_tools import import_translator +from skeinforge_tools.skeinforge_utilities import interpret from skeinforge_tools import polyfile from skeinforge_tools import raft import cStringIO @@ -94,11 +94,11 @@ __author__ = "Enrique Perez (perez_enrique@yahoo.com)" __date__ = "$Date: 2008/21/04 $" __license__ = "GPL 3.0" -def getTowerChainGcode( filename, gcodeText, towerPreferences = None ): +def getTowerChainGcode( fileName, gcodeText, towerPreferences = None ): "Tower a gcode linear move text. Chain tower the gcode if it is not already towered." - gcodeText = gcodec.getGcodeFileText( filename, gcodeText ) + gcodeText = gcodec.getGcodeFileText( fileName, gcodeText ) if not gcodec.isProcedureDone( gcodeText, 'raft' ): - gcodeText = raft.getRaftChainGcode( filename, gcodeText ) + gcodeText = raft.getRaftChainGcode( fileName, gcodeText ) return getTowerGcode( gcodeText, towerPreferences ) def getTowerGcode( gcodeText, towerPreferences = None ): @@ -127,22 +127,22 @@ def transferFillLoopsToSurroundingLoops( fillLoops, surroundingLoops ): for surroundingLoop in surroundingLoops: transferFillLoops( fillLoops, surroundingLoop ) -def writeOutput( filename = '' ): +def writeOutput( fileName = '' ): """Tower a gcode linear move file. Chain tower the gcode if it is not already towered. - If no filename is specified, tower the first unmodified gcode file in this folder.""" - if filename == '': - unmodified = import_translator.getGNUTranslatorFilesUnmodified() + If no fileName is specified, tower the first unmodified gcode file in this folder.""" + if fileName == '': + unmodified = interpret.getGNUTranslatorFilesUnmodified() if len( unmodified ) == 0: print( "There are no unmodified gcode files in this folder." ) return - filename = unmodified[ 0 ] + fileName = unmodified[ 0 ] towerPreferences = TowerPreferences() preferences.readPreferences( towerPreferences ) startTime = time.time() - print( filename ) - print( 'File ' + gcodec.getSummarizedFilename( filename ) + ' is being chain towered.' ) - suffixFilename = filename[ : filename.rfind( '.' ) ] + '_tower.gcode' - towerGcode = getTowerChainGcode( filename, '', towerPreferences ) + print( fileName ) + print( 'File ' + gcodec.getSummarizedFilename( fileName ) + ' is being chain towered.' ) + suffixFilename = fileName[ : fileName.rfind( '.' ) ] + '_tower.gcode' + towerGcode = getTowerChainGcode( fileName, '', towerPreferences ) if towerGcode == '': return gcodec.writeFileText( suffixFilename, towerGcode ) @@ -168,31 +168,31 @@ class ThreadLayer: class TowerPreferences: "A class to handle the tower preferences." def __init__( self ): - "Set the default preferences, execute title & preferences filename." + "Set the default preferences, execute title & preferences fileName." #Set the default preferences. self.archive = [] self.activateTower = preferences.BooleanPreference().getFromValue( 'Activate Tower', True ) self.archive.append( self.activateTower ) self.extruderPossibleCollisionConeAngle = preferences.FloatPreference().getFromValue( 'Extruder Possible Collision Cone Angle (degrees):', 60.0 ) self.archive.append( self.extruderPossibleCollisionConeAngle ) - self.filenameInput = preferences.Filename().getFromFilename( import_translator.getGNUTranslatorGcodeFileTypeTuples(), 'Open File to be Towered', '' ) - self.archive.append( self.filenameInput ) + self.fileNameInput = preferences.Filename().getFromFilename( interpret.getGNUTranslatorGcodeFileTypeTuples(), 'Open File to be Towered', '' ) + self.archive.append( self.fileNameInput ) self.maximumTowerHeight = preferences.IntPreference().getFromValue( 'Maximum Tower Height (layers):', 0 ) self.archive.append( self.maximumTowerHeight ) self.towerStartLayer = preferences.IntPreference().getFromValue( 'Tower Start Layer (integer):', 1 ) self.archive.append( self.towerStartLayer ) - #Create the archive, title of the execute button, title of the dialog & preferences filename. + #Create the archive, title of the execute button, title of the dialog & preferences fileName. self.executeTitle = 'Tower' - self.filenamePreferences = preferences.getPreferencesFilePath( 'tower.csv' ) - self.filenameHelp = 'skeinforge_tools.tower.html' + self.fileNamePreferences = preferences.getPreferencesFilePath( 'tower.csv' ) + self.fileNameHelp = 'skeinforge_tools.tower.html' self.saveTitle = 'Save Preferences' self.title = 'Tower Preferences' def execute( self ): "Tower button has been clicked." - filenames = polyfile.getFileOrDirectoryTypesUnmodifiedGcode( self.filenameInput.value, import_translator.getGNUTranslatorFileTypes(), self.filenameInput.wasCancelled ) - for filename in filenames: - writeOutput( filename ) + fileNames = polyfile.getFileOrDirectoryTypesUnmodifiedGcode( self.fileNameInput.value, interpret.getImportPluginFilenames(), self.fileNameInput.wasCancelled ) + for fileName in fileNames: + writeOutput( fileName ) class TowerSkein: @@ -204,7 +204,7 @@ class TowerSkein: self.extrusionWidth = 0.6 self.feedrateMinute = 959.0 self.feedrateTable = {} - self.halfExtrusionHeight = 0.4 + self.halfLayerThickness = 0.4 self.islandLayers = [] self.isLoop = False self.isPerimeter = False @@ -233,7 +233,7 @@ class TowerSkein: "Add a gcode thread to the output." if len( thread ) > 0: firstPoint = thread[ 0 ] - if z + self.halfExtrusionHeight < self.oldZ: + if z + self.halfLayerThickness < self.oldZ: highPoint = complex( firstPoint.real, firstPoint.imag ) if self.oldLocation != None: oldLocationComplex = self.oldLocation.dropAxis( 2 ) @@ -413,8 +413,8 @@ class TowerSkein: return if firstWord == '(<decimalPlacesCarried>': self.decimalPlacesCarried = int( splitLine[ 1 ] ) - elif firstWord == '(<extrusionHeight>': - self.halfExtrusionHeight = 0.5 * float( splitLine[ 1 ] ) + elif firstWord == '(<layerThickness>': + self.halfLayerThickness = 0.5 * float( splitLine[ 1 ] ) elif firstWord == '(<extrusionWidth>': self.extrusionWidth = float( splitLine[ 1 ] ) self.addLine( line ) diff --git a/trunk/reprap/miscellaneous/python-beanshell-scripts/skeinforge_tools/unpause.py b/trunk/reprap/miscellaneous/python-beanshell-scripts/skeinforge_tools/unpause.py index 40134a77..5fba934d 100644 --- a/trunk/reprap/miscellaneous/python-beanshell-scripts/skeinforge_tools/unpause.py +++ b/trunk/reprap/miscellaneous/python-beanshell-scripts/skeinforge_tools/unpause.py @@ -54,7 +54,7 @@ from skeinforge_tools.skeinforge_utilities import intercircle from skeinforge_tools.skeinforge_utilities import preferences from skeinforge_tools import analyze from skeinforge_tools import fillet -from skeinforge_tools import import_translator +from skeinforge_tools.skeinforge_utilities import interpret from skeinforge_tools import polyfile import cStringIO import os @@ -67,11 +67,11 @@ __date__ = "$Date: 2008/21/04 $" __license__ = "GPL 3.0" -def getUnpauseChainGcode( filename, gcodeText, unpausePreferences = None ): +def getUnpauseChainGcode( fileName, gcodeText, unpausePreferences = None ): "Unpause a gcode linear move text. Chain unpause the gcode if it is not already unpaused." - gcodeText = gcodec.getGcodeFileText( filename, gcodeText ) + gcodeText = gcodec.getGcodeFileText( fileName, gcodeText ) if not gcodec.isProcedureDone( gcodeText, 'fillet' ): - gcodeText = fillet.getFilletChainGcode( filename, gcodeText ) + gcodeText = fillet.getFilletChainGcode( fileName, gcodeText ) return getUnpauseGcode( gcodeText, unpausePreferences ) def getUnpauseGcode( gcodeText, unpausePreferences = None ): @@ -96,20 +96,20 @@ def getSelectedPlugin( unpausePreferences ): return plugin return None -def writeOutput( filename = '' ): - "Unpause a gcode linear move file. Chain unpause the gcode if it is not already unpaused. If no filename is specified, unpause the first unmodified gcode file in this folder." - if filename == '': - unmodified = import_translator.getGNUTranslatorFilesUnmodified() +def writeOutput( fileName = '' ): + "Unpause a gcode linear move file. Chain unpause the gcode if it is not already unpaused. If no fileName is specified, unpause the first unmodified gcode file in this folder." + if fileName == '': + unmodified = interpret.getGNUTranslatorFilesUnmodified() if len( unmodified ) == 0: print( "There are no unmodified gcode files in this folder." ) return - filename = unmodified[ 0 ] + fileName = unmodified[ 0 ] unpausePreferences = UnpausePreferences() preferences.readPreferences( unpausePreferences ) startTime = time.time() - print( 'File ' + gcodec.getSummarizedFilename( filename ) + ' is being chain unpaused.' ) - suffixFilename = filename[ : filename.rfind( '.' ) ] + '_unpause.gcode' - unpauseGcode = getUnpauseChainGcode( filename, '', unpausePreferences ) + print( 'File ' + gcodec.getSummarizedFilename( fileName ) + ' is being chain unpaused.' ) + suffixFilename = fileName[ : fileName.rfind( '.' ) ] + '_unpause.gcode' + unpauseGcode = getUnpauseChainGcode( fileName, '', unpausePreferences ) if unpauseGcode == '': return gcodec.writeFileText( suffixFilename, unpauseGcode ) @@ -121,29 +121,29 @@ def writeOutput( filename = '' ): class UnpausePreferences: "A class to handle the unpause preferences." def __init__( self ): - "Set the default preferences, execute title & preferences filename." + "Set the default preferences, execute title & preferences fileName." #Set the default preferences. self.archive = [] self.activateUnpause = preferences.BooleanPreference().getFromValue( 'Activate Unpause', False ) self.archive.append( self.activateUnpause ) self.delay = preferences.FloatPreference().getFromValue( 'Delay (milliseconds):', 28.0 ) self.archive.append( self.delay ) - self.filenameInput = preferences.Filename().getFromFilename( import_translator.getGNUTranslatorGcodeFileTypeTuples(), 'Open File to be Unpaused', '' ) - self.archive.append( self.filenameInput ) + self.fileNameInput = preferences.Filename().getFromFilename( interpret.getGNUTranslatorGcodeFileTypeTuples(), 'Open File to be Unpaused', '' ) + self.archive.append( self.fileNameInput ) self.maximumSpeed = preferences.FloatPreference().getFromValue( 'Maximum Speed (ratio):', 1.5 ) self.archive.append( self.maximumSpeed ) - #Create the archive, title of the execute button, title of the dialog & preferences filename. + #Create the archive, title of the execute button, title of the dialog & preferences fileName. self.executeTitle = 'Unpause' - self.filenamePreferences = preferences.getPreferencesFilePath( 'unpause.csv' ) - self.filenameHelp = 'skeinforge_tools.unpause.html' + self.fileNamePreferences = preferences.getPreferencesFilePath( 'unpause.csv' ) + self.fileNameHelp = 'skeinforge_tools.unpause.html' self.saveTitle = 'Save Preferences' self.title = 'Unpause Preferences' def execute( self ): "Unpause button has been clicked." - filenames = polyfile.getFileOrDirectoryTypesUnmodifiedGcode( self.filenameInput.value, import_translator.getGNUTranslatorFileTypes(), self.filenameInput.wasCancelled ) - for filename in filenames: - writeOutput( filename ) + fileNames = polyfile.getFileOrDirectoryTypesUnmodifiedGcode( self.fileNameInput.value, interpret.getImportPluginFilenames(), self.fileNameInput.wasCancelled ) + for fileName in fileNames: + writeOutput( fileName ) class UnpauseSkein: diff --git a/trunk/reprap/miscellaneous/python-beanshell-scripts/skeinforge_tools/nozzle_wipe.py b/trunk/reprap/miscellaneous/python-beanshell-scripts/skeinforge_tools/wipe.py index 93c408fd..0b417b47 100644 --- a/trunk/reprap/miscellaneous/python-beanshell-scripts/skeinforge_tools/nozzle_wipe.py +++ b/trunk/reprap/miscellaneous/python-beanshell-scripts/skeinforge_tools/wipe.py @@ -1,71 +1,72 @@ """ -Nozzle wipe is a script to wipe the nozzle. +Wipe is a script to wipe the nozzle. -At the beginning of a layer, depending on the preferences nozzle, wipe will move the nozzle with the extruder off to the arrival point, +At the beginning of a layer, depending on the preferences, wipe will move the nozzle with the extruder off to the arrival point, then to the wipe point, then to the departure point, then back to the layer. -The default 'Activate Nozzle Wipe' checkbox is on. When it is on, the functions described below will work, when it is off, the functions +The default 'Activate Wipe' checkbox is on. When it is on, the functions described below will work, when it is off, the functions will not be called. The "Location Arrival X" preference, is the x coordinate of the arrival location. The "Location Arrival Y" and "Location Arrival Z" -preferences are the y & z coordinates of the location. The equivalent "Location Wipe.." and "Location Departure.." preferences are for -the wipe and departure locations. +preferences are the y & z coordinates of the location. The equivalent "Location Wipe.." and "Location Departure.." preferences +are for the wipe and departure locations. -The "Nozzle Wipe Period (layers)" preference is the number of layers between nozzle wipes. Nozzle wipe will always wipe just before -the first layer, afterwards it will wipe every "Nozzle Wipe Period" layers. With the default of three, nozzle wipe will wipe just before -the zeroth layer, the third layer, sixth layer and so on. +The "Wipe Period (layers)" preference is the number of layers between wipes. Wipe will always wipe just before the first layer, +afterwards it will wipe every "Wipe Period" layers. With the default of three, wipe will wipe just before the zeroth layer, the +third layer, sixth layer and so on. -To run nozzle wipe, in a shell which nozzle wipe is in type: -> python nozzle_wipe.py +To run wipe, in a shell which wipe is in type: +> python wipe.py -The following examples nozzle wipes 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 nozzle_wipe.py. The nozzle wipe function will nozzle wipe if the -'Activate Nozzle Wipe' checkbox is on. The functions writeOutput and getNozzleWipeChainGcode check to see if the text has been -nozzle wiped, if not they call the getHopChainGcode in hop.py to hop the text; once they have the hopped text, then they nozzle wipe. +The following examples wipes 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 wipe.py. The wipe function +will wipe if the 'Activate Wipe' checkbox is on. The functions writeOutput and getWipeChainGcode check to see if the text +has been wiped, if not they call the getHopChainGcode in hop.py to hop the text; once they have the hopped text, then they +wipe. -> python nozzle_wipe.py -This brings up the dialog, after clicking 'Nozzle Wipe', the following is printed: -File Screw Holder Bottom.stl is being chain nozzle wiped. -The nozzle wiped file is saved as Screw Holder Bottom_nozzle_wipe.gcode +> python wipe.py +This brings up the dialog, after clicking 'Wipe', the following is printed: +File Screw Holder Bottom.stl is being chain wiped. +The wiped file is saved as Screw Holder Bottom_wipe.gcode -> python nozzle_wipe.py Screw Holder Bottom.stl -File Screw Holder Bottom.stl is being chain nozzle wiped. -The nozzle wiped file is saved as Screw Holder Bottom_nozzle_wipe.gcode +> python wipe.py Screw Holder Bottom.stl +File Screw Holder Bottom.stl is being chain wiped. +The wiped file is saved as Screw Holder Bottom_wipe.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 nozzle_wipe ->>> nozzle_wipe.main() -This brings up the nozzle wipe dialog. +>>> import wipe +>>> wipe.main() +This brings up the wipe dialog. ->>> nozzle_wipe.writeOutput() -File Screw Holder Bottom.stl is being chain nozzle wiped. -The nozzle wiped file is saved as Screw Holder Bottom_nozzle_wipe.gcode +>>> wipe.writeOutput() +File Screw Holder Bottom.stl is being chain wiped. +The wiped file is saved as Screw Holder Bottom_wipe.gcode ->>> nozzle_wipe.getNozzleWipeGcode(" -( GCode generated by May 8, 2008 slice.py ) +>>> wipe.getWipeGcode(" +( GCode generated by May 8, 2008 carve.py ) ( Extruder Initialization ) .. many lines of gcode .. ") -Many line of nozzle wiped gcode. +Many line of wiped gcode. ->>> nozzle_wipe.getNozzleWipeChainGcode(" -( GCode generated by May 8, 2008 slice.py ) +>>> wipe.getWipeChainGcode(" +( GCode generated by May 8, 2008 carve.py ) ( Extruder Initialization ) .. many lines of gcode .. ") -Many line of nozzle wiped gcode. +Many line of wiped gcode. """ @@ -79,7 +80,7 @@ from skeinforge_tools.skeinforge_utilities import preferences from skeinforge_tools.skeinforge_utilities.vector3 import Vector3 from skeinforge_tools import analyze from skeinforge_tools import hop -from skeinforge_tools import import_translator +from skeinforge_tools.skeinforge_utilities import interpret from skeinforge_tools import polyfile import cStringIO import math @@ -92,60 +93,60 @@ __date__ = "$Date: 2008/21/04 $" __license__ = "GPL 3.0" -def getNozzleWipeChainGcode( filename, gcodeText, nozzleWipePreferences = None ): - "Nozzle wipe a gcode linear move text. Chain nozzle wipe the gcode if it is not already nozzle wiped." - gcodeText = gcodec.getGcodeFileText( filename, gcodeText ) +def getWipeChainGcode( fileName, gcodeText, wipePreferences = None ): + "Wipe a gcode linear move text. Chain wipe the gcode if it is not already wiped." + gcodeText = gcodec.getGcodeFileText( fileName, gcodeText ) if not gcodec.isProcedureDone( gcodeText, 'hop' ): - gcodeText = hop.getHopChainGcode( filename, gcodeText ) - return getNozzleWipeGcode( gcodeText, nozzleWipePreferences ) + gcodeText = hop.getHopChainGcode( fileName, gcodeText ) + return getWipeGcode( gcodeText, wipePreferences ) -def getNozzleWipeGcode( gcodeText, nozzleWipePreferences = None ): - "Nozzle wipe a gcode linear move text." +def getWipeGcode( gcodeText, wipePreferences = None ): + "Wipe a gcode linear move text." if gcodeText == '': return '' - if gcodec.isProcedureDone( gcodeText, 'nozzle_wipe' ): + if gcodec.isProcedureDone( gcodeText, 'wipe' ): return gcodeText - if nozzleWipePreferences == None: - nozzleWipePreferences = NozzleWipePreferences() - preferences.readPreferences( nozzleWipePreferences ) - if not nozzleWipePreferences.activateNozzleWipe.value: + if wipePreferences == None: + wipePreferences = WipePreferences() + preferences.readPreferences( wipePreferences ) + if not wipePreferences.activateWipe.value: return gcodeText - skein = NozzleWipeSkein() - skein.parseGcode( gcodeText, nozzleWipePreferences ) + skein = WipeSkein() + skein.parseGcode( gcodeText, wipePreferences ) return skein.output.getvalue() -def writeOutput( filename = '' ): - "Nozzle wipe a gcode linear move file. Chain nozzle wipe the gcode if it is not already nozzle wiped. If no filename is specified, nozzle wipe the first unmodified gcode file in this folder." - if filename == '': - unmodified = import_translator.getGNUTranslatorFilesUnmodified() +def writeOutput( fileName = '' ): + "Wipe a gcode linear move file. Chain wipe the gcode if it is not already wiped. If no fileName is specified, wipe the first unmodified gcode file in this folder." + if fileName == '': + unmodified = interpret.getGNUTranslatorFilesUnmodified() if len( unmodified ) == 0: print( "There are no unmodified gcode files in this folder." ) return - filename = unmodified[ 0 ] - nozzleWipePreferences = NozzleWipePreferences() - preferences.readPreferences( nozzleWipePreferences ) + fileName = unmodified[ 0 ] + wipePreferences = WipePreferences() + preferences.readPreferences( wipePreferences ) startTime = time.time() - print( 'File ' + gcodec.getSummarizedFilename( filename ) + ' is being chain nozzle wiped.' ) - suffixFilename = filename[ : filename.rfind( '.' ) ] + '_nozzle_wipe.gcode' - nozzleWipeGcode = getNozzleWipeChainGcode( filename, '', nozzleWipePreferences ) - if nozzleWipeGcode == '': + print( 'File ' + gcodec.getSummarizedFilename( fileName ) + ' is being chain wiped.' ) + suffixFilename = fileName[ : fileName.rfind( '.' ) ] + '_wipe.gcode' + wipeGcode = getWipeChainGcode( fileName, '', wipePreferences ) + if wipeGcode == '': return - gcodec.writeFileText( suffixFilename, nozzleWipeGcode ) - print( 'The nozzle wiped file is saved as ' + gcodec.getSummarizedFilename( suffixFilename ) ) - analyze.writeOutput( suffixFilename, nozzleWipeGcode ) - print( 'It took ' + str( int( round( time.time() - startTime ) ) ) + ' seconds to nozzle wipe the file.' ) + gcodec.writeFileText( suffixFilename, wipeGcode ) + print( 'The wiped file is saved as ' + gcodec.getSummarizedFilename( suffixFilename ) ) + analyze.writeOutput( suffixFilename, wipeGcode ) + print( 'It took ' + str( int( round( time.time() - startTime ) ) ) + ' seconds to wipe the file.' ) -class NozzleWipePreferences: - "A class to handle the nozzle wipe preferences." +class WipePreferences: + "A class to handle the wipe preferences." def __init__( self ): - "Set the default preferences, execute title & preferences filename." + "Set the default preferences, execute title & preferences fileName." #Set the default preferences. self.archive = [] - self.activateNozzleWipe = preferences.BooleanPreference().getFromValue( 'Activate Nozzle Wipe', False ) - self.archive.append( self.activateNozzleWipe ) - self.filenameInput = preferences.Filename().getFromFilename( import_translator.getGNUTranslatorGcodeFileTypeTuples(), 'Open File to be Nozzle Wiped', '' ) - self.archive.append( self.filenameInput ) + self.activateWipe = preferences.BooleanPreference().getFromValue( 'Activate Wipe', False ) + self.archive.append( self.activateWipe ) + self.fileNameInput = preferences.Filename().getFromFilename( interpret.getGNUTranslatorGcodeFileTypeTuples(), 'Open File to be Wiped', '' ) + self.archive.append( self.fileNameInput ) self.locationArrivalX = preferences.FloatPreference().getFromValue( 'Location Arrival X (mm):', - 70.0 ) self.archive.append( self.locationArrivalX ) self.locationArrivalY = preferences.FloatPreference().getFromValue( 'Location Arrival Y (mm):', - 50.0 ) @@ -164,24 +165,24 @@ class NozzleWipePreferences: self.archive.append( self.locationWipeY ) self.locationWipeZ = preferences.FloatPreference().getFromValue( 'Location Wipe Z (mm):', 50.0 ) self.archive.append( self.locationWipeZ ) - self.nozzleWipePeriod = preferences.IntPreference().getFromValue( 'Nozzle Wipe Period (layers):', 3 ) - self.archive.append( self.nozzleWipePeriod ) - #Create the archive, title of the execute button, title of the dialog & preferences filename. - self.executeTitle = 'Nozzle Wipe' - self.filenamePreferences = preferences.getPreferencesFilePath( 'nozzle_wipe.csv' ) - self.filenameHelp = 'skeinforge_tools.nozzle_wipe.html' + self.wipePeriod = preferences.IntPreference().getFromValue( 'Wipe Period (layers):', 3 ) + self.archive.append( self.wipePeriod ) + #Create the archive, title of the execute button, title of the dialog & preferences fileName. + self.executeTitle = 'Wipe' + self.fileNamePreferences = preferences.getPreferencesFilePath( 'wipe.csv' ) + self.fileNameHelp = 'skeinforge_tools.wipe.html' self.saveTitle = 'Save Preferences' - self.title = 'Nozzle Wipe Preferences' + self.title = 'Wipe Preferences' def execute( self ): - "Nozzle wipe button has been clicked." - filenames = polyfile.getFileOrDirectoryTypesUnmodifiedGcode( self.filenameInput.value, import_translator.getGNUTranslatorFileTypes(), self.filenameInput.wasCancelled ) - for filename in filenames: - writeOutput( filename ) + "Wipe button has been clicked." + fileNames = polyfile.getFileOrDirectoryTypesUnmodifiedGcode( self.fileNameInput.value, interpret.getImportPluginFilenames(), self.fileNameInput.wasCancelled ) + for fileName in fileNames: + writeOutput( fileName ) -class NozzleWipeSkein: - "A class to nozzle wipe a skein of extrusions." +class WipeSkein: + "A class to wipe a skein of extrusions." def __init__( self ): self.decimalPlacesCarried = 3 self.extruderActive = False @@ -238,19 +239,19 @@ class NozzleWipeSkein: "Get number rounded to the number of carried decimal places as a string." return euclidean.getRoundedToDecimalPlaces( self.decimalPlacesCarried, number ) - def parseGcode( self, gcodeText, nozzleWipePreferences ): - "Parse gcode text and store the nozzle wipe gcode." + def parseGcode( self, gcodeText, wipePreferences ): + "Parse gcode text and store the wipe gcode." self.lines = gcodec.getTextLines( gcodeText ) - self.nozzleWipePeriod = nozzleWipePreferences.nozzleWipePeriod.value - self.parseInitialization( nozzleWipePreferences ) - self.locationArrival = Vector3( nozzleWipePreferences.locationArrivalX.value, nozzleWipePreferences.locationArrivalY.value, nozzleWipePreferences.locationArrivalZ.value ) - self.locationDeparture = Vector3( nozzleWipePreferences.locationDepartureX.value, nozzleWipePreferences.locationDepartureY.value, nozzleWipePreferences.locationDepartureZ.value ) - self.locationWipe = Vector3( nozzleWipePreferences.locationWipeX.value, nozzleWipePreferences.locationWipeY.value, nozzleWipePreferences.locationWipeZ.value ) + self.wipePeriod = wipePreferences.wipePeriod.value + self.parseInitialization( wipePreferences ) + self.locationArrival = Vector3( wipePreferences.locationArrivalX.value, wipePreferences.locationArrivalY.value, wipePreferences.locationArrivalZ.value ) + self.locationDeparture = Vector3( wipePreferences.locationDepartureX.value, wipePreferences.locationDepartureY.value, wipePreferences.locationDepartureZ.value ) + self.locationWipe = Vector3( wipePreferences.locationWipeX.value, wipePreferences.locationWipeY.value, wipePreferences.locationWipeZ.value ) for self.lineIndex in xrange( self.lineIndex, len( self.lines ) ): line = self.lines[ self.lineIndex ] self.parseLine( line ) - def parseInitialization( self, nozzleWipePreferences ): + def parseInitialization( self, wipePreferences ): "Parse gcode initialization and store the parameters." for self.lineIndex in xrange( len( self.lines ) ): line = self.lines[ self.lineIndex ] @@ -259,7 +260,7 @@ class NozzleWipeSkein: if firstWord == '(<decimalPlacesCarried>': self.decimalPlacesCarried = int( splitLine[ 1 ] ) elif firstWord == '(<extrusionStart>': - self.addLine( '(<procedureDone> nozzle_wipe )' ) + self.addLine( '(<procedureDone> wipe )' ) return elif firstWord == '(<extrusionWidth>': self.extrusionWidth = float( splitLine[ 1 ] ) @@ -276,7 +277,7 @@ class NozzleWipeSkein: self.oldLocation = gcodec.getLocationFromSplitLine( self.oldLocation, splitLine ) elif firstWord == '(<layerStart>': self.layerIndex += 1 - if self.layerIndex % self.nozzleWipePeriod == 0: + if self.layerIndex % self.wipePeriod == 0: self.shouldWipe = True elif firstWord == 'M101': self.extruderActive = True @@ -286,11 +287,11 @@ class NozzleWipeSkein: def main( hashtable = None ): - "Display the nozzle wipe dialog." + "Display the wipe dialog." if len( sys.argv ) > 1: writeOutput( ' '.join( sys.argv[ 1 : ] ) ) else: - preferences.displayDialog( NozzleWipePreferences() ) + preferences.displayDialog( WipePreferences() ) if __name__ == "__main__": main() |