Crashing CF with a simple recursion
Posted: Fri Jun 16, 2006 6:06 am
Here is a simple shape:
This works perfectly. However, if I change the recursion in S2 to
the program crashes (on Mac OS X). I know why - the program stops recursing when the shapes grow to small. My second example grows bigger and bigger, thus the size limit is never hit.
Are there some general programming rules for avoiding such mistakes, such as "Never scale up when recursing"?
An even better solution would be to throw a warning or stop rendering when a certain recursion limit is reached. Don't know if this is possible.
Code: Select all
startshape S1
rule S1 {
S2 {}
}
rule S2 {
CIRCLE{}
S2 {x 1.5 s .5}
}
Code: Select all
S2 {x 1.5 s 1.5}
Are there some general programming rules for avoiding such mistakes, such as "Never scale up when recursing"?
An even better solution would be to throw a warning or stop rendering when a certain recursion limit is reached. Don't know if this is possible.