-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathdisplay
executable file
·34 lines (29 loc) · 890 Bytes
/
display
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
#!/usr/bin/env bash
# Get directory of this script
SCRIPT=`realpath -s $0`
BASEDIR=`dirname $SCRIPT`
# Check the processing-java is on PATH
processing_java_path=$(which processing-java)
if [ ! -x "$processing_java_path" ] ; then
echo "ERROR: processing-java not on the PATH"
echo "It can be got from: https://processing.org/download/"
exit 1
fi
# Build sketch as application if it was not built yet
if [ ! -d "$BASEDIR/sketchbook/display/built" ]; then
echo "Wait for compilation ..."
cd $BASEDIR/sketchbook
processing-java --sketch=display --output=./display/built --export
fi
read -r -d '' USAGE <<END
Visualization tool for Voronoi diagram
Usage: display.sh [width] [height]
or
dislay.sh [minX] [minY] [maxX] [maxY]
END
if [ $# -eq 2 -o $# -eq 4 ]; then
"$BASEDIR"/sketchbook/display/built/display "$@"
else
echo "$USAGE"
exit 1
fi