Graechan: I get the same result as Charlie .. if any adjustment is made to the "Spikes" slider the script goes awol.
The problem is as saulgoode indicated ..ie. the slider is defined with precision=0 (meaning that only the integer part of the value is displayed in the dialog box) but the value passed to the script is a full float value (accurate to about 10 decimal places) representing the
actual position of the slider as set by the user. That float value will never decrement to
precisely zero ..it goes
past zero and just keeps on going negative! (The "(zero? cnt)" condition never retruns true.)
Since the "spikes" value is also used to determine the
spike-angle you also get some very strange angles ..again accurate to about 10 decimal places.
The simplest solution is to insert the line:
(set! spikes (truncate spikes))
at the top of the procedure ..it works fine then.
For good measure you could also change the "(unless (zero? cnt) .." to "(while (> cnt 0) ..)" ..the same as the "iterations" loop later in the script.
Further thoughts and observations:
1.
Graechan wrote:
the reason I have disallowed an odd number of spikes is that Gmic's Linear blur blurs in both directions
You have set step=2 to eliminate odd numbers but it is still possible to enter an odd value by manually dragging the slider ..and yes you do get double the number of spikes expected!
2. You set the initial angle as half the inter-spike angle (eg. if spikes=4 inter-spike angle is 90 degrees and therefore initial angle is 45 degrees). User has no control over angle. Surely the initial angle could be set with an "offset angle" slider (as is done in many other scripts and plug-ins) so that the user can decide.
3. a minor typo in the "soft" filter registration:
SF-ADJUSTMENT "Spokes" '(4 1 10 1 1 0 0)
Methinks it should read "Spikes" (although I suppose "spokes" is actually a close synonym in this case!)