contour
clone your own copy | download snapshot

Snapshots | iceberg

Inside this repository

loop.mp
text/plain

Download raw (2.5 KB)

prologues := 3;
outputtemplate := "%j-%c.svg";
outputformat := "svg";

beginfig(1)

  h:=45mm;
  w:=20mm;
  lby:=0.25;
  lbx:=0.1;

	z1=(0w,0h);
	z2=((1-lbx)*w,lby*h);
	z3=(0.5w,1h);
  z4=(lbx*w,lby*2*h);
	z5=(1w,0h);

  pickup pencircle scaled 2;
	draw z1..z2..z3..z4..z5;
  
  dotlabels.top(1, 2, 3, 4, 5)

endfig;


beginfig(2)

  h:=100mm;
  w:=20mm;
  lby:=0.5;
  lbx:=0.25;

	z1=(0w,0h);
	z2=(0.5w,1h);
	z3=(1w,0h);

  pickup pencircle scaled 2;
	draw z1{right}..{left}z2..{right}z3;
  
  dotlabels.top(1, 2, 3)
  
endfig;


beginfig(3)

  h:=200mm;
  w:=20mm;
  s:=10mm;
  lby:=0.5;
  lbx:=0;

	z1=(0w,0h);
	z2=((1-lbx)*w,lby*h);
	z3=(0.5w,1h);
  z4=(lbx*w,lby*h);
	z5=(w+.5(s-w),0h);

  pickup pencircle scaled 2;
	% draw z1{right}..z2..{left}z3{left}..z4..{right}z5;
	% draw z1{right}..z2..{left}z3{left}..z4..{right}z5;

  draw z1{right}..z2...z3...z4..{right}z5..z2 shifted (s,0) ... z3 shifted (s,0) ... z4  shifted (s,0) .. {right}z5 shifted (s,0) .. z2 shifted (2s,0) ... z3 shifted (2s,0) ... z4 shifted (2s,0) .. {right}z5 shifted (2s,0);
  
  draw z1{right}..{left}z3..{right}z5 withcolor red;
  draw z1 shifted(s, 0) {right} .. {up}z2 shifted(s, 0) .. z3 shifted(s, 0) .. {down}z4 shifted(s, 0) .. {right}z5 shifted(s, 0) withcolor blue;
  draw z1 shifted(2s, 0) {right} ... {up}z2  shifted(2s, 0) ... z3  shifted(2s, 0) ... {down}z4  shifted(2s, 0) ... {right}z5  shifted(2s, 0) withcolor green;

  dotlabels.top(1, 2, 3, 4, 5)

endfig;

beginfig(4)

  h:=200mm;
  w:=20mm;
  s:=50mm;
  lby:=0.75;
  lbx:=-.5;

	z1=(0w,0);
	z2=(w, .5h);
	z3=(0, .5h);
  z4=(w,0);

  pickup pencircle scaled 2;
	
  draw z1{right}..{up}z2..{down}z3..{right}z4;
  
  dotlabels.top(1, 2, 3, 4)

endfig;

beginfig(5)

  h:=50mm;
  w:=20mm;
  s:=20mm;
  lby:=0.25;
  lbx:=-.5;

	z1=(0w,0);
	z2=(w, lby * h);
	z3=(w, (1 - lby) * h);
  z4=(.5w, h);
  z5=(0, (1 - lby) * h);
	z6=(0, lby * h);
  z7=(w,0);

  pickup pencircle scaled 2;
	
  draw z1{right}..z2..z3..z4..z5..z6..{right}z7;
  
  dotlabels.top(1, 2, 3, 4,5,6,7)

endfig;

beginfig(6)

  h:=50mm;
  w:=20mm;
  s:=10mm;
  lby:=0.75;
  lbx:=0;

	z1=(0w,0h);
	z2=((1-lbx)*w,lby*h);
	z3=(0.5w,1h);
  z4=(lbx*w,lby*h);
	z5=(w+.5(s-w),0h);

  pickup pencircle scaled 2;
  
  draw z5 shifted(-s, 0){right}...z2...z3...z4...{right}z5 ... z2 shifted (s,0) ... z3 shifted (s,0) ... z4  shifted (s,0) ... {right}z5 shifted (s,0) ... z2 shifted (2s,0) ... z3 shifted (2s,0) ... z4 shifted (2s,0) ... {right}z5 shifted (2s,0);

  dotlabels.top(1, 2, 3, 4);

endfig;

end;