# Python: module skeinforge_application.skeinforge_plugins.craft_plugins.cleave

skeinforge_application.skeinforge_plugins.craft_plugins.cleave ($Date: 2008/02/05 $) | index /home/enrique/Desktop/backup/babbleold/script/reprap/fabmetheus/skeinforge_application/skeinforge_plugins/craft_plugins/cleave.py

Previous / Next / Contents

`
Cleave is a script to cleave a shape into svg slice layers.
Settings
Add Layer Template to SVG
Extra Decimal Places
Import Coarseness
Layer Height
Layers
Layers From
Layers To
Mesh Type
Correct Mesh
Unproven Mesh
Perimeter Width
SVG Viewer
Examples
`

## Settings

### Add Layer Template to SVG

Default is on.
When selected, the layer template will be added to the svg output, which adds javascript control boxes. So 'Add Layer Template to SVG' should be selected when the svg will be viewed in a browser.
When off, no controls will be added, the svg output will only include the fabrication paths. So 'Add Layer Template to SVG' should be deselected when the svg will be used by other software, like Inkscape.

### Extra Decimal Places

Default is two.
Defines the number of extra decimal places export will output compared to the number of decimal places in the layer height. 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 edge width.

### Layer Height

Default is 0.4 mm.
Defines the height of the layer, this is the most important cleave setting.

### Layers

Cleave slices from bottom to top. To get a single layer, set the "Layers From" to zero and the "Layers To" to one. The layer from until layer to range is a python slice.

#### Layers From

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

#### Layers To

Default is a huge number, which will be limited to the highest index layer.
Defines the index of the top layer that will be cleaved. If the 'Layers To' index is a huge number like the default, the carving will go to the top of the model. If the 'Layers To' index is negative, then the carving will go to the 'Layers To' index below the top layer.

### Mesh Type

Default is 'Correct Mesh'.

#### Correct Mesh

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

#### Unproven Mesh

When selected, cleave 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 two millimeters.
Defines the width of the edge.

### SVG Viewer

Default is webbrowser.
If the 'SVG Viewer' is set to the default 'webbrowser', the scalable vector graphics file will be sent to the default browser to be opened. If the 'SVG Viewer' is set to a program name, the scalable vector graphics file will be sent to that program to be opened.

## Examples

The following examples cleave the file Screw Holder Bottom.stl. The examples are run in a terminal in the folder which contains Screw Holder Bottom.stl and cleave.py.
> python cleave.py
This brings up the cleave dialog.
> python cleave.py Screw Holder Bottom.stl
The cleave tool is parsing the file:
Screw Holder Bottom.stl
..
The cleave tool has created the file:
.. Screw Holder Bottom_cleave.svg

Previous / Next / Contents

Modules

``

__init__ fabmetheus_utilities.archive fabmetheus_utilities.euclidean fabmetheus_utilities.fabmetheus_tools.fabmetheus_interpret | fabmetheus_utilities.gcodec math os fabmetheus_utilities.settings | skeinforge_application.skeinforge_utilities.skeinforge_polyfile skeinforge_application.skeinforge_utilities.skeinforge_profile fabmetheus_utilities.svg_writer sys | time

Classes

``

CleaveRepository
CleaveSkein

class CleaveRepository
`` | `A class to handle the cleave settings.`

Methods defined here:

__init__(self)
  `Set the default settings, execute title & settings fileName.`

execute(self)
  `Cleave button has been clicked.`

class CleaveSkein
`` | `A class to cleave a carving.`

Methods defined here:

getCarvedSVG(self, carving, fileName, repository)
  `Parse gnu triangulated surface text and store the cleaved gcode.`

Functions

``

getCraftedText(fileName, gcodeText='', repository=None)
  `Get cleaved text.`

getNewRepository()
  `Get new repository.`

main()
  `Display the cleave dialog.`

writeOutput(fileName, shouldAnalyze=True)
  `Cleave a GNU Triangulated Surface file.`

Data
`` |  | __author__ = 'Enrique Perez (perez_enrique@yahoo.com)' __date__ = '$Date: 2008/02/05 $' __license__ = 'GNU Affero General Public License http://www.gnu.org/licenses/agpl.html' absolute_import = _Feature((2, 5, 0, 'alpha', 1), (2, 7, 0, 'alpha', 0), 16384)

Author
`` |  | Enrique Perez (perez_enrique@yahoo.com)