diff options
author | jaseg <git@jaseg.de> | 2023-03-30 14:54:46 +0200 |
---|---|---|
committer | jaseg <git@jaseg.de> | 2023-03-30 14:54:46 +0200 |
commit | bc63166a40f522014dfd11e830cce11d6d61be6d (patch) | |
tree | 68cfdb9fc743a07b1d5f3ac7bd5909208b355e0e /gerbolyze/__init__.py | |
parent | 2df63318a272fcf2d1f1f6652c999cc3c415d431 (diff) | |
download | gerbolyze-bc63166a40f522014dfd11e830cce11d6d61be6d.tar.gz gerbolyze-bc63166a40f522014dfd11e830cce11d6d61be6d.tar.bz2 gerbolyze-bc63166a40f522014dfd11e830cce11d6d61be6d.zip |
svg-flatten: Make drill size mapping more precise, add tests
Diffstat (limited to 'gerbolyze/__init__.py')
-rwxr-xr-x | gerbolyze/__init__.py | 24 |
1 files changed, 0 insertions, 24 deletions
diff --git a/gerbolyze/__init__.py b/gerbolyze/__init__.py index e817471..2989169 100755 --- a/gerbolyze/__init__.py +++ b/gerbolyze/__init__.py @@ -335,30 +335,6 @@ def parse_subtract_script(script, default_dilation=0.1, default_script=DEFAULT_S subtract_script[out_layer] = subtract_script.get(out_layer, []) + [(in_layer, dilation)] return subtract_script -# Parameter parsing foo -#====================== - -def parse_bbox(bbox): - if not bbox: - return None - elems = [ int(elem) for elem in re.split('[,/ ]', bbox) ] - if len(elems) not in (2, 4): - raise click.BadParameter( - '--bbox must be either two floating-point values like: w,h or four like: x,y,w,h') - - elems = [ float(e) for e in elems ] - - if len(elems) == 2: - bounds = [0, 0, *elems] - else: - bounds = elems - - # now transform bounds to the format pcb-tools uses. Instead of (x, y, w, h) or even (x1, y1, x2, y2), that - # is ((x1, x2), (y1, y2) - - x, y, w, h = bounds - return ((x, x+w), (y, y+h)) - # Utility foo # =========== |