gotcha

Author Topic: Inkscape 0.92 wrong dimensions on generated gcode with laser plugin  (Read 41544 times)

January 16, 2017, 04:07:20 AM
Read 41544 times

braga

  • Sr. Newbie

  • Offline
  • **

  • 4
Hi everyone,

I was very excited about the new inkscape 0.92 release but after installing it i realised that i could no longer get correct gcode from the jtechphonics laser plugin in this version. For instance, a 2cmx2cm square in inkscape 0.92 would generate a ~0,5cmx0,5cm square in gcode.  I'm using macOS Sierra by the way.  I still have the inkscape 0.91 version installed wich still works fine using the same plugin. I've gone through settings but i cant seem to find anything that could be causing this issue. Any thoughts?

Thanks in advance.

Best regards,
Braga

January 16, 2017, 02:59:35 PM
Reply #1

brynn

  • Administrator

  • Offline
  • ******

  • 3,942
  • Gender
    Female

    Female
    • Inkscape Community
Welcome to the forum!

Inkscape's native resolution changed from 90 dpi to 96 dpi, in the new stable 0.92.  I wonder if that could be responsible for the problem you're seeing?

For some reason, the Inkscape developers didn't change all the various options where dpi can be set, so users need to change a couple of things.  Although now that I think of it, they should not be affecting what you're doing.  Inkscape Preferences > Bitmaps and change the import and export resolution.  And if you use the Export PNG dialog, you need to change the dpi there as well.

If you open an image that you made with a previous version of Inkscape, you'll get a small dialog, informing about the change, and giving you a couple of options to adjust the image.

And there was a change with 0.91 which affected a lot of extensions, which was something to do with units, that I don't understand.  But if you've been using 0.91 successfully, then either the change didn't affect that extension, or it was already fixed.

It might be that the maker of that extension needs to update it, to work properly with 0.92.  Can you find any contact info from that extension's dialog, or maybe in a readme in the directory or download package?  It sounds like it might be a proprietary extension, which would mean that not just anyone can fix it.

Or maybe they already have put out an update or upgrade?  Have you checked to see if there is a newer version available?
  • Inkscape version 0.92.3
  • Windows 7 Pro, 64-bit
Inkscape Tutorials (and manuals)                      Inkscape Community Gallery                        Inkscape for Cutting Design                     



"Be ashamed to die until you have won some victory for humanity" - Horace Mann                       

January 17, 2017, 01:28:01 PM
Reply #2

braga

  • Sr. Newbie

  • Offline
  • **

  • 4
Tanks for your help brynn,

I've now tried changing the resolution to 90dpi in all places but that didn't work.
I ve also discovered on a youtube video comments that other people had this issue with 0.92 and could only make it work again if they downgraded to 0.91.
Also, i've find out that another plugin (the native gcodetools) is not working properly, for instance when one go Extensions->GcodeTools->Orientation Points, the (0,0) is correctly placed but the (100,0) point is placed in around (350,0). I think all the subsequent problems are related to this.

Do you think it may have something to do with the viewBox (as in "document properties"-> Scale->ViewBox)?

Thanks in advance.

Edited (for the sake of the mighty truth): After further investigation i found out that there was nothing wrong with the native gcode plugin or the orientation points, apparently thats just fine.
« Last Edit: January 20, 2017, 09:27:59 AM by braga, Reason: Information Correction »

January 17, 2017, 06:03:02 PM
Reply #3

brynn

  • Administrator

  • Offline
  • ******

  • 3,942
  • Gender
    Female

    Female
    • Inkscape Community
Quote (selected)
I've now tried changing the resolution to 90dpi

I think that's probably a typo, but since it's so important (for other readers) the dpi for version 0.92, is 96.

I don't have a complete understanding of the viewbox.  The understanding I do have, is that the viewbox tells browsers how much space is needed to display the image.  It may have other consquences that I haven't learned about yet.  But my best understanding at this time, is that it shouldn't be affecting those extensions.

However, the change in resolution could have (as far as I understand).  If I had the proper formula (or could figure out what it should be), I would calculate whether the 6 point change in resolution would cause exactly and precisely that result in the change of orientation points.  But I'm generally somewhat confused about dpi.  But that might be a clue, if you understand enough to do the math.

