Skip to content
Discussion options

You must be logged in to vote

So, first of all I would recommend using PyGerber 3.0.0a4 which is not exactly stable but has much nicer API.
Second of all, I don't think it has to be that complicated, you could just render the outline and get size of image rendered from rendering result:

from pygerber.gerber.api import GerberFile
from pathlib import Path

path_to_my_gerber_file = Path().cwd() / "example.grb"

gerber_file = GerberFile.from_file(path_to_my_gerber_file)

image = gerber_file.render_with_pillow()
space = image.get_image_space()
print(space.width_mm, space.height_mm)

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@nabelekt
Comment options

Answer selected by nabelekt
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants