File: polyfilm.cmd

package info (click to toggle)
evolver 2.70+ds-4
  • links: PTS, VCS
  • area: main
  • in suites: bullseye, buster, sid
  • size: 17,148 kB
  • sloc: ansic: 127,395; makefile: 209; sh: 98
file content (45 lines) | stat: -rw-r--r-- 1,243 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
// polyfilm.cmd
// command to produce Polycut format file
// usage: polyfilm >>> "filename"

// Programmer: Ken Brakke, brakke@susqu.edu, http://www.susqu.edu/brakke

define vertex attribute offnumber integer;

// command to print OFF format part (the vertices and facets)
verlist := { local offnum;
             offnum := 0;
             foreach vertex vv do 
             { printf "%f %f %f \n",x,y,z;
               vv.offnumber := offnum;
               offnum += 1;
             }
}  // end verlist

facelist := { foreach facet ff do 
              { printf "3 ";
                foreach ff.vertex vv do printf "%g ",vv.offnumber; 
                printf "\n";
              }
}  // end facelist

do_off := { printf "OFF\n%g %g %g\n",vertex_count,facet_count,edge_count;
	        verlist;
            facelist
}  // end do_off

// vect-like file command for triple lines
trbb := { foreach edge ee where ee.valence==3 do 
          { foreach ee.vertex vv do printf "%f %f %f  ",x,y,z ;
		    printf "\n";
          } 
}
trips := { printf "TRIPLE\n"; printf "%g\n",sum(edges where valence==3,1); trbb }

polyfilm := {do_off; trips}


// End polyfilm.cmd

// Usage: polyfilm >>> "filename.poly"