diff options
author | jaseg <git@jaseg.de> | 2022-01-19 13:40:04 +0100 |
---|---|---|
committer | jaseg <git@jaseg.de> | 2022-01-19 13:40:04 +0100 |
commit | 6c924609416b82e6be68680874d86447cffa9fd9 (patch) | |
tree | 9b5803acfb5850a56f1c3f485569867b8df7c019 /gerbonara/gerber/tests/image_support.py | |
parent | 40286fc92fc05ce82cbad4615f497ba389ac9457 (diff) | |
download | gerbonara-6c924609416b82e6be68680874d86447cffa9fd9.tar.gz gerbonara-6c924609416b82e6be68680874d86447cffa9fd9.tar.bz2 gerbonara-6c924609416b82e6be68680874d86447cffa9fd9.zip |
Matcher WIP
Diffstat (limited to 'gerbonara/gerber/tests/image_support.py')
-rw-r--r-- | gerbonara/gerber/tests/image_support.py | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/gerbonara/gerber/tests/image_support.py b/gerbonara/gerber/tests/image_support.py index ba28561..36343d9 100644 --- a/gerbonara/gerber/tests/image_support.py +++ b/gerbonara/gerber/tests/image_support.py @@ -63,6 +63,8 @@ def run_cargo_cmd(cmd, args, **kwargs): def svg_to_png(in_svg, out_png, dpi=100, bg='black'): run_cargo_cmd('resvg', ['--background', bg, '--dpi', str(dpi), in_svg, out_png], check=True, stdout=subprocess.DEVNULL) +to_gerbv_svg_units = lambda val, unit='mm': val*72 if unit == 'inch' else val/25.4*72 + def gerbv_export(in_gbr, out_svg, format='svg', origin=(0, 0), size=(6, 6), fg='#ffffff', bg='#000000'): x, y = origin w, h = size |