i have some c++ programmed filters on a machine i cannot access right now.
however, some (improvised and untested) examples are quite simple:
| Code: |
removeNs.sh:
#!/bin/bash
cat $1|sed 's/N[0-9]* //g'
A very simple mirrored rotate actually just exchanges X and Y coordinates.
exchangeXY.sh
#!/bin/bash
cat $1 |sed 's/X/§/g' |sed 's/Y/X/g' |sed 's/§/Y/g'
rotateCCW.sh:
#!/bin/bash
cat $1 |sed 's/X/§/g' |sed 's/Y\([ ]*\)\([-0-9\.]*\)/X[-1*[\2]]/g' |sed 's/§/Y/g
flipX.sh:
#!/bin/bash
cat $1 |sed 's/X\([ ]*\)\([-0-9\.]*\)/X[-1*[\2]]/g'
flipY.sh:
#!/bin/bash
cat $1 |sed 's/Y\([ ]*\)\([-0-9\.]*\)/Y[-1*[\2]]/g'
|
ok this last is a bit more complex
| Code: |
parameterizeZ.sh:
#!/bin/bash
###edit this list to your usual z values
###ZLIST="2.0 -5.0 0.1"
ZLIST="2.0 -5.0 0.1"
#####
ori=`cat $1|tr '\n' '§'`
number=500
cur="$ori"
count=0
for i in $ZLIST;
do
echo "#$[$number+$count] = $i; Z originally $i "
count=$[$count+1]
done
count=0
for i in $ZLIST;
do
t=`echo $i |sed 's/\./\\\./g' |sed 's/\-/\\\-/g'`
sedstring="s/Z[ ]*$t/Z #$[$number+$count]/g"
#echo "TT=$t sed: $sedstring"
new=`echo $cur |sed -e "$sedstring"`
cur=$new
count=$[$count+1]
done
echo $cur |tr '§' '\n'
|
Please remember, this were done created in the last 4 minutes, and have not been tested with e.g. circle moves
trivial: of course they should be executeable: chmod +x whatever.sh
---
at the remote machine I have a "centergcode" which takes the algebraic average of all (X,Y) vectors and shift the position X0Y0 to this average.
maybe i will try to improve my python by doing some filters with them.
And one that replaces relative moves by absolute ones.