Are you having this problem with a drawing you made using an older Inkscape version?  Or does this problem affect new drawings?  If it's affecting new drawings, then the problem is nothing to do with the viewbox.  (Because the viewbox is new for 0.92.)

My best idea about this, is that the extensions need to be updated.  I don't know exactly why, if it's because of the change of dpi or something else.  But lately, a lot of extension have needed updating, for one reason or another.

I would suggest...well, a few things, one of which I'd be glad to help.  Ask on either the development or user's IRC channel about this.  Ask on the mailing list.  And if those native gcodetools you mention are the ones made by the Russian guy (or team, I'm not sure), then post in that English thread on the Russian forum about it.  All those extensions contain the address of that thread.

For me, it's frustrating to visit that thread, because it's a single topic, with over 40 pages, the last time I looked.  I don't know why he didn't make a whole board, because that would make it easier for people to search for the info they need.  Maybe didn't realize how popular those extensions would be.  But as a last resort, and if he's the author of those extensions, then I would certainly visit and post.

(I really should try to remember his name, so I don't keep calling him "that Russian guy".  I'll start now.....  Oh yes, it is a team.  See Extensions menu > Gcodetools > About > Help tab.  But the lead developer, and who runs that forum, is Nick Drobchenko.)

The part I could help with, is to post to the mailing list, and convey any response we might get, in case you didn't want to subscribe (I think you have to subscribe to be able to post to it).

BUT, if the extension you mentioned first carries a non-free license, (whether you pay for the extension of not) then it's not going to help for Nick or his team to fix the gcodetools extension.  At the same time you ask Nick and/or the Inkscape developers for help, I would contact the author of that extension as well.  If it carries a free license, then anyone could fix it, and you would need to find someone who is willing to fix it.

Hhhmm....well, not unless that jtechphonics extension actually calls up and uses the Orientation Points extension.  If the part that needs fixing is ONLY in that extension, then yes, getting it fixed should fix the problem.  But I really have no idea how it works.

  • Inkscape version 0.92.3
  • Windows 7 Pro, 64-bit
Inkscape Tutorials (and manuals)                      Inkscape Community Gallery                        Inkscape for Cutting Design                     



"Be ashamed to die until you have won some victory for humanity" - Horace Mann                       

January 17, 2017, 07:34:23 PM
Reply #4

brynn

  • Administrator

  • Offline
  • ******

  • 3,942
  • Gender
    Female

    Female
    • Inkscape Community
You might want to follow this thread on the mailing list:  https://sourceforge.net/p/inkscape/mailman/message/35608925/  (That's the op for that thread.)

It's something to do with units, which as I mentioned, is a reason that some extensions have needed to be fixed.  I only have a vague notion about this.  But if you contact the extensions authors, as I suggested, they might find it interested too.
  • Inkscape version 0.92.3
  • Windows 7 Pro, 64-bit
Inkscape Tutorials (and manuals)                      Inkscape Community Gallery                        Inkscape for Cutting Design                     



"Be ashamed to die until you have won some victory for humanity" - Horace Mann                       

January 18, 2017, 10:48:29 AM
Reply #5

braga

  • Sr. Newbie

  • Offline
  • **

  • 4
Ok ill follow your suggestions and contact Both extensions developers to see if they can help. Because I'm also new to this gcode thing,Ii wanted to make sure that something was going on, and that it was not some obvious thing, before i contacted the developers.

Or does this problem affect new drawings? 
Answering your question, it happens with new drawings. Even a simple square is not translated to correct gcode, then, i do exactly the same thing with the same plugin version but in inkscape 0.91 and it all goes well.

well, not unless that jtechphonics extension actually calls up and uses the Orientation Points extension.

Im not sure if it calls it or not. I've learned python in the past but i don't think im quite up to the task :). Ohhh how i wish had more spare time to learn all these things and solve them myself....

Meantime ill stick to the 0.91 version at least for gcode generation and wait for some feedback from the developers.

Thanks again bryyn for your great support.

January 18, 2017, 01:14:32 PM
Reply #6

