startshape serpinski
rule serpinski{
//the sides of the triangle
line { r 0 y -0.288}
line { r 120 y 0.144 x .25}
line { r 240 y 0.144 x -.25 }
//fill in the corners to make it look neat
CIRCLE { s 0.015625 y 0.576 }
CIRCLE { s 0.015625 y -0.288 x .5 }
CIRCLE { s 0.015625 y -0.288 x -.5 }
serpinski{ y .288 size .5}
serpinski{ y -0.144 x .25 size .5}
serpinski{ y -0.144 x -.25 size .5}
}
rule line {
line64 {}
}
rule line2 {
SQUARE { x -.25 size .5 }
SQUARE { x .25 size .5 }
}
rule line4 {
line2 { x -.25 size .5 }
line2 { x .25 size .5 }
}
rule line8 {
line4 { x -.25 size .5 }
line4 { x .25 size .5 }
}
rule line16 {
line8 { x -.25 size .5 }
line8 { x .25 size .5 }
}
rule line32 {
line16 { x -.25 size .5 }
line16 { x .25 size .5 }
}
rule line64 {
line32 { x -.25 size .5 }
line32 { x .25 size .5 }
}
I love that serpinski. Check out how abstract it gets if you put a 10 degree rotation in the recursion... I would say that more than anything I've seen in CFDG, it looks like a hand-drawn piece:
startshape serpinski
rule serpinski{
//the sides of the triangle
line { r 0 y -0.288}
line { r 120 y 0.144 x .25}
line { r 240 y 0.144 x -.25 }
//fill in the corners to make it look neat
CIRCLE { s 0.015625 y 0.576 }
CIRCLE { s 0.015625 y -0.288 x .5 }
CIRCLE { s 0.015625 y -0.288 x -.5 }
serpinski{ y .288 size .5 rotate 10}
serpinski{ y -0.144 x .25 size .5 rotate -10}
serpinski{ y -0.144 x -.25 size .5 rotate 10}
}
rule line {
line64 {}
}
rule line2 {
SQUARE { x -.25 size .5 }
SQUARE { x .25 size .5 }
}
rule line4 {
line2 { x -.25 size .5 }
line2 { x .25 size .5 }
}
rule line8 {
line4 { x -.25 size .5 }
line4 { x .25 size .5 }
}
rule line16 {
line8 { x -.25 size .5 }
line8 { x .25 size .5 }
}
rule line32 {
line16 { x -.25 size .5 }
line16 { x .25 size .5 }
}
rule line64 {
line32 { x -.25 size .5 }
line32 { x .25 size .5 }
}
startshape serpinski
rule serpinski{
//the sides of the triangle
line { r 0 y -0.288}
line { r 120 y 0.144 x .25}
line { r 240 y 0.144 x -.25 }
//fill in the corners to make it look neat
CIRCLE { s 0.015625 y 0.576 }
CIRCLE { s 0.015625 y -0.288 x .5 }
CIRCLE { s 0.015625 y -0.288 x -.5 }
serpinski{ y .288 size .5 rotate 10}
serpinski{ y -0.144 x .25 size .5 rotate -10}
serpinski{ y -0.144 x -.25 size .5 rotate 10}
}
rule line {
line { r 1 }
}
rule line {
line { r -1 }
}
rule line 0.1{
line64 {}
}
rule line2 {
SQUARE { x -.25 size .5 }
SQUARE { x .25 size .5 }
}
rule line4 {
line2 { x -.25 size .5 }
line2 { x .25 size .5 }
}
rule line8 {
line4 { x -.25 size .5 }
line4 { x .25 size .5 }
}
rule line16 {
line8 { x -.25 size .5 }
line8 { x .25 size .5 }
}
rule line32 {
line16 { x -.25 size .5 }
line16 { x .25 size .5 }
}
rule line64 {
line32 { x -.25 size .5 }
line32 { x .25 size .5 }
}
chris wrote:
Hope my playing with your code isn't too interfering. I just like to play with the CFDG's I really like.
Oh, please do play. It seems to me that playing with other peroples CFDG's is what this forum is/should be all about. That's how I managed to figure the damn thing out in the first place, anyway
That random rotation trick I discovered while making the dance_party.cfdg (it's on this board)... On that one I actually had an object that was a pivot point with a segment attached, with a pivot on the end of that, with another segment attached. It allowed random limbs. It was a pleasing discovery.
You can do something similar for random translations: just have rules for adding or subtracting small values to x and y, with small probability of termination.