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

Enhancement: Render Project as SVG #357

Open
clemjvdm opened this issue Dec 17, 2024 · 6 comments
Open

Enhancement: Render Project as SVG #357

clemjvdm opened this issue Dec 17, 2024 · 6 comments
Labels
enhancement New feature or request help wanted Extra attention is needed
Milestone

Comments

@clemjvdm
Copy link

Hello, currently I believe a project can only be rendered to a rasterized image. It would be nice to be able to export it as an SVG as well.

@clemjvdm clemjvdm changed the title Render Project as SVG Enhancement: Render Project as SVG Dec 17, 2024
@Argmaster
Copy link
Owner

Thank you for your interest in PyGerber project. I am glad to receive enhancement suggestions. Right now I don't have capacity to implement this feature, I will look into it in the future. It is planned as part of release 3.0.0, but there is no exact timeline for said release. If you want, you can try implementing it yourself, I can provide help and general guidelines if needed. We are always happy to receive pull requests!

@clemjvdm
Copy link
Author

clemjvdm commented Dec 24, 2024

Thanks for your reply. I understand. I'd be happy to try and implement it. Where should I reach out for some guidance? The discussion board?

@Argmaster
Copy link
Owner

We can continue this discussion here, in comments.
In general what you should probably do is to use shapely representation of image to merge multiple images (geometries) into one image. Im not sure if shapely supports concept of z-index, you would need to verify it. After composing shapely geometry into one image you would likely be able to use existing shapely -> svg export implementation or something really similar.

Have a look at implementaiton details for existing svg and raster export code here:

If shapely doesnt provide z-index-like functionality, you could instead reimplement svg export and stack the geometry into one image, but this requires taking into account that different layers can have different size and offsets. Afaik svg should support z-index so at least this part should go smoothly.

To sum up, start by looking into existing svg export code and shapely vm to have general idea how we handle vector geometry and svg export, then have a look into raster exports with pillow to get an idea what we have to account for while exporting multiple images at once. Afterwards try figuring out if you can utilize shapely geometry union to merge geometry or svg format to merge multiple images into one.

@Tommy0295
Copy link

Hello,
I would appreciate this feature also very much.
@clemjvdm did you get it to work or tried it at all?

@clemjvdm
Copy link
Author

clemjvdm commented Jan 9, 2025

I haven't worked on it yet, but I plan to soon. @Tommy0295

@Argmaster Argmaster added enhancement New feature or request help wanted Extra attention is needed labels Jan 25, 2025
@Argmaster Argmaster moved this to Todo in PyGerber Jan 25, 2025
@Argmaster Argmaster added this to the 3.0.0b1 milestone Jan 25, 2025
@Argmaster Argmaster mentioned this issue Jan 29, 2025
47 tasks
@Argmaster
Copy link
Owner

Hi, @clemjvdm, @Tommy0295

Did you have time to work on this? If you couldn't find time to work on it, I would prefer to take it over to try implementing this feature for 3.0.0b1. If you have worked on this, can you please submit a pull request with whatever code you have crafted so we can track progress on that?

I appreciate your good intentions regardless.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request help wanted Extra attention is needed
Projects
Status: Todo
Development

No branches or pull requests

3 participants