HOME
BACKGROUND
OBJECTIVES
PROJECT
CREDITS
REFERENCES

PV WAVE Program

pro ANSYS_to_vrml
openw,3,'vrml.wrl'
printf,3,'#VRML V1.0 ascii'
printf,3,''
printf,3,'Separator {'
printf,3,'Coordinate3 {'
printf,3,'point ['
line=fltarr(4)
openr,1,'vert.dat'
WHILE NOT eof(1) DO BEGIN &$
 READF, 1, line &$
 printf,3,FORMAT="(3(1x,F8.2),',')",line(1),line(2),line(3) &$
ENDWHILE
close,1
printf,3,']'
printf,3,'}'
printf,3,'Material {'
printf,3,'diffuseColor ['
  red=0.5
  green=0.5
  blue=0.5
  printf,3,FORMAT="(' ',F4.2,' ',F4.2,' ',F4.2,',')",red,green,blue
printf,3,']'
printf,3,'}'
printf,3,'IndexedFaceSet {'
printf,3,'coordIndex ['
openr,2,'poly.dat'
vert=lonarr(8)
a=lonarr(5)
WHILE NOT eof(2) DO BEGIN &$
 readf,2,a,vert &$
  for j=1,4 do begin &$
   printf,3,FORMAT="(1x,I5,',')",vert(j-1) &$
  endfor &$
 printf,3,' -1,' &$
 ENDWHILE
printf,3,']'
printf,3,'}'
printf,3,'}'
close,1,2,3
return
end
 
 

The vert.dat file contains the node location information, and the poly.dat file contains the element information.
 
 

BACK