VisiCut icon indicating copy to clipboard operation
VisiCut copied to clipboard

Visicut doesn't align layers from svg correctly

Open Roycinger opened this issue 1 year ago • 7 comments

Hi, I was preparing a drawing in Inkscape like this: image After importing in Visicut, the 2 layers (outline and text) are distorted / misplaced: image

Is there anything I'm missing? This should be 2 jobs for engraving and cutting

edit: Yes, I'm using the Inkscape extension to open it in Visicut

Roycinger avatar Sep 11 '24 16:09 Roycinger

could you upload the SVG, so we can investigate?

t-oster avatar Sep 13 '24 06:09 t-oster

could you upload the SVG, so we can investigate?

Sorry for getting back late, I missed the email notification. I think I trashed the initial file from the screenshot but I still got another similar file with quite the same issue. I'll append it to this post 177mm Thanks for having a look!

Roycinger avatar Oct 05 '24 09:10 Roycinger

@Roycinger this file works as expected on my machine (R) screenshot-0 screenshot

t-oster avatar Oct 05 '24 21:10 t-oster

Looks like this for me: image In your first screenshot, there's a small portion of the text as well right on the top

Roycinger avatar Oct 05 '24 23:10 Roycinger

You are right. The XML Structure is: screenshot-1

and visicut seems to interpret the text-nodes correctly and the tspan nodes in the text as additional text on the wrong position. I will investigate further.

t-oster avatar Oct 06 '24 11:10 t-oster

until then it will help if you convert the text to objects in inkscape (which should be done by the visicut inkscape plugin imho)

t-oster avatar Oct 06 '24 11:10 t-oster

If we just ignore tspan element, this particular file works. However since tspan elements can have their own attributes (https://developer.mozilla.org/en-US/docs/Web/SVG/Element/tspan) we should handle them correctly. We probably should treat the text-node the same as a group node (aka ignore the node itself, only use the attributes in the hierarchy) but we have to wrap all text in text nodes without tspans in some artifical tspan object.

Maybe we should collect a few test files for this, before start implementing.

t-oster avatar Oct 06 '24 11:10 t-oster