Inelegant Interference Pattern (elegants inquire within)

If you have a design you're proud of, share the cfdg file here. It's also a good place to ask for feedback and collaborate.

Moderators: MtnViewJohn, chris, mtnviewmark

Post Reply
odinsdream
Posts: 12
Joined: Sat Jul 09, 2005 2:18 pm

Inelegant Interference Pattern (elegants inquire within)

Post by odinsdream »

I'm playing around trying to simulate an interference pattern like you get in a wave pool from the interacting ripples. Here's what I've got so far, which is far from elegant:

Code: Select all

startshape SCENE

rule SCENE{
	FAN{}
	FAN{x 40 y 40 r 180}
	FAN{x 40 r 90}
	FAN{y 40 r -90}
}

rule FAN{
	LINE {}
	LINE {r 5}
	LINE {r 10}
	LINE {r 15}
	LINE {r 20}
	LINE {r 25}
	LINE {r 30}
	LINE {r 35}
	LINE {r 40}
	LINE {r 45}
	LINE {r 50}
	LINE {r 55}
	LINE {r 60}
	LINE {r 65}
	LINE {r 70}
	LINE {r 75}
	LINE {r 80}
	LINE {r 85}
	LINE {r 90}
}

rule LINE {
	CIRCLE { s 0.1} 
	CIRCLE { x 1 s 0.2} 
	CIRCLE { x 2 s 0.3} 
	CIRCLE { x 3 s 0.4} 
	CIRCLE { x 4 s 0.5} 
	CIRCLE { x 5 s 0.4} 
	CIRCLE { x 6 s 0.3} 
	CIRCLE { x 7 s 0.2} 
	CIRCLE { x 8 s 0.1} 
	CIRCLE { x 9 s 0.2}
	CIRCLE { x 10 s 0.3} 
	CIRCLE { x 11 s 0.4} 
	CIRCLE { x 12 s 0.5} 
	CIRCLE { x 13 s 0.4} 
	CIRCLE { x 14 s 0.3} 
	CIRCLE { x 15 s 0.2} 
	CIRCLE { x 16 s 0.1} 
	CIRCLE { x 17 s 0.2} 
	CIRCLE { x 18 s 0.3}
	CIRCLE { x 19 s 0.4} 
	CIRCLE { x 20 s 0.5} 
	CIRCLE { x 21 s 0.4} 
	CIRCLE { x 22 s 0.3} 
	CIRCLE { x 23 s 0.2} 
	CIRCLE { x 24 s 0.1} 
	CIRCLE { x 25 s 0.2} 
	CIRCLE { x 26 s 0.3} 
	CIRCLE { x 27 s 0.4}
}
I'd love to see some other approaches to this. For instance, I tried doing the line drawing recursively, but that caused the image to expand to infinity and become too small to be drawn at all. There also must be a more visually-appealing way to draw the waves aside from this chunky method I'm using.

User avatar
lagroue
Posts: 114
Joined: Wed Jul 06, 2005 11:33 pm
Location: Paris, France
Contact:

Post by lagroue »

This gives some interferences, too.

Code: Select all

startshape scene

rule scene {
	B { }
	B { flip 90 r -1.4 }
}

rule B {
	CIRCLE { s 0.7 }
	B { x 1 r 1.15 s 0.99996 }
}

Post Reply