brynn

  • Administrator

  • Offline
  • ******

  • 3,942
  • Gender
    Female

    Female
    • Inkscape Community
Oh, you're welcome.  I'll be intereseted to learn what the problem was.  Well, in a general way, since I probably won't understand very much.  But at least it will help when someone else has a similar problem.

Good luck!
  • Inkscape version 0.92.3
  • Windows 7 Pro, 64-bit
Inkscape Tutorials (and manuals)                      Inkscape Community Gallery                        Inkscape for Cutting Design                     



"Be ashamed to die until you have won some victory for humanity" - Horace Mann                       

February 24, 2017, 02:15:21 AM
Reply #7

Shockster

  • Sr. Newbie

  • Offline
  • **

  • 2
Hello peeps, pretty sure I found the problem. It's kinda the opposite of brynn's suggestion regarding dpi... the plugin has hard-coded scale factors to map DPI to inch and mm.

The 0.92 update added support for units and scale in the document properties, and as such they moved a function from the extension context to the global context which converts units (unittouu). Someone had updated the plugin to reflect this new usage, but didn't bother to remove the built-in unit conversion. I tore that stuff out and things started scaling correctly. Diff for gcodetools.py is attached, but for those who don't want to login: in def orientation, remove all references orientation_scale, or just set it to 1 in both instances.

If that doesn't work for inches, set your scale to 25.4 before import.

Pz!

February 24, 2017, 03:26:50 AM
Reply #8

brynn

  • Administrator

  • Offline
  • ******

  • 3,942
  • Gender
    Female

    Female
    • Inkscape Community
Welcome to the forum!

And thanks for the hard work in scouting out the problem!

At the moment, I'm not sure what kind of license those gcodetools extensions carry.  I wonder if it would be possible for someone else to fix it, besides the authors?  Because I'm just thinking that a lot of users will not have the ability (and/or inclination) to attack the code on their own.  So fixing, and providing a working extension would be ideal.

Visitors who aren't logged in should still be able to get the extensions.

Thanks again  :)
  • Inkscape version 0.92.3
  • Windows 7 Pro, 64-bit
Inkscape Tutorials (and manuals)                      Inkscape Community Gallery                        Inkscape for Cutting Design                     



"Be ashamed to die until you have won some victory for humanity" - Horace Mann                       

February 24, 2017, 10:41:32 AM
Reply #9

Shockster

  • Sr. Newbie

  • Offline
  • **

  • 2
Oh you're totally right, they don't need to log in to get attachments. :P

And indeed, I shouldn't expect people to know how to hand-rejigger their python extensions, so I've attached my modified gcodetools.py for 0.92! Put it under your <program files>\Inkscape\share\extensions folder, rename the old gcodetools.py to gcodetools.py.old, and rename gcodetools.py.txt as gcodetools.py! It's under GNU v2 license, so I've also added a comment at the top of the file describing the modification. Standard warnings apply, no warranty, etc.

I can post a pull request (to fix it for all), but I'm not sure to where, since the inkscape and gcodetools Github repos have diverged, and so it's a choice between updating gcodetools to where inkscape is and going through the integration process, or going the lazy route and just updating inkscape's version of gcodetools. In either case, getting the code into people's hands requires another release, which I don't have permission to do.

Cheers!

February 25, 2017, 07:06:08 AM
Reply #10

brynn

  • Administrator

  • Offline
  • ******

  • 3,942
  • Gender
    Female

    Female
    • Inkscape Community
Well, the reason I asked if you know what kind of license the gcodetools have, is because there's a chance you don't have permissison to edit them (well, you could edit and use for yourself, but not provide them for others).

Since they're part of Inkscape, chances are, it's ok.  But I'm not sure if it can be seen as definitely ok.  I'll try to find out some more about it.  Or maybe someone else knows about that?  Or maybe you already know that it's definitely ok?

Inkscape never has had a github repo (although devs are currently considering a move).  If you saw Inkscape on github, it was likely a test (I know someone made a test a few months ago- but it would be outdated by now), or someone's personal repo. 

