# Fillet Documentation

## Introduction

Fillet is a python script that bevels or fillets gcode, to provide smooth extruder movement. It can either bevel, arc segment, arc point or arc radius. After either bevel or arc segment, only linear commands are added. After arc point or arc radius, the linear gcode move commands are transformed into respectively helical arc point or arc radius commands.

## Example

This example bevels and fillets the gcode file Hollow Square.gcode. This example is run in a terminal in the folder which contains Hollow Square.gcode and fillet.py.

    >>> import reprap.fillet as fillet
    Fillet has been imported.
    The gcode files in this directory that are not already beveled or filleted are the following:
    ['Hollow Square.gcode']

    >>> fillet.arcPoint()
    File Hollow Square.gcode is being filleted into arc points.
    ( GCode generated by March 29,2007 Skeinforge )
    ( Extruder Initialization )
    ..
    many lines of gcode
    ..
    The arc point file is saved as Hollow Square_arc_point.gcode

    >>> fillet.arcPointFile("Hollow Square.gcode")
    File Hollow Square.gcode is being filleted into arc points.
    ..
    The arc point file is saved as Hollow Square_arc_point.gcode

    >>> fillet.arcPointFiles(["Hollow Square.gcode"])
    File Hollow Square.gcode is being filleted into arc points.
    ..
    The arc point file is saved as Hollow Square_arc_point.gcode

    >>> fillet.arcPointText("
    ( GCode generated by March 29,2007 Skeinforge )
    ( Extruder Initialization )
    ..
    many lines of gcode
    ..
    ")

    ( GCode generated by March 29,2007 Skeinforge )\n( Extruder Initialization )\n
    ..
    many lines of gcode
    ..

    >>> fillet.arcRadius()
    File Hollow Square.gcode is being filleted into arc radiuses.
    ..
    The arc radius file is saved as Hollow Square_arc_radius.gcode

    >>> fillet.arcRadiusFile("Hollow Square.gcode")
    File Hollow Square.gcode is being filleted into arc radiuses.
    ..
    The arc radius file is saved as Hollow Square_arc_radius.gcode

    >>> fillet.arcRadiusFiles(["Hollow Square.gcode"])
    File Hollow Square.gcode is being filleted into arc radiuses.
    ..
    The arc radius file is saved as Hollow Square_arc_radius.gcode

    >>> fillet.arcRadiusText("
    ( GCode generated by March 29,2007 Skeinforge )
    ( Extruder Initialization )
    ..
    many lines of gcode
    ..
    ")

    ( GCode generated by March 29,2007 Skeinforge )\n( Extruder Initialization )\n
    ..
    many lines of gcode
    ..

    >>> fillet.arcSegment()
    File Hollow Square.gcode is being arc segmented.
    ..
    The arc segment file is saved as Hollow Square_arc_segment.gcode

    >>> fillet.arcSegmentFile("Hollow Square.gcode")
    File Hollow Square.gcode is being arc segmented.
    ..
    The arc segment file is saved as Hollow Square_arc_segment.gcode

    >>> fillet.arcSegmentFiles(["Hollow Square.gcode"])
    File Hollow Square.gcode is being arc segmented.
    ..
    The arc segment file is saved as Hollow Square_arc_segment.gcode

    >>> fillet.arcSegmentText("
    ( GCode generated by March 29,2007 Skeinforge )
    ( Extruder Initialization )
    ..
    many lines of gcode
    ..
    ")

    ( GCode generated by March 29,2007 Skeinforge )\n( Extruder Initialization )\n
    ..
    many lines of gcode
    ..

    >>> fillet.bevel()
    File Hollow Square.gcode is being beveled.
    ..
    The beveled file is saved as Hollow Square_bevel.gcode

    >>> fillet.bevelFile("Hollow Square.gcode")
    File Hollow Square.gcode is being beveled.
    ..
    The beveled file is saved as Hollow Square_bevel.gcode

    >>> fillet.bevelFiles(["Hollow Square.gcode"])
    File Hollow Square.gcode is being beveled.
    ..
    The beveled file is saved as Hollow Square_bevel.gcode

    >>> fillet.bevelText("
    ( GCode generated by March 29,2007 Skeinforge )
    ( Extruder Initialization )
    ..
    many lines of gcode
    ..
    ")

    ( GCode generated by March 29,2007 Skeinforge )\n( Extruder Initialization )\n
    ..
    many lines of gcode
    ..

## Arc Point Commands

### arcPoint

Fillet a gcode linear move file into a helical point move file.
fillet.arcPoint( filename = '' )

- filename - Name of the file. If no filename is specified, fillet all the unmodified gcode files in this folder.

Returns: Nothing

### arcPointFile

Fillet a gcode linear move file into a helical point move file.
fillet.arcPointFile( filename )

- filename - Name of the file.

Returns: Nothing

### arcPointFiles

Fillet gcode linear move files into helical point move files.
fillet.arcPointFiles( filenames )

- filenames - List of filenames.

Returns: Nothing

### arcPointText

Fillet a gcode linear move text into a helical point move gcode text.
fillet.arcPointText( gcodeText )

- gcodeText - Gcode text.

Returns: Helical point move gcode text

## Arc Radius Commands

### arcRadius

Fillet a gcode linear move file into a helical radius move file.
fillet.arcRadius( filename = '' )

- filename - Name of the file. If no filename is specified, fillet all the unmodified gcode files in this folder.

Returns: Nothing

### arcRadiusFile

Fillet a gcode linear move file into a helical radius move file.
fillet.arcRadiusFile( filename )

- filename - Name of the file.

Returns: Nothing

### arcRadiusFiles

Fillet gcode linear move files into helical radius move files.
fillet.arcRadiusFiles( filenames )

- filenames - List of filenames.

Returns: Nothing

### arcRadiusText

Fillet a gcode linear move text into a helical radius move gcode text.
fillet.arcRadiusText( gcodeText )

- gcodeText - Gcode text.

Returns: Helical radius move gcode text

## Arc Segment Commands

### arcSegment

Fillet a gcode linear move file into an arc segment linear move file.
fillet.arcSegment( filename = '' )

- filename - Name of the file. If no filename is specified, fillet all the unmodified gcode files in this folder.

Returns: Nothing

### arcSegmentFile

Fillet a gcode linear move file into an arc segment linear move file.
fillet.arcSegmentFile( filename )

- filename - Name of the file.

Returns: Nothing

### arcSegmentFiles

Fillet gcode linear move files into arc segment linear move files.
fillet.arcSegmentFiles( filenames )

- filenames - List of filenames.

Returns: Nothing

### arcSegmentText

Fillet a gcode linear move text into an arc segment linear move gcode text.
fillet.arcSegmentText( gcodeText )

- gcodeText - Gcode text.

Returns: Arc segment radius move gcode text

## Bevel Commands

### bevel

Bevel a gcode linear move file.
fillet.bevel( filename = '' )

- filename - Name of the file. If no filename is specified, bevel all the unmodified gcode files in this folder.

Returns: Nothing

### bevelFile

Bevel a gcode linear move file.
fillet.bevelFile( filename )

- filename - Name of the file.

Returns: Nothing

### bevelFiles

Bevel gcode linear move files.
fillet.bevelFiles( filenames )

- filenames - List of filenames.

Returns: Nothing

### bevelText

Bevel a gcode linear move text.
fillet.bevelText( gcodeText )

- gcodeText - Gcode text.

Returns: Beveled gcode text