Inkscape.org
Using Inkscape with Cutters/Plotters Vinyl cutter - when using export/plot extension cuts as it returns to origin
  1. #1
    GJenkinsUK GJenkinsUK @GJenkinsUK

    When I use the export/plot extension to cut vinyl it works OK until the end of the drawing when instead of moving the cutter to a safe height it cuts an extra unwanted line as the blade moves from the last intended cutting point back to the origin.

    Does anyone know a way around this?

    The problem doesn't seem to occur if I use Inkcut - but I understood Inkcut was now deprecated.

    I am using Inkscape 0.92 with Linux Ubuntu 18.04.  My cutter is a Chinese one with no visible branding, but InkCut thinks it is an ANAgraph AE-70e.

    Any help would be much appreciated.

  2. #2
    brynn brynn @brynn

    I would guess this might be a setting for the machine itself.  At least I didn't see anything in the extension that might be responsible for it.  Or maybe the machine's software.  I mean, I can see where this kind of option might be useful, but it doesn't make sense for it to happen in every case.  Maybe you could look into the machine's documentation?

    Or maybe you could trick the machine, if you can't find any setting?  What if you draw your own line, that connects the end to the beginning, without cutting through everything else?

  3. #3
    GJenkinsUK GJenkinsUK @GJenkinsUK

    Many thanks for the suggestions.  There's no machine software that works with Linux as far as I can tell - at any rate I've always just used it with Inkscape and Inkcut, which worked fine with earlier versions.

    I have tried tricking the machine by adding an extra line, but the problem I have is that it sometimes cuts the extra line first, then cuts everything else - which means that it still cuts a line right across everything else as the head returns from the final cutting point to the origin.

    Back to using Inkcut, I think.

  4. #4
    brynn brynn @brynn
    *
    GJenkinsUK

    I have tried tricking the machine by adding an extra line, but the problem I have is that it sometimes cuts the extra line first, then cuts everything else

    You mean it cuts the extra line that you drew first?  There might be a way to fix that....  There should be a way.  When you say it sometimes does that, have you figured out when it doesn't, why it doesn't?  Is it cutting the last line that you drew first?

    If that's the case, you could try reversing the path.  Path menu > Reverse.  Or there might be another way to trick it, if the path order is the issue.

    I guess you must have tried to figure out what causes the cutting head to raise?  Of course I don't have any kind of machine like this.  But it kind of seems like a no brainer that the machine should have a button to raise the head.  Or a button to stop cutting or pause the job, or something like that?

    Would a simulator help with this?  Could that predict when it's going to happen?

    Would you call this a bug?  If so, maybe it should be reported?

    There was a guy who knows a lot about that particular extension, but I can't remember his name....  I haven't seen him in this new forum, I don't think.  I guess he's just busy with life....

    Well anyway, don't give up yet.  Maybe someone who is more familiar with these things will have some better suggestions for you.

    Edit

    Hey wait!  If it cut the extra line that you drew first, that must mean that line was not connected to the original line.  Otherwise, why would it start cutting in the middle of a line?  Do you remember whether you joined the new path to the original?  Or you just drew the line but didn't join the nodes?

     

  5. #5
    GJenkinsUK GJenkinsUK @GJenkinsUK

    Thanks for the further ideas.  I have fiddled around with the positioning of the extra line, but there is a snag in that there must be some kind of optimising routine which decides the order of cutting the lines and adding the extra line then changes the final cutting point.  I have raised the question on the developers forum and as a result will now try Inkscape 1.0 to see if that solves the issues.

     

  6. #6
    tron tron @tron

    Hi GJenkinsUK. I had the exact same problem when using inkscape with my cutter almost a year ago. I have a US Cutter but it is also made in China. It is the same as the UK cutter. it was a while ago so i can only tell you off the top of my head what you need to do. I can tell you in more detail next time i'm in the shop. it will at least point you in the right direction.

    There is a python script that runs the plotter called plotter.py (i'm pretty sure). in that file there are plotter protocols depending on which you are using. i use HPGL. There you need to change the order in which your plotter functions while it's cutting. PU is 'PEN UP' is what you want to be at the end of the syntax.

    the only caveat is that i got lazy and modified the file for the root user now i have to run sudo inkscape for it to work. not a big deal but be sure to edit the file for the correct user to solve your problem. Prob should be reported as a bug or might have been already, i'm not sure. I hope that helps.

  7. #7
    GJenkinsUK GJenkinsUK @GJenkinsUK

    Hi Tron

    That is very useful.

    I have checked and now know that my cutter is a Liyu SC631 - which looks like the SC cutters sold by USCutter. I have found file plotter.py (there is also plotter.pyc?), but I am not familiar with Python (or that matter how to edit Python), so any more information you can give when you are back in the shop about what changes need to be made and how you made them would be hugely helpful. I am also using HPGL, so I am hopeful that what worked for you would work for me too.

    Thanks for taking the time to comment - particularly at Christmas!

  8. #8
    tron tron @tron

    HeyGJenkinsUK. Sure np. I remember having this problem and it drove me crazy! couldn't find much online too. Had to hack it to work.

    I haven't been to the shop but i have inkscape at home and i remember the basic concept of what i had to do. you want the plotter.py file. back it up, in case you bust it you can restore it. you can edit it with nano, vim, or gedit if you don't want to use the cli. Here goes:

    Youll find this on line 107 like so:

            self.hpgl = hpglInit + self.hpgl + ';SP0;PU0,0;IN; '

    SP (select pen) pen 0 in this case since you only have one. PU (pen up), i think the 0,0 is the cooridnates. then finally IN (initiate). I think IN is where the problem lies. i don't remember what i changed mine to is what i'll have to double check at the shop, but rather than waiting for me you can mess around w it. i might have moved PU to the end, or removed IN comletely. remember that the semi colon is what separates each command and needs to be at the end along with the commas like so:

            self.hpgl = hpglInit + self.hpgl + ';SP0;PU0,0;IN; '

    You can find all the hgpl commands here

    I hope that helps. Let me know the rusults. By then i might be by the shop to send you the file exactly.

  9. #9
    GJenkinsUK GJenkinsUK @GJenkinsUK

    Hi Tron

    I have found the relevant line in the file.  I have also looked at the HPGL commands using the link you sent,  Looking at these, and also some examples on the internet (eg here - https://www.isoplotec.co.jp/HPGL/eHPGL.htm  ) , I would have expected to find a PU command at the end.  However, as I don't feel confident with HPGL or Python, if its OK I'll sit tight until you are back in the shop - I'm worried about trashing the whole thing and can use the work-around of Inkcut if I need to do any cutting in the meantime.

    Many thanks.

  10. #10
    tron tron @tron

    I'm at the shop today. I found it on line 107. Here you go:

            self.hpgl = hpglInit + self.hpgl + ';PU0,0;SP0;IN; '

    Pen up to home location, select pen 0, initiate. That should do it. let me know the result.

  11. #11
    Martin Owens Martin Owens @doctormo🌹🧀

    The current extension (1.0 master) says

    return init + hpgl + ';SP0;PU0,0;@ '

    Is this different? Do you have a patch that would help the extension?

  12. #12
    tron tron @tron

    Hi @doctormo. Unfortunately i do not have a patch. The syntax does look different though. i have never seen the @ and am not sure what hgpl command it represents. I'm not sure what extension i'm using either. i'm pretty sure my inkscape version is 0.92. Next time i'm in i'll check that too.

  13. #13
    GJenkinsUK GJenkinsUK @GJenkinsUK

    Hi Tron

    You are a real star - that works a treat.  I don't think I would ever have worked it out myself.  Thank you, thank you, thank you.

    For Martin's information, the command on line 107 of plotter.py in Inkscape 0.92 that did not work was:

    self.hpgl = hpglInit + self.hpgl + ';SP0;PU0,0;IN; '

    Tron's fix (which cured the problem for me) involves changing the order to:

    self.hpgl = hpglInit + self.hpgl + ';PU0,0;SP0;IN; '

    In other words the SP0 and PU0,0 commands have changed position.

    I have tried to run Inkscape 1.0 on another computer using AppImage, but the plot extension will not work as it cannot find py.serial.  I know nothing about HPGL but would suspect that, as the current extension follows the same order as the 0.92 extension that doesn't work properly (SP first, then PU) the new extension will have the same problem.

     

     

     

  14. #14
    GJenkinsUK GJenkinsUK @GJenkinsUK

    Hi Martin

    I have now got Inkscape 1 working.  It shows the same problem as I had before - after cutting the shape the pen returns to the origin without lifting, so you get an unwanted extra cut which, depending on the layout of your design, can right where you don't want it.  Although it does plot I also get an error message "The output from the extension could not be parsed". I wonder if this is because it doesn't like the @ in the extension - I know nothing about HPGL but I can't see any references to @ in the various lists of HPGL instructions available on line.

    Do I need to submit a bug report or is it enough that I have raised it here?

  15. #15
    tron tron @tron

    Hey @GJenkinsUK I'm glad it worked for you. I know how frustrating it is when it didnt work as expected. you're most welcome. i hope it will help others that are experiencing the same problem. its an easy fix for a small but very annoying problem.

  16. #16
    Martin Owens Martin Owens @doctormo🌹🧀

    The min goal is not to fix this in documentation, but to actually fix it in code so no one else has to have the issue.

    (perl lazy)

  17. #17
    tron tron @tron

    I didn't make the extension. that's up to the developer. feel free to report a bug.

  18. #18
    GJenkinsUK GJenkinsUK @GJenkinsUK

    Martin

    I have (I think) raised two new bug reports for 1.0 - one covering the "unwanted line" issue and the other the  "The output from the extension could not be parsed" problem.

    I am happy to test any proposed solutions, but may need some help installing them.

    Massive thanks again to Tron for the answer for 0.92 - I would simply never have had the confidence to dive into the innards of plotter.py and make changes.

  19. #19
    Martin Owens Martin Owens @doctormo🌹🧀

    @tron There isn't a developer and I am the developer. (I'm the current extensions lead for Inkscape). If the code can't be updated, it'll have to be removed from Inkscape in future releases, and installed seperately. (otherwise we'll be hosting known bad code and have no one to look after it)

    @GJenkinsUK Thanks for your help. I think testing will be very useful, there are some files in the tests/data/refs directory (linked above) which claim to represent the known good output for the extension. If you test with these and see errors then you can edit the files directly with corrections and this will force developers (me, it'll force me) to fix it in the ways specificed by the new known good reference file.

  20. #20
    tron tron @tron
    *

    there isn't a developer and you're the developer? extensions lead for inkscape! that's impessive. i thought you were just another user experiencing the same problem. to my knowledge this has been a problem since inkcut was incorporated into inkscape as an extention in 0.92. That's a long time to host bad code. please don't depricate the plotter function. I'm sure GJenkinsUK can fix it for you.

    Thanks for your support. Inkscape is awesome!

  21. #21
    Martin Owens Martin Owens @doctormo🌹🧀

    Sorry yes I mean, the extension itself doesn't have a sponsor/developer who looks after it. It's in the general pool and we try our best to look after it. But some of these extensions are highly specialised and we don't have the hardware or experence to even test them properly. So any help from users (any users) such as yourself and @GJenkinsUK can really turn the process from impossible to support, to keeping it running.

  22. #22
    tron tron @tron
    *

    doesn't the original creator of inkcut support it? without this extension i wouldn't be able to use my cutter so i am very greatful it is part of inkscape. I'm not an expert but i can take a look the tests/data/refs files and add stuff since i use my cutter often. i am by no means a developer though. just okay at solving problems.

    Where can i find tests/data/refs? Also, what is this v1.0 everyone keeps refering to?

  23. #23
    Martin Owens Martin Owens @doctormo🌹🧀

    The inkcut developer is not available. Probably moved on or doesn't have the time to contribute atm.

    So the 1.0 release can be found at https://inkscape.org/releases/?latest=1

    The extensions can be found at https://gitlab.com/inkscape/extensions/find_file/master

    Type hpgl into the search box on that page and it will pull up all hpgl files, the py files is the code for both input and output and the refs files are the test comparisons. I.e what happens when you run the extension. The output ref contains hpgl codes and the input ref contains svg (I.e. what you would get if you opened a hpgl file)

    The reference svg that's used is I think the shapes.svg file, so when changing the expected output, bare in mind the input svg and don't change bits that might be related to shapes in that svg.

    And thank you for any help you might be able to give.

  24. #24
    tron tron @tron

    Hi @doctormo. Sure np. Glad to help if i can. I looked at the plotter.py master and line 107 is different. must be a newer version of the extension. it is to convert hpgl to knk which is a protocol i'm not familiar with. the hgpl to hpgl that i was referring to earlier in this thread is on line 75 now and is the same error that @GJenkinsUK was experiencing. Can i change it!? how does this work? is there somewhere i can document the error and submit the change?

  25. #25
    Martin Owens Martin Owens @doctormo🌹🧀
    *

    Yes, so on GitLab (linked above) you can create an account and then edit the file, it prompts you to create a *branch* which is like your personal local copy of the repository and then you can create a merge request once finished. This instructs me to review your changes, in GitLab I can then comment on specific changes, or approve and merge the changes into the code.

    Let me know if you need any help, I presume you would rather use the website interface than the command line interface (us developers use the command line, but it's pretty much the same workflow)

  26. #26
    tron tron @tron
    *

    Okay. i'll do that shortly. Both me and @GJenkinsUK can confirm it works. I'm sure you'll get some sort of notification.

    How do i use the cli for gitLab? i'm going to look it up.

  27. #27
    GJenkinsUK GJenkinsUK @GJenkinsUK

    Hi @doctormo

    I'm very happy to help test any changes but my knowledge is limited so I will need some help.

    I'm not sure how to install Inkscape 1.0 so I can test it with edited extensions in the same way that I was able to apply Trons edit to Inkscape 0.92.  I have tried installing it both as a snap and as an AppImage, and so have been able to test that the "cutting unwanted extra line" bug is still there - which it is.  However, as far as I can work out neither of these lend themselves to editing (at least by someone with my limited knowledge).  I installed Inkscape again following the instructions here https://inkscape.org/release/inkscape-master/gnulinux/ubuntu/ppa/

    but this has installed version 1.1-dev, which does not appear to have the export/plot extension.

    Are you able to help me installing a copy of Inkscape 1.0 which I can edit?

    Thanks.

  28. #28
    Martin Owens Martin Owens @doctormo🌹🧀
    *

    Thanks @GJenkinsUK The lack of extension does seem like a bug. But we can work around that.

    If you extract the files in this repository to your folder you should have access to the newest code: https://gitlab.com/inkscape/extensions

    Extraction can be done via git, using the command

    git clone https://gitlab.com/inkscape/extensions

    Or gitlab provides a zip file you can use. Although using git will allow you to **pull** down new changes as we fix them.

  29. #29
    Akin1 Akin1 @Akin1

    Hi I had exact same problem cutter would cut a line on return to start position, thanks to tron for his fix it worked a treat.

  30. #30
    GJenkinsUK GJenkinsUK @GJenkinsUK

    It has taken me a long time (because I have not got a clue what I am doing here) but I have now been able to install version 1.0 with extensions.  I can confirm that Tron's edit to plotter.py also works in version 1.0 and removes the unwanted line.  I have mentioned this on GitLab and am now hoping someone will help me with the process of submitting a merge request (which is what I understand I have to do next).

  31. #31
    GJenkinsUK GJenkinsUK @GJenkinsUK

    It turns out that a merge request to make the necessary changes has already been submitted.

  32. #32
    David David @DaveyLC

    Hi, 

    I have the exact same Liyu SC631 plotter, it was always cutting the return to home line with version 0.92 so I've upgraded to 1.0 but now I have a new more serious issue:

    I can cut basic paths but if I try and cut say a PNG that has been traced regardless of how big the image is my plotter runs all the way to the X end stop and then pretty much rolls through a complete roll of vinyl :o 

    What am I doing wrong? :(

     

     

    Thanks for any help!

  33. #33
    GJenkinsUK GJenkinsUK @GJenkinsUK

    Sorry DaveyLC, but I haven't been able to get the release version of 1.0 working yet, so I can't really help until I get that sorted out, which might be some days yet.

    Possibly it might be an idea to start a new thread which describes this new problem?  Otherwise people will only see your post if they are interested in the "cuts on return to origin" problem, which hopefully Tron's solution has now sorted out.

    Sorry I can't help more at the moment and good luck with finding a solution - these things are desperately frustrating.

  34. #34
    David David @DaveyLC

    Thanks, I'll start a new thread.

  35. #35
    Martin Owens Martin Owens @doctormo🌹🧀

    @GJenkinsUK Let me know if you'd like some help with the extension writing. https://chat.inkscape.org/channel/inkscape_extensions

  36. #36
    David David @DaveyLC
    *

    I'm still tearing my hair out over this one (well would be if I had any hair ;) )..  

  37. #37
    GJenkinsUK GJenkinsUK @GJenkinsUK

    David

    I've submitted a longer reply under the other heading - in short though I can't recreate the problem you are having with my Liyu plotter.

    Gareth

  38. #38
    GJenkinsUK GJenkinsUK @GJenkinsUK

    Hi @doctormo

    Thanks for the offer of help with extension writing, but I think at the moment it is going to be beyond me.  I last coded in 1980 (everyone was very proud of their brand new Prime 750 computer), so I although I have now started to learn python I have a long way to go.

    Gareth

  39. #39
    Smithclr Smithclr @Smithclr
    **

    Inkscape is really great at designing, which is what it was created for,  but not so much with cutting.   Any cutter purchased here comes with cutting software,  Your designs in Inkscape can be saved and imported in your cutting software.(You will want to save your files anyway).  You do not state which operating system you plan to use.  PC or Mac?    I only know of 1 person on here who cuts for a hobby with an MH topvinylcutters and Inkscape.  They do not recommend Inkscape for cutting.   We also steer buyers away from the MH vinyl cutter, too many known problems, Any vinyl cutter above it is better. 

  40. #40
    GJenkinsUK GJenkinsUK @GJenkinsUK

    Hi @Smithclr

    The good news is that the problem described in the header of this thread (the plot extension cuts as it returns to origin) has been solved by @tron . In Inkscape 0.92 you need to edit the extension file plotter.py.

    The command on line 107 of plotter.py in Inkscape 0.92 that did not work was:

    self.hpgl = hpglInit + self.hpgl + ';SP0;PU0,0;IN; '

    Tron's fix (which cured the problem for me) involves changing the order to:

    self.hpgl = hpglInit + self.hpgl + ';PU0,0;SP0;IN; '

    As to the issue of using the cutting software supplied with the vinyl cutter there are several reasons why people might not want or be able to go down this route, but for Linux users like myself the one main one is that, as far as I can tell, the bundled cutting software supplied does not run under Linux.  In fact my only reason for using Inkscape is that it provides me with a way of cutting vinyl which will run on my operating system.

  41. #41
    firemonte firemonte @firemonte

    Would love to know how to install inkcut plugin in a windows version of Inkscape

     

  42. #42
    GJenkinsUK GJenkinsUK @GJenkinsUK

    I don't use Windows so cannot give detailed help, but have you tried following the instructions at:

    https://inkscape.org/gallery/=extension/

     

     

     

Inkscape Inkscape.org Inkscape Forum Using Inkscape with Cutters/Plotters Vinyl cutter - when using export/plot extension cuts as it returns to origin