skeinforge_tools.craft_plugins.chop ($Date: 2008/02/05 $)
index
/home/enrique/Desktop/backup/babbleold/script/reprap/pyRepRap/skeinforge_tools/craft_plugins/chop.py

Previous / Next / Contents


Chop is a script to chop a shape into svg slice layers.


Settings
  Add Extra Top Layer if Necessary
  Extra Decimal Places
  Import Coarseness
  Layer Thickness
  Layers
    Layers From
    Layers To
  Mesh Type
    Correct Mesh
    Unproven Mesh
  Perimeter Width
Examples

Settings


Add Extra Top Layer if Necessary

Default is on.

When selected, chop will add an extra layer at the very top of the object if the top of the object is more than half the layer thickness above the first slice. This is so the cutting tool doesn't cut too deeply through the top of the object on its first pass.

Extra Decimal Places

Default is one.

Defines the number of extra decimal places export will output compared to the number of decimal places in the layer thickness. The higher the 'Extra Decimal Places', the more significant figures the output numbers will have.

Import Coarseness

Default is one.

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' setting, the wider the gaps in the mesh it will span. An import coarseness of one means it will span gaps of the perimeter width.

Layer Thickness

Default is 0.4 mm.

Defines the thickness of the layer, this is the most important chop setting.

Layers

Chop slices from top to bottom. To get only the bottom layer, set the "Layers From" to minus one. The 'Layers From' until 'Layers To' range is a python slice.

Layers From

Default is zero.

Defines the index of the top layer that will be chopped. If the 'Layers From' is the default zero, the carving will start from the top layer. If the 'Layers From' index is negative, then the carving will start from the 'Layers From' index above the bottom layer.

Layers To

Default is a huge number, which will be limited to the highest index number.

Defines the index of the bottom layer that will be chopped. If the 'Layers To' index is a huge number like the default, the carving will go to the bottom of the model. If the 'Layers To' index is negative, then the carving will go to the 'Layers To' index above the bottom layer.

Mesh Type

Default is 'Correct Mesh'.

Correct Mesh

When selected, the mesh will be accurately chopped, and if a hole is found, chop will switch over to the algorithm that spans gaps.

Unproven Mesh

When selected, chop 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 is not actually a gap in the model.

Perimeter Width

Default is 2 mm.

Defines the width of the perimeter.

Examples


The following examples chop the file Screw Holder Bottom.stl. The examples are run in a terminal in the folder which contains Screw Holder Bottom.stl and chop.py.


> python chop.py
This brings up the chop dialog.


> python chop.py Screw Holder Bottom.stl
The chop tool is parsing the file:
Screw Holder Bottom.stl
..
The chop tool has created the file:
.. Screw Holder Bottom_chop.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 chop
>>> chop.main()
This brings up the chop dialog.


>>> chop.writeOutput( 'Screw Holder Bottom.stl' )
The chop tool is parsing the file:
Screw Holder Bottom.stl
..
The chop tool has created the file:
.. Screw Holder Bottom_chop.svg


Previous / Next / Contents


 
Modules
       
__init__
skeinforge_tools.skeinforge_utilities.euclidean
skeinforge_tools.skeinforge_utilities.gcodec
skeinforge_tools.skeinforge_utilities.interpret
math
os
skeinforge_tools.meta_plugins.polyfile
skeinforge_tools.profile
skeinforge_tools.skeinforge_utilities.settings
skeinforge_tools.skeinforge_utilities.svg_codec
sys
time

 
Classes
       
ChopRepository
skeinforge_tools.skeinforge_utilities.svg_codec.SVGCodecSkein
ChopSkein

 
class ChopRepository
    A class to handle the chop settings.
 
  Methods defined here:
__init__(self)
Set the default settings, execute title & settings fileName.
execute(self)
Chop button has been clicked.

 
class ChopSkein(skeinforge_tools.skeinforge_utilities.svg_codec.SVGCodecSkein)
    A class to chop a carving.
 
  Methods defined here:
addExtraTopLayerIfNecessary(self, rotatedBoundaryLayers)
Add extra top layer if necessary.
getCarvedSVG(self, carving, fileName, repository)
Parse gnu triangulated surface text and store the chopped gcode.

Methods inherited from skeinforge_tools.skeinforge_utilities.svg_codec.SVGCodecSkein:
__init__(self)
addLayerBegin(self, layerIndex, z)
Add the start lines for the layer.
addLayerEnd(self, rotatedBoundaryLayer)
Add the path and end lines for the layer.
addLine(self, line)
Add a line of text and a newline to the output.
addLines(self, lines)
Add lines of text to the output.
addRotatedLoopLayerToOutput(self, layerIndex, rotatedBoundaryLayer)
Add rotated boundary layer to the output.
addRotatedLoopLayersToOutput(self, rotatedBoundaryLayers)
Add rotated boundary layers to the output.
getInitializationForOutputSVG(self, procedureName)
Get initialization gcode for the output.
getReplacedSVGTemplate(self, fileName, procedureName, rotatedBoundaryLayers)
Get the lines of text from the svg_layer.template file.
getRounded(self, number)
Get number rounded to the number of carried decimal places as a string.
getRoundedComplexString(self, point)
Get the rounded complex string.
getSVGLoopString(self, loop)
Get the svg loop string.
getSVGPathString(self, path)
Get the svg path string.

 
Functions
       
getCraftedText(fileName, text='', repository=None)
Get chopped text.
getCraftedTextFromFileName(fileName, repository=None)
Chop a shape file.
getNewRepository()
Get the repository constructor.
main()
Display the chop dialog.
writeOutput(fileName='')
Chop a GNU Triangulated Surface file.  If no fileName is specified, chop the first GNU Triangulated Surface file in this folder.

 
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)