summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/tex/latex/profcollege/PfCBonbon.tex
blob: 08be71cd4f0230f8ff5fe35625e070afa7dffb0a (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
%%%
% Bonbon
%%%
\setKVdefault[Bonbon]{CouleurUn=red,Bicolore=false,Echelle=1}%
\defKV[Bonbon]{CouleurDeux=\setKV[Bonbon]{Bicolore}}%

\NewDocumentCommand\Bonbon{o}{%
  \useKVdefault[Bonbon]%
  \setKV[Bonbon]{#1}%
  \ifluatex%
    \mplibforcehmode%
    \begin{mplibcode}
      boolean Bicolore;
      Bicolore:=\useKV[Bonbon]{Bicolore};
      color CouleurUn,CouleurDeux;
      CouleurUn:=\useKV[Bonbon]{CouleurUn};
      if Bicolore:
      CouleurDeux:=\useKV[Bonbon]{CouleurDeux};
      fi;
      Echelle:=\useKV[Bonbon]{Echelle};
      input PfCSolid;
      
      pas:=0.25132;
      
      Initialisation(10,50,50,15);
      incolor:=CouleurUn;
      outcolor:=CouleurUn;
      if Bicolore:
      draw Sparam("Echelle*(u,cos(u)*cos(v),cos(u)*sin(v))",0,pi,pas,0,2*pi,pas);
      incolor:=CouleurDeux;
      outcolor:=CouleurDeux;
      draw Sparam("Echelle*(u,cos(u)*cos(v),cos(u)*sin(v))",pi,2*pi,pas,0,2*pi,pas);
      else:
      draw Sparam("Echelle*(u,cos(u)*cos(v),cos(u)*sin(v))",0,2*pi,pas,0,2*pi,pas);
      fi;
    \end{mplibcode}
  \fi%
}%