Make svg filename configurable
This commit is contained in:
parent
cb81979a7f
commit
23a3b2d12b
1 changed files with 4 additions and 2 deletions
|
|
@ -603,6 +603,7 @@ def print_valid_twists(ctx, param, value):
|
|||
@click.option('--turns', type=int, default=5, help='Number of turns')
|
||||
@click.option('--pcb/--footprint', default=False, help='Generate a KiCad PCB instead of a footprint')
|
||||
@click.option('--outer-diameter', type=float, default=50, help='Outer diameter [mm]')
|
||||
@click.option('--svg-out', type=click.Path(writable=True, dir_okay=False, path_type=Path), help='Filename to output SVG illustration of the coil to')
|
||||
@click.option('--inner-diameter', type=float, default=25, help='Inner diameter [mm]')
|
||||
@click.option('--trace-width', type=float, default=None)
|
||||
@click.option('--via-diameter', type=float, default=0.6)
|
||||
|
|
@ -634,7 +635,7 @@ def generate(outfile, turns, outer_diameter, inner_diameter, via_diameter, via_d
|
|||
footprint_name, layer_pair, twists, clipboard, counter_clockwise, keepout_zone, keepout_margin,
|
||||
arc_tolerance, pcb, mesh_out, magneticalc_out, circle_segments, mesh_split_out, copper_thickness,
|
||||
board_thickness, mesh_mutual_out, mutual_offset_x, mutual_offset_y, mutual_offset_z, mutual_rotation_z,
|
||||
two_layer, close_loop):
|
||||
two_layer, svg_out, close_loop):
|
||||
|
||||
if 'WAYLAND_DISPLAY' in os.environ:
|
||||
copy, paste, cliputil = ['wl-copy'], ['wl-paste'], 'xclip'
|
||||
|
|
@ -942,7 +943,8 @@ def generate(outfile, turns, outer_diameter, inner_diameter, via_diameter, via_d
|
|||
transform=f'rotate(-45 {x} {y})',
|
||||
style=f'font: 1px bold sans-serif; fill: {rainbow[n+1]}'))
|
||||
|
||||
svg_file('/tmp/test.svg', svg_stuff, 100, 100, -50, -50)
|
||||
if svg_out:
|
||||
svg_file(svg_out, svg_stuff, 100, 100, -50, -50)
|
||||
|
||||
if footprint_name:
|
||||
name = footprint_name
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue