Hi, after creating a rectangle in Inkscape, I turn it into a Bitmap and export it as .png
Impotent into Luban 4.3.2 it is shown as on the left.
In Luban - selecting Vector image → adding a cutting process on the path (3mm, 100% default) —> creating the G-Code → Luban doubles each line and the laser is cutting two times (right pic)
Try using a vector file format (SVG or DXF) and see if that helps. Currently what you have is not an actual vector image—PNG is a raster format. Note that Luban has bugs surrounding vector image import that you will have to tolerate or work around.
Or you can try alternative software (Lightburn for laser, Fusion 360 for CNC) to generate your gcode, and avoid Luban’s bizarre and buggy behaviour that way.
Ya, converting a raster image to vector is never going to be ideal. I’m guessing a 2 pixel wide bitmap is converting to a double line to built up width.
Try saving as “Plain SVG” format rather than Inkscape SVG format, or try DXF in inkscape, and make sure to set the Viewport size and Document size correctly. Also worth looking at the Line thickness/width on that path in inkscape.
I also had the “double lines” problem when I created shapes with Inkscape. I searched for a long time and found no solution. In https://ncviewer.com I could at least see the double line in the G-code. But I didn’t have the knowledge and the desire to get to grips with G-Code.
Lightburn was my saviour. Just load your double-lines.svg created with Incscape into Lightburn. Scroll into it and you will see double lines. Ungrouped in Lightburn, one line deleted and chapeau!
If you haven’t discovered @Skreelink 's guide yet, check this out.
This seems to be the best place to add this, though there are other forum entries that are related. Those posts blame double lines on Inkscape, but i followed a post that showed how to remove the double lines coming from Inkscape. Now my SVG files have a single line, but Luban is producing Gcode with two lines. My version of Luban is 4.2.2, which is old, but works (every newer version I have heard of has problems). In Luban, I looked at max zoom at the SVG file imported:
It’s hard to see in the picture above, but the loaded Gcode has double lines. This is causing the laser burns to run twice, a small distance apart, taking twice as long, and messing up some fine details in the finished product. Was this problem ever addressed in Luban, or, as suggested above, should I just trash Luban and go with Lightburn? Thanks…
I would put my bet on that the seemingly single line in Inkscape is a path that surrounds the “line”, and the line in effect is a filled closed path. Luban will follow the path, not the “line”, so basically cutting out the encircled object that represents the line.
What to do? If the line is the result of you vectorizing a bitmap image (which would me my guess, but on that I would not bet money ), play around with the parameters of that tool in Inkscape. If this is a genuine vector image from the beginning (or even if you cannot get better results from vectorization), you can split up the path and delete half of it.
The Inkscape process I use was supposed to remove any second line, which is a problem I had in the past. When I zoom in via a viewer, I can only see one line - doesn’t mean there isn’t two, but I only see one (and before I could see two in the SVG). It is a pretty thick line, however. I tried to change the line width, but the bitmap tool doesn’t seem to pay attention to that, and there doesn’t seem to be a bitmap trace parameter for the line generated. Since I don’t use these programs all that much, I am not at all expert at them. Searching for help on changing the line width produces the usual useless results (I can remember when searching the web meant useful answers).
Found out how to change stroke style, and by making stroke narrower, there is still a double line, I just couldn’t see it. So, having tried trace centerline on trace bitmap, and had it totally screw up my tight corners, I guess I am at a loss for next step. Clearly the process given to remove the double lines in Inkscape doesn’t work. The designs, produced by my son, are way too complicated to manually trace the lines which was one suggestion I saw. Seems to me this all should not be so complicated, which has me questioning the tools/programs I am using.
I’d think you’d be now able to identify the double path. Now go to an “end” of the line and select two adjecent path points (hold shift) - please note, for clarity I switched the form fill to transparent - would recommend to do so anyhow:
As in my example, one may look very distorted - or may not. However, pick the one that is worse than the other - click on it (this will select one segment), then press Ctrl + A –> Select all (of that path):
Hopefully that path is good enough. If it has distortions, you might need to edit it (which is often cumbersome), or find other parameters for vectorizing a bitmap.
I thought I was attaching a file, but it put it inline. I did find a way, albeit time consuming, to be rid of the double lines. Here is what I did.
Import bitmap file (a TIF)
run trace bitmap (no rounded corners, brightness cutoff)
get rid of bitmap (drag off and delete)
select trace results (this will have double lines after setting stroke to .2mm)
run Path > break apart
shift click black chip on palette
click x at left of palette
This results in the double lines, but then, for each set of double lines, select one line, and delete. This results in a bunch of single line shapes. It probably will result in some shapes no longer lining up exactly, but seems to be the best I can do, trying to delete the inner lines in all cases. The file I am converting is basically closed shapes inside other closed shapes.
Since it is so many forms, it would be tedious (but possible) to remove the duplicate ones…
I just tried to find an operation that would merge the pathes, but I have no good idea… If TIFF is not allowed, would bitmap (BMP) work? I’d really like to play with the original raster image…
While tedious, I was able to go though the two files I have to get rid of the inside set of lines. This took a while, and I have asked my son to try generating his art files in vector format, which he is working on. Using Inkscape, I can’t get BMP, but can create PNG, which the upload allowed:
My son was able to generate SVG files with clean single lines, though he didn’t tell me what process he used. I have asked him (via email) and will post his process when I find out what it is. I checked out his test file and Luban only shows one line in the Gcode rendering, so whatever he is doing will save my time of deleting lines and the laser cuts will be twice as fast and cleaner. Thanks for the help.
Is there not a parameter in the conversion to consider any ‘line’ below a certain width as one vector path rather than trying to create a path each side of the thickness?