program metavs * ====== * Convert "spl" to AVS "geom" format * ---------------------------------- * Compile, load & run with: * * fc -fi metavs.FOR -L/usr/avs/lib/ \ * -lgeom -lsim_f -lutil -o metavs * metavs $1 > $1.geom * include '/usr/avs/include/geom.inc' parameter (LIMIT=100000) real verts(3,4) integer obj character regel*80,txt*40 * call getarg(1,txt) lt=lnblnk(txt) if(lt.eq.0) ) stop 'One argument: "spl" filename without suffix' open(1,file=txt(:lt)//'.spl') c rewind(1) c read(1,'(a)') regel * ... Create empty geometrical object: obj=geom_create_obj(GEOM_POLYHEDRON,GEOM_NULL) * * ... Loop through polygons: do 10 L=1,LIMIT do 15 m=1,4 read(1,'(a)',err=11,end=11) regel lr=lnblnk(regel) * ... End of polygon: if(lr.le.3) goto 16 * ... Number of vertices (3 or 4): many=m read(regel,*) (verts(k,m),k=1,3) 15 continue 16 continue * call geom_add_disjoint_polygon(obj,verts,GEOM_NULL,GEOM_NULL,many, , GEOM_DONT_COPY_DATA,GEOM_NOT_SHARED) 10 continue 11 continue * * ... To 'stdout': call geom_write_obj(obj,1,0) end