Pflasterung Gruppe M2, Typ3.
Basis ist ein Dreieck
Jede Seite wird durch eine  C-Kurve ersetzt
Konstruktion siehe Script 2
============================================

ScriptBegin
var Grafik = "Script Turtle"

var c=33;            // Strecke AB 
    wa=79;           // Winkel AB,BC (95  ,79 )
    a=1.0*c;         // Strecke BC   (0.78, 1 )
    
    x0=-15;  y0=30;  // PflasterAnfangspunkt
    imax=7;  jmax=3;

    HilfC  ="black"; 
    RandC  ="#252525";
    RandW  =0.5;
    Fill1  ="#2ed2e5";
    Fill0  ="#7cee61";
    Fillp  ="gold";//"darkorange";//


function init()
{ t.setBrush("dimgray");
  t.setPage();  
  t.setAntiAliasing(); 
}


function draw()
{ //t.drawKoordSystem(); t.drawRaster();

  defBefehle();
  defSplines();
  defFliesen();  //testDraw();
  drawPflaster();
  t.setPen(RandC); t.rahmen();
}


function defBefehle()
{ t.setNoStyle();  
  t.goTo(0,0);t.turnTo(0);

  t.trianglePolygon(c,wa,a);
  t.setPen(); t.defDraw("Dreieck");

  t.defPoint("A",0); 
  t.defPoint("B",1);
  t.defPoint("C",2);
 
  t.defPoint("Mc","A","B",0.5);
  t.defPoint("Mb","B","C",0.5);
  t.defPoint("Ma","C","A",0.5);

  t.setPen(RandC,RandW); 
  t.defLine("AB","A","B"); 
  t.defLine("BC","B","C"); 
  t.defLine("CA","C","A"); 

  t.defVector("ShiftAB","A","B");    
  t.defVector("ShiftBC","B","C");  
  t.defVector("ShiftCA","C","A");  
}


function defSplines()
{  
  defAMc(); t.cPolygon(); t.splinePolygon();
  t.setPen(RandC,RandW); t.defDraw("AB",3);

  defBMa(); t.cPolygon(); t.splinePolygon();
  t.setPen(RandC,RandW); t.defDraw("BC",3);

  defCMb(); t.cPolygon(); //t.splinePolygon();
  t.setPen(RandC,RandW); t.defDraw("CA",3);

} 


function defAMc()
{t.setNoStyle();
 t.beginPolygon();
 t.goTo(0,0);
 t.moveTo(10.5,-5.25);
 t.moveTo(15,0);
 t.endPolygon(3); 
}

function defBMa()
{t.setNoStyle();
 t.beginPolygon();
 t.goTo(30,0);
 t.moveTo(26,3);
 t.moveTo(26,8);
 t.moveTo(16,5);
 t.moveTo(20,14);
 t.moveTo(28,12);
 t.endPolygon(3);
 t.splinePolygon();
}


function defCMb()
{t.setNoStyle();
 t.beginPolygon();
 t.goTo(0,0);
 t.moveTo(7,2);
 t.moveTo(-5,11);
 t.moveTo(8,7);
 t.moveTo(16,9);
 t.moveTo(13,12);
 t.endPolygon(3);
 t.splinePolygon();
}
 

function defAdd()
{t.setNoStyle();
 t.beginPolygon();
 t.goTo(3,10);
 t.moveTo(15,4);
 t.moveTo(6,-2);
 t.moveTo(8,5);
 t.moveTo(3,10);
 t.endPolygon(0);
 t.splinePolygon();
}


function  defFliesen()
{ t.beginPolygon();
  t.setPolygon("AB"); t.addPolygon("BC");
  t.addPolygon("CA");
  t.endPolygon();
  t.setPen(RandC,RandW,1);

  t.setBrush(Fill0,1,220); t.defDraw("Fliese0");   

  t.setRotate("Mc",180); t.setPolygon();
  t.setBrush(Fill1,1,220); t.defDraw("Fliese1");

  defAdd(); t.setTranslate(-0.2,-1.2); t.setRotate(13,false);
  t.setPolygon();
  t.setPen(RandC,RandW,1); t.setBrush(Fillp,1,100);
  t.defDraw("Fliese0",1);
}



function drawPflaster()
{
  t.setIdentity(); t.setNoStyle(); 
  t.turnTo(-17);
  for(j=-jmax; j<=jmax; j++)
  { t.goTo(x0,y0);
    t.shift("ShiftCA",j);  t.shift("ShiftBC",-imax);

    for(i=-imax; i<=imax; i++)
     {      
       if (i>-4) t.draw("Fliese0");      
       if (i<1) t.draw("Fliese1"); 
       t.shift("ShiftBC");
    }    
  }
}


function testDraw()
{ t.setIdentity();
  t.goTo(-50,0); t.turnTo(0); 
  t.draw("AB");  t.draw("BC");  t.draw("CA");
  t.goTo(0,0); t.draw("Dreieck");
  t.draw("Fliese0");
  //t.draw("Fliese1");
}

ScriptEnd#1


============================================
Konstruktion zu Script #1

============================================
ScriptBegin
var Grafik = "Script Turtle"

function init() //Initialisierungen
{ t.defScript("M23","./Pflaster03.txt#1");
  t.setPage(-55,60,6);
} 

function draw() //Zeichenbefehle
{ //t.drawKoordSystem();
  t.drawRaster();
  t.msg("Pflasterung M2, Typ 3","blue");
  Konstruktion();
}


function Konstruktion()
{ t.msgDraw(); t.goTo("ShiftAB"); t.turnTo(0);

  t.setPen("black",0); t.setBrush("gray",1,80);

  t.draw("Fliese0",false);
  t.draw("Fliese1");

  t.setPen("red",0.4); t.draw("AB",false); 
  t.setPen("blue",0.4); t.draw("BC",false); 
  t.setPen("green",0.4);  t.draw("CA",false);

  t.setPen("black",0.2); t.setBrush("yellow",1,80);
  t.draw("Dreieck",false);
  t.draw("A"); t.draw("B"); t.draw("C");
  t.draw("Mc"); t.draw("Ma"); t.draw("Mb");

  t.setPen("green",0.3,2);
  t.goTo(0,0); t.draw("ShiftBC"); t.moveTo("ShiftBC");
  t.goTo(0,0); t.draw("ShiftAB"); t.moveTo("ShiftAB");
  t.goTo(0,0); t.draw("ShiftCA"); t.moveTo("ShiftCA");

  t.setPen("black",0); t.setBrush("yellow",1,30);

  t.goTo(0,0);    
  t.setNoStyle(); t.shift("ShiftBC",-1);
  t.setPen(""); t.setBrush(""); t.draw("Dreieck",false);
  t.setNoStyle(); t.shift("ShiftAB");
  t.setPen(""); t.setBrush(""); t.draw("Dreieck",false);

  t.goTo(0,0); t.setNoStyle();    
  t.setPen(""); t.setBrush(""); t.draw("Dreieck",false);
  t.setNoStyle(); t.shift("ShiftBC");
  t.setPen(""); t.setBrush(""); t.draw("Dreieck",false);
  t.setNoStyle(); t.shift("ShiftAB");
  t.setPen(""); t.setBrush(""); t.draw("Dreieck",false);

  t.setFont("Courier",1.8,false,40);
  t.text(-40,19,40,0,
"Pflasterung Gruppe M2 Typ3\n\n\
Frei gewählt:\n\
  1.Dreieck\n\
  2.Halbe Kurven rot, blau, grün\n\
");

  t.goTo(0,0);
  t.drawName("ShiftAB",-9,1.5);
  t.drawName("ShiftBC",-9,-2.5);
  t.drawName("ShiftCA",-9,-2.5);

  t.shift("ShiftAB");
  t.drawName("A",-1.1,-2.2);
  t.drawName("Mc",2,-2.2);
  t.drawName("B",2,-2.2);
  t.drawName("Mb",-2.2,-2.2);
  t.drawName("C",2,-2.2);
  t.drawName("Ma",2.2,-1.2);
}

ScriptEnd#2

