summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rwxr-xr-xmakelabel.sh14
-rwxr-xr-xtestfont.sh6
-rwxr-xr-xtools/offsetshape.sh5
-rwxr-xr-xtwirl.sh2
4 files changed, 24 insertions, 3 deletions
diff --git a/makelabel.sh b/makelabel.sh
new file mode 100755
index 0000000..123f3a4
--- /dev/null
+++ b/makelabel.sh
@@ -0,0 +1,14 @@
+#!/bin/bash
+target="$1"
+xoffset=$2
+yoffset=$3
+zoffset=$4
+while read -N 1 c;do
+ name="$(printf "%02x" "'$c")"
+ if [ "$name" = "0a" ]; then
+ xoffset=-6
+ yoffset="$(printf '%d - %d\n' $yoffset 10 | bc)"
+ fi
+ grep "^$name " font/font.hackvr | sed 's ^'"$name"' '"$target"' ' | ./tools/offsetshape.sh "$xoffset" "$yoffset" "$zoffset"
+ xoffset="$(printf '%d + %d\n' $xoffset 6 | bc)"
+done
diff --git a/testfont.sh b/testfont.sh
index 5abd182..d6785a8 100755
--- a/testfont.sh
+++ b/testfont.sh
@@ -1,13 +1,13 @@
#!/bin/bash
xoffset=0
yoffset=0
-while read -N 1 c;do
+while read -rN 1 c;do
name="$(printf "%02x" "'$c")"
if [ "$name" = "0a" ]; then
xoffset=-6
- yoffset="$(printf '%d - %d\n' $yoffset 10 | bc)"
+ yoffset="$(printf '%d - %d\n' $yoffset 9 | bc)"
fi
grep "^$name " font/font.hackvr | sed 's/^'"$name"'/'"${name}_${xoffset}_${yoffset}"'/g'
printf "%s_%s_%s move %d %d 0\n" "$name" "$xoffset" "$yoffset" "$xoffset" "$yoffset"
- xoffset="$(printf '%d + %d\n' $xoffset 6 | bc)"
+ xoffset="$(printf '%d + %d\n' $xoffset 5 | bc)"
done
diff --git a/tools/offsetshape.sh b/tools/offsetshape.sh
new file mode 100755
index 0000000..a6bb595
--- /dev/null
+++ b/tools/offsetshape.sh
@@ -0,0 +1,5 @@
+#!/bin/sh
+#objectname addshape points_in_shape
+echo offsetshape: $1 $2 $3
+awk '{ for(i=4;i<=(3+($3*3));i+=3){$i+='"$1"';$(i+1)+='"$2"';$(i+2)+='"$3"';} print $0;}'
+
diff --git a/twirl.sh b/twirl.sh
new file mode 100755
index 0000000..4ff5205
--- /dev/null
+++ b/twirl.sh
@@ -0,0 +1,2 @@
+#!/bin/bash
+cat <(cat meshes/female_basemesh1_2.hackvr) <(./makerotate.sh woman | ./src/slowcat 10000) | ./hackvr $USER