fillet ($Date: 2008/21/04 $) | index /home/enrique/Desktop/backup/babbleold/script/reprap/pyRepRap_v0.1/fillet.py |
Fillet is a script to fillet or bevel the corners on a gcode file.
Fillets rounds the corners slightly in a variety of ways. This is to reduce corner blobbing and sudden extruder acceleration.
The default radio button choice is 'Bevel'. If the default choice is 'Do Not Fillet', the gcode text is handed over the next tool in the
skeinforge chain. To run fillet, in a shell type:
> python fillet.py
To run fillet, install python 2.x on your machine, which is avaliable from http://www.python.org/download/
To use the preferences dialog you'll also need Tkinter, which probably came with the python installation. If it did not, look for it at:
www.tcl.tk/software/tcltk/
To export a GNU Triangulated Surface file from Art of Illusion, you can use the Export GNU Triangulated Surface script at:
http://members.axion.net/~enrique/Export%20GNU%20Triangulated%20Surface.bsh
To bring it into Art of Illusion, drop it into the folder ArtOfIllusion/Scripts/Tools/.
The GNU Triangulated Surface format is supported by Mesh Viewer, and it is described at:
http://gts.sourceforge.net/reference/gts-surfaces.html#GTS-SURFACE-WRITE
To turn an STL file into filled, filleted gcode, first import the file using the STL import plugin in the import submenu of the file menu
of Art of Illusion. Then from the Scripts submenu in the Tools menu, choose Export GNU Triangulated Surface and select the
imported STL shape. Then type 'python slice.py' in a shell in the folder which slice & fillet are in and when the dialog pops up, set
the parameters and click 'Save Preferences'. Then type 'python fill.py' in a shell in the folder which fill is in and when the dialog
pops up, set the parameters and click 'Save Preferences'. Then type 'python comb.py' in a shell in the folder which fill is in and
when the dialog pops up, change the parameters if you wish but the default 'Comb Hair' is fine. Then type 'python stretch.py' in a
shell in the folder which fill is in and when the dialog pops up, change the parameters if you wish but the default stretch is
conservative. Then type 'python fillet.py' in a shell and when the dialog pops up, change the parameters if you wish but the
default bevel is fine. Then click 'Fillet', choose the file which you exported in Export GNU Triangulated Surface and the filled &
filleted file will be saved with the suffix '_fillet'.
To write documentation for this program, open a shell in the fillet.py directory, then type 'pydoc -w fillet', then open 'fillet.html' in
a browser or click on the '?' button in the dialog. To use other functions of fillet, type 'python' in a shell to run the python
interpreter, then type 'import fillet' to import this program.
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
The psyco download page is:
http://psyco.sourceforge.net/download.html
The following examples fillet the files Hollow Square.gcode & Hollow Square.gts. The examples are run in a terminal in the folder
which contains Hollow Square.gcode, Hollow Square.gts and fillet.py. The fillet function executes the preferred fillet type, which
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
tabs. The functions filletChainFile and getFilletChainGcode check to see if the text has been combed, if not they call the
getStretchChainGcode in stretch.py to fill the text; once they have the stretched text, then they fillet.
> pydoc -w fillet
wrote fillet.html
> python fillet.py
This brings up the dialog, after clicking 'Fillet', the following is printed:
File Hollow Square.gts is being chain filleted.
The filleted file is saved as Hollow Square_fillet.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 fillet
>>> fillet.main()
This brings up the fillet dialog.
>>> fillet.arcPointFile()
File Hollow Square.gcode is being filleted into arc points.
The arc point file is saved as Hollow Square_fillet.gcode
>>> fillet.arcRadiusFile()
File Hollow Square.gcode is being filleted into arc radiuses.
The arc radius file is saved as Hollow Square_fillet.gcode
>>> fillet.arcSegmentFile()
File Hollow Square.gcode is being arc segmented.
The arc segment file is saved as Hollow Square_fillet.gcode
>>> fillet.bevelFile()
File Hollow Square.gcode is being beveled.
The beveled file is saved as Hollow Square_fillet.gcode
>>> fillet.filletChainFile()
Hollow Square.gts
File Hollow Square.gcode is being chain filleted.
The filleted file is saved as Hollow Square_fillet.gcode
>>> fillet.filletFile()
File Hollow Square.gcode is being filleted.
The filleted file is saved as Hollow Square_fillet.gcode
>>> fillet.getArcPointGcode("
( GCode generated by May 8, 2008 slice.py )
( Extruder Initialization )
..
many lines of gcode
..
")
>>> fillet.getArcRadiusGcode("
( GCode generated by May 8, 2008 slice.py )
( Extruder Initialization )
..
many lines of gcode
..
")
>>> fillet.getArcSegmentGcode("
( GCode generated by May 8, 2008 slice.py )
( Extruder Initialization )
..
many lines of gcode
..
")
>>> fillet.getBevelGcode("
( GCode generated by May 8, 2008 slice.py )
( Extruder Initialization )
..
many lines of gcode
..
")
>>> fillet.getFilletGcode("
( GCode generated by May 8, 2008 slice.py )
( Extruder Initialization )
..
many lines of gcode
..
")
>>> fillet.getFilletChainGcode("
( GCode generated by May 8, 2008 slice.py )
( Extruder Initialization )
..
many lines of gcode
..
")
Modules | ||||||
|
Classes | ||||||||||||||||||||||||||||||||||||||||||
|
Functions | ||
|
Data | ||
__author__ = 'Enrique Perez (perez_enrique@yahoo.com)' __date__ = '$Date: 2008/21/04 $' __license__ = 'GPL 3.0' |
Author | ||
Enrique Perez (perez_enrique@yahoo.com) |