Hi,
If you download the attached pto and run :
cpclean --max-distance "2" -o "./out.pto" "./in.pto"
it revomes 0 control point, even though the max distance is 2.01
I assume cpclean rounds the values and considers 2.01 good enough ?
Problem is because of that, my bash script sometimes works fine and other times loops indefinitely. Here's why :
In my script, the user gives a distance threshold. As long as the pto's maximum control point distance is above that threshold, the script will run several commands including cpclean, in a while loop. More precisely :
while [[ $maxdist > $tolerance ]] ; do cpclean --max-distance $tolerance1 -o "$pto" "$pto"
autooptimiser -n -o "$pto" "$pto"
maxdist=`checkpto "$pto" | grep Maximum | awk -F ": " '{print $2}'` done
So if the user gives 2 as the threshold for the attached pto file, my script will never get out of the while loop.
Did I make a wrong assumption about cpclean?
How would you go about this?