startshape TRIPLES

rule TRIPLES {
	LINES { r 0 }
	LINES { r 120 }
	LINES { r -120 }
}	

rule LINES {
	UTRIANGLE { y 0.5 }
	LINES { r 20 b 0.15 y 0.75 x -0.4330125  s 0.754877 }
	LINER { r -60 b 0.15 y 0.75 x 0.4330125  s 0.754877 }
 }
rule LINER { LINER15 { } }
rule LINER { LINER12 { } }
rule LINER { LINER9 { } }
rule LINER { LINER6 { } }
rule LINER15 {
	UTRIANGLE { y 0.5 }
	LINER { r -15 b 0.02
		y 0.75 x 0.4330125  s 0.754877 }
 }
rule LINER12 {
	UTRIANGLE { y 0.5 }
	LINER { r -12 b 0.02
		y 0.75 x 0.4330125  s 0.754877 }
 }
rule LINER9 {
	UTRIANGLE { y 0.5 }
	LINER { r -9 b 0.02
		y 0.75 x 0.4330125  s 0.754877 }
 }
rule LINER6 {
	UTRIANGLE { y 0.5 }
	LINER { r -6 b 0.02
		y 0.75 x 0.4330125  s 0.754877 }
 }

// 0.754877 is the solution to
// x^2 + x^3 = 1
// this allows double backed
// triangles to exactly line up!


rule TESTU {
	TESTU_background { }
	UTRIANGLE { }
	UTRIANGLE { y 0.5 x -0.866025 b 0.5 r 60 }
	UTRIANGLE { y 0.5 x +0.866025 b 0.5 r 60 }
}
rule TESTU_background {
	CIRCLE {  b 0.5 }
	CIRCLE  { y -1 }
	CIRCLE { y -0.5 x -0.866025 }
	CIRCLE { y -0.5 x 0.866025 }
	CIRCLE { y 0.5 x -0.866025 }
	CIRCLE { y 0.5 x 0.866025 }
	CIRCLE  { y 1 }
}

rule UTRIANGLE {
	TRIANGLE { r 42.5 s 0.525 }
}
rule TRIANGLE{ 
	ARM { r 0 }
	ARM { r 120 }
	ARM { r -120 }
} 

rule ARM {
	CIRCLE { }
	ARM { y 0.1 s 0.9 r 2 }
}
