Page 1 sur 1

Graphe de l'hébesphéno-rotonde triangulaire

MessagePublié: 15 Jan 2010 18:41
par Alphonse Capriani
Voici une application du fichier graphes.mac de Joffrey et Patrick pour la création du graphe d'un polyèdre.

Ici, je présente le graphe du solide de Johnson J92 : l'hébesphéno-rotonde triangulaire. En fait, je donne deux versions du graphe (il s'agit du même graphe : seul l'arrangement des sommets est différent)

Image
Image


Voici le code permettant d'obtenir ces deux graphes :

Code: Tout sélectionner
\begin{texgraph}[file,call]
Cmd   [Fenetre(-3+4*i,15-5*i,1+i), Marges(0.5,0.5,0.5,0.5), Border(0)];
   [theta:=0.6261, phi:=1.6036, OriginalCoord(1),IdMatrix()];
   [IdMatrix3D(), ModelView(ortho)];

Include
   "graphes.mac";
   "PolyedresII.mac";

Mac
    Init = [ Matrice:=[0,1,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,1,0,1,0,0,0,0,0,0,0,0,
   0,0,1,1,0,1,0,0,0,1,1,0,0,0,0,0,0,0,1,1,0,0,0,0,0,1,0,0,0,0,1,1,0,0,0,0,0,0,0,0,1,
   1,0,0,0,0,1,1,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,0,0,0,0,1,0,0,0,0,0,0,0,0,
   0,0,0,0,1,0,1,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,1,0,0,0,0,
   1,1,0,0,0,0,0,1,0,0,0,0,0,0,0,0,1,1,0,0,0,1,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,1,1,0,
   1,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,0,0,1,
   0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,0,0,1,0,0,0,0,1,0,0,1,0,0,0,0,0,0,0,0,0,0,
   0,1,0,0,0,0,0,1,0,1,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,1,0,0,1,0,0,0,0,0,0,0,0,0,0,
   0,1,0,0,0,0,0,1,0,1,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,1,0,0,1,0,0,0,0,0,0,0,0,1,0,
   0,0,0,0,1,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,1,0,0,0,0,0,0,0],
    NbSommets:=20,
    PosSommets:=[0,i,-0.86602540378443-0.5*i,0.86602540378443-0.5*i,-0.86602540378443+0.5*i,
   -i,0.86602540378443+0.5*i,-1.73205080756888+i,-2*i,1.73205080756888+i,-1.73205080756888-i,
   1.73205080756888-i,2*i,-2,-1-1.73205080756888*i,1-1.73205080756888*i,2,1+1.73205080756888*i,
   -1+1.73205080756888*i,3-3*i],
    typeGraphe:=-1,
    Rayon:=3,
    rayon:=0.25,
    bouclescale:=1,
    dotstyle:=-1,
    linesep:=0.5,
    arrowwidth:=8,
    angledep:=Nil,
    angledep:=Nil,
    arrowposboucle:=[0.265,0.765],
    arrowposarete:=[0.25,0.75],
    ReCalc() ];

    Sommet1 = "T";

    optionsSommet1 = "[Color:=white, FillColor:=limegreen]";

    Sommet2 = "P";

    optionsSommet2 = "[Color:=black, FillColor:=gold]";

    Sommet3 = "P";

    optionsSommet3 = "[Color:=black, FillColor:=gold]";

    Sommet4 = "P";

    optionsSommet4 = "[Color:=black, FillColor:=gold]";

    Sommet5 = "T";

    optionsSommet5 = "[Color:=white, FillColor:=limegreen]";

    Sommet6 = "T";

    optionsSommet6 = "[Color:=white, FillColor:=limegreen]";

    Sommet7 = "T";

    optionsSommet7 = "[Color:=white, FillColor:=limegreen]";

    Sommet8 = "C";

    optionsSommet8 = "[Color:=white, FillColor:=navy]";

    Sommet9 = "C";

    optionsSommet9 = "[Color:=white, FillColor:=navy]";

    Sommet10 = "C";

    optionsSommet10 = "[Color:=white, FillColor:=navy]";

    Sommet11 = "T";

    optionsSommet11 = "[Color:=white, FillColor:=limegreen]";

    Sommet12 = "T";

    optionsSommet12 = "[Color:=white, FillColor:=limegreen]";

    Sommet13 = "T";

    optionsSommet13 = "[Color:=white, FillColor:=limegreen]";

    Sommet14 = "T";

    optionsSommet14 = "[Color:=white, FillColor:=limegreen]";

    Sommet15 = "T";

    optionsSommet15 = "[Color:=white, FillColor:=limegreen]";

    Sommet16 = "T";

    optionsSommet16 = "[Color:=white, FillColor:=limegreen]";

    Sommet17 = "T";

    optionsSommet17 = "[Color:=white, FillColor:=limegreen]";

    Sommet18 = "T";

    optionsSommet18 = "[Color:=white, FillColor:=limegreen]";

    Sommet19 = "T";

    optionsSommet19 = "[Color:=white, FillColor:=limegreen]";

    Sommet20 = "H";

    optionsSommet20 = "[Color:=white, FillColor:=crimson]";

    aux = "[LineStyle:=noline]";

    poids1_1 = "";

    auxOptionsAretes = "[LineStyle:=noline]";

    userOptions = "Liste(Set(rayon,0.25),Set(Width,thicklines),Set(FillColor,limegreen))";

    optionsArete8_20 = "[LineStyle:=noline]";

    optionsArete9_20 = "[LineStyle:=noline]";

    optionsArete10_20 = "[LineStyle:=noline]";

    optionsArete11_20 = "[LineStyle:=noline]";

    optionsArete12_20 = "[LineStyle:=noline]";

    optionsArete13_20 = "[LineStyle:=noline]";

Graph objet1 = [
   tMin:=-2.7,tMax:=4.2,DotScale:=1+i,
   Fenetre(-3-5*i, 15+4*i, 1+i),
   $Mat:=ReadData("GrapheJ92.txt", 1),
   PosSommets:=[0,
       i, exp(-5*i*pi/6), exp(-i*pi/6),
       exp(5*i*pi/6), -i, exp(i*pi/6),
       2*exp(5*i*pi/6), -2*i, 2*exp(i*pi/6),
       2*exp(-5*i*pi/6), 2*exp(-i*pi/6), 2*i,
       -2, 2*exp(-2*i*pi/3), 2*exp(-i*pi/3), 2, 2*exp(i*pi/3), 2*exp(2*i*pi/3),
       3-3*i],
   DefMatrice(Mat),
   DefLabels("T", "", "P", "", "P", "", "P", "", "T", "", "T", "", "T", "", "C", "", "C", "", "C", "",
       "T", "", "T", "", "T", "", "T", "", "T", "", "T", "", "T", "", "T", "", "T", "", "H", ""),
   DefOptionsAretes([8, 20, 9, 20, 10, 20, 11, 20, 12, 20, 13, 20], "[LineStyle:=noline]"),
   DefOptionsSommets(20, "[Color:=white, FillColor:=crimson]",
       [2, 3, 4], "[Color:=black, FillColor:=gold]",
       [8, 9, 10], "[Color:=white, FillColor:=navy]",
       [1, 5, 6, 7, 11, 12, 13, 14, 15, 16, 17, 18, 19], "[Color:=white, FillColor:=limegreen]"),
   
   { Tracé des six arêtes non droite }
   Width:=thicklines,
   $P:=PosSommets[20],
   $P1:=PosSommets[8], $P2:=PosSommets[9], $P3:=PosSommets[10],
   $P4:=PosSommets[11], $P5:=PosSommets[12], $P6:=PosSommets[13],
   Path([P1, (2*P1+P)/3-0.8*exp(i*pi/3)*(P-P1), (P1+2*P)/3-0.8*exp(2*i*pi/3)*(P-P1), P, bezier,
      P2, move, ((P2+P)/2)-0.25*i*(P-P2), P, bezier,
      P3, move, ((P3+P)/2)+0.25*i*(P-P3), P, bezier,
      P4, move, ((P4+P)/2)-0.65*i*(P-P4), P, bezier,
      P5, move, P, line,
      P6, move, (2*P6+P)/3+0.65*exp(2*i*pi/3)*(P-P6), (P6+2*P)/3+0.65*exp(i*pi/3)*(P-P6), P, bezier]),
   
   { Tracé du reste du graphe }
   Dgraphe([rayon:=0.25, Width:=thicklines, FillColor:=limegreen]),
   
   { Affichage du polyèdre J92 }
   SetMatrix([10-i, 3, 3*i]),
   opacity:=0.75, StyleL:=Thicklines, LineCap:=round,
   HebesphenoRotondeT(Origin, vecI, A, B, C, D, E),
   Build3D(A, B, C, D, E),
   Display3D(),
   
   { Titre du graphique }
   SetMatrix([0, 1, i]),
   LabelStyle:=center, LabelSize:=Large,
   Label((Xmin+Xmax)/2+i*Ymax, "Graphe de l'hébesphéno-rotonde triangulaire ($\mathcal{J}_{92}$)"),
];
\end{texgraph}

et le fichier dans lequel j'ai enregistré ma matrice :
Code: Tout sélectionner
0 1 1 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
1 0 0 0 1 0 1 0 0 0 0 0 0 0 0 0 0 1 1 0
1 0 0 0 1 1 0 0 0 0 0 0 0 1 1 0 0 0 0 0
1 0 0 0 0 1 1 0 0 0 0 0 0 0 0 1 1 0 0 0
0 1 1 0 0 0 0 1 0 0 0 0 0 0 0 0 0 0 0 0
0 0 1 1 0 0 0 0 1 0 0 0 0 0 0 0 0 0 0 0
0 1 0 1 0 0 0 0 0 1 0 0 0 0 0 0 0 0 0 0
0 0 0 0 1 0 0 0 0 0 0 0 0 1 0 0 0 0 1 1
0 0 0 0 0 1 0 0 0 0 0 0 0 0 1 1 0 0 0 1
0 0 0 0 0 0 1 0 0 0 0 0 0 0 0 0 1 1 0 1
0 0 0 0 0 0 0 0 0 0 0 0 0 1 1 0 0 0 0 1
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 1 0 0 1
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 1 1
0 0 1 0 0 0 0 1 0 0 1 0 0 0 0 0 0 0 0 0
0 0 1 0 0 0 0 0 1 0 1 0 0 0 0 0 0 0 0 0
0 0 0 1 0 0 0 0 1 0 0 1 0 0 0 0 0 0 0 0
0 0 0 1 0 0 0 0 0 1 0 1 0 0 0 0 0 0 0 0
0 1 0 0 0 0 0 0 0 1 0 0 1 0 0 0 0 0 0 0
0 1 0 0 0 0 0 1 0 0 0 0 1 0 0 0 0 0 0 0
0 0 0 0 0 0 0 1 1 1 1 1 1 0 0 0 0 0 0 0

Re: Graphe de l'hébesphéno-rotonde triangulaire

MessagePublié: 15 Jan 2010 19:33
par P.Fradin
Salut Alphonse,

Il est inutile d'ajouter le fichier contenant la matrice, elle est déjà dans ton source, mais elle n'est pas prise en compte lors du chargement du fichier, il aurait fallu modifier l'élément graphique. Ce n'est pas grave.

Voilà ce que donne le code de l'élément graphique avec la version 0.2 de graphes.mod (il faut aussi charger PolyedresII.mod):

Code: Tout sélectionner
[
Fenetre(-3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*exp(2*i*pi/3),
           3-3*i],
DefLabels("T", "", "P", "", "P", "", "P", "", "T", "", "T", "", "T", "", "C", "", "C", "", "C", "",
           "T", "", "T", "", "T", "", "T", "", "T", "", "T", "", "T", "", "T", "", "T", "", "H", ""),
DefOptionsSommets(20, "[labelColor:=white, backColor:=crimson]",
           [2, 3, 4], "[labelColor:=black, backColor:=gold]",
           [8, 9, 10], "[labelColor:=white, backColor:=navy]",
           [1, 5, 6, 7, 11, 12, 13, 14, 15, 16, 17, 18, 19], "[labelColor:=white, backColor:=limegreen]"),
DefOptionsAretes(
        [8,20], "[auto:=0,angleA:=-135,angleB:=-135,dist:=1.5]",
        [9,20], "[auto:=0,angleA:=-50,angleB:=-180,dist:=0.75]",
        [10,20], "[auto:=0,angleA:=-50,angleB:=90,dist:=1]",
        [11,20], "[auto:=0,angleA:=-80,angleB:=-160,dist:=1]",
        [13,20], "[auto:=0,angleA:=30,angleB:=45,dist:=1.25]",
        ),

       { Tracé du reste du graphe }
Dgraphe([rayon:=0.25, Width:=thicklines, circleColor:=white]),

       { Affichage du polyèdre J92 }
SetMatrix([10-i, 3, 3*i]),
opacity:=0.75, StyleL:=Thicklines, LineCap:=round,
HebesphenoRotondeT(Origin, vecI, A, B, C, D, E),
Build3D(A, B, C, D, E),
Display3D(),

       { Titre du graphique }
SetMatrix([0, 1, i]),
LabelStyle:=center, LabelSize:=Large,
Label((Xmin+Xmax)/2+i*(Ymax-0.5), "Graphe de l'hébesphéno-rotonde triangulaire ($\mathcal{J}_{92}$)"),
]


grapheAlphonse.png
grapheAlphonse.png (48.32 Kio) Consulté 9019 fois

Re: Graphe de l'hébesphéno-rotonde triangulaire

MessagePublié: 15 Jan 2010 19:42
par Alphonse Capriani
Ca m'a l'air parfait tout ca!!!

Le code est nettement plus propre qu'avec mon bidouillage. Encore une fois, je suis impatient de tester cette nouvelle version de graphes.mac...

Re: Graphe de l'hébesphéno-rotonde triangulaire

MessagePublié: 15 Jan 2010 19:49
par P.Fradin
Je te met une version test en fichier joint. Pour ta question sur la courbe de Bezier je finis un schéma et je le poste.
graphes0.2.zip
(6.78 Kio) Téléchargé 829 fois

Re: Graphe de l'hébesphéno-rotonde triangulaire

MessagePublié: 18 Jan 2010 17:19
par Alphonse Capriani
Ok d'ac : c'est parfait!!!

Je vais tester dès ce soir cette mise à jour. Je pense qu'avec ton exemple précédent, je devrait déja y voir plus clair.

Affaire à suivre...