About drawing empty circles :
First, three ideas on recursion depth limits :MtnViewJohn wrote:This is exactly the class of shapes that would benefit from control of recursion depth. This is a much more interesting use than my original thoughts on hue control.Code: Select all
startshape letter_O rule arc { CIRCLE { } arc { r 1 x .1 y .1 } } rule letter_O { arc {limit =360} }
- they theorically break the context-free paradigm
- they don't break it when they are seen as a rendering engine optimizer (it's useless to draw this empty circle forever, just stop at 360 degrees, this will be enough)
- they totally break it when outside of this optimizing scope, but then they may be seen as a tool for drawing new basic shapes (such as a slice of pie, for example, or a stripped square)
Those make me think too that there is a real interest in implementing such a feature.
Now, assuming target values, aka limit values, described in this topic, will be implemented, maybe we could merge those with this recursion depth requested feature ?
Something like :
Code: Select all
startshape letter_O
rule arc {
CIRCLE { }
arc { r 1 x .1 y .1 }
}
rule letter_O {
# tell arc to break when its rotation will be 360 further
arc { |r 360 break }
}
BUT setting a rotation target "arc { |r 360 }" is still possible.
It wouldn't be useful for "bringing rotation closer to its limit", but it would be to tell "stop iterating when limit is reached".
Now I don't know if previous code should be written as :
Code: Select all
startshape letter_O
rule arc {
CIRCLE { }
# break if target is reached
arc { r 1 break x .1 y .1 }
}
rule letter_O {
arc { |r 360 }
}
Or the 360=0 property of angles (hum... in this circle case, 359 would still do the trick)