Subversion Repositories wimsdev

Rev

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

Rev Author Line No. Line
20 reyssat 1
 
981 bpr 2
!if $wims_read_parm!=slib_header
20 reyssat 3
 !goto proc
4
!endif
5
slib_title=Polyhedron applet with Convex3D
3668 reyssat 6
slib_parms=1\
20 reyssat 7
,name of the polyhedron (see index)
8
 
9
slib_author=Bernadette PERRIN-RIOU
10
slib_out=code for draw of drawing a polyhedron with the applet Convex3D
11
slib_comment=
12
 
13
!exit
14
 
15
:proc
16
 
17
!distribute items $wims_read_parm into slib_polyedre,slib_options
18
slib_prgm=
19
!reset slib_points, slib_faces, slib_aretes
20
!!********** Traitement des options
21
 
22
slib_optcnt=!itemcnt $slib_options
23
!for slib_no=1 to $slib_optcnt
24
  slib_option=!item $slib_no of $slib_options
25
  slib_option=!declosing $slib_option
26
 slib_optionname=!item 1 of $slib_option
27
 slib_optionvalue=!items 2 to -1 of $slib_option
28
 !if $slib_optionname issametext faces
29
  slib_faces=$slib_optionvalue
30
 !endif
31
 !if $slib_optionname issametext aretes
32
  slib_aretes=$slib_optionvalue
33
 !endif
34
 !if $slib_optionname issametext points
35
  slib_points=$slib_optionvalue
36
 !endif
37
!next slib_no
38
!default slib_faces=0
39
!default slib_aretes=0
40
!default slib_points=0
41
 
42
!!********** Lecture des données polyedre
43
 
44
slib_polyedre=!record  0 of data/polyedre_off/$slib_polyedre.off
45
slib_H=1
46
slib_u=!line 1 of $slib_polyedre
47
slib_nom=!replace internal # by $empty in $slib_u
48
!while # isin $slib_u
49
!advance slib_H
50
slib_u=!line $slib_H of $slib_polyedre
51
!endwhile
52
 
53
 
54
!distribute word $slib_u into slib_S_cnt, slib_F_cnt, slib_A_cnt
55
 
56
slib_sommet=!line $[$slib_H+1] to $[$slib_H+$slib_S_cnt] of $slib_polyedre
57
slib_sommet=!nonempty lines $slib_sommet
58
 
59
slib_arete=!line $[$slib_H+$slib_S_cnt+$slib_F_cnt+1] to $[$slib_H+$slib_S_cnt+$slib_F_cnt+$slib_A_cnt] of $slib_polyedre
60
slib_arete=!nonempty line $slib_arete
61
 
62
slib_face=!line $[$slib_H+$slib_S_cnt+1] to $[$slib_H+$slib_S_cnt+$slib_F_cnt] of $slib_polyedre
63
slib_face=!nonempty line $slib_face
64
 
65
!!********** code de mise en scene
66
 
67
slib_prelim=
68
slib_fin=
69
!!********** code de dessin des sommets
70
 
71
 slib_out_sommet=
72
 
73
  !for slib_na=1 to $slib_S_cnt
74
    slib_coord=!line $slib_na of $slib_sommet
75
    slib_out_sommet=$slib_out_sommet,$slib_coord
76
  !next slib_na
77
slib_out_sommet=!nonempty items $slib_out_sommet
78
slib_out_sommet=!singlespace $slib_out_sommet
79
!!********** code de dessin des faces 
80
slib_out_face=
81
!for slib_nc=1 to $slib_F_cnt
82
   slib_r=!line $slib_nc of $slib_face
83
   slib_r=!word 2 to -1 of $slib_r
84
   slib_out_face=$slib_out_face $slib_r -1
85
 !next slib_nc
86
slib_out_face=!singlespace $slib_out_face
87
 
88
slib_out=$slib_S_cnt $slib_F_cnt;$slib_out_sommet;$slib_out_face