|
| 1 | +# orx-axidraw |
| 2 | + |
| 3 | +GUI for configuring and plotting with an Axidraw pen-plotter. |
| 4 | + |
| 5 | +Uses the [AxiCLI](https://axidraw.com/doc/cli_api/#introduction) command line tool |
| 6 | +to communicate with the pen plotter. |
| 7 | + |
| 8 | +Requires: Python 3.8 or higher. |
| 9 | + |
| 10 | +This orx create a Python virtual environment and downloads AxiCLI automatically. |
| 11 | + |
| 12 | +## Usage |
| 13 | + |
| 14 | +```kotlin |
| 15 | +fun main() = application { |
| 16 | + program { |
| 17 | + val axi = Axidraw(this, PaperSize.A5) |
| 18 | + axi.resizeWindow() |
| 19 | + |
| 20 | + val gui = WindowedGUI() |
| 21 | + gui.add(axi) |
| 22 | + |
| 23 | + axi.draw { |
| 24 | + fill = null |
| 25 | + axi.bounds.grid(4, 6).flatten().forEach { |
| 26 | + circle(it.center, Double.uniform(20.0, 50.0)) |
| 27 | + } |
| 28 | + } |
| 29 | + |
| 30 | + extend(gui) |
| 31 | + extend { |
| 32 | + drawer.clear(ColorRGBa.WHITE) |
| 33 | + axi.display(drawer) |
| 34 | + } |
| 35 | + } |
| 36 | +} |
| 37 | +``` |
| 38 | + |
| 39 | +Study the inputs available in the GUI. Most are explained in the [AxiCLI](https://axidraw.com/doc/cli_api/#introduction) documentation page. |
| 40 | + |
| 41 | +### Important |
| 42 | + |
| 43 | +* Choose the correct pen-plotter model and servo type in the GUI before plotting. |
| 44 | +* Always make sure the pen is at the home position before starting to plot. If it's not, unpower the steppers, |
| 45 | +drag the carriage home (near the Axidraw's CPU), then power the steppers back on. |
| 46 | + |
| 47 | +### Tips |
| 48 | + |
| 49 | +* One can repeatedly click on `toggle up/down` and adjust `pen pos down` and `pen pos up` |
| 50 | +to find the ideal heights for the pen. |
| 51 | +* Enable `fills occlude strokes` and increase margin value to hide elements near |
| 52 | +the borders of the paper. |
| 53 | +* Click `save` to save your SVG file. |
| 54 | +* Click `plot` to plot the visible design using the current settings. |
| 55 | +* A [2D camera](https://guide.openrndr.org/extensions/camera2D.html) is enabled by default to place your design on the paper. |
| 56 | +* Click `resume plotting` after pressing the hardware pause button (or including a pause |
| 57 | +command on a layer) to continue. |
| 58 | +* To get a plotting time estimate, enable `preview` and click `plot`. Nothing will be plotted, but the estimate will be shown in the IDE console. |
| 59 | + |
| 60 | +The `Load` and `Save` buttons *at the top of the GUI* can be used to load and save the plotting settings. In a future version we may embed the plotting settings into the SVG file. |
| 61 | + |
| 62 | +### Multi color plots |
| 63 | + |
| 64 | +orx-axidraw makes it easy to create multi-pen plots. To do that, use two or more stroke colors in your design. The order of the lines does not matter. Then, before plotting, call `axi.groupStrokeColors()`. This will group curves into layers based on their stroke colors and insert a pause between layers, allowing you to change the pen. |
| 65 | + |
| 66 | +When the plotter pauses during plotting, change the pen and click `resume plotting` to continue. |
0 commit comments