Shape Union Creates a Line in Luban

I created a path from 2 shapes in Inkscape by using the union operation. When importing the SVG into Luban, everything looks correct. I apply an “on the path” toolpath for the laser and select “Generate G-code and Preview”. This results in a single horizontal line for the toolpath. Sorry for everything being in one picture, but the forums won’t let me embed more than one picture:

I’ve tried to convert both shapes to paths before performing the union operation, but it has the same results. If the shapes are not unioned, they will have the correct toolpath in the preview.

I’m not sure if this is a Luban or Inkscape issue, but since the new path is imported properly into Luban I’m doubting it’s an Inkscape issue. It looks like it’s an issue with union, but I’m not sure why it’s happening. Am I missing something? The only way I’ve gotten around this is to export the path as a picture and then do a bitmap trace, but this is not a perfect representation of the original.

Anyone have any ideas?

What if you transform to a path in inkscape after you union? (Also try deleting the inner shape and bumping up the stroke)

I’ve seen the line you see, I think that’s typically because you have show page border in inkscape.

Nivekmai,

I think what you’re suggesting is “Path” → “Object to Path” or “Path” → “Stroke to Path”, both of which I have tried. Also, once the union is complete, the resulting combination is no longer an object (like a circle or a rectangle in this case) but a path. I’m also assuming that your suggestion to “delete the inner shape and bumping up the stroke” meant for me to remove the fill, activate the stroke, and then increase the stroke width to a higher value. I tried this as well, but it still has the same results

Also, I always have show page border on in Inkscape and never have an issue with that. Just for grins, I tried turning it off and it had no effect. The other noticeable thing is that the length of the line is the length of the path before the toolpath is applied, and the position is the top of the bounding box for the path.

Just to show you that I don’t have issues normally, here are examples of different things:
image

The one on the left is the both objects converted to paths. The middle one is a circle object and a rectangle object. The one on the right is after union. These are the toolpaths for each, not to be confused with when they are first imported. When they are imported, they look exactly like they look in Inkscape.

Thanks for the advice. Hopefully someone can point out what I’m doing wrong.

Yea, you’re right, I can repro 100%, seems that luban is failing to generate toolpaths for complex objects.

But, I also somehow managed to get it to work. I have no idea what I did, but it was something I did in inkscape that eventually made luban able to correctly generate a toolpath:

image

I think my steps were:

  1. Make circle/rect
  2. Union
  3. Stroke to path
  4. Object to path
  5. ???
  6. now it works

One of the things I was noticing was that it was the actual path object that luban was struggling with, and I was playing around deleting parts of the XML properties.

Here’s the path of the object I somehow futzed with to get luban to correctly toolpath:

    <path
       id="path929"
       style="color:#000000;font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-size:medium;line-height:normal;font-family:sans-serif;font-variant-ligatures:normal;font-variant-position:normal;font-variant-caps:normal;font-variant-numeric:normal;font-variant-alternates:normal;font-variant-east-asian:normal;font-feature-settings:normal;font-variation-settings:normal;text-indent:0;text-align:start;text-decoration:none;text-decoration-line:none;text-decoration-style:solid;text-decoration-color:#000000;letter-spacing:normal;word-spacing:normal;text-transform:none;writing-mode:lr-tb;direction:ltr;text-orientation:mixed;dominant-baseline:auto;baseline-shift:baseline;text-anchor:start;white-space:normal;shape-padding:0;shape-margin:0;inline-size:0;clip-rule:nonzero;display:inline;overflow:visible;visibility:visible;opacity:1;isolation:auto;mix-blend-mode:normal;color-interpolation:sRGB;color-interpolation-filters:linearRGB;solid-color:#000000;solid-opacity:1;vector-effect:none;fill:#000000;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:0.264999;stroke-linecap:round;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1;color-rendering:auto;image-rendering:auto;shape-rendering:auto;text-rendering:auto;enable-background:accumulate;stop-color:#000000;stop-opacity:1"
       d="m 157.85599,102.01909 c -10.22603,-0.20305 -19.9627,7.49999 -21.89388,17.58304 -1.77045,8.06205 1.58819,16.90868 8.19756,21.83316 0,11.92555 0,23.85109 0,35.77663 9.13089,0 18.26177,0 27.39265,0 0,-11.92537 0,-23.85074 0,-35.77611 8.01188,-5.87525 10.98191,-17.48874 6.67719,-26.45803 -3.51425,-7.82841 -11.80467,-13.05695 -20.37352,-12.95869 z" />

If you open the SVG in a text editor, you should be able to paste that in and use it in luban, but it’s probably not the exact shape you want.

I’ll try and figure out what I did reproducibly later.

Thanks for looking at it Kevin. I did get a “clean” bitmap trace out of my original design, so I’ve moved on from this. It would be nice if a dev would look into it though.