The AxiDraw Extensions for Inkscape - Software to drive the AxiDraw drawing machine.
More about AxiDraw: http://www.axidraw.com/
For installation, please read current installation instructions on the AxiDraw documentation site.
Software for the AxiDraw drawing machine
License: GNU General Public License v2.0
The AxiDraw Extensions for Inkscape - Software to drive the AxiDraw drawing machine.
More about AxiDraw: http://www.axidraw.com/
For installation, please read current installation instructions on the AxiDraw documentation site.
I'm trying to keep the pen lift to an absolute minimum. However the arm bends slightly as it extends. This means when adjusting the UP position to be optimal at the origin, the pen will touch the paper when far away from the origin along the X axis.
I'm suggesting to add a lift offset value. I.e. add X percent (user defined) when the arm is stretched out all the way and interpolate in between. There are other options to improve this, however this seemed to me the easiest (from implementation, as well as from a user input perspective).
Very happy to discuss!
This function should work with or without machine connected.
Following up on issue #49, it turns out that the rarely used visibility attribute has not been handled quite correctly. (That we hadn't noticed thus far does seem to confirm that it's rarely used...)
Attached is a test file featuring a grid of test circles with the visibility attribute (e.g., visibility="hidden"
) and/or visibility style (e.g., style="visibility:hidden;"
) variously applied. This test file should render approximately as follows (and does so in Chrome, Safari, Firefox, and Adobe Illustrator):
A complicating factor (and likely one of the other reasons that this hasn't come up sooner) is that this is not how the file renders in Inkscape. Inkscape itself does not render the visibility attribute nor style correctly. The following screenshot is from Inkscape 0.92, which ignores essentially ignores both the visibility attribute and visibility style element:
This is documented in the Inkscape bug tracker several times in bugs dating back to 2004. See, for example:
AxiDraw Control currently plots the circles in that file as follows, shown in blue:
There are two specific Issues with that behavior:
(1) The visibility attribute is partially followed here: If an object has visibility="hidden"
, it is indeed hidden, but its child is not shown, even if it has attribute visibility="visible"
.
(2) The visibility style element is ignored.
If items (1) and (2) are resolved, AxiDraw Control should plot the circles as follows, the same way that the browsers render the graphic:
Excuse me, when I started drawing, once every operation, the Inkscape tip: “Plot paused by button press after node number 0.Use the "resume" feature to continue.” It didn't actually press the PRG button.
After running the serial command "SC,13,0\r", inkscape can be used normally. But restart after Shut Down , the problem arose.
Please help, Thanks!
system : windows7 64bit
inkscape : 0.91 64bit
EBB : v2.3 white
Firmware Version: 2.5.1
Axidraw control: Every version takes place
In some cases with a plain SVG document opened in Inkscape, the document appears to not have the units set correctly. After changing the document size to Letter, it still does not behave correctly.
To reproduce:
Result: The AxiDraw moves to the corner of the allowed page size and raises and lowers its pen, as though it is trying to print outside the allowed movement area.
We should handle this better in at least two ways:
I am having the following issue with an Axidraw v3:
It driver/software does not seem to work on macOS 10.12.4. Is this known to be a problem? We've tested two different MBPro models with, no luck. Another MBP with 10.12.3 works.
After having successfully used the same machine from a RaspberryPi with newest Raspbian running cncserver, it now has stopped to work as well.
Is there a way to reset/force update the firmware to ensure the Axidraw works as expected and to narrow down the problem? Is there any other way to diagnose the state of the board/software?
Thanks for your help!
Add feature to AxiDraw Layer Control to force a pause, as though the pause button had been pressed, when encountered.
This feature, in combination with external scripts that perform the initial plot and resume(s), could be used to create complex scripted behaviors where the machine does not return to home after the completion of a portion of the SVG.
Potential uses include:
We have in some cases observed jittery, shuddering movement of an AxiDraw when driven from a slower computer, either with a slow CPU (e.g., on a slow Windows notebook) or when the CPU is busy (e.g., on an iMac while using a web browser). This seems to chiefly be noticeable at higher movement speeds, and only on slower or preoccupied computers.
This appears to be due either to the computational load of planning the trajectory in real time, or perhaps to the relatively high rate of USB communications. (The data rate is very low compared to many USB devices but there are frequently-initiated communications.)
It is possible that one or more of the following strategies may help to alleviate the issue:
time.sleep()
) while waiting for long moves to complete. (Intentional delays are added to avoid communication timeouts; these may be longer than needed if computation is taking longer.)Several error messages (e.g., for indicating that an image cannot be plotted) try to display the layer number. If the document does not have any layers, or if the area to be drawn is in the root of the document, it may fail with an error like:
File "axidraw.py", line 921, in recursivelyTraverseSvg
'Please convert images to line art before drawing. ' +
AttributeError: AxiDrawClass instance has no attribute 'sCurrentLayerName'
Bad XML in axidraw_hatch.inx
Noticed this when launching axidraw on Fedora 25 laptop.
I've been using AxiDraw for a short time, but a feature came to my mind regarding home position.
Sometimes it seems like it would be more convenient if the pen's starting position would correspond to a particular point on the drawing, rather than the top-left corner of the Inkscape's document area.
For example, if you wanted to draw a star on a flat object that has a surface that is not rectangular (or has mushy edges), it is difficult to pinpoint the exact location the pen should be place to match the Inkscape's home position correctly. In this case it would be more convenient to just place an anchor on the drawing area in Inkscape (maybe the star's middle), place the pen above the point on the surface where we want the star's middle to be and start plotting.
I've tried achieving this by placing the carriage at the wanted position and placing my drawing (the star's middle) onto the top-left corner in the document, hoping that AxiDraw would then draw the star exactly where I wanted. Unfortunately, the AxiDraw couldn't draw parts of the star that were outside the drawing area..
Anyway, I hope I explained the idea clearly!
Speed 100%, 1000 DPI setting.
Possible model: An option checkbox in AxiDraw Control allows you to enable auto-fill.
If selected, any object that has a fill will be filled by hatch fills, using some reasonable set of assumptions. (In particular, angle of hatches, inset value, and spacing of hatches.) It may be better to allow a single adjustable parameter (hatch spacing/pen width).
Possible choice: Fill will be ignored if white in color?
(This would be relatively simple to implement, but will have a huge performance cost...)
Need an example file to demonstrate issue.
Seen on tiny spirals. Need to attach test file.
Goes away when acceleration is disabled.
In a similar vein to evil-mad/wcb-ink#24, it would be nice to have some per-layer control features for the AxiDraw.
The main ideas listed there are chiefly relevant to paint -- water dipping, and re-inking (per stroke and so forth). AxiDraw does not need these. However, it could use some other potential per-layer adjustments, for example pen-down speed and pen-down height.
Current layer-numbering syntax requires only that the layer name begins with an integer in the range of 0 to 100. We could extend this by detecting that layer-name integer, followed by a specific escape sequence, followed by another integer, perhaps in the range of 0 to 100. (Certain integers may be excluded, depending on the escape sequence.)
The escape sequences could be +H
for pen-down height and +S
for pen-down speed, not case sensitive. When printing a layer with one or more layers that contain parameters like this, the specified pen-down height or pen-down speed would override the defaults given in the extension, for that layer only. Since the speed cannot go to zero, the integer following +S
would need to be in the range 1 to 100. If more than one valid parameter of a given type is found (say, more than one valid speed command for a given layer), only the last one detected would have an effect. Escape sequences need to be given at the start of a layer or immediately following the layer number.
Example layer names:
2 forest floor
: The layer number is 2, and it is labeled as "forest floor". It prints with the default pen height and speed.
45+S50_forest floor
: The layer number is 45, and it is labeled as "_forest floor". It prints with the default pen height, but with pen-down speed of 50, regardless of the value specified in the extension.
100+H5055forest floor
: An invalid declaration, since the requested height is 5055 (which is outside of the range 0 to 100). The layer number is 100. It prints with the default pen height and speed, since there is not a valid override.
0+s1+h100 Forest floor
: The layer number is 0. It prints with the pen-down height of 100, and with pen-down speed of 1, regardless of the value specified in the extension.
22+S0+H0 Forest floor
: The layer number is 22. It prints with the pen-down height of 0, and with the default pen-down speed 1, since the speed value of 0 is not valid.
99+S25_+H50 Forest floor
: The layer number is 99. It prints with the default pen-down height, but with a pen-down speed of 25. The height parameter is not valid, since it does not directly follow the other parameter but is interrupted by an underscore. The layer name is "_+H50 Forest floor".
+H50 Forest floor
: No layer number given. It prints with the default pen-down speed, but with a pen-down height of 50. (Layer numbers are not required.)
A CLI version of the extension would help make it possible to drive the AxiDraw without using Inkscape. This could potentially improve performance (as Inkscape does not also need to parse and display the file), and enable things like "mail merge" type rapid-fire printing.
See https://github.com/hacktoon/ink2canvas for inspiration.
As a follow-on to #7, it might be nice to have a way to specify that a given layer (or set of layers) should not print. This could be done by specifying an escape sequence in the layer name. The tricky part is to make the escape sequence one that will not (often) be used accidentally, is easy to type, and is short.
Perhaps a layer name starting with +X
would not print.
Another approach would be to require that the layer name start with %
--It is uncommon to label things with names that begin with %
.
Comments welcome.
If the USB cable is unplugged while plotting, one might get an error message like:
Failed after command: SM,30,333,-266
Failed after command: SM,30,265,-212
Failed after command: SM,30,200,-160
Failed after command: SM,30,133,-106
Failed after command: SM,30,66,-53
Error reading serial data.
Traceback (most recent call last):
File "axidraw.py", line 2100, in <module>
e.affect()
File "/Applications/Inkscape_091.app/Contents/Resources/share/inkscape/extensions/inkex.py", line 285, in affect
self.effect()
File "axidraw.py", line 280, in effect
self.plotDocument()
File "axidraw.py", line 554, in plotDocument
self.recursivelyTraverseSvg( self.svg, self.svgTransform )
File "axidraw.py", line 625, in recursivelyTraverseSvg
self.recursivelyTraverseSvg( node, matNew, parent_visibility=v )
File "axidraw.py", line 683, in recursivelyTraverseSvg
self.plotPath( node, matNew )
File "axidraw.py", line 1157, in plotPath
self.plotSegmentWithVelocity( fX, fY, 0, 0)
File "axidraw.py", line 1951, in plotSegmentWithVelocity
if strButton[0] == '1': #button pressed
IndexError: string index out of range
This would be better served by a shorter error message of the form "Lost connectivity to AxiDraw. Did the USB cable get unplugged?"
There seems to be an issue where a simple Bézier curve is not drawn "smoothly" - meaning the speed fluctuates while drawing the line, resulting in a drawing that has some parts of the line thinner than others.
Here is a
Video of the Problem (listen to the sound)
and here is the corresponding
Svg File (containing just one Bézier Curve)
Using Windows 7, inkscape 0.91, axidraw extension 1.5.9 and ebb firmware 2.5.1.
When running the sample file the problem is very noticeable. I haven't done any explicit testing with older versions, but I'm confident that the issue wasn't present in release 1.2.2.
I tried my best to include all the relevant information in this report. Please let me know if you require anything else.
On a user-submitted document, found that a test square 1" on a side previews as 1.066" on a side. All objects and their positions on the page are uniformly off in scale.
The document appears to display correctly within Inkscape. It also appears to plot correctly. As displayed in Inkscape, a rectangle 11 inches long appears to be 990 screen px wide-- so the document does indeed have 90 px/inch.
By the ratio, this appears to be a 96/90 scaling issue. That is to say, our conversion of inches to motor steps is not working correctly. Simply changing pxPerInch = 90.0
to pxPerInch = 96.0
in plot_utils.py does not seem to solve the issue.
The document was originally created in Illustrator:
Generator: Adobe Illustrator 18.0.0, SVG Export Plug-In . SVG Version: 6.00 Build 0)
Copying the object(s) to a new document created with Templates->Letter landscape appears to solve the issue-- so the problem is with the interpretation of the document itself. Some sort of zoom, scaling, or units is being correctly rendered by Inkscape but not by preview portion of the AxiDraw driver. Notably, the document in question lacks a viewBox attribute. The "working" document has viewBox="0 0 11 8.5"
, and the "broken" document has none.
In the two documents attached, scale_error_test2.svg has the error but scale_error_test3-OK.svg does not.
Gut instinct: The root cause is an inconsistency in Inkscape 0.91's handling of scaling -- there are 90 px per inch except when dealing with viewbox issues, in which case there are 96 px per inch. Migrating to Inkscape 0.92 ought to alleviate this particular issue, since there are 96 PPI everywhere. (There are, still, outstanding reasons not to migrate to 0.92, importantly that 0.91 is still the recommended version for Mac.)
Potential temporary and ugly workaround: On documents where no viewbox is detected, scale all preview items by 90/96. As the attached example scale_error_test4.svg shows, this does not catch all cases-- some cases may still have scaling, even if a viewBox is present.
Should be reduced to perhaps 50% of current value. The current 100% value cannot actually be used.
Hello, I got up and running on my AxiDraw on OS X in under five minutes, which was wonderful!
I'm having a little more trouble getting everything working on Ubuntu 14.04 though:
No matter what document I create or open in Inkscape, or how many times I change "Inkscape Preferences" and "Document Preferences" to use mm or inches, I'm unable to get the AxiDraw extension to begin plotting. (Note, I am able to move the pen up and down via the AxiDraw interface, so I believe serial is getting to the AxiDraw).
Even with a brand-new Inkscape document with the following steps, I see the "not in right units" error message and am unable to remedy it:
I'm running Ubuntu 14.04 on a Toshiba Chromebook 2 via crouton.
Notably, I had everything working on the same hardware using Ubuntu 12.04 (or whatever the LTS Ubuntu 12 was called). I only changed over to Ubuntu 14 because I want to use AxiDraw with PaperJS, and Chrome isn't available on Ubuntu 12.
Please let me know if I can provide any more information that would help. Thanks for any assistance anyone can provide, and thanks again for making an excellent plotter!
AKA
Working with an imported PDF document 8.5 x 11 inches might have size given as width="612pt" height="792pt"
-- We should be able to identify this as 8.5 x 11 inches.
For the EggBot, we have the "reorder paths for speed" extension. It would be nice to have something similar for AxiDraw.
Possible approach: Add as an extension that is not part of the AxiDraw software, per se-- similar to the Arrange > Restack extension.
Possible approach: Add as a checkbox, and do so automatically at print time.
Not sure how or even if this is possible from Inkscape. But if the EBB gets a new 'name' command (issue 83 in EggBot) then it might be possible to have multiple instances of Inkscape open, and somehow choose one of the available AxiDraws by EBB name. Also a way to set the name of a given EBB.
I notice that the extensions have version numbers directly in the id
tags (e.g., command.evilmadscientist.axidraw.rev170
. The effect is that each new version of the extensions has its own set of potentially unique option settings, and fails to inherit settings from the previous version. Each upgrade necessitates re-entering settings that ought to have carried forward, while a downgrade would lead to old settings coming to the fore. This behavior is inconsistent with the typical expectation that relevant settings are preserved (or in a more complex system, preservable) on upgrade.
Recommendation: remove revision numbers from the id
tag for the AxiDraw-related extensions.
Need data: After pausing, the resume function sometimes just returns home, instead of resuming.
In order to reduce plotting time, it could be possible to not stop the pen during pen up/pen down transitions. It will be hard to have the same precision as normal because the weight and height of the pen are not known. But by having the user tweak a parameter it should be possible to get decent results.
This would be particularly interesting for stippling patterns with many dots or for dashed lines.
Despite hiding SVG layers in the UI or programmatically (via the style "display:none"), they still get plotted by the AxiDraw control. Normal printing excludes such elements.
Two test files are attached... one has all layers visible, the other has a layer hidden via the style "display:none". Both plot exactly the same, despite the layer being hidden.
There is code present that's supposed to deal with visibility on output, but that code doesn't look at the style at all (which is where this information normally resides for files created in Inkscape or Illustrator).
I've submitted PR #47 to correct this issue. It follows the same convention as was used in the current code, including notifying the user with the pre-existing informational box that is already used when hidden/invisible layers or elements are skipped.
Hi due to quite a lot of svg to print I would like to purchase may be three to four AxiDraw and then run them at once. How can I control multiple AxiDraw at once?
Meaning is not clear.
Setup:
Problem:
Using Inkscape, the AxiDraw manual mode commands to raise / lower the pen failed to work. I haven't tried other commands exhaustively. Overwriting the 1.5.9 driver files with the contents of the original v1.2.2 driver restored normal functionality.
My SVG is a bunch of sibling tags. Is it possible to use the hatch fill extension to fill each polygon individually but not make connections between polygons? I think I'm just using the settings incorrectly.
hatch_fill_svg.zip
Edit: I'm moving this issue to EggBot evil-mad/EggBot#90
Manual AxiDraw commands require up to five clicks to access in Inkscape. This could be made much easier by having certain commands activate directly from the cascading extension menus (e.g., pen control, motor control, and version info). PR #46 illustrates this.
This is a problem because the pen does not raise from what it was drawing before until this "thinking" pause is over and causing a lot of ink to spill onto the page.
I've worked around this by splitting my curves up, but preferably the pen would lift before.
There's a warning in the Readme that I just noticed:
Pyserial. (Note that an older version, 2.7, must be used on Windows.)
I've been using the latest version of PySerial on Windows since I got my AxiDraw and it works fine.
If this warning is still required, some verbiage about what version of Python this affects would be useful. Otherwise the warning may be obsolete.
[ This may not be worth fixing since it may be an atypical setup, but wanted to mention, just in case. ]
On my Mac, Inkscape is installed in ~/Applications/
instead of the top-level /Applications/
.
The AxiDraw_V1.0.2.pkg installer complains about requiring Inkscape 0.91 or higher since it can't locate Inkscape. There's no option to specify another location to check for Inkscape.
Workaround: Move Inkscape.app into /Applications/
I keep getting this and have no idea what to do.
The fantastic lxml wrapper for libxml2 is required by inkex.py and therefore this extension. Please download and install the latest version from http://cheeseshop.python.org/pypi/lxml/, or install it through your package manager by a command like: sudo apt-get install python-lxml
Technical details:
No module named lxml
A list of Inkscape "verbs" can be found by querying Inkscape directly from the command line. On the Mac, that's /Applications/Inkscape.app/Contents/Resources/script --verb-list --without-gui
An example script should demonstrate the following common tasks:
It may also be worth showing some examples of "mail merge" type behavior to replace placeholder text with real text. One example (using sed) here: http://superuser.com/questions/793322/add-text-via-command-line-inkscape?rq=1
If units are not found, it should be handled gracefully with an error message-- possibly indicating that the file should be opened with File > Import.
UI: Display distance plotted along with time elapsed.
Started the program and after a few words,
"Traceback (most recent call last):
File "axidraw.py", line 2047, in
e.affect()
File "C:\Program Files (x86)\Inkscape\share\extensions\inkex.py", line 268, in affect
self.effect()
File "axidraw.py", line 253, in effect
self.plotDocument()
File "axidraw.py", line 519, in plotDocument
self.recursivelyTraverseSvg( self.svg, self.svgTransform )
File "axidraw.py", line 584, in recursivelyTraverseSvg
self.recursivelyTraverseSvg( node, matNew, parent_visibility=v )
File "axidraw.py", line 584, in recursivelyTraverseSvg
self.recursivelyTraverseSvg( node, matNew, parent_visibility=v )
File "axidraw.py", line 584, in recursivelyTraverseSvg
self.recursivelyTraverseSvg( node, matNew, parent_visibility=v )
File "axidraw.py", line 641, in recursivelyTraverseSvg
self.plotPath( node, matNew )
File "axidraw.py", line 1012, in plotPath
if len( simplepath.parsePath( d ) ) == 0:
File "C:\Program Files (x86)\Inkscape\share\extensions\simplepath.py", line 110, in parsePath
raise Exception, 'Invalid path, no initial command.'
Exception: Invalid path, no initial command."
The program gets stuck there and Axidraw is unable to work.
Following up on #1, the pause and resume functionality still has a significant issue.
After pausing, and then resuming, it is sometimes the case that the last path drawn before pausing is redrawn. (Known issue, following the fix in issue #1.)
However, it is also apparently the case -- in rare circumstances -- that after resuming, an extraneous pen-down line may be drawn. My interpretation is that this is the same issue as noted previously -- drawing the last line over again -- except that it is interpreting a pen-up move as a pen-down move and redrawing it.
Unfortunately, this occurs in rare circumstances only. Perhaps it is possible to build in a software-defined breakpoint, after a certain tagged path or node count, so that we can simulate pressing the button at an exact time, and thereby reproduce and remove this issue altogether.
Hi!
Just recieved my AxiDraw today and it's awesome (works like a charm), but I'm having some issues related with Hatch Fill inkscape extension.
I've a svg file that have a text path, but when trying to do the fill part, it says two errors:
Traceback (most recent call last): File "eggbot_hatch.py", line 1719, in <module> e.affect() File "C:\Program Files\Inkscape\share\extensions\inkex.py", line 265, in affect self.getposinlayer() File "C:\Program Files\Inkscape\share\extensions\inkex.py", line 207, in getposinlayer x = self.unittouu( xattr[0] + 'px' ) File "C:\Program Files\Inkscape\share\extensions\inkex.py", line 351, in unittouu return retval * (self.__uuconv[u.string[u.start():u.end()]] / self.__uuconv[self.getDocumentUnit()]) File "C:\Program Files\Inkscape\share\extensions\inkex.py", line 304, in getDocumentUnit p = param.match(svgwidth) TypeError: expected string or buffer
¡Hope to get this working soon!
Thanks so much!
Calling Inkscape from command line:
Contents/Resources/share/inkscape/extensions/axidraw.inx:41: parser error : xmlParseEntityRef: no name
<_option value="toggle-pen" >Toggle pen between UP & DOWN</_option>
It would be very useful to have a feature that predicts how long a plot will take. And similarly, to visualize the trajectory of the pen, for example with a dot the moves along the path, but I'm not sure Inkscape allows for this.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.