Files
secondo/Algebras/RegionInterpolation2/dia2reg
2026-01-23 17:03:45 +08:00

10 lines
426 B
Bash

#!/bin/bash
# This script can convert the polygons of a dia-file (https://wiki.gnome.org/Apps/Dia) into a
# file suitable to import into Secondo. Dia must be installed for this to work.
for FILE in $@; do
NNAME=${FILE/.dia/}_obj
( echo "(OBJECT r () region ("; dia -t svg -e - $FILE | grep -Eo points=\".*\" | uniq | grep -o [0-9].*[0-9] | sed 's/^\(.*\)$/(((\1)))/' | sed s/\ /\)\(/g | tr , ' '; echo "))" ) > $NNAME
done;