From 4127a18e8997f0f94ac97ab3e9eec1010fd1e857 Mon Sep 17 00:00:00 2001 From: jaseg Date: Fri, 31 Mar 2023 14:12:45 +0200 Subject: Fix drill layer handling for latest changes in gerbonara --- gerbolyze/__init__.py | 6 +++--- gerbolyze/tests/test_integration.py | 3 ++- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/gerbolyze/__init__.py b/gerbolyze/__init__.py index 2989169..542cded 100755 --- a/gerbolyze/__init__.py +++ b/gerbolyze/__init__.py @@ -204,7 +204,7 @@ def empty_template(output_svg, size, force, copper_layers, no_default_layers, la @click.argument('output_gerbers', type=click.Path(path_type=Path)) @click.option('-n', '--naming-scheme', default='kicad', type=click.Choice(['kicad', 'altium']), help='Naming scheme for gerber output file names.') @click.option('--zip/--no-zip', 'is_zip', default=None, help='zip output files. Default: zip if output path ends with ".zip" or when outputting to stdout.') -@click.option('--separate-drill-file/--composite-drill-file', 'separate_drill', help='Use Altium composite Excellon drill file format (default)') +@click.option('--composite-drill-file/--separate-drill-file', 'composite_drill', help='Use Altium composite Excellon drill file format (default)') @click.option('--dilate', default=0.1, type=float, help='Default dilation for subtraction operations in mm') @click.option('--curve-tolerance', type=float, help='Tolerance for curve flattening in mm') @click.option('--no-subtract', 'no_subtract', flag_value=True, help='Disable subtraction') @@ -216,7 +216,7 @@ def empty_template(output_svg, size, force, copper_layers, no_default_layers, la @click.option('--pattern-complete-tiles-only', is_flag=True, help='passed through to svg-flatten') @click.option('--use-apertures-for-patterns', is_flag=True, help='passed through to svg-flatten') def convert(input_svg, output_gerbers, is_zip, dilate, curve_tolerance, no_subtract, subtract, trace_space, vectorizer, - vectorizer_map, exclude_groups, separate_drill, naming_scheme, + vectorizer_map, exclude_groups, composite_drill, naming_scheme, pattern_complete_tiles_only, use_apertures_for_patterns): ''' Convert SVG file directly to gerbers. @@ -276,7 +276,7 @@ def convert(input_svg, output_gerbers, is_zip, dilate, curve_tolerance, no_subtr dilated = do_dilate(d_layer, amount) layer.merge(dilated, mode='above', keep_settings=True) - if not separate_drill: + if composite_drill: print('Merging drill layers...') stack.merge_drill_layers() diff --git a/gerbolyze/tests/test_integration.py b/gerbolyze/tests/test_integration.py index 5232cb1..f324096 100644 --- a/gerbolyze/tests/test_integration.py +++ b/gerbolyze/tests/test_integration.py @@ -83,5 +83,6 @@ def test_convert_layers(): # Note: svg-flatten rounds these diameters to the geometric tolerance given on the command line (0.01mm by # default). - assert set(stack.drill_layers[0].drill_sizes()) == {0.7, 0.5} + assert stack.drill_pth.drill_sizes() == [0.7] + assert stack.drill_npth.drill_sizes() == [0.5] -- cgit