summaryrefslogtreecommitdiff
path: root/gerbonara/cam.py
diff options
context:
space:
mode:
authorjaseg <git@jaseg.de>2023-04-04 19:06:04 +0200
committerjaseg <git@jaseg.de>2023-04-10 23:57:15 +0200
commit07b2628dbb08de7120ef3c760cd91f0d8901fe73 (patch)
treeb640afbcf0da447185e72f572e373149f4aff079 /gerbonara/cam.py
parent387ff3de76664e620afebb6dabbccc0424710546 (diff)
downloadgerbonara-07b2628dbb08de7120ef3c760cd91f0d8901fe73.tar.gz
gerbonara-07b2628dbb08de7120ef3c760cd91f0d8901fe73.tar.bz2
gerbonara-07b2628dbb08de7120ef3c760cd91f0d8901fe73.zip
Various convenience improvements, and make board name guessing really smart
Diffstat (limited to 'gerbonara/cam.py')
-rw-r--r--gerbonara/cam.py6
1 files changed, 3 insertions, 3 deletions
diff --git a/gerbonara/cam.py b/gerbonara/cam.py
index 14d4c61..49c2df3 100644
--- a/gerbonara/cam.py
+++ b/gerbonara/cam.py
@@ -247,9 +247,9 @@ class Polyline:
return None
(x0, y0), *rest = self.coords
- d = f'M {x0:.6} {y0:.6} ' + ' '.join(f'L {x:.6} {y:.6}' for x, y in rest)
+ d = f'M {float(x0):.6} {float(y0):.6} ' + ' '.join(f'L {float(x):.6} {float(y):.6}' for x, y in rest)
width = f'{self.width:.6}' if not math.isclose(self.width, 0) else '0.01mm'
- return tag('path', d=d, style=f'fill: none; stroke: {color}; stroke-width: {width:.6}; stroke-linejoin: round; stroke-linecap: round')
+ return tag('path', d=d, style=f'fill: none; stroke: {color}; stroke-width: {float(width):.6}; stroke-linejoin: round; stroke-linecap: round')
class CamFile:
@@ -283,7 +283,7 @@ class CamFile:
content_min_x, content_min_y = float(content_min_x), float(content_min_y)
content_max_x, content_max_y = float(content_max_x), float(content_max_y)
content_w, content_h = content_max_x - content_min_x, content_max_y - content_min_y
- xform = f'translate({content_min_x:.6} {content_min_y+content_h:.6}) scale(1 -1) translate({-content_min_x:.6} {-content_min_y:.6})'
+ xform = f'translate({float(content_min_x):.6} {float(content_min_y+content_h):.6}) scale(1 -1) translate({-float(content_min_x):.6} {-float(content_min_y):.6})'
tags = [tag('g', tags, transform=xform)]
return setup_svg(tags, bounds, margin=margin, arg_unit=arg_unit, svg_unit=svg_unit,