@@ -10,6 +10,7 @@ help() {
10
10
echo " f Path to .kicad_pcb file"
11
11
echo " b Image background. Options: transparent, opaque. Default: transparent for PNG, opaque for JPEG"
12
12
echo " o Directory where the images and optinally the animation should be written to."
13
+ echo " p Set a prefix for the images diffrent from project name"
13
14
echo " a Render animation and select animation output format (mp4 or gif)."
14
15
echo " z Camera zoom default 1"
15
16
echo " v Print protgram version"
@@ -28,11 +29,12 @@ extract_output_path() {
28
29
29
30
background=" transparent"
30
31
31
- while getopts :f:o:a:b:z:hv option
32
+ while getopts :f:o:p: a:b:z:hv option
32
33
do
33
34
case " ${option} " in
34
35
f) kicad_pcb=${OPTARG} ;;
35
36
o) output_path=${OPTARG} ;;
37
+ p) filename_prefix=${OPTARG} ;;
36
38
a) animation=${OPTARG} ;;
37
39
b) background=${OPTARG} ;;
38
40
z) zoom=${OPTARG} ;;
50
52
51
53
if [[ -z " $output_path " ]]; then
52
54
path=$( extract_output_path " $2 " )
53
- name=$( extract_project_name " $2 " )
55
+ extracted_project_name=$( extract_project_name " $2 " )
56
+ name=" ${filename_prefix:- $extracted_project_name } "
54
57
echo " name: $name "
55
58
echo " path: $path "
56
59
output_path=" $path "
@@ -59,9 +62,15 @@ if [[ -z "$output_path" ]]; then
59
62
echo " output_top: $output_top "
60
63
echo " output_bottom: $output_bottom "
61
64
else
62
- output_top=" $output_path /top.png"
63
- output_bottom=" $output_path /bottom.png"
64
- output_animation=" $output_path "
65
+ if [[ -n " $filename_prefix " ]]; then
66
+ output_top=" $output_path /${filename_prefix} _top.png"
67
+ output_bottom=" $output_path /${filename_prefix} _bottom.png"
68
+ output_animation=" $output_path "
69
+ else
70
+ output_top=" $output_path /top.png"
71
+ output_bottom=" $output_path /bottom.png"
72
+ output_animation=" $output_path "
73
+ fi
65
74
fi
66
75
67
76
0 commit comments