Ok, this appears to be the gcodetools that belong to Inkscape, so I think you can put the request there, and also ask them to try and make it available to Inkscape asap.  https://github.com/cnc-club/gcodetools  If it turns out not to be the right place, I'm sure they will tell you.  But it looks right to me.  Feel free to include a link to this topic, if they aren't aware of the problem.  We certainly would welcome their advice.

Also, I've added PY and INX both for attachment formats, so you don't have to hide them in text files next time  :)
  • Inkscape version 0.92.3
  • Windows 7 Pro, 64-bit
Inkscape Tutorials (and manuals)                      Inkscape Community Gallery                        Inkscape for Cutting Design                     



"Be ashamed to die until you have won some victory for humanity" - Horace Mann                       

February 25, 2017, 04:54:13 PM
Reply #11

Moini

  • IC Mentor

  • Offline
  • ******

  • 1,568
    • VektorRascheln
I'd do it on github, and then ask in the Inkscape bug reports if they could update the version for 0.92.2 (you'd need to get it in before April).
There's also another issue open, that has been created by an Inkscape bug team member.

That would be the way that would allow the greatest number of people to enjoy the update.

August 08, 2017, 05:39:30 PM
Reply #12

maucor2

  • Newbie

  • Offline
  • *

  • 1

Hello! the way that I found, was to select the second reference point including the arrow(100;00;000...) with shit+ctrl and send it to X:100 and Y:0 on the draw, that solve the problem/

Hola la forma en la que lo logre corregir fue seleccionando segundo punto de referencia y la flechita (el que dice 100:00:00...) y lo arrastre hasta la posición X:100 Y:00 del dibujo y ya esa fue la solución!! Suerte!!

September 06, 2017, 10:00:17 AM
Reply #13

Joemac05

  • Newbie

  • Offline
  • *

  • 1

    ************ FIXED  ***************   :f5:

Thanks a bunch folks mine is fixed. I had upgraded FROM .091 TO .092.2 last week and all seemed fine. That is until I tried cutting with my laser last night. The dimensions were everything but correct. Too small, too large, always wrong. Using the J Tech Photonics plugin. I uninstalled .092.2 and then installed .091 and now all is well again.

I was running in circles until I found this thread, thanks again.   :ty1:

-Joemac05
  • Inkscape version 0.92.2
  • Windows 10

October 20, 2017, 08:41:31 AM
Reply #14

karbonis

  • Sr. Newbie

  • Offline
  • **

  • 2
gcodetools in 92.2 "orientation points" gives me the X-axis position as "5" but it is actually way to the right about 12 inches.

You need to find out what that X coordinate actually is, as indicated by the ARROW point.

What I do then is to draw a rectangle starting ON the point of the arrow and drag down and right.

( Make sure to let it snap with confirmation. )

Then look at the horizontal menu bar at the top and read the X position given for the top-left corner of the rectangle. This is where the tip of the arrow is.

Edit the first orientation point on the right side given by gcodetools "(5)" and change it to the X position number indicated.

Do NOT ungroup those numbers, just use the text tool to change it.

Then try your simulation after running the rest of the ops.
  • 91, 92.2
  • mac, windows 7

October 22, 2017, 04:07:57 AM
Reply #15

brynn

  • Administrator

  • Offline
  • ******

  • 3,942
  • Gender
    Female

    Female
    • Inkscape Community
Welcome to the forum!

I don't have any type of cutting hardware, but I've been trying to keep up with the gcode tools, as much as I'm able (by using simulator), in case I might be able to help others.

When you say the X position is 5, do you mean the orientation point on the right?  And when you say it says 5 but it's really something else.  Where are you seeing the discrepancy?  Is it when you go to cut (or simulate) that it indicates a different position?  Could that software have a different resolution?
  • Inkscape version 0.92.3
  • Windows 7 Pro, 64-bit
Inkscape Tutorials (and manuals)                      Inkscape Community Gallery                        Inkscape for Cutting Design                     



"Be ashamed to die until you have won some victory for humanity" - Horace Mann                       

October 22, 2017, 04:49:49 PM
Reply #16

karbonis

  • Sr. Newbie

  • Offline
  • **

  • 2
Hi brynn!

Yes, it's the group of numbers on the right side. The first number indicates a point on the X axis  and identifies it. It  has always been "5" since I updated inkscape to 92.2.

I realized it was a problem right away because 1)as soon as you look at the orientation points numbers it was obvious that the 5 was incorrect and the  arrow pointed at about 18" according to the rulers, and 2) when I ran through a CAMotics simulation the X axis was scaled down a lot.

The first thing I tried was to select the "orientation points" at the right middle handle and scale the entire group on the X axis only so the arrow was actually pointing at 5" as shown on the rulers.

It's hard to get a good measurement sometimes that way so then I drew a box to create something to measure and create a guide against.
inkscapeGcodeToolsOrientationPointsErrors.PNG
*inkscapeGcodeToolsOrientationPointsErrors.PNG
(21.61 kB . 572x319)
(viewed 10659 times)
  • 91, 92.2
  • mac, windows 7

October 22, 2017, 07:59:39 PM
Reply #17

brynn

  • Administrator

  • Offline
  • ******

  • 3,942
  • Gender
    Female

    Female
    • Inkscape Community
I don't see that.  If I switch both my Display Units (along with the correct Scale setting) (in Document Properties > Page tab) and the units in the Orientation Points dialog to inches, the ruler agrees with the right point.

I suspect you may have your document units and/or scale setting incorrect.  But I have such a shaky understanding about those things, that I hesitate to say for sure.  So someone else will hopefully chime in on that part.

But the part I'm sure of, is that it is possible to have the orientation points and the ruler agree, and not need to perform the steps you're using.  (The steps seem entirely reasonable, for making up the difference.  I'm just not sure if they are necessary.)

Could you either share the SVG file with us, or report what your Display Units (top of Document Properties > Page tab) and Scale (about halfway down the same page) are set for?

Will someone else (who understands the units/scale thing) chime in, please?  Maybe it's not that, but I'm not sure what else it could be.  (Maybe Path Data format?)

Edit
Hhmm, adding a screenshot, I see that they aren't perfectly aggreeing, but it's a lot closer than 18 ".

Edit #2
I'm not sure, but I seem to recall reading a tutorial somewhere, which said that the units should remain as pixel, for some part of the gcodetools workflow.  But I don't remember which part (display units, or units in one of the extension dialog, or what).  I'll try to find that tutorial.
  • Inkscape version 0.92.3
  • Windows 7 Pro, 64-bit
Inkscape Tutorials (and manuals)                      Inkscape Community Gallery                        Inkscape for Cutting Design                     



"Be ashamed to die until you have won some victory for humanity" - Horace Mann                       

October 23, 2017, 05:07:35 AM
Reply #18

Moini

  • IC Mentor

  • Offline
  • ******

  • 1,568
    • VektorRascheln
Yes, please try if it works correctly when you use the px template (File -> New From Template -> default px). I didn't test, or read all the rest here, or even ever have used a cutting machine, but I have a hunch it will work.

October 24, 2017, 02:06:02 PM
Reply #19

brynn

  • Administrator

  • Offline
  • ******

  • 3,942
  • Gender
    Female

    Female
    • Inkscape Community
Thanks, Moini!  At least I was on the right track to suspect the units/scale settings.  But karbonis is using inches.

It looks like there's not a template for that.  Am I correct that he should use that template, and then change Display Units to inches?  (and maybe page size units)
  • Inkscape version 0.92.3
  • Windows 7 Pro, 64-bit
Inkscape Tutorials (and manuals)                      Inkscape Community Gallery                        Inkscape for Cutting Design                     



"Be ashamed to die until you have won some victory for humanity" - Horace Mann                       

December 11, 2017, 09:42:10 PM
Reply #20

MiEquiZ

  • Sr. Newbie

  • Offline
  • **

  • 3
Thank you very much for this discussion and de insights shared. I was suffering the mysterious displacement of orientation points but finally, this is what I did and with it, the drawings are showing right for me and the GCode is coming out with the specified dimensions. I am referring to Inkscape installation of ver. 0.92.2 (x64)

1. In the gcodetools.py file (in: "Inkscape\share\extensions" directory in Windows), at lines 5859 (case of units in mm) & 5863 (case of units in inches)
 
lineHasChange
5859orientation_scale =  3.5433070660 orientation_scale =  1
5863orientation_scale = 90orientation_scale = 25.4

That was it!

Then, I also noticed that the page template should specify the viewbox in mm like this (for a landscape letter size page):

  viewBox="0 0 279.4 215.9"

All that has to be cared for is that the scale should be 1.0 if display units are mm and 25.4 if set to inches.

Notice this on the Document properties. Here is the case of display units set to mm:
page_mm.png
*page_mm.png
(158.06 kB . 582x896)
(viewed 9864 times)


And this is the case of display units set to inches:
page_mm.png
*page_mm.png
(158.06 kB . 582x896)
(viewed 9864 times)






December 12, 2017, 04:13:08 AM
Reply #21

brynn

  • Administrator

  • Offline
  • ******

  • 3,942
  • Gender
    Female

    Female
    • Inkscape Community
I'm not sure about this.  But I think if you set the units for your page size to mm, the Viewbox would show the correct values.  While it's not necessary, it's probably a good idea to use the same units for the page size as you use for the document.

As far as I know the Orientation Points extension is functioning properly.  I would be extremely cautious about editing an extension. 

I can't say this for a fact, but I think you might be using the wrong scale for mm.  Maybe this will help you?  https://inkscape.org/en/learn/faq/#inkscape-092-my-drawings-are-just-quarter-their-original-size-when-i-open-them-program-xyz
  • Inkscape version 0.92.3
  • Windows 7 Pro, 64-bit
Inkscape Tutorials (and manuals)                      Inkscape Community Gallery                        Inkscape for Cutting Design                     



"Be ashamed to die until you have won some victory for humanity" - Horace Mann                       

December 12, 2017, 03:34:17 PM
Reply #22

MiEquiZ

  • Sr. Newbie

  • Offline
  • **

  • 3
Thank you brynn. On Checking, what I am doing is very similar to what Shockster did before in this same thread, but he went on to modify more deeply:

Line in gcodetools.pyAction
5859Delete
5860Delete
5863Delete
5864Delete
5867Delete
5869Replace "si =" with "i ="
5874Replace "% (si[0], -si[1]+doc_height)," with "% (i[0], -i[1]+doc_height),"
5878Replace "% (i[0],i[1],i[2]), (si[0]+10), (-si[1]-10+doc_height)," with "% (i[0],i[1],i[2]), (i[0]+10), (-i[1]-10+doc_height),"

With very much the same result. Just for the record, at least to understand a bit better what is going on, but both worked the same to me. Perhaps it is better to use Schockster fix. In any event, I wish the authors of GCodeTools should have look at this at this point!

Regarding the boxview I didn't mess with the numbers there, I just let Inkscape do the numbers when changing the display units. What happened to me is that I was using New from Template with a letter-sized Page...., and then I noticed the scaling problem because I ended up with huge arrows generated by gcodetools!!!!! Changing the numbers as I stated solved the situation.

December 13, 2017, 11:15:34 PM
Reply #23

brynn

  • Administrator

  • Offline
  • ******

  • 3,942
  • Gender
    Female

    Female
    • Inkscape Community
You're welcome to file a bug report, if you think there is a bug.  Visit https://launchpad.net/inkscape

However, it might take a long time to get any replies.  That's because we have not been able to contact the team which developed the gcode tools extensions, in....I think it's been over a year, maybe 2.  They aren't even answering questions posted in their own forum.  Some other developer still might look at it, but....

I could be wrong, but I'm pretty sure, for mm units, the scale needs to be set for 3.77953.  I suspect that will clear up the problem, without modifying the extension.

(Is that right, Moini?)
  • Inkscape version 0.92.3
  • Windows 7 Pro, 64-bit
Inkscape Tutorials (and manuals)                      Inkscape Community Gallery                        Inkscape for Cutting Design                     



"Be ashamed to die until you have won some victory for humanity" - Horace Mann                       

December 14, 2017, 01:17:39 PM
Reply #24

Moini

  • IC Mentor

  • Offline
  • ******

  • 1,568
    • VektorRascheln
Or just use the px default template, I think that's going to fix it.