diff options
Diffstat (limited to 'codegen/regen.sh')
| -rwxr-xr-x | codegen/regen.sh | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/codegen/regen.sh b/codegen/regen.sh new file mode 100755 index 0000000..dbf9f6b --- /dev/null +++ b/codegen/regen.sh @@ -0,0 +1,16 @@ +#!/bin/sh +# Regenerate the symbolic projection functions with maxima. +# Run from anywhere; requires maxima (and rustfmt if available). +set -e +cd "$(dirname "$0")" +OUT=../crates/gipfel-core/src/projection/generated + +for p in rectilinear cylindrical; do + maxima -b lsq_${p}.mac | python3 fixup.py > ${OUT}/${p}_funcs.rs +done + +if command -v rustfmt >/dev/null; then + rustfmt ${OUT}/rectilinear_funcs.rs ${OUT}/cylindrical_funcs.rs 2>/dev/null || true +fi +echo "generated:" +wc -l ${OUT}/*_funcs.rs |
