Yin Yang

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
User avatar
Shinji
Posts: 3
Joined: Mon Dec 01, 2008 2:05 pm
Location: Czech Republic
Contact:

Yin Yang

Post by Shinji »

Hi, I'm new here but I also have some skills in Context Free from before.

I thought if there is a way to draw my favorite Yin Yang symbol, because I've not seen it in the gallery (maybe my fault :} ).

I have discovered one variant and I wanna know if there are some different variants of doing it :}

If you'll post some answers, I'll post the code :D


Image
Someone

User avatar
MtnViewJohn
Site Admin
Posts: 882
Joined: Fri May 06, 2005 2:26 pm
Location: Mountain View, California
Contact:

Post by MtnViewJohn »

Here are two ways that come to mind:

Code: Select all

startshape yinyang

background {b -0.5}

rule yinyang {
	100 * {r -1.8} {
		CIRCLE {x 0.5}
		CIRCLE {x -0.5 b 1}
	}
	CIRCLE {x 0.5 s 0.25}
	CIRCLE {x -0.5 s 0.25 b 1}
}

path yinoryang {
	ARCTO {x -1 r 0.5}
	ARCTO {x 1 r 1 p cw}
	ARCTO {r 0.5 p cw}
	CLOSEPOLY{}
	FILL{}
}

rule yinyang2 {
	yinoryang{b 1}
	yinoryang{r 180}
	CIRCLE {x 0.5 s 0.25}
	CIRCLE {x -0.5 s 0.25 b 1}
}

User avatar
Shinji
Posts: 3
Joined: Mon Dec 01, 2008 2:05 pm
Location: Czech Republic
Contact:

Post by Shinji »

Thanks John, I did it the same way as your first, through the rotation of two circles.

The second way is very interesting too, I've realized Context Free is on It's way since I used it last. I need to study new functions for sure :}

I wish a great New year for all of the Context Free crew :}
Someone

User avatar
Guigui
Posts: 50
Joined: Sat Aug 05, 2006 5:28 pm
Location: Annecy, France

Post by Guigui »

There is another way found by Seyen in 2007: the Taijitu.

Smart way too, hu?

It can be simplified like that:

Code: Select all

startshape Taijitu
background {b -.5}

rule Taijitu{
	360*{r .5}{
		CIRCLE{y -.5}
		CIRCLE{y -.5 s .2 b 1}
		CIRCLE{y .5 flip 90 b 1}
		CIRCLE{y .5 s .2}}
}
8^)

User avatar
Shinji
Posts: 3
Joined: Mon Dec 01, 2008 2:05 pm
Location: Czech Republic
Contact:

Post by Shinji »

Guigui wrote:There is another way found by Seyen in 2007: the Taijitu.

Smart way too, hu?

It can be simplified like that:

Code: Select all

startshape Taijitu
background {b -.5}

rule Taijitu{
	360*{r .5}{
		CIRCLE{y -.5}
		CIRCLE{y -.5 s .2 b 1}
		CIRCLE{y .5 flip 90 b 1}
		CIRCLE{y .5 s .2}}
}
The same way, but thanks too.
Someone

User avatar
Guigui
Posts: 50
Joined: Sat Aug 05, 2006 5:28 pm
Location: Annecy, France

Post by Guigui »

oh you're right :oops:
8^)

Post Reply