9
9
echo " b Image background. Options: transparent, opaque. Default: transparent for PNG, opaque for JPEG"
10
10
echo " o Directory where the images and optinally the animation should be written to."
11
11
echo " a Render animation and select animation output format (mp4 or gif)."
12
+ echo " z Camera zoom default 1"
12
13
echo " v Print protgram version"
13
14
echo " h Print this Help."
14
15
echo
@@ -25,13 +26,14 @@ extract_output_path() {
25
26
26
27
background=" transparent"
27
28
28
- while getopts :f:o:a:b:hv option
29
+ while getopts :f:o:a:b:z: hv option
29
30
do
30
31
case " ${option} " in
31
32
f) kicad_pcb=${OPTARG} ;;
32
33
o) output_path=${OPTARG} ;;
33
34
a) animation=${OPTARG} ;;
34
35
b) background=${OPTARG} ;;
36
+ z) zoom=${OPTARG} ;;
35
37
h) help ;;
36
38
v) echo " IMAGE version: ${VERSION:- none} " && exit ;;
37
39
\? )
@@ -67,14 +69,20 @@ echo "$output_path"
67
69
68
70
mkdir -p " $output_path "
69
71
72
+ KICAD_CLI_OPTIONAL_ARGS=" "
73
+
74
+ if [[ -n " $zoom " ]]; then
75
+ KICAD_CLI_OPTIONAL_ARGS=" $KICAD_CLI_OPTIONAL_ARGS --zoom $zoom "
76
+ fi
77
+
70
78
echo " rendering top"
71
- $KICAD_CLI pcb render --side top --background $background -o " $output_top " " $kicad_pcb "
79
+ $KICAD_CLI pcb render --side top --background $background -o " $output_top " " $kicad_pcb " $KICAD_CLI_OPTIONAL_ARGS
72
80
echo " rendering bottom"
73
- $KICAD_CLI pcb render --side bottom --background $background -o " $output_bottom " " $kicad_pcb "
81
+ $KICAD_CLI pcb render --side bottom --background $background -o " $output_bottom " " $kicad_pcb " $KICAD_CLI_OPTIONAL_ARGS
74
82
75
83
if [[ -n " $animation " ]]; then
76
84
echo " rendering animation"
77
85
kicad_animation.sh $animation " $kicad_pcb " " $output_animation "
78
86
fi
79
87
80
- ls " $output_path "
88
+ ls " $output_path "
0 commit comments