From: Lulu
+ + +// Rivers, Roads and Rails / Contact +// 2014-01-23 V1 +// by Stratum 0 +// License: WTF + +$fn=20; +Kante=100; +Hoehe=4; +Kerbe=2; +RadiusA=Kante/4; +RadiusB=Kante*2/4; +RadiusC=Kante*3/4; +Strichdicke=8; +Kachelnummer=5; + +if (Kachelnummer==1) +{ + difference() + { + CreateTile("white"); + translate ([Kante/2,Kante/2,0]) CreateArch(RadiusA,"red"); + translate ([Kante/2,Kante/2,0]) CreateArch(RadiusB,"black"); + translate ([Kante/2,Kante/2,0]) CreateArch(RadiusC,"blue"); + } +}; + + +if (Kachelnummer==2) +{ + difference() + { + CreateTile("white"); + translate ([-Kante/2,Kante/2,0]) CreateArch(RadiusA,"red"); + translate ([-Kante/2,Kante/2,0]) CreateArch(RadiusB,"black"); + translate ([-Kante/2,Kante/2,0]) CreateArch(RadiusC,"blue"); + } +}; + +if (Kachelnummer==3) +{ + difference() + { + CreateTile("white"); + translate ([Kante/2,-Kante/2,0]) CreateArch(RadiusA,"red"); + translate ([Kante/2,-Kante/2,0]) CreateArch(RadiusB,"black"); + translate ([Kante/2,-Kante/2,0]) CreateArch(RadiusC,"blue"); + } +}; + + +if (Kachelnummer==4) +{ + difference() + { + CreateTile("white"); + translate ([-Kante/2,-Kante/2,0]) CreateArch(RadiusA,"red"); + translate ([-Kante/2,-Kante/2,0]) CreateArch(RadiusB,"black"); + translate ([-Kante/2,-Kante/2,0]) CreateArch(RadiusC,"blue"); + } +}; + + +if (Kachelnummer==5) +{ + translate ([-Kante/4,Kante/4,Hoehe-Kerbe]) CreateEnd(RadiusC,"blue"); + difference() + { + CreateTile("white"); + translate ([-Kante/2,-Kante/2,Hoehe-Kerbe]) CreateArch(RadiusA,"red"); + translate ([-Kante/2,-Kante/2,Hoehe-Kerbe]) CreateArch(RadiusB,"black"); + + } +}; + + + + +module CreateTile(myColor) +{ + // Basisdomino erstellen + color(myColor) cube([Kante, Kante, Hoehe], center=true); +}; // End Module + + +module CreateArch(myRadius, myColor) +{ + difference () // Innenkreis vom AuÃenkreis abziehen. + { + color (myColor) + cylinder(Hoehe, myRadius+Strichdicke, myRadius+Strichdicke, center=true, $fn=60); + cylinder(Hoehe, myRadius-Strichdicke, myRadius-Strichdicke, center=true, $fn=60); + } +}; + +module CreateEnd(myLane, myColor) +{ + color(myColor) cube([Kante/2,Strichdicke*2, Hoehe], center=true); + +}; + +