Simplified test script, fixed readme
This commit is contained in:
58
src/test.sh
58
src/test.sh
@ -24,7 +24,7 @@ config_file=conf/conf.json
|
||||
|
||||
# name of preset in conf. file
|
||||
#presets=("strong" "test-weak" "test-repeat" "test-strong")
|
||||
presets=("ridge" "weak")
|
||||
presets=("ridge")
|
||||
|
||||
# generate stl files and set generation mode {"planar", "curved", "mapped"}
|
||||
generate_stl=true
|
||||
@ -43,46 +43,36 @@ apply_filter() {
|
||||
for in in ${file_arr[@]}
|
||||
do
|
||||
# check that the file exists
|
||||
if test -f "$in"
|
||||
then
|
||||
# append preset name to filename for easier identification, if not generating stl (that would result in very long names)
|
||||
if $generate_stl; then
|
||||
out="${in%%${match1}*}${match1}$format"
|
||||
else
|
||||
out="${in%%${match1}*}_$preset${match1}$format"
|
||||
fi
|
||||
[[ -f "$in" ]] || continue
|
||||
|
||||
# skip stl files and files with preset name in them
|
||||
if [[ $in == *".stl"* ]] || [[ $in == *_* ]]; then
|
||||
((j++))
|
||||
continue
|
||||
fi
|
||||
# skip stl files and files with preset name in them
|
||||
[[ "$in" == *_* ]] && continue
|
||||
[[ "$in" == *".stl" ]] && continue
|
||||
|
||||
((i++))
|
||||
echo -e "|\n|----------------------- File no. $i: $in ------------------------------|\n"
|
||||
((i++))
|
||||
echo -e "|\n|----------------------- File no. $i: $in ------------------------------|\n"
|
||||
|
||||
if $generate_stl; then
|
||||
((i++))
|
||||
if [[ "$generate_stl_mode" = "planar" ]]; then
|
||||
if $generate_stl; then
|
||||
out="${in%%${match1}*}${match1}$format"
|
||||
case "$generate_stl_mode" in
|
||||
"planar")
|
||||
python3 $exec_path $in $out $dpi -c $config_file $1 --stl p $height_line $height_base || break
|
||||
|
||||
elif [[ "$generate_stl" = "curved" ]]; then
|
||||
;;
|
||||
"curved")
|
||||
python3 $exec_path $in $out $dpi -c $config_file $1 --stl c $height_line $height_base $curv_x $curv_y || break
|
||||
|
||||
elif [[ "$generate_stl" = "mapped" ]]; then
|
||||
pass
|
||||
;;
|
||||
"mapped")
|
||||
python3 $exec_path $in $out $dpi -c $config_file $1 --stl m $height_line $height_base $fp_file|| break
|
||||
else
|
||||
;;
|
||||
*)
|
||||
echo "Invalid stl generation mode"
|
||||
break
|
||||
fi
|
||||
else
|
||||
python3 $exec_path $in $out $dpi -c $config_file $1 || break
|
||||
fi
|
||||
else
|
||||
echo "File $file does not exist"
|
||||
fi
|
||||
|
||||
exit 1
|
||||
;;
|
||||
esac
|
||||
else
|
||||
out="${in%%${match1}*}_$preset${match1}$format"
|
||||
python3 $exec_path $in $out $dpi -c $config_file $1 || break
|
||||
fi
|
||||
done
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user