Subversion Repositories wimsdev

Rev

Rev 17224 | Go to most recent revision | Details | Compare with Previous | Last modification | View Log | RSS feed

Rev Author Line No. Line
16886 bpr 1
!if $wims_read_parm!=slib_header
2
  !goto proc
3
!endif
4
slib_title=Dessin d'un patron aléatoire du polyèdre
5
slib_author=Bernadette, Perrin-Riou
6
slib_parms=2\
16889 bpr 7
,nom d'un polyèdre (en anglais comme dans la base dans wims)\
17096 bpr 8
size=200,option as words: size=(vertical size) keywords:vertex_legend face_legend  color=[general_color;number:color;number:color2;...] raw tikz html
16886 bpr 9
 
10
slib_out=dessin en canvasdraw
11
slib_comment=Preliminary version (syntaxe can change)
12
!!rajouter option couleur face et sommet ? size ?
17166 bpr 13
slib_example=cube,size=300 vertex_legend face_legend html\
16912 bpr 14
cube,html\
15
cube,raw\
17224 bpr 16
cube,size=300 vertex_legend face_legend tikz\
16912 bpr 17
dodecahedron,size=500 vertex_legend face_legend color=[red] html\
18
enneagonal_antiprism_dual,size=400 color=[blue;5,red;7,yellow] html\
19
j09_elongated_pentagonal_pyramid,size=300 html\
17085 bpr 20
j45_gyroelongated_square_bicupola,size=500 html\
17224 bpr 21
j45_gyroelongated_square_bicupola,html\
22
[6 8 12;0 0 1;0 1 0;-1 0 0;1 0 0;0 -1 0;0 0 -1;3,0,1,3;3,1,5,3;3,0,3,4;3,3,5,4;3,0,2,1;3,1,2,5;3,0,4,2;3,2,4,5], tikz spanning_tree=[2,6,1,2,6,8,3,8] vertex_legend face_legend\
17166 bpr 23
[6,8,12;0,0,1;0,1,0;-1,0,0;1,0,0;0,-1,0;0,0,-1;3,0,1,3;3,1,5,3;3,0,3,4;3,3,5,4;3,0,2,1;3,1,2,5;3,0,4,2;3,2,4,5], html spanning_tree=[2,6,1,2,6,8,3,8] vertex_legend face_legend\
16886 bpr 24
 
25
!exit
26
 
27
:proc
17224 bpr 28
!reset slib_xyz slib_sfa slib_ff slib_size slib_pat slib_out
16886 bpr 29
 
30
!distribute items $wims_read_parm into slib_polname,slib_option,slib_color
31
!set wims_multiexec=$wims_multiexec pari
32
!set slib_size=!getopt size in $slib_option
17222 bpr 33
!set slib_maxwhile=!getopt pseudomax in $slib_option
16886 bpr 34
!default slib_size=200
35
!set slib_color=!getopt color in $slib_option
36
!set slib_color=$(slib_color[1;])
37
!default slib_color=black
16889 bpr 38
!if # isin $slib_polname or [ isin $slib_polname
17096 bpr 39
  !set slib_pol=!declosing $slib_polname
17166 bpr 40
  !set slib_pol=!rows2lines $slib_pol
16889 bpr 41
!else
17096 bpr 42
  !set slib_pol=!record 0 of data/polyedre_off/$(slib_polname).off
16889 bpr 43
!endif
17003 bpr 44
 
45
!readproc slib/geo2D/polyoff
17189 bpr 46
!! define slib_facecnt in particular in polyoff
17166 bpr 47
!set slib_pat=!getopt spanning_tree in $slib_option
48
slib_patron=0
17222 bpr 49
!default slib_maxwhile=10
17166 bpr 50
!if $slib_pat=
17213 bpr 51
  slib_cntmp=0
17222 bpr 52
  !while ($slib_patron=0 or $slib_patron=$empty or pseudonet isin $slib_patron) and $slib_cntmp<$slib_maxwhile
17166 bpr 53
    !set slib_patron=!exec pari m=adjacence(ff); f2=depl_standard(ff,xyz);couv=arbre_couvrant_aleatoire(m); W=etale(couv,ff,f2[1],matsize(xyz)[1])
17213 bpr 54
    !increase slib_cntmp
17166 bpr 55
  !endwhile
17183 bpr 56
  !set slib_pat=!exec pari couv
17166 bpr 57
!else
58
  !set slib_patron=!exec pari m=adjacence(ff);f2=depl_standard(ff,xyz);couv=[$slib_pat]; W=etale(couv,ff,f2[1],matsize(xyz)[1])
59
  !set slib_pat=!declosing $slib_pat
17213 bpr 60
  !if $slib_patron=$empty
61
    slib_patron=1
62
  !endif
63
  !if $slib_patron iswordof 0 1
64
    !set slib_out=$slib_patron
17183 bpr 65
    !goto end
66
  !endif
17166 bpr 67
!endif
17096 bpr 68
!set slib_W1=!exec pari W[1]
69
!set slib_W2=!exec pari W[2]
70
!set slib_W2_=
16886 bpr 71
!if face_legend iswordof $slib_option
72
  !for slib_j=1 to $slib_facecnt
73
    !set slib_tmp=!declosing $(slib_W2[$slib_j])
74
    !set slib_W2_=!append item [$slib_tmp,$slib_j] to $slib_W2_
75
  !next
76
  slib_W2=$slib_W2_
77
!endif
17224 bpr 78
!set slib_raw=[$slib_W1],[$slib_W2]
16898 bpr 79
 
17224 bpr 80
!if raw notwordof $slib_option
81
  !readproc slib/geo2D/offdraw $slib_raw, $slib_option
17213 bpr 82
  !reset slib_cntmp
17223 bpr 83
  !if pseudonet isin $slib_patron
84
    !set slib_out=pseudonet $slib_out
17213 bpr 85
  !endif
16912 bpr 86
!endif
17225 bpr 87
!if tikz iswordof $slib_option
88
  slib_out=$slib_raw\
89
  $slib_out
90
!endif
17224 bpr 91
!if raw iswordof $slib_option
92
  !set slib_out=$slib_raw
17085 bpr 93
!endif
17224 bpr 94
!!now in off2draw
95
!!!!if tikz iswordof $slib_option
96
!!!  !set slib_W1_cnt=!rowcnt $slib_W1
97
!!!  !set slib_W2_cnt=!itemcnt $slib_W2
98
!!!  !set slib_tex=\begin{center}\
99
!!!  \begin{tikzpicture}[scale=1]
100
!!!  !for slib_j=1 to $slib_W2_cnt
101
!!!    !set slib_k=!declosing $(slib_W2[$slib_j])
102
!!!    !set slib_tex=$slib_tex\
103
!!!  \draw($(slib_W1[$(slib_k[2])+1;1,2]))
104
!!!    !for slib_s=2 to $[$(slib_k[1])+1]
105
!!!      !set slib_tex=$slib_tex --($(slib_W1[$(slib_k[$slib_s])+1;1,2]))
106
!!!    !next
107
!!!    !set slib_tex=$slib_tex --($(slib_W1[$(slib_k[2])+1;1,2]));
108
!!!  !next
109
!!!  !set slib_tex=$slib_tex\
110
!!!  \end{tikzpicture}\
111
!!!\end{center}
112
!!!  !set slib_out=$slib_out\
113
!!!$slib_tex
114
!!!!endif
17183 bpr 115
:end
16886 bpr 116
$slib_out