skeinforge_tools.slice_shape ($Date: 2008/02/05 $) | index /home/enrique/Desktop/backup/babbleold/script/reprap/pyRepRap/skeinforge_tools/slice_shape.py |
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 Density' is the density of the extruded shape over the
density of the filament. The 'Extrusion Width Over Thickness' ratio is the ratio of the extrusion width over the layer thickness. A ratio of
one means the extrusion is a circle, a typical ratio of 1.5 means the extrusion is a wide oval.
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.
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 Hollow Square.gts. The examples are run in a terminal in the folder which
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
or a spreadsheet program set to separate tabs.
> python slice.py
This brings up the dialog, after clicking 'Slice', the following is printed:
File Hollow Square.gcode is being sliced.
The sliced file is saved as Hollow Square_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 Hollow Square.gts is being sliced.
The sliced file is saved as Hollow Square_slice.gcode
It took 3 seconds to slice the file.
>>> slice.writeOutput()
File Hollow Square.gcode is being sliced.
The sliced file is saved as Hollow Square_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
..
")
Classes | ||||||||||||||||||
|
Functions | ||
|
Data | ||
__author__ = 'Enrique Perez (perez_enrique@yahoo.com)' __date__ = '$Date: 2008/02/05 $' __license__ = 'GPL 3.0' absolute_import = _Feature((2, 5, 0, 'alpha', 1), (2, 7, 0, 'alpha', 0), 16384) |
Author | ||
Enrique Perez (perez_enrique@yahoo.com) |