Package-level declarations

Types

Link copied to clipboard
class Axidraw(program: Program, val paperSizeInMm: Vector2, val drawBounds: Rectangle = program.drawer.bounds, fit: Vector2 = Vector2.ZERO)

Class for working with Axidraw pen plotters. It communicates with the axicli command line program, which is installed automatically using Python. Provides an extensive GUI to configure the pen plotter, to save and load designs, preview them, layout designs using a Camera2D, plot, resume and more.

Link copied to clipboard

Axidraw models. See: https://axidraw.com/doc/cli_api/#model

Link copied to clipboard

Axidraw reordering optimization types. See: https://axidraw.com/doc/cli_api/#reordering

Link copied to clipboard

Pen-lift mechanism. See: https://axidraw.com/doc/cli_api/#penlift

Link copied to clipboard

Axidraw layer mode. The command argument will be prepended to the layer name.

Link copied to clipboard
data class ExecutionResult(val errorCode: Int, val output: String)

Data class containing the output text and error code resulting from executing command line programs.

Link copied to clipboard

Represents common paper sizes using the A-series standard.

Functions

Link copied to clipboard
fun GroupNode.configure(layerName: String = "layer", penSpeed: Int? = null, penHeight: Int? = null, plotDelay: Int? = null, layerMode: AxiLayerMode = AxiLayerMode.DEFAULT)

Configure an SVG layer name. Certain character sequences are used by the Axidraw software to control layer speed, height and delay. Other characters make the layer be ignored, or trigger a pause. The arguments in this function provide a typed approach to construct the layer name. See https://wiki.evilmadscientist.com/AxiDraw_Layer_Control

Link copied to clipboard
fun invokePython(arguments: List<String>, executable: String = systemPython()): ExecutionResult
Link copied to clipboard
fun Composition.saveToInkscapeFile(file: File, postProcess: (String) -> String = { xml -> xml })

Save a Composition to an Inkscape file. Includes expected XML namespaces and sets an XML header with the view window size. Strips an extra wrapping <g> tag to make special layer names work with the Axidraw pen plotter.

Link copied to clipboard

Determines the appropriate Python executable name based on the operating system.

Link copied to clipboard
fun venvPython(venv: File): String

Returns the path to the Python executable in a given virtual environment. The path varies depending on the operating system.