This function creates a version of a manual axidraw connection that instead of sending instructions to the plotter will collect them for later replay. For bigger plots it is preferred to use this as it makes it easier to pause and rewind if something goes wrong.

axi_ghost(units = "cm", paper = "A4")

Arguments

units

Either 'cm' or 'in' giving the unit the instructions should be interpreted in.

paper

The size of the paper to plot on. Is only relevant for the plot method.

Value

An object with the methods given in the Recording Instructions and After Recording sections.

Recording Instructions

The following methods are available for recording drawing instructions and mirror those of axi_manual():

  • connect(): Start a connection to the plotter.

  • disconnect(): End a connection to the plotter.

  • go_to(): Move the plotter head to the absolute (x, y) position.

  • move_to(): Move the plotter head to the absolute (x, y) position, raising the head if not already up.

  • line_to(): Move the plotter head to the absolute (x, y) position, lowering the head if not already down.

  • go_rel(): Move the plotter head with the relative (x, y) amount.

  • move_rel(): Move the plotter head with the relative (x, y) amount, raising the head if not already up.

  • line_rel(): Move the plotter head with the relative (x, y) amount, lowering the head if not already down.

  • pen_up(): Raise the pen head.

  • pen_down(): Lower the pen head.

  • set_pen_color(): Records the color of the pen currently in use.

After Recording

Once the instructions have been recorded there is a bunch of stuff you can do with it:

  • plot(): Will take the recorded data and send it to the plotter, for real this time. During plotting an internal counter will keep track of where you are so that you can pause and resume the plot at any time.

  • preview(): Will render the plotter movement on screen. You can choose to only show drawing movement, or air movement as well. Further, you can either set a single color for the drawing lines or use the color encoded with the movement. Lastly, it is possible to draw all movement or either the remaining or already drawn parts, which uses the internal counter to figure out how for proceeded.

  • get_pen_position(): Get the internal counter. The counter records everything between a pen down and a pen up as a single movement.

  • set_pen_position(): Sets a new pen position manually.

  • rewind_pen_postion(): Move the pen position backwards in time.

  • forward_pen_position(): Move the pen position forward in time.

  • reset_pen_position(): Sets the pen position to the start of the plot.

  • get_path(): Returns the recorded movement information.