raft ($Date: 2008/21/04 $) | index /home/enrique/Desktop/backup/babbleold/script/reprap/pyRepRap_v0.1/raft.py |
Raft is a script to raft the threads to partially compensate for filament shrinkage when extruded.
The important value for the raft preferences is "Maximum Raft Over Half Extrusion Width (ratio)" which is the ratio of the
maximum amount the thread will be rafted compared to half of the extrusion width. The default is 0.3, if you do not want to
use raft, set the value to zero. With a value of one or more, the script might raft a couple of threads in opposite directions
so much that they overlap. In theory this would be because they'll contract back to the desired places, but in practice they might
not. The optimal value of raft will be different for different materials, so the default value of 0.3 is chosen because it will
counter the contraction a bit, but not enough to cause overlap trouble.
In general, raft will widen holes and push corners out. The algorithm works by checking at each turning point on the
extrusion path what the direction of the thread is at a distance of "Raft from Distance over Extrusion Width (ratio)" times the
extrusion width, on both sides, and moves the thread in the opposite direction. The magnitude of the raft increases with the
amount that the direction of the two threads is similar and by the "Maximum Raft Over Half Extrusion Width (ratio)". The
script then also raftes the thread at two locations on the path on close to the turning points. In practice the filament
contraction will be similar but different from the algorithm, so even once the optimal parameters are determined, the raft
script will not be able to eliminate the inaccuracies caused by contraction, but it should reduce them. To run raft, in a shell
type:
> python strectch.py
To run raft, 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, rafted 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 & raft 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 and when the dialog pops up,
change the parameters if you wish but the default 'Comb Hair' is fine. Then type 'python raft.py' in a shell and when the dialog pops up,
change the parameters if you wish but the default is fine to start. Then click 'Raft', choose the file which you exported in
Export GNU Triangulated Surface and the filled & rafted file will be saved with the suffix '_raft'. Once you've made a shape, then
you can decide what the optimal value of "Maximum Raft Over Half Extrusion Width (ratio)" is for that material.
To write documentation for this program, open a shell in the raft.py directory, then type 'pydoc -w raft', then open 'raft.html' in
a browser or click on the '?' button in the dialog. To write documentation for all the python scripts in the directory, type 'pydoc -w ./'.
To use other functions of raft, type 'python' in a shell to run the python interpreter, then type 'import raft' 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 raft 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 raft.py. The raft function will raft if 'Comb Hair' is true, which can be set in the dialog or by changing
the preferences file 'raft.csv' with a text editor or a spreadsheet program set to separate tabs. The functions raftChainFile and
getRaftChainGcode check to see if the text has been rafted, if not they call the getFillChainGcode in fill.py to fill the text; once they
have the filled text, then they raft.
> pydoc -w raft
wrote raft.html
> python raft.py
This brings up the dialog, after clicking 'Raft', the following is printed:
File Hollow Square.gts is being chain rafted.
The rafted file is saved as Hollow Square_raft.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 raft
>>> raft.main()
This brings up the raft dialog.
>>> raft.raftChainFile()
Hollow Square.gts
File Hollow Square.gts is being chain rafted.
The rafted file is saved as Hollow Square_raft.gcode
>>> raft.raftFile()
File Hollow Square.gcode is being rafted.
The rafted file is saved as Hollow Square_raft.gcode
>>> raft.getRaftGcode("
( GCode generated by May 8, 2008 slice.py )
( Extruder Initialization )
..
many lines of gcode
..
")
>>> raft.getRaftChainGcode("
( GCode generated by May 8, 2008 slice.py )
( Extruder Initialization )
..
many lines of gcode
..
")
HDPE.raft_temp = 200
HDPE.first_layer_temp = 240
HDPE.layer_temp = 220
PCL.raft_temp = 0 // no raft
PCL.first_layer_temp = 130
PCL.layer_temp = 120
ABS.raft_temp = 200
ABS.first_layer_temp = 215
ABS.layer_temp = 230
PLA.raft_temp = 0
PLA.first_layer_temp = 180
PLA.layer_temp = 160
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) |