* fichier : cinemb1.dgibi ************************************************************************ * Section : Langage Objets * Section : Maillage Autres ************************************************************************ ***** graph = 'N'; * Example of use of the cinemb procedure * * A mesh is made of 1 arches: we want to pass under turning and rising * the head. ***** * P.PEGON JRC-ISPRA 01/10/95 ***** opti echo 1; opti dime 3 elem qua4; * * generation of the mesh "mesht" * dens 2.5; p1=0 5 0; p2=0 10 0; p3=0 10 15; p4=0 -10 15; p5=0 -10 0; p6=0 -5 0; p7=0 -5 10; p8=0 5 10; * cont1=p1 d p2 d p3 d p4 d p5 d p6 d p7 d p8 d p1; mesh1=cont1 surf plan; * opti elem cub8; p9=6 0 0; mesht=coul (mesh1 volu tran p9) bleu; depl mesht 'PLUS' (-3 0 0); * * generation of the point of view trajectory (traj1) * and of the associated direction of view (dire1) * and direction of head axis (axet1) * ptra1=-15 0. 0.; ptra2= 15 0. 0.; traj1=chan (ptra1 d 30 ptra2) 'POI1'; j=0; repe lab1 (nbel traj1); j=j+1; oeilj=(traj1 elem j) point 1; xj =coor 1 oeilj; direj= ((-1)*xj) 0. 10.; direj=direj/(norm direj); * axe1j=10. 0. xj; axe1j=axe1j/(norm axe1j); axe2j= 0. 1. 1.; alpha=xj/15.; axetj=(alpha*axe1j) plus ((1-(abs alpha))*axe2j); axetj=axetj/(norm axetj); * xj yj zj=coor direj; vdirj=manu 'CHPO' oeilj 3 'UX' xj 'UY' yj 'UZ' zj nature discret; xj yj zj=coor axetj; vtetj=manu 'CHPO' oeilj 3 'UX' xj 'UY' yj 'UZ' zj nature discret; si (ega j 1); dire1=direj; axet1=axetj; vdir1=vdirj; vtet1=vtetj; sinon; dire1=dire1 et direj; axet1=axet1 et axetj; vdir1=vdir1 et vdirj; vtet1=vtet1 et vtetj; finsi; fin lab1; * vvdir1=vecto vdir1 1 'UX' 'UY' 'UZ' jaun; vvtet1=vecto vtet1 1 'UX' 'UY' 'UZ' vert; SI ( ega graph 'O'); trac (100 10 100) cach (mesht et traj1) (vvdir1 et vvtet1); * * call cinemb * defo1=cinemb mesht traj1 dire1 axet1; * finsi; * plot * * WARNING: start the animation, stop it clicking in the same place, * and resize the plot on the current frame in order to * eliminate useless details by clipping * (the dream is to exclude from the vision all what is cut) * oeil1=(traj1 elem 1) point 1; opc11=(dire1 elem 1) point 1; opc12=(axet1 elem 1) point 1;; opc11=opc11/(norm opc11); opc12=opc12 moin ( (opc11 psca opc12) * opc11 ); opc12=opc12/(norm opc12); opc13=opc11 pvec opc12; pc11=oeil1 plus (2*opc11); pc12=pc11 plus opc12; pc13=pc11 plus opc13; mena; si ( ega graph 'O'); trac oeil1 defo1 face dire coup pc11 pc12 pc13 oscil; trac oeil1 defo1 facb dire coup pc11 pc12 pc13 oscil; trac oeil1 defo1 fsdb dire coup pc11 pc12 pc13 oscil; trac oeil1 defo1 cach dire coup pc11 pc12 pc13 oscil; finsi; fin ;