Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

IMPORTED SVGs BORDERS ON DESIGN PAGE #2342

Open
HomebuiltCNC opened this issue Oct 17, 2023 · 3 comments
Open

IMPORTED SVGs BORDERS ON DESIGN PAGE #2342

HomebuiltCNC opened this issue Oct 17, 2023 · 3 comments
Labels

Comments

@HomebuiltCNC
Copy link

Version

2.0.21

Hardware / Firmware

GRBL 1.1

What happened

I imported an SVG file onto the design sheet and its aspect ratio was changed. I then set its width to the original 165mm width. The frame around the shape is 165mm but the shape itself is not 165mm wide. The The SVG has no border and no hidden/floating elements. I tried importing a different SVG (heart shape) and got the same result, however importing a circle or square had no problems. This is the screen shot showing the issue:

Screen Shot 2023-10-17 at 9 00 08 pm

The SVG data is shown in this screen shot:
Screen Shot 2023-10-17 at 8 58 41 pm

How to reproduce

Import the attached SVG file onto the design sheet and the aspect ratio should be changed from the original 165 in the x direction and 145.115 in the y direction. Putting the left bottom corner onto (0,0) shows the white space on either side of the heart shape.

heart vector by me drawing05

Operating System

MAC OS Catalina Version 10.15.07

Anything else

Every time the file is imported.

@breiler
Copy link
Collaborator

breiler commented Oct 18, 2023

Thanks for the report. I did a quick test and there is obviously something wrong when importing SVG:s. This will require some time to investigate...

@breiler breiler added the bug label Oct 18, 2023
@HomebuiltCNC
Copy link
Author

I have discovered that I can resolve my own issue by making sure that, in the SVG, I have a node at the left, right , top and bottom extremes of the path. These then ensure the SVG is brought into the editor with the correct sizes.
It appears UGS may look only at the coordinates provided within the SVG's bezier curve path and does not calculate the correct relevant left, right, top or bottom extremes?
I have now also found that UGS won't import SVG rectangles with rounded corners.
I'm getting interested in possibly helping out here. Is there something I should/could do?

@breiler
Copy link
Collaborator

breiler commented Oct 27, 2023

I did some poking around and couldn't find anything obvious in the code. It may be the library we are using for importing or it may be something with my code converting to the internal model. It is tricky to debug and right now I have some more urgent issues to work with.

I have now also found that UGS won't import SVG rectangles with rounded corners.
I'm getting interested in possibly helping out here. Is there something I should/could do?

You are very welcome to try, it would be a nice addition!
To speed up development you can use the DesignerMain to start the designer tool.

You might be able to add some properties for the rounded corners here to the rectangle shape:
Rectangle.java.

The parsing of the rectangle is done here SvgReader.java

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants