Retour

Source : Volumepavev3.mp

Animation flash


Volumepavev3.mp
prologues:=2;
 
vardef CB(expr pg)=
  save cbt;
  picture cbt;
  cbt=image(
    transparence polygone(pg,pg+(1/6)*(G-B),pg+(1/6)*(G-B)+(1/3)*(A-B),pg+(1/6)*(G-B)+(1/3)*(A-B)+(1/9)*(C-B),pg+(1/3)*(A-B)+(1/9)*(C-B),pg+(1/9)*(C-B));
    trace polygone(pg,pg+(1/6)*(G-B),pg+(1/6)*(G-B)+(1/3)*(A-B),pg+(1/6)*(G-B)+(1/3)*(A-B)+(1/9)*(C-B),pg+(1/3)*(A-B)+(1/9)*(C-B),pg+(1/9)*(C-B));
    trace chemin(pg+(1/6)*(G-B),pg+(1/6)*(G-B)+1/9*(C-B),pg+(1/9)*(C-B));
    trace segment(pg+(1/6)*(G-B)+1/9*(C-B),pg+(1/6)*(G-B)+(1/3)*(A-B)+(1/9)*(C-B));
    );
  cbt
enddef;
 
input geometriesyr16;
for l=0 upto 2:
  for k=0 upto 8:
    figureespace(-10u,-10u,10u,10u);
    Initialisation(5,50,30,500);
    color A,B,C,D,E,F,G,H;
    A=(0,0,0);
    B=(1/2,0,0);
    C=(1/2,3/2,0);
    D=(0,3/2,0);
    E=(0,3/2,1);
    F=(0,0,1);
    G=(1/2,0,1);
    H=(1/2,3/2,1);
    trace chemin(F,A,B) dashed evenly;
    trace segment(A,D) dashed evenly;
    drawoptions(withcolor blanc);
    trace appelation(B,C,-2mm,btex 9 unit\'es etex);
    trace appelation(C,D,-2mm,btex 3 unit\'es etex);
    trace appelation(D,E,-2mm,btex 6 unit\'es etex);
    drawoptions();
    if l=0:
      if k=8:
	trace appelation(B,C,-2mm,btex 9 unit\'es etex);
      fi;
      fillcolor:=vert;
      for p=0 upto k:
	trace CB(B+(p/9)*(C-B)+(l/3)*(A-B));
      endfor;
    fi;
    if l=1:
      trace appelation(B,C,-2mm,btex 9 unit\'es etex);
      fillcolor:=jaune;
      for p=0 upto k:
	if p=8:
	  fillcolor:=vert;
	fi;
	trace CB(B+(p/9)*(C-B)+(l/3)*(A-B));
      endfor;
      fillcolor:=vert;
      for p=0 upto 8:
	trace CB(B+(p/9)*(C-B)+(0/3)*(A-B));
      endfor;
    fi;
    if l=2:
      trace appelation(B,C,-2mm,btex 9 unit\'es etex);
      fillcolor:=jaune;
      for p=0 upto k:
	if k=8:
	  trace appelation(C,D,-2mm,btex 3 unit\'es etex);
	fi;
	if p=8:
	  fillcolor:=vert;
	fi;
	trace CB(B+(p/9)*(C-B)+(l/3)*(A-B));
      endfor;
      fillcolor:=jaune;
      for p=0 upto 7:
	trace CB(B+(p/9)*(C-B)+(1/3)*(A-B));
      endfor;
      fillcolor:=vert;
      trace CB(B+(8/9)*(C-B)+(1/3)*(A-B));
      for p=0 upto 8:
	trace CB(B+(p/9)*(C-B)+(0/3)*(A-B));
      endfor;
    fi;
    trace polygone(B,C,D,E,F,G);
    trace chemin(G,H,E);
    trace segment(H,C);
    finespace;
  endfor;
endfor;
for k=1 upto 5:
  figureespace(-10u,-10u,10u,10u);
  Initialisation(5,50,30,500);
  color A,B,C,D,E,F,G,H;
  A=(0,0,0);
  B=(1/2,0,0);
  C=(1/2,3/2,0);
  D=(0,3/2,0);
  E=(0,3/2,1);
  F=(0,0,1);
  G=(1/2,0,1);
  H=(1/2,3/2,1);
  trace chemin(F,A,B) dashed evenly;
  trace segment(A,D) dashed evenly;
  drawoptions(withcolor blanc);
    trace appelation(B,C,-2mm,btex 9 unit\'es etex);
    trace appelation(C,D,-2mm,btex 3 unit\'es etex);
    trace appelation(D,E,-2mm,btex 6 unit\'es etex);
  drawoptions();
  trace appelation(B,C,-2mm,btex 9 unit\'es etex);
  trace appelation(C,D,-2mm,btex 3 unit\'es etex);
  fillcolor:=jaune;
  for p=0 upto 7:
    trace CB(B+(p/9)*(C-B)+(2/3)*(A-B));
  endfor;
  fillcolor:=vert;
  trace CB(B+(8/9)*(C-B)+(2/3)*(A-B));
  fillcolor:=jaune;
  for p=0 upto 7:
   trace CB(B+(p/9)*(C-B)+(1/3)*(A-B));
  endfor;
  fillcolor:=vert;
  trace CB(B+(8/9)*(C-B)+(1/3)*(A-B));
  for p=0 upto 8:
    trace CB(B+(p/9)*(C-B)+(0/3)*(A-B));
  endfor;
  fillcolor:=jaune;
  for q=1 upto k:
    if k=5:
      trace appelation(D,E,-2mm,btex 6 unit\'es etex);
    fi;
    for p=0 upto 8:
      trace CB(B+(p/9)*(C-B)+(2/3)*(A-B)+(q/6)*(G-B));
      fillcolor:=vert;
      trace CB(8/9[B,C]+(q/6)*(G-B)+(2/3)*(A-B));
      fillcolor:=jaune;
      trace CB(B+(p/9)*(C-B)+(1/3)*(A-B)+(q/6)*(G-B));
      trace CB(B+(p/9)*(C-B)+(0/3)*(A-B)+(q/6)*(G-B));
    endfor;
  endfor;
  trace polygone(B,C,D,E,F,G);
  trace chemin(G,H,E);
  trace segment(H,C);
  finespace;
endfor;
for k=0 upto 3:
  figureespace(-10u,-10u,10u,10u);
  Initialisation(5,50,30,500);
  color A,B,C,D,E,F,G,H;
  A=(0,0,0);
  B=(1/2,0,0);
  C=(1/2,3/2,0);
  D=(0,3/2,0);
  E=(0,3/2,1);
  F=(0,0,1);
  G=(1/2,0,1);
  H=(1/2,3/2,1);
  trace chemin(F,A,B) dashed evenly;
  trace segment(A,D) dashed evenly;
  trace appelation(B,C,-2mm,btex 9 unit\'es etex);
  trace appelation(C,D,-2mm,btex 3 unit\'es etex);
  trace appelation(D,E,-2mm,btex 6 unit\'es etex);
  fillcolor:=jaune;
  for p=0 upto 7:
    trace CB(B+(p/9)*(C-B)+(2/3)*(A-B));
  endfor;
  fillcolor:=vert;
  trace CB(B+(8/9)*(C-B)+(2/3)*(A-B));
  fillcolor:=jaune;
  for p=0 upto 7:
    trace CB(B+(p/9)*(C-B)+(1/3)*(A-B));
  endfor;
  fillcolor:=vert;
  trace CB(B+(8/9)*(C-B)+(1/3)*(A-B));
  for p=0 upto 8:
    trace CB(B+(p/9)*(C-B)+(0/3)*(A-B));
  endfor;
   for q=1 upto 5:
    for p=0 upto 8:
      trace CB(B+(p/9)*(C-B)+(2/3)*(A-B)+(q/6)*(G-B));
      fillcolor:=vert;
      trace CB(8/9[B,C]+(q/6)*(G-B)+(2/3)*(A-B));
      fillcolor:=jaune;
      trace CB(B+(p/9)*(C-B)+(1/3)*(A-B)+(q/6)*(G-B));
      trace CB(B+(p/9)*(C-B)+(0/3)*(A-B)+(q/6)*(G-B));
    endfor;
  endfor;
  trace polygone(B,C,D,E,F,G);
  trace chemin(G,H,E);
  trace segment(H,C);
  finespace;
endfor